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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 21:00, jarrettashlyn
Write a method so that the main() code below can be replaced by the simpler code that calls method original main(): public class calcmiles { public static void main(string [] args) { double milesperhour; double minutestraveled; double hourstraveled; double milestraveled; milesprhour = scnr. nextdouble(); minutestraveled = scnr. nextdouble(); hourstraveled = minutestraveled / 60.0; milestraveled = hourstraveled * milesperhour; system. out. println("miles: " + milestraveled); } }
Answers: 2
image
Computers and Technology, 23.06.2019 10:00, lamanihill
Now, open this passage to read about fafsa requirements. describe the information you will need to provide in order to complete a fafsa. list at least three of the required documents you must include.
Answers: 3
image
Computers and Technology, 23.06.2019 12:30, Prettygirlyaya
How is the brightness of oled of the diaplay is controled
Answers: 1
image
Computers and Technology, 23.06.2019 19:40, Latoyajenjins1789
Use a physical stopwatch to record the length of time it takes to run the program. calculate the difference obtained by calls to the method system. currenttimemillis() just before the start of the algorithm and just after the end of the algorithm. calculate the difference obtained by calls to the method system. currenttimemillis() at the start of the program and at the end of the program so that the elapsed time includes the display of the result. use the value returned by the method system. currenttimemillis() just after the end of the algorithm as the elapsed time.
Answers: 3
You know the right answer?
Greatest common divisor

the greatest common divisor (gcd) of two integers is the larges...

Questions in other subjects:

Konu
Health, 20.11.2020 02:00
Konu
Mathematics, 20.11.2020 02:00
Konu
Mathematics, 20.11.2020 02:00