Could someone please help me with this recursion assignment? Iwill give a lifesa
ID: 3608630 • Letter: C
Question
Could someone please help me with this recursion assignment? Iwill give a lifesaver rating. Thanks!Write MIPS assembly code for the following C/Java programfragment, which computes the McCarthy 91 function.
{ int result; if(n > 100) result = n – 10; if(n <= 100) result = McCarthy91(McCarthy91(n+11)); return result; } Could someone please help me with this recursion assignment? Iwill give a lifesaver rating. Thanks!
Write MIPS assembly code for the following C/Java programfragment, which computes the McCarthy 91 function.
{ int result; if(n > 100) result = n – 10; if(n <= 100) result = McCarthy91(McCarthy91(n+11)); return result; }
Explanation / Answer
McCarthy91 : CLR result MVI n,data CMP n,100 JLE Loop SUB n, 10 MOVresult, n REJ result Loop: Add n, 11 JMP McCarthy; I hope this will help u..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.