3. (20 pts) Consider this C-like code. The program begins execution in main whic
ID: 3808869 • Letter: 3
Question
3. (20 pts) Consider this C-like code. The program begins execution in main which will create a stack frame and allo- cate local variables and a in the stack at offsets of 0, and 8 from SNp. respectively For this question, you are to write the MIPS32 language code that implements the function call to fun0 on line 17 in mail Write no your answer by completing the blanks on the answer sheet [01] int fun int a int b) [02] [03] int c 1 to4] for (i c b ++c) if (c a) [05] [06] [07] [08] [09] return b [10] [12] int main [13] [14] int x, y, z [15] x SysReadInt [16] y SysReadInt [17] z fun x, y) [19]Explanation / Answer
1. lw $r0,x
2. lw $r1,y
3.jal fun (here jal is jump and link)
4.jr $ra (jump register and address to register)
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.