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 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 23.06.2019 22:00
Jackson, who works in the finance department of a company, is holding a seminar for other employees on how to file taxes. only three employees sign up to attend the seminar. which device can he use to share his presentation with a group of three employees?
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
You know the right answer?
Greatest common divisor

the greatest common divisor (gcd) of two integers is the larges...
Questions
Questions on the website: 13722362