Question: Assume that the stack and the static data segments are empty and that the stack and global pointers start at address 0x7fff fffc and 0x1000

Assume that the stack and the static data segments are empty and that the stack and global pointers start at address 0x7fff fffc and 0x1000 8000, respectively. Assume the calling conventions as speciied in Figure 2.11 and that function inputs are passed using registers $a0–$a3 and returned in register $r0. Assume that leaf functions may only use saved registers.b. int my_global 100; main() { } int { int x = 10; 20: } int y int z; z } int { } int my_global = 100; main

Figure 2.11Preserved Saved registers: $50-$57 Stack pointer register: $sp Return address register: $ra Stack above the

Show the contents of the stack and the static data segments after each function call.

b. int my_global 100; main() { } int { int x = 10; 20: } int y int z; z } int { } int my_global = 100; main () { my_function(x, y). my function(int x, int y) return x y + my_global; int z: my_global += 1; z = leaf_function(my_global); leaf_function(int x) return x + 1;

Step by Step Solution

3.47 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The images provided describe two different scenarios each with a code snippet and a listing of register categories as per their usage in functions in what appears to be a MIPSlike assembly language en... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Organization Design Questions!