2002-11-23 11:19:51 +00:00
|
|
|
;
|
|
|
|
; Ullrich von Bassewitz, 23.11.2002
|
2017-03-12 22:21:43 +00:00
|
|
|
; Christian Krueger, 11-Mar-2017, saved 5 bytes
|
2002-11-23 11:19:51 +00:00
|
|
|
;
|
|
|
|
; CC65 runtime: Convert char in ax into a long
|
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export aulong, along
|
|
|
|
.importzp sreg
|
2002-11-23 11:19:51 +00:00
|
|
|
|
|
|
|
; Convert A from char to long in EAX
|
|
|
|
|
2017-03-12 22:21:43 +00:00
|
|
|
along: ldx #$ff
|
|
|
|
cmp #$80 ; Positive?
|
|
|
|
bcs store ; no, apply $FF
|
2002-11-23 11:19:51 +00:00
|
|
|
|
2017-03-12 22:21:43 +00:00
|
|
|
aulong: ldx #0
|
|
|
|
store: stx sreg
|
2013-05-09 11:56:54 +00:00
|
|
|
stx sreg+1
|
|
|
|
rts
|