1
0
mirror of https://github.com/cc65/cc65.git synced 2026-03-11 08:41:58 +00:00
Files
cc65/libsrc/runtime/sub.s

34 lines
705 B
ArmAsm

;
; Ullrich von Bassewitz, 05.08.1998
;
; CC65 runtime: sub ints
;
.export tossuba0, tossubax
.import addysp1
.importzp c_sp
; AX = TOS - AX
tossuba0:
ldx #0
tossubax:
sec
eor #$FF
.if .cap(CPU_HAS_ZPIND)
adc (c_sp)
ldy #1
.else
ldy #0
adc (c_sp),y ; Subtract low byte
iny
.endif
pha ; Save high byte
txa
eor #$FF
adc (c_sp),y ; Subtract high byte
tax ; High byte into X
pla ; Restore low byte
jmp addysp1 ; drop TOS