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
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