Question: For the following sub - problems, consider the following program: float bar ( int r , int s ) { float i; i = 2

For the following sub-problems, consider the following program:
float bar(int r, int s){ float i; i =20.0+(r + s); return i; } int foo1(int a , int b){ float g; g = bar(b, a); return (int)g; } int foo2(int a , int b){ float h; h = bar(a, b); return (int)h; } void main(){ int x; int y; float f; x =1+ x * y; y = foo1(x, y)+ foo2(x, y); ...//some computations }
Question 1.1
Q1.1
10 Points
Grading comment:
Assume your program is running on a machine with 4 registers, using callee saves. Assume address (i.e., pointers) are 8 bytes, floats are 4 bytes and ints are 4 bytes. Draw the complete stack (i.e., the stack including all active activation records) for the program right after the first time bar has been called, and before bar returns. For each slot in the stack, indicate what is stored there, and how much space that slot takes up.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!