few 6502 and some 65SC02 optimizations

This commit is contained in:
IrgendwerA8
2017-03-12 23:21:43 +01:00
parent 0ec4534bd6
commit 0de44517ac
23 changed files with 272 additions and 78 deletions

View File

@@ -1,5 +1,6 @@
;
; Ullrich von Bassewitz, 23.11.2002
; Christian Krueger, 11-Mar-2017, saved 5 bytes
;
; CC65 runtime: Convert char in ax into a long
;
@@ -9,16 +10,12 @@
; Convert A from char to long in EAX
along: ldx #$ff
cmp #$80 ; Positive?
bcs store ; no, apply $FF
aulong: ldx #0
stx sreg
store: stx sreg
stx sreg+1
rts
along: cmp #$80 ; Positive?
bcc aulong ; Yes, handle like unsigned type
ldx #$ff
stx sreg
stx sreg+1
rts