2.19.3 [5] <2.8> For each function call, show the contents of the stack after the
function call is made. Assume the stack pointer is originally at address 0x7ffffffc,
and follow the register conventions as specified in Figure 2.11.
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:
a. int f(int a, int b, int c, int d){
return func(func(a,b),c+d);
}
b. int f(int a, int b, int c, int d){
if(a+b>c+d)
return func(a+b,c+d);
return func(c+d,a+b);
}
 
 
View Solution
 
 
 
<< Back Next >>