Question: This question is based off of, Chapter 7.10, Problem 7PE or Irvine's Assembly Language for x86 Processors (7th Edition). There is a solution on this

This question is based off of, Chapter 7.10, Problem 7PE or Irvine's Assembly Language for x86 Processors (7th Edition).

This question is based off of, Chapter 7.10, Problem 7PE or Irvine's

There is a solution on this site (https://www.chegg.com/homework-help/assembly-language-for-x86-processors-7th-edition-chapter-7.10-problem-7PE-solution-9780133769470), but running it gave me the following error:

Error A2070 invalid instruction operands

This occurs at the line "shl ebx,count-1". I can't figure out what's the problem with this, but there are A LOT of solutions for this book that either writtled with errors, or do not actually complete their excecution, so I'm hoping an expert can do something.

PLEASE NOTE: This uses Include Irvine32.inc, and the problem must use Irvine32's variables such as SHL, MOV, ADD and so on.

***7. Bitwise Multiplication Write a procedure named BitwiseMultiply that multiplies any unsigned 32-bit integer by EAX, using only shifting and addition. Pass the integer to the procedure in the EBX register, and return the product in the EAX register. Write a short test program that calls the procedure and displays the product. (We will assume that the product is never larger than 32 bits.) This is a fairly challenging program to write. One possible approach is to use a loop to shift the mul tiplier to the right, keeping track of the number of shifts that occur before the Carry flag is set. The resulting shift count can then be applied to the SHL instruction, using the multiplicand as the destination operand. Then, the same process must be repeated until you find the last 1 bit in the multiplier. ***7. Bitwise Multiplication Write a procedure named BitwiseMultiply that multiplies any unsigned 32-bit integer by EAX, using only shifting and addition. Pass the integer to the procedure in the EBX register, and return the product in the EAX register. Write a short test program that calls the procedure and displays the product. (We will assume that the product is never larger than 32 bits.) This is a fairly challenging program to write. One possible approach is to use a loop to shift the mul tiplier to the right, keeping track of the number of shifts that occur before the Carry flag is set. The resulting shift count can then be applied to the SHL instruction, using the multiplicand as the destination operand. Then, the same process must be repeated until you find the last 1 bit in the multiplier

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!