Question

8. The following algorithm can be used to carry out division of two non- negative numbers by repeated subtraction. initialize

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

Below is the code assembly x86.

BEGIN : mov edx, 0 //load edx with value 0

WHILE : cmp eax, ebx //compare the content of eax and ebx

jl END // Jump to label END if eax < ebx

sub eax, ebx // subtract ebx from eax

inc edx //increment the content of edx by 1 to store the quotient

jmp LOOP //Jump to label WHILE for further iteration

END : Ret //Return

Please comment for any clarification.

Add a comment
Know the answer?
Add Answer to:
8. The following algorithm can be used to carry out division of two non- negative numbers by repeated subtraction. initialize quotient to o WHILE dividend >- divisor DO increment quotient subtr...
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