Question: Problem 3 - Parameter Passing foo access links control links ar fp program foo() a, b integer; procedure bar(integer x, integer y) 1 z: integer;

 Problem 3 - Parameter Passing foo access links control links ar

Problem 3 - Parameter Passing foo access links control links ar fp program foo() a, b integer; procedure bar(integer x, integer y) 1 z: integer; x=x+y+z; 3 // statement body of foo call bar(a, b); print a, b; F Use the RISC machine instructions loadI, loadAI, storeAI, add to show the code that needs to be generated for the body of procedure bar (statements (/*1*/ through /*3*/) Assume that 1. Register r0 contains the frame pointer (fp) value. 2. Formal parameter x is call-by-reference, and formal parameter y is call-by-value. Assume that bar's parameters x and y have bcen correctly initialized as part of the procedure call of bar 3. Use the stack frame layout as shown above. The figure shows the runtime stack when the program execution reaches program point /*0*/ in procedure bar. What values for a and b does the program print

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!