LISTING1.TXT: Difference between revisions

From Atari Wiki
Jump to navigation Jump to search
(Olivier.jan moved page LISTING1.TXT to LISTING1.TXT/fr: Renaming for language version)
Tag: New redirect
 
(Replacing content of with translated version)
Tag: Removed redirect
Line 1: Line 1:
#REDIRECT [[LISTING1.TXT/fr]]
+
{{Languages|LISTING1.TXT}}
  +
<pre>
  +
******************************************************************
  +
* *
  +
* 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
  +
  +
</pre>
  +
Back to [[ASM_Tutorial]]
  +
[[Category: 68000 ASSEMBLER ON ATARI ST Part 1 ]]

Revision as of 00:51, 17 December 2023

******************************************************************
*                                                                *
*             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