mirror of
https://github.com/fumiama/c64-snake.git
synced 2026-06-10 21:24:11 +08:00
add score(初步)
This commit is contained in:
31
print.asm
Normal file
31
print.asm
Normal file
@@ -0,0 +1,31 @@
|
||||
.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
|
||||
Reference in New Issue
Block a user