Question: Read the program below before answering the question. ... denotes the code that is irrelevant to this question. int fo( int a, int b, int



Read the program below before answering the question. "..." denotes the code that is irrelevant to this question. int fo( int a, int b, int c, int d ); int main() \{ int x,y,z; z=f00(1,x,2,y) 3 int fo( int a, int b, int c, int d ) \{ int i,j,k; i=c+2; return j; \} Assume that (i) rG represents the register pointing to the beginning of the locations where the global variables are stored, (ii) rL denotes the register that records the start of the locations where the local variables are stored, (iii) the offsets of the variables in the program above are given in the table below, and (iv) the activation record of function main starts at address 0x8000. In the table, each capital letter represents an integer. Which one of the following statements is correct? a. Only the instructions in function foo can access the data in the activation record of function foo. b. The activation record of function foo is created by the instructions in function foo. c. The complete activation record of function foo is removed from the runtime stack by the instructions in function main. d. The activation record of function foo is created by the instructions in both functions main and foo. Read the program below before answering the question. "..." denotes the code that is irrelevant to this question. int fo( int a, int b, int c, int d ); int main() \{ int x,y,z; z=f00(1,x,2,y) 3 int fo( int a, int b, int c, int d ) \{ int i,j,k; i=c+2; return j; \} Assume that (i) rG represents the register pointing to the beginning of the locations where the global variables are stored, (ii) rL denotes the register that records the start of the locations where the local variables are stored, (iii) the offsets of the variables in the program above are given in the table below, and (iv) the activation record of function main starts at address 0x8000. In the table, each capital letter represents an integer. Which one of the following statements is correct? a. Only the instructions in function foo can access the data in the activation record of function foo. b. The activation record of function foo is created by the instructions in function foo. c. The complete activation record of function foo is removed from the runtime stack by the instructions in function main. d. The activation record of function foo is created by the instructions in both functions main and foo
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
