nes-proj/cpu/6502/lib/lc-asm.S

31 lines
571 B
ArmAsm

;---------------------------------------------------------------------
.importzp ptr1
.export _lc_set
.export _lc_resume
;---------------------------------------------------------------------
_lc_set:
sta ptr1
stx ptr1+1
tsx
lda $0102,x
ldy #$01
sta (ptr1),y
lda $0101,x
dey
sta (ptr1),y
rts
;---------------------------------------------------------------------
_lc_resume:
sta ptr1
stx ptr1+1
ldy #$01
lda (ptr1),y
beq :+
tsx
sta $0102,x
dey
lda (ptr1),y
sta $0101,x
: rts
;---------------------------------------------------------------------