1
0
mirror of https://github.com/fumiama/c64-snake.git synced 2026-06-05 00:32:39 +08:00
Files
c64-snake/print.asm
2021-04-03 19:34:32 +08:00

31 lines
390 B
NASM

.macro print
pha
tya
pha
lda #<_1 ; 取参数的低八位
ldy #>_1 ; 取参数的高八位
jsr printstr
pla
tay
pla
.macend
; PRINTSTR routine. Accumulator stores the low byte of the address,
; X register stores the high byte.
.scope
.data zp
.space _ptr 2
.text
printstr:
sta _ptr
sty _ptr+1
ldy #$00
_lp:
lda (_ptr),y
beq _done
jsr chrout
iny
bne _lp
_done:
rts
.scend