Atari 400 Basic Reference Manual page 75

Vintage computer
Hide thumbs Also See for 400:
Table of Contents

Advertisement

Address
Object
Code
02C4
02C5
02C6
02C7
6000
68
6001
A200
6003
ACC402
6006
BDC502
6009
9DC402
600C
E8
600D
E002
600F
90F5
6011
8CC602
6014
60
Assembler
Prints This
11
Indicates data (source)
* Routine is relocatable
When completed, type DONE and press
lilii!lmJ.
Now place the cursor after the
last entry (999) on the DATA line and press
lilii!lmJ.
Now run the program by typing GOTO 1000 and pressing limml3,or add line 5
GOTO 1000 and type RUN
lilii!lmJ.
Press
l!m!!:l
to stop program and delete line
5.
Figure 11-2 illustrates an assembler subroutine used to rotate colors which
might prove useful.
It
is included here for the information of the user.
Assembler Subroutine to Rotate Colors ..
Line
No.
0100
0110
0120
0130
0140
0150
0160
0170
0175
0180
0190
0200
0210
0220
0230
0240
0250
0260
0270
0280
0290
Label
Mnemonic
Data
Routine to rotate COLOR data
From one register to another.
4 colors are rotated.
Operating system address
COLOR 0 = $02C4
COLOR 1 = $02C5
COLOR 2 = $02C6
COLOR 3 = $02C7
*=
$6000
Machine program starting address*
PLA
Pop stack (See Chapter 4)
LDX
110
Zero the X register
LDY
COLORO
Save COLOR 0
LOOP
LDA
COLOR1,X
STA
COLORO,X
INX
Increment the X re.e;ister (add one)
CPX
113
Compare contents of X register
with 2
BCC
LOOP
Loop if X register contents are
less than
2
STY
COLOR3
Save COLOR 0 in COLOR 3
RTS
Return from machine level sub-
routine
This Portion is Source Information Programmer Enters
Using Atari Assembler Cartridge
$ Indicates a hexadecimal number
Figure 11-2. Assembler Subroutine To Rotate Colors
Advanced Programming Techniques
67

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

800

Table of Contents