Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
43
Task/Repeat-a-string/6502-Assembly/repeat-a-string.6502
Normal file
43
Task/Repeat-a-string/6502-Assembly/repeat-a-string.6502
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
CHROUT equ $FFD2 ;KERNAL call, prints the accumulator to the screen as an ascii value.
|
||||
|
||||
org $0801
|
||||
|
||||
|
||||
db $0E,$08,$0A,$00,$9E,$20,$28,$32,$30,$36,$34,$29,$00,$00,$00
|
||||
|
||||
|
||||
|
||||
|
||||
lda #>TestStr
|
||||
sta $11
|
||||
|
||||
lda #<TestStr
|
||||
sta $10
|
||||
|
||||
|
||||
ldx #5 ;number of times to repeat
|
||||
|
||||
loop:
|
||||
jsr PrintString
|
||||
dex
|
||||
bne loop
|
||||
|
||||
|
||||
RTS ;RETURN TO BASIC
|
||||
|
||||
|
||||
PrintString:
|
||||
ldy #0
|
||||
loop_PrintString:
|
||||
lda ($10),y ;this doesn't actually increment the pointer itself, so we don't need to back it up.
|
||||
beq donePrinting
|
||||
jsr CHROUT
|
||||
iny
|
||||
jmp loop_PrintString
|
||||
donePrinting:
|
||||
rts
|
||||
|
||||
|
||||
|
||||
TestStr:
|
||||
db "HA",0
|
||||
Loading…
Add table
Add a link
Reference in a new issue