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 7
|
2002-03-16 20:27:50 +00:00
|
|
|
;
|
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.export mulax7
|
|
|
|
.importzp ptr1
|
2002-03-16 20:27:50 +00:00
|
|
|
|
2013-05-09 11:56:54 +00:00
|
|
|
.proc mulax7
|
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
|
|
|
|
sec
|
|
|
|
sbc ptr1
|
2018-05-21 16:18:01 +00:00
|
|
|
tay
|
2013-05-09 11:56:54 +00:00
|
|
|
txa
|
|
|
|
eor #$ff
|
|
|
|
adc ptr1+1 ; * (8 - 1)
|
|
|
|
tax
|
2018-05-21 16:18:01 +00:00
|
|
|
tya
|
2013-05-09 11:56:54 +00:00
|
|
|
rts
|
2002-03-16 20:27:50 +00:00
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
|