1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-06 15:06:07 +00:00
cc65/libsrc/runtime/along.s

21 lines
433 B
ArmAsm
Raw Normal View History

;
; Ullrich von Bassewitz, 23.11.2002
2017-03-12 22:21:43 +00:00
; Christian Krueger, 11-Mar-2017, saved 5 bytes
;
; CC65 runtime: Convert char in ax into a long
;
.export aulong, along
.importzp sreg
; 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
2017-03-12 22:21:43 +00:00
aulong: ldx #0
store: stx sreg
stx sreg+1
rts