LISTING1.TXT

From Atari Wiki
Revision as of 23:58, 16 December 2023 by Olivier.jan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
******************************************************************
*                                                                *
*             68000 ASSEMBLER COURSE ON ATARI ST                 *
*                                                                *
*                 by The Fierce Rabbit (from 44E)                *
*                                                                *
*                         Second series                          *
*                                                                *
*                       Listing number 1                         *
*                                                                *
******************************************************************

* Displaying an image included in the program.

         LEA       IMAGE,A6          image address
         ADDA.L    #2,A6             jump over the DEGAS header
         MOVE.L    A6,-(SP)          now on the colors
         MOVE.W    #6,-(SP)          set by XBIOS(6)
         TRAP      #14
         ADDQ.L    #6,SP

         MOVE.W    #3,-(SP)          looks for the screen address
         TRAP      #14
         ADDQ.L    #2,SP
         MOVE.L    D0,A5             saves it in A5

         ADDA.L    #32,A6            jump over the colors (16 words)
         MOVE.W    #7999,D0          init counter
COPIE    MOVE.L    (A6)+,(A5)+       transfer image to screen
         DBF       D0,COPIE

         MOVE.W    #7,-(SP)          waits for a key press
         TRAP      #1
         ADDQ.L    #2,SP

         MOVE.W    #0,-(SP)          and bye bye
         TRAP      #1

IMAGE    INCBIN    "A:\TRUC.PI1"     the image

Back to ASM_Tutorial