Question: ASSEMBLY LANGUAGE!!!!! For this program you will find the largest common factor for 2 numbers, a and b. The largest common factor is the largest

ASSEMBLY LANGUAGE!!!!!

For this program you will find the largest common factor for 2 numbers, a and b.

The largest common factor is the largest positive number that divides the two numbers.

The C++ code for doing this is:

int LCF (int a, int b)

{

if (a == 0 && b == 0)

b = 1;

else

if (b == 0)

b = a;

else

if (a != 0)

while (a != b)

if (a < b)

b -= a;

else

a -= b;

return b;

}

In your code, you should follow this C++ code as closely as possible.

Put a in eax, and b in ebx.

Do not use any loop instructions directly.

Do use compare and jump instructions.

Do not use any procedures except MyProgram.

You code should be your work alone.

You example of your console window should look as follows:

Please provide an integer for b: 8

Please provide an integer for a: 4

The largest common factor of a and b is: +4

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!