Merge pull request #389 from IrgendwerA8/stringimprovements

Optimization of string functions (size & speed).
This commit is contained in:
Oliver Schmidt
2017-04-04 15:39:37 +02:00
committed by GitHub
20 changed files with 607 additions and 267 deletions

View File

@@ -1,5 +1,6 @@
;
; Ullrich von Bassewitz, 25.10.2000
; Christian Krueger, 02-Mar-2017, some bytes saved
;
; CC65 runtime: Convert int in ax into a long
;
@@ -9,18 +10,13 @@
; Convert AX from int to long in EAX
axlong: ldy #$ff
cpx #$80 ; Positive?
bcs store ; No, apply $FF
axulong:
ldy #0
sty sreg
store: 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