rol ptr1+1
clc
adc ptr1
- tay
+ pha
txa
adc ptr1+1
tax
- tya
+ pla
rts
.endproc
;
; CC65 runtime: Multiply the primary register by 5
;
+; Don't touch the Y-register here, the optimizer relies on it!
.export mulax5
.importzp ptr1
rol ptr1+1
clc
adc ptr1
- tay
+ pha
txa
adc ptr1+1
tax
- tya
+ pla
rts
.endproc
;
; CC65 runtime: Multiply the primary register by 7
;
+; Don't touch the Y-register here, the optimizer relies on it!
.export mulax7
.importzp ptr1
rol ptr1+1 ; * 8
sec
sbc ptr1
- tay
+ pha
txa
eor #$ff
adc ptr1+1 ; * (8 - 1)
tax
- tya
+ pla
rts
.endproc
;
; CC65 runtime: Multiply the primary register by 9
;
+; Don't touch the Y-register here, the optimizer relies on it!
.export mulax9
.importzp ptr1
rol ptr1+1 ; * 8
clc
adc ptr1 ; * (8+1)
- tay
+ pha
txa
adc ptr1+1
tax
- tya
+ pla
rts
.endproc