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
|
|
|
;
|
|
|
|
|
2003-10-28 08:47:47 +00:00
|
|
|
.export mulax9
|
|
|
|
.importzp ptr1
|
2002-03-16 20:27:50 +00:00
|
|
|
|
|
|
|
.proc mulax9
|
|
|
|
|
2003-10-28 08:47:47 +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
|
2002-03-16 20:27:50 +00:00
|
|
|
clc
|
2003-10-28 08:47:47 +00:00
|
|
|
adc ptr1 ; * (8+1)
|
2002-03-16 20:27:50 +00:00
|
|
|
pha
|
2003-10-28 08:47:47 +00:00
|
|
|
txa
|
2002-03-16 20:27:50 +00:00
|
|
|
adc ptr1+1
|
|
|
|
tax
|
|
|
|
pla
|
|
|
|
rts
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|