1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 21:32:19 +00:00
cc65/libsrc/runtime/ldec.s
2018-03-08 22:10:11 +01:00

28 lines
532 B
ArmAsm

;
; Piotr Fusik, 07.03.2018
; originally by Ullrich von Bassewitz
;
; CC65 runtime: Decrement eax by value in Y
;
.export deceaxy
.importzp sreg, tmp1
deceaxy:
sty tmp1
sec
sbc tmp1
bcs @L9
; borrow from X
dex
cpx #$ff
bne @L9
; X wrapped from zero to $ff, borrow from sreg
dec sreg
cpx sreg
bne @L9
; sreg wrapped from zero to $ff, borrow from sreg+1
dec sreg+1
@L9: rts