mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 19:29:37 +00:00
01b788b1fc
git-svn-id: svn://svn.cc65.org/cc65/trunk@44 b7a2c559-68d2-44c3-8de9-860c34a00d81
33 lines
420 B
ArmAsm
33 lines
420 B
ArmAsm
;
|
|
; Ullrich von Bassewitz, 05.08.1998
|
|
;
|
|
; CC65 runtime: add ints
|
|
;
|
|
|
|
; Make this as fast as possible, even if it needs more space since it's
|
|
; called a lot!
|
|
|
|
.export tosadda0, tosaddax
|
|
.importzp sp
|
|
|
|
tosadda0:
|
|
ldx #0
|
|
tosaddax:
|
|
ldy #0
|
|
clc
|
|
adc (sp),y ; lo byte
|
|
pha ; save it
|
|
txa
|
|
iny
|
|
adc (sp),y ; hi byte
|
|
tax
|
|
clc
|
|
lda sp
|
|
adc #2
|
|
sta sp
|
|
bcc L1
|
|
inc sp+1
|
|
L1: pla ; Restore low byte
|
|
rts
|
|
|