Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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]]
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 10g Insider Solutions

Authors: Arun R. Kumar, John Kanagaraj, Richard Stroupe

1st Edition

0672327910, 978-0672327919

More Books

Students also viewed these Databases questions