home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_18_1987_Transactor_Publishing.d64
/
multiply.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
483b
|
24 lines
100 ; multiply routine
110 mloop = *
120 lsr m1 ;sr m1
130 ror m1+1 ;the carry from m1 -> m1+1
140 bcc shift ;add on carry set
150 clc ;r=r+m2
160 lda m2+1
170 adc r+1
180 sta r+1
190 lda m2
200 adc r
210 sta r
220 shift = *
230 asl m2+1 ;sl m2
240 rol m2
250 lda m1+1
260 bne mloop
270 lda m1 ;if m1 and m1+1=0
280 bne mloop ;when we are done
290 rts
300 m1 .word $0023
310 m2 .word $000f
320 r .word $0000