1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-28 22:30:12 +00:00
cc65/libsrc/runtime/sub.s

32 lines
379 B
ArmAsm
Raw Normal View History

;
; Ullrich von Bassewitz, 05.08.1998
;
; CC65 runtime: sub ints
;
.export tossuba0, tossubax
.import addysp1
.importzp sp, ptr1
;
; AX = TOS - AX
;
tossuba0:
ldx #0
tossubax:
ldy #0
sta ptr1
stx ptr1+1
lda (sp),y ; lo byte
sec
sbc ptr1
sta ptr1 ; save lo byte
iny
lda (sp),y
sbc ptr1+1
tax
lda ptr1
jmp addysp1 ; drop TOS, set condition codes