Problem Statement
You are to write a Linux elf64 assembly language program that performs the following tasks:
1. Prompts the user to enter a positive integer number (of value no more than 264-1.)
2. Prompts the user to enter a second positive integer number (of value no more than 264-1.)
3. Prints out the integer that is the greatest common divisor of the two entered numbers.
For those that don’t know, there is a famous algorithm (that is at least 2000 years old) for calculating this value. The greatest common divisor (GCD) algorithm goes as follows:
GCD (a, b):
if (b==0)
answer = a
else if (a<a)
answer = GCD (b, a )
else // (b>=a)
answer = GCD (b, a % b)
Comments
Leave a comment