Question

The following algorithm can be used to carry out multiplication of M and N by repeated...

The following algorithm can be used to carry out multiplication of M and N by repeated addition:

initialize product to 0
REPEAT
add M to product
decrement N
UNTIL N == 0

Use this algorithm to multiply the contents of %ax by the contents of %bx and store the product in %dx.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

.model small                  
.code                      
mov dx, 00h
mov ax, 02h
mov bx, 04h

lp:
cmp bx, 00h ; compare bx with 0
jbe final ; jump if bx is below or equal to 0
add dx, ax ; else dx <- dx+ax
sub bx, 01h ; bx<-bx-1

final:
mov ah,4ch
int 21H
end ; end of program

Add a comment
Know the answer?
Add Answer to:
The following algorithm can be used to carry out multiplication of M and N by repeated...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT