
2.4. LOOPING 21
ORG $D000
FCB $55, $6F, $66, $4D, $2D, $44, $62, $72, $6E
Run the above program using CALL C300
4
. Modify the above program as shown
below and explain what the program does. Do you see why we do the DEX before
we access memory?
ORG $C400
LDAB #$09
LDX #$D000
ABX
SNICKER TSTB
BEQ SNACK
DEX
LDAA 0,X
JSR OUTA
DECB
BRA SNICKER
SNACK SWI
ORG $D000
FCB $55, $6F, $66, $4D, $2D, $44, $62, $72, $6E
Now for some other useful examples. Explain what each of them does. Run
the programs and using memory dump, verify that your explanation is correct.
Each of the functions start with an ORG command.
ORG $C500
LDAB #$10
LDX #$D000
CALLOOH TSTB
BEQ CALLAY
4
Don’t forget to assemble it and then transfer the S19 file to the HC11!
Komentarze do niniejszej Instrukcji