2002-03-16 20:27:50 +00:00
|
|
|
;
|
2003-10-28 08:47:47 +00:00
|
|
|
; Piotr Fusik, 24.10.2003
|
|
|
|
; originally by Ullrich von Bassewitz
|
2002-03-16 20:27:50 +00:00
|
|
|
;
|
2003-10-28 08:47:47 +00:00
|
|
|
; CC65 runtime: Multiply the primary register by 9
|
2002-03-16 20:27:50 +00:00
|
|
|
;
|
2018-05-22 17:10:07 +00:00
|
|
|
; Don't touch the Y-register here, the optimizer relies on it!
|
2002-03-16 20:27:50 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export mulax9
|
|
|
|
.importzp ptr1
|
2002-03-16 20:27:50 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc mulax9
|
2002-03-16 20:27:50 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
sta ptr1
|
|
|
|
stx ptr1+1
|
|
|
|
asl a
|
|
|
|
rol ptr1+1 ; * 2
|
|
|
|
asl a
|
|
|
|
rol ptr1+1 ; * 4
|
|
|
|
asl a
|
|
|
|
rol ptr1+1 ; * 8
|
|
|
|
clc
|
|
|
|
adc ptr1 ; * (8+1)
|
2018-05-22 17:10:07 +00:00
|
|
|
pha
|
2013-05-09 11:56:54 +00:00
|
|
|
txa
|
|
|
|
adc ptr1+1
|
|
|
|
tax
|
2018-05-22 17:10:07 +00:00
|
|
|
pla
|
2013-05-09 11:56:54 +00:00
|
|
|
rts
|
2002-03-16 20:27:50 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|