Question: Fill the stack with all activation record instances, including local variables, static and dynamic chains, when execution reaches position 1 in the following skeletal program.

Fill the stack with all activation record instances, including local variables, static and dynamic chains, when execution reaches position 1 in the following skeletal program. (10 points) : procedure Main is var A : integer; procedure Subl is var B : integer; procedure Sub2 is var C, D : integer; procedure Sub3 is var A : integer; begin ---- of Sub3 end; ---- of Sub3 procedure Sub4 is var B, C : integer; begin of Sub4 Sub3; ------------ 1 end; ---- of Sub4 begin of Sub2 .... Sub4; end; ---- of Sub2 begin ---- of Subl Sub2; end; ---- of Sub1 begin - of Main Subl; end; ---- of Main Activation Record Instances
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
