home *** CD-ROM | disk | FTP | other *** search
- ; 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
-
-