Code test and debug on MIPSym a MIPS assembly language program to calculate recu
ID: 3715687 • Letter: C
Question
Code test and debug on MIPSym a MIPS assembly language program to calculate recursively the functionComb(n,m) = (if m == 0 || n == m ) ? 1 : Comb(n-1,m)+Comb(n-1,m-1);
Comb is 0 if m>n or n<0 or m<0
Your code should include a main routine that asks the user for input values of m and n and displays the result of the function call. The main routine should loop until the value that the function returns is zero. Code test and debug on MIPSym a MIPS assembly language program to calculate recursively the function
Comb(n,m) = (if m == 0 || n == m ) ? 1 : Comb(n-1,m)+Comb(n-1,m-1);
Comb is 0 if m>n or n<0 or m<0
Your code should include a main routine that asks the user for input values of m and n and displays the result of the function call. The main routine should loop until the value that the function returns is zero.
Explanation / Answer
Following is the MIPS code. You can generate it by first writing the C code and then compiling as "gcc -S test.c"
.file "test.c"
.text
.globl comb
.type comb, @function
comb:
pushl
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.