Question: An ARC program calls the subroutine foo, passing it three arguments, a, b and c. The subroutine has two local variables, m and n. Show

 An ARC program calls the subroutine foo, passing it three arguments,

a, b and c. The subroutine has two local variables, m and

An ARC program calls the subroutine foo, passing it three arguments, a, b and c. The subroutine has two local variables, m and n. Show the position of the stack pointer and the contents of the relevant stack elements for a stack-based calling convention at the points in the program shown below. Note that subroutine foo does not return anything. a. Just before executing the call at label x b. When the stack frame for foo is completed C. Just before executing the ld at label z (i.e. when the calling routine resumes) Use the stack notation shown ! Push the arguments a, b and c call foo z : ld &ri, r2 . foo: ! subroutine starts here : jmpl fr15 + 4, fr0 An ARC program calls the subroutine foo, passing it three arguments, a, b and c. The subroutine has two local variables, m and n. Show the position of the stack pointer and the contents of the relevant stack elements for a stack-based calling convention at the points in the program shown below. Note that subroutine foo does not return anything. a. Just before executing the call at label x b. When the stack frame for foo is completed C. Just before executing the ld at label z (i.e. when the calling routine resumes) Use the stack notation shown ! Push the arguments a, b and c call foo z : ld &ri, r2 . foo: ! subroutine starts here : jmpl fr15 + 4, fr0

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 Databases Questions!