2000-10-25 07:06:55 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 25.10.2000
|
2017-03-05 01:09:12 +00:00
|
|
|
; Christian Krueger, 02-Mar-2017, some bytes saved
|
2000-10-25 07:06:55 +00:00
|
|
|
;
|
|
|
|
; CC65 runtime: Convert int in ax into a long
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export axulong, axlong
|
|
|
|
.importzp sreg
|
2000-10-25 07:06:55 +00:00
|
|
|
|
|
|
|
; Convert AX from int to long in EAX
|
|
|
|
|
2017-03-05 01:09:12 +00:00
|
|
|
axlong: ldy #$ff
|
|
|
|
cpx #$80 ; Positive?
|
|
|
|
bcs store ; No, apply $FF
|
|
|
|
|
2000-10-25 07:06:55 +00:00
|
|
|
axulong:
|
2013-05-09 11:56:54 +00:00
|
|
|
ldy #0
|
2017-03-05 01:09:12 +00:00
|
|
|
store: sty sreg
|
2013-05-09 11:56:54 +00:00
|
|
|
sty sreg+1
|
|
|
|
rts
|