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

41 lines
597 B
NASM
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; printfield 打印蛇,包括边框
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
printfield:
.scope
.data zp
.space _ptr 2
.text
ldx #23 ; i代表行数不含边框
lda #<field ; 取地址低8位
sta _ptr
lda #>field ; 取地址高8位
sta _ptr + 1
ldy #0
* lda #cblk
sta (_ptr), y ; 打印左边框
lda #39
jsr _addptr
lda #cblk
sta (_ptr), y ; 打印右边框
lda #1
jsr _addptr
dex
bne -
lda #cblk
ldy #40
dec _ptr
* sta (_ptr), y ; 打印底边
dey
bne -
rts
_addptr:
clc
adc _ptr
bcc +
inc _ptr + 1
* sta _ptr
rts
.scend