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, 07.04.2000
; Christian Krueger, 12-Mar-2017, added 65SC02 optimization
;
; CC65 runtime: += operator
;
@@ -10,6 +11,7 @@
.export laddeq1, laddeqa, laddeq
.importzp sreg, ptr1, tmp1
.macpack cpu
laddeq1:
lda #$01
@@ -20,14 +22,20 @@ laddeqa:
stx sreg+1
laddeq: sty ptr1+1 ; Store high byte of address
ldy #$00 ; Address low byte
clc
.if (.cpu .bitand ::CPU_ISET_65SC02)
adc (ptr1)
sta (ptr1)
ldy #$01 ; Address byte 1
.else
ldy #$00 ; Address low byte
adc (ptr1),y
sta (ptr1),y
iny ; Address byte 1
.endif
pha ; Save byte 0 of result for later
iny ; Address byte 1
txa
adc (ptr1),y ; Load byte 1
sta (ptr1),y