Searching \ for 'Multiplication program' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'Multiplication program'.

Truncated match.
PICList Thread
'Multiplication program'
1998\12\09@003308 by Scott Shidel...

O yeah, also I figured I mite include the problem I am working on incase
some of you can debug it.  The program SHOULD multiply 4 and 6.
Once again, I got this from Myke Predko's book.

       List    p=16c711
       include <>
Prod    equ     0x0c
LoopC   equ     0x0e
Plier   equ     0x0f
Licand  equ     0x11
       goto    start
       org     0x04
       clrf    Prod
       clrf    Prod+1
       movlw   H'6'
       movwf   Plier
       movlw   H'4'
       movwf   Licand
       movlw   16
       movwf   LoopC
       rrf     Plier+1
       rrf     Plier
       btfss   STATUS, C
        goto   AddSkip
       movf    Licand+1, w
       addwf   Prod+1
       movf    Licand, w
       addwf   Prod
       btfsc   STATUS, C
        incf   Prod+1

       bcf     STATUS, C
       rlf     Licand
       rlf     Licand+1

       decfsz  LoopC
       goto Loop

               The Pinto Page:
                  Join the Ford Turbo Mailing List!
-71 Pinto, stock 2.3 turbo, 13.67@98, radials
       8.1@85 1/8th mile on slicks
-85 Merkur 13.764@98 on radials&3300lbs! Under $300 in mods!

1998\12\09@004137 by Michael Hagberg

here it is!!! make this a movlw D'16' (i think that's how to force decimal

>        movlw   16
>        movwf   LoopC

1998\12\09@065854 by Stig Brautaset

How about:

Plier        equ    0x0c
PlierHI    equ    0x0d
Licand    equ    0x0e

       org      0x00
       clrf      Plier
       clrf      PlierHI
       clrf      Licand

       movlw   6
       movwf   Plier
       movlw   4
       movwf   Licand

       movf   Licand, f             ; Test if zero
       btfss   STATUS, Z
         goto  finish                  ; A*0 = 0, so output is given

       movf   Plier, f                 ; Test if zero
       btfss   STATUS, Z
         goto  finish                  ; 0*B = 0, so output is given

       bcf      STATUS, C       ; Reset carry so it does not affect multiplication
       rlf        Plier                    ; Do multiplication
       btfss   STATUS, C       ; if carry, increment high byte
         incf    Plier+1
       decfsz   Licand                ; When Licand is zero, multiplication is done
         goto    Loop

This is just out of my head, I do not have any helpers here, so I might not even remember the asm-instructions correctly...


Stig Brautaset - - ICQ: 11052183
Student of electronics  -


{Quote hidden}

How about substituting the above with:
   org    0x00    ; start of program

{Quote hidden}

1998\12\09@150232 by myke predko

Hi Folks (and Scott),

I just got a chance to look at this week's mail.

>here it is!!! make this a movlw D'16' (i think that's how to force decimal
>>        movlw   16
>>        movwf   LoopC

In all my PICMicro code, I set the Radix to Decimal.

I also wanted to point out that on my 16 Bit operations page, I have
included a 16 Bit multiplication (with 32 bit result) snippet that is *very*
efficient and fast (much better than the routines I've come up with).  It
can be found at:


Read Alfred Lansing's book on Sir Ernest Shackleton's 1914 voyage and
adventure in the Antarctic.  Two years trying to return to civilization:
this week's book at:

Also look at:

for information on "Handbook of Microcontrollers" which has been named the
Main Selection for November 1998 for the Electronics Book Club!

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...