Question: The following three problems in this Exercise refer to a function f that calls another function func. The code for C function func is already
The following three problems in this Exercise refer to a function f that calls another function func. The code for C function func is already compiled in another module using the MIPS calling convention from Figure 2.14. The function declaration for func is “int func(int a, int b);”. The code for function f is as follows:
Figure 2.14

Translate function f into MIPS assembly language, also using the MIPS calling convention from Figure 2.14. If you need to use registers $t0 through $t7, use the lower-numbered registers first.
Name Register number $zero $v0-$vl $a0-$a3 $t0-$t7 $50-$s7 $t8-$t9 $gp $sp $fp $ra 0 2-3 4-7 8-15 16-23 24-25 28 29 30 31 The constant value 0 Values for results and expression evaluation Arguments Temporaries Usage Saved More temporaries Global pointer Stack pointer Frame pointer Return address Preserved on call? n.a. no no no yes no yes yes yes yes
Step by Step Solution
3.34 Rating (157 Votes )
There are 3 Steps involved in it
Provided are two different C functions named f Lets translate each one into MIPS assembly code using the MIPS calling convention from Figure 214 We wi... View full answer
Get step-by-step solutions from verified subject matter experts
