1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 19:29:37 +00:00
cc65/libsrc/runtime/sub.s
cuz c413c5feeb Several SBC optimizations suggested by Piotr Fusik
git-svn-id: svn://svn.cc65.org/cc65/trunk@1121 b7a2c559-68d2-44c3-8de9-860c34a00d81
2001-11-17 11:25:12 +00:00

36 lines
475 B
ArmAsm

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