2000-05-28 13:40:48 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 05.08.1998
|
|
|
|
;
|
|
|
|
; CC65 runtime: long sub
|
|
|
|
;
|
|
|
|
|
|
|
|
;
|
|
|
|
; EAX = TOS - EAX
|
|
|
|
;
|
|
|
|
.export tossubeax
|
|
|
|
.import addysp1
|
2001-11-17 11:25:12 +00:00
|
|
|
.importzp sp, sreg
|
2000-05-28 13:40:48 +00:00
|
|
|
|
|
|
|
tossubeax:
|
|
|
|
ldy #0
|
|
|
|
sec
|
2001-11-17 11:25:12 +00:00
|
|
|
eor #$FF
|
|
|
|
adc (sp),y ; byte 0
|
|
|
|
pha ; Save low byte
|
2000-05-28 13:40:48 +00:00
|
|
|
iny
|
2001-11-17 11:25:12 +00:00
|
|
|
txa
|
|
|
|
eor #$FF
|
|
|
|
adc (sp),y ; byte 1
|
2000-05-28 13:40:48 +00:00
|
|
|
tax
|
|
|
|
iny
|
|
|
|
lda (sp),y
|
|
|
|
sbc sreg ; byte 2
|
|
|
|
sta sreg
|
|
|
|
iny
|
|
|
|
lda (sp),y
|
|
|
|
sbc sreg+1 ; byte 3
|
|
|
|
sta sreg+1
|
2001-11-17 11:25:12 +00:00
|
|
|
pla ; Restore byte 0
|
|
|
|
jmp addysp1 ; Drop TOS
|
2000-05-28 13:40:48 +00:00
|
|
|
|