greatest common divisor

Would you like us to handle your paper? Use our company for better grades and meet your deadlines.

Order a Similar Paper Order a Different Paper

!!!Assembly Language x86 only!!! INCLUDE with .asm file

Greatest Common Divisor

Write a recursive implementation of Euclid’s algorithm for finding the greatest common divisor (GCD) of two integers.

The Euclidean algorithm:

– Input: Two positive integers, a and b.

– Output: The greatest common divisor, g, of a and b.

– Internal computation

—If a<b, exchange a and b.

—If b=0, report a as the GCD of a and b

—Divide a by b and get the remainder, r. If r=0, report b as the GCD of a and b.

—Replace a by b and replace b by r. Return to the previous step.

Write a test program that calls your GCD procedure five times, using the following pairs of integers: (35,15), (72,18), (31,17), (128,640), (121,0). After each procedure call, display the GCD.

Sample output:

Do you need help with this or a different assignment? We offer CONFIDENTIAL, ORIGINAL (Turnitin/LopesWrite/SafeAssign checks), and PRIVATE services using latest (within 5 years) peer-reviewed articles. Kindly click on ORDER NOW to receive an A++ paper from our masters- and PhD writers.

Get a 15% discount on your order using the following coupon code SAVE15

Order a Similar Paper Order a Different Paper