Question: Assembly Programming The task for this practical is to write an assembly program which can multiply two integer numbers. However, the program should not use

Assembly Programming
The task for this practical is to write an assembly program which can multiply two integer numbers. However, the program should not use the mul or imul instruction to accomplish this. Instead, the program should perform the multiplication using the following multiplication. The multiplication of two numbers is achieved using shift operations and simple addition. The next sections detail how the multiplication works and define the requirements of the program. Make sure that ALL program requirements are implemented as stated.
Two numbers a and b can be multiplied by repeatedly halving a(discarding remainders) and doubling b(see table below). The value of b is added to the result if the value in a is odd. The procedure stops when a reached 1. In the shown example we compute r=a*b with a=17 and b=34.17 is odd and therefore r=r+b=0+34. Halving a=17 results in a=8 when discarding the remainder. Doubling b=34 results in b=68.a=8 is even and therefore we do not add b=68 to the result r. The process continues until we reach a=1 and b=544.1 is odd and therefore r=r+b=34+544=578. a has reached 1 and the algorithm terminates leaving the multiplication result of r=a*b=17*34=578.
\table[[a,b],[17,34],[8,68],[4,136],[2,272],[1,544],[,578]]
 Assembly Programming The task for this practical is to write an

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!