Question: Problem 3 - Parameter Passing foo control links links fp program foo) a, b integer; procedure bar (integer x, integer y ( z: integer; z=3;
Problem 3 - Parameter Passing foo control links links fp program foo) a, b integer; procedure bar (integer x, integer y ( z: integer; z=3; xxyz; /* 2 // statement body of foo b = 6; call bar(a, b) print a, b;h Use the RISC machine nstructions 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 been 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 "in procedure bar What values for a and b does the program print
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
