Problem: We are given two decimal numbers we have to find the GCD of two numbers and print the GCD in decimal format.
Refer for finding GCD of two numbers.
Input: d1 = 16, d2 = 24 Output: GCD = 8 Input: d1 = 12, d2 = 18 Output: GCD = 6
- Load value d1 in ax and d2 in bx
- Call the gcd function
- If value in bx is zero
- Then set the value of gcd ( CX ) as ax
- Else set the value of ax as bx and value of bx as ax % bx
- Call the gcd function recursively
- Load the value of cx into ax
- Call the print function to print the gcd of two numbers
Note: The program cannot be run on an online editor, please use MASM to run the program and use dos box to run MASM, you might use any 8086 emulator to run the program
- 8086 program to find sum of odd numbers in a given series
- 8086 program to find sum of Even numbers in a given series
- 8086 program to find average of n numbers
- 8086 program to determine squares of numbers in an array of n numbers
- 8086 program to determine cubes of numbers in an array of n numbers
- 8086 program to print a String
- 8086 program to Print a 16 bit Decimal number
- 8086 program to add two 8 bit BCD numbers
- 8086 program to print the table of input integer
- 8086 program to add two 16 bit BCD numbers with carry
- 8086 program to multiply two 8 bit numbers
- 8086 program to multiply two 16-bit numbers
- 8086 program to subtract two 8 bit BCD numbers
- 8086 program to add two 16-bit numbers with or without carry
- 8086 program to subtract two 16 bit BCD numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.