1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-04 17:04:58 +00:00
cc65/libsrc/runtime/axlong.s

27 lines
471 B
ArmAsm
Raw Normal View History

;
; Ullrich von Bassewitz, 25.10.2000
;
; CC65 runtime: Convert int in ax into a long
;
.export axulong, axlong
.importzp sreg
; Convert AX from int to long in EAX
axulong:
ldy #0
sty sreg
sty sreg+1
rts
axlong: cpx #$80 ; Positive?
bcc axulong ; Yes, handle like unsigned type
ldy #$ff
sty sreg
sty sreg+1
rts