CS360 Midterm Exam: March 2, 2004. Question 5

The main() from Question 3 is linked with procedure a() from Question 4, and a procedure b() which you cannot see. We execute the program from the command line, and after a few instructions, main() calls procedure b(). Then, after a few more instructions, procedure b() calls the procedure a(). As the computer begins to execture the jsr statement (which is at memory location 0x1064), the stack and registers look as follows:

Answer the following questions:

Part a. What memory location contains the statement 'jsr b'?
Part b. What is argc?
Part c. In the procedure main(), what is & i?
Part d. In the procedure a(), suppose the first parameter is named p1. What is & p1?
Part e. What is the value of memory location 0xfff475?
Part f. What will the frame pointer be while procedure a() is running?
Part g. When procedure a() returns, what is the value of register r1?
Part h. There has been a programming mistake involving procedure b(). What is it?