Computers and Technology

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.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:30, barkonatree
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
image
Computers and Technology, 24.06.2019 08:00, nataliamontirl4230
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
image
Computers and Technology, 24.06.2019 10:00, alexapacheco012
What did i do wrong with this const discord = require('discord. js'); var bot = new discord. client(); const token = 'ntm3mjcxmtu1mjg3ote2ntq2.dyogew. dpfiwfpuifzuzvifop-csuxasnm' const prefix = "! " bot. registry. registergroup('simple', 'simple'); bot. registry. registerdefaults(); bot. registry. + '/commands'); bot. on('message', message => { if(message. content == 'hi! ') { message. channel. send ('@everyone sup, how is @everyone day going'); } if(message. content == 'h3lp') { message. channel. send ('dose not have any commands yet'); } bot. on('ready', function() { console. log("ready") }); bot. login(token);
Answers: 1
image
Computers and Technology, 24.06.2019 17:30, bxbykay1
Looking at the electroscope, describe how you can cause the two leaves at the bottom to repel each other and stay that way
Answers: 3
Do you know the correct answer?
Greatest common divisor

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

Questions in other subjects:

Konu
Mathematics, 21.04.2020 18:47