Question: i need help implementing this function into a naked funstion in ASSEMBLY language /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Dijkstra's Algorithm to calculate GCD. Implement a recursive function in assembly
i need help implementing this function into a naked funstion in ASSEMBLY language
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Dijkstra's Algorithm to calculate GCD.
Implement a recursive function in assembly that calculates the greatest common divisor of two unsigned integers.
Given two unsigned integers n and m, we can define GCD(m , n) as:
GCD(m , n) = n , if (m % n) == 0 GCD(m , n) = GCD(n , m % n) , if (m % n) > 0
************************************************************************************************/
__declspec(naked) unsigned int gcd(unsigned int m, unsigned int n) {
// C code to be converted to x86 assembly /* if ((m % n) == 0) return n; else return gcd(n, m % n); */ __asm { mov eax, 0 // BEGIN YOUR CODE HERE
// END YOUR CODE HERE ret } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
