home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar Extras 3
/
Ex3side1.d64
/
16x16
< prev
next >
Wrap
Text File
|
2022-08-28
|
418b
|
42 lines
; this code multiples a 16 bit number
; by a 16 bit number.
; store multitplier in mplrl and mplrh
; multiplicand in mcndl and mcndh
.org $c000
.mem
mlt16 lda #0
sta res+2
sta res+3
ldx #16
nxtbt lsr mplrh
ror mplrl
bcc align
clc
lda res+2
adc mcndl
sta res+2
lda res+3
adc mcndh
align ror
sta res+3
ror res+2
ror res+1
ror res
dex
bne nxtbt
rts
mplrl .byt 0
mplrh .byt 0
mcndl .byt 0
mcndh .byt 0
res .buf 4