@screen @ctrl
screen:
CLS
LIT 0 LIT 10 PSH PSH do: RSI LIT 40 SFT
LIT 0 LIT f PSH PSH while:
DUP RSI ADD OVR RSI ADD LDB SET
PUL INC PSH
RSI RSJ NEQ LIT @while JCN
PUL PUL POP POP POP
PUL INC PSH
RSI RSJ NEQ LIT @do JCN
PUL PUL POP POP
LIT pos: 0 FRM LIT a MOD LIT 9 LTH SET
BRK
ctrl:
KEY LIT 1 AND LIT @up JCR
KEY LIT 2 AND LIT @down JCR
KEY LIT 4 AND LIT @left JCR
KEY LIT 8 AND LIT @right JCR
KEY LIT 10 AND LIT @keya JCR
KEY LIT 20 AND LIT @keyb JCR
BRK
up: LIT @pos LDA LIT 10 SUB LIT @pos STA RET
down: LIT @pos LDA LIT 10 ADD LIT @pos STA RET
left: LIT @pos LDA DEC LIT @pos STA RET
right: LIT @pos LDA INC LIT @pos STA RET
keya: LIT 1 LIT @pos LDA STB RET
keyb: LIT 0 LIT @pos LDA STB RET
|