1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
djyliett [7]
3 years ago
10

Write a function gcd in assembly language, which takes two parameters, calculates and returns the gcd of those two numbers. You

do not need to write the whole program. Just write the function part. The function should use the standard Linux registers for parameters and return values. Add additional comments to describe how you are doing the calculation.
Computers and Technology
1 answer:
Inga [223]3 years ago
4 0

Answer:

Explanation:

The following is written in Java. It creates the function that takes in two int values to calculate the gcd. It includes step by step comments and prints the gcd value to the console.

       public static void calculateGCD(int x, int y) {

           //x and y are the numbers to find the GCF which is needed first

           x = 12;

           y = 8;

           int gcd = 1;

           //loop through from 1 to the smallest of both numbers

           for(int i = 1; i <= x && i <= y; i++)

           {

               //returns true if both conditions are satisfied

               if(x%i==0 && y%i==0)

                   //once we have both values as true we store i as the greatest common denominator

                   gcd = i;

           }

           //prints the gcd

           System.out.printf("GCD of " + x + " and " + y + " is: " + gcd);

       }

You might be interested in
A programmer is creating an algorithm that will be used to turn on the motor to open the gate in a parking garage. The specifica
Mars2501 [29]

The algorithm which can be used to open the gate under the appropriate conditions is:

  1. Check if the time is during business hours.
  2. If Yes, check if the gate sensor is activated.
  3. If Yes, check if the gate is open.
  4. If it is No, turn on the motor.

<h3>What is an algorithm?</h3>

An algorithm can be defined as a standard formula (procedures) which comprises a set of finite steps and instructions that is typically used for solving a problem on a computer under the appropriate conditions.

This ultimately implies that, an algorithm is a standard, logical formula (procedures) containing the step-by-step rules and instructions for performing a specific task or proffering a solution to a specific problem on a computer system.

In this scenario, the algorithm which can be used to open the gate under the appropriate conditions is:

  1. Check if the time is during business hours.
  2. If Yes, check if the gate sensor is activated.
  3. If Yes, check if the gate is open.
  4. If it is No, turn on the motor.

Read more on algorithm here: brainly.com/question/24793921

5 0
2 years ago
Can anybody please help me with 7.4.7 spelling bee codehs?
Eddi Din [679]

Answer:

What are you trying to say?

Explanation:

7 0
3 years ago
Why do some people put salt on sidewalks when it snows?
drek231 [11]
It help to melt the snow quicker. they salt eats away the snow.
6 0
4 years ago
"Inheritance is the process by which a new class - known as a _________ - is created from another class, called the ____________
Novay_Z [31]

Answer:

child class

parent class

Explanation:

"Inheritance is the process by which a new class - known as a __child class__ - is created from another class, called the __parent class__. "

3 0
3 years ago
What parts make cars a system?
NeTakaya
<span>This is a list of automotive parts mostly for vehicles using internal combustion engines which are manufactured components of automobiles: Contents. [hide]. 1 Body and main parts. 1.1 Doors; 1.2 Windows. 2 Electrical and electronics. 2.1 Audio/video devices; 2.2 Cameras; 2.3 Charging system; 2.4 Electrical ...</span><span>
</span>
7 0
4 years ago
Read 2 more answers
Other questions:
  • How to create a function, called separate_int_and_str, which takes in a list and separates out the integer values and strings in
    9·1 answer
  •                                                        HELP PLEASE 
    12·2 answers
  • This common technique, employed at the edge of a network, eliminates the need for public IP addresses on a private network while
    8·1 answer
  • Which of the follow represents a form of disruptive technology? Tend to open new markets and destroy old ones A new way of doing
    11·1 answer
  • Sql is an example of a ________ category programming language. 4gl 3gl 5gl 2gl
    15·1 answer
  • Wyjaśnij w kontekście bezpieczeństwa, dlaczego wykonanie przelewu bankowego nie w każdej sytuacji wymaga zastosowania kwalifikow
    12·1 answer
  • Which of the following would you not see on a windows 10 start menu?
    6·1 answer
  • What option from the format tab should you use to remove unwanted parts of a picture
    8·1 answer
  • The Open Systems Interconnection (OSI) Reference Model: defines standards for many aspects of computing and communications withi
    12·1 answer
  • spreadsheet solution Credit Score Current Rate First Name: Mary 500 6.50% Last Name: Bell 550 6.25% Address: 123 First Street 60
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!