subject

Greatest common divisor

the greatest common divisor (gcd) of two integers is the largest integer that will evenly divide both integers. the recursive gcd algorithm, described by the following pseudocode: function ged(a, b)
if b=0
return a;
else
return ged(b, a mod b);

write a recursive implementation of euclid's algorithm for finding the greatest common divisor (gcd) of two integers. you can use div instruction to implement your algorithm. it is a single operand is supplied (register or memory operand), which is assumed to be the divisor: div reg/mem32

col1 dividend edx: eax
col2 divisor rm32
col3 quotient eax
col4 remainder edx

first your program prompts the user to enter two positive integers, one after the other. your program will then call the gcd subroutine to find the gcd of the two numbers, and then on return to the calling program it will read the return value and print the result.

example:
enter the first integer: 36
enter the second integer: 60
the gcd of the two numbers is:

your program will consist of two files: • prog4.asm .gcd. asm the prog4.s file will contain code that asks a user for two integers and calls the subroutine which will be located in a separate file (gcd. asm) to get the result and then shows the result to the user. use microsoft's advanced invoke and proto directives to implement your multimodule program.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:00
Consider how gaming consoles initially relied on joysticks and joypads and then made the switch to modern gaming controls, which include analog sticks, buttons and switches, touch controls, accelerometers, motion controls, etc. name at least two kinds of gaming experiences that are possible with these new control devices but were not possible on original joysticks. explain how new technologies made this newer game style possible.
Answers: 1
question
Computers and Technology, 23.06.2019 23:40
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
question
Computers and Technology, 24.06.2019 15:00
Universal windows platform is designed for which windows 10 version?
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
True or false technology is often discovered by accident
Answers: 2
You know the right answer?
Greatest common divisor

the greatest common divisor (gcd) of two integers is the larges...
Questions
question
Mathematics, 30.03.2021 17:10
question
Mathematics, 30.03.2021 17:10
question
Chemistry, 30.03.2021 17:10
question
Mathematics, 30.03.2021 17:10
question
Mathematics, 30.03.2021 17:10
question
Mathematics, 30.03.2021 17:10
question
History, 30.03.2021 17:10
Questions on the website: 13722362