2000-10-25 07:06:55 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 25.10.2000
|
|
|
|
;
|
|
|
|
; CC65 runtime: Convert int in ax into a long
|
|
|
|
;
|
|
|
|
|
2013-05-09 13:56:54 +02:00
|
|
|
.export axulong, axlong
|
|
|
|
.importzp sreg
|
2000-10-25 07:06:55 +00:00
|
|
|
|
|
|
|
; Convert AX from int to long in EAX
|
|
|
|
|
|
|
|
axulong:
|
2013-05-09 13:56:54 +02:00
|
|
|
ldy #0
|
|
|
|
sty sreg
|
|
|
|
sty sreg+1
|
|
|
|
rts
|
2000-10-25 07:06:55 +00:00
|
|
|
|
2013-05-09 13:56:54 +02:00
|
|
|
axlong: cpx #$80 ; Positive?
|
|
|
|
bcc axulong ; Yes, handle like unsigned type
|
|
|
|
ldy #$ff
|
|
|
|
sty sreg
|
|
|
|
sty sreg+1
|
|
|
|
rts
|
2000-10-25 07:06:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
|