Question
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
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. One possible approach is to use a loop to shift the multiplier to the right, keeping track of the number of shifts that occur before the Carry ?ag 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 ?nd the last 1 bit in the multiplier.
Prompt the user to enter the multiplicand, the multiplier and display the result after the procedure returns the result to the main procedure.
WRITE THE CODE IN ASSEMBLY LANGUAGE AND ALSO WRITE THE COMMENTS ON EACH LINE SO I CAN UNDERSTAND PROPERLY AND SCREENSHOT THE OUTPUT.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started