辅导汇编、讲解Bitwise Multiplication汇编

- 首页 >> 其他


Objectives:

1.Implement Bitwise Multiplication algorithm

2.Apply loop

3.Write user defined procedure

4.Use user defined procedure

5.Apply Irvine32.inc library

Problem Description:

Write a procedure named BitwiseMultiply that multiplies any unsinged 32-bit integer by EAX, using only sifting and addition. Pass the integer to the procedure in the EBX register and return the product in the EXA 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 multiplier 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 (Refer to Programming Exercise #7 on page 285)

Sample Run:

After user hits any key, the program exits.

Due Date:

Turn in YourNameProj7.asm via Blackboard. Due date will be announced on Blackboard