Question: Probem 2 - Lexical Scoping Code Generation Assume that all variables are lexically scoped. program main) 1int a, b; procedure f() 1 int c; procedure

 Probem 2 - Lexical Scoping Code Generation Assume that all variables

Probem 2 - Lexical Scoping Code Generation Assume that all variables are lexically scoped. program main) 1int a, b; procedure f() 1 int c; procedure gO (#A*) print a,b,c; end g; a=0; c = 1; call gO; print c; end f; procedure g) I int a,b; a-3, b = 7; call f); print a,b; end g, a= 2; b=3; print a,b; call gO; print a,b; end main; 1. Show the runtime stack with its stack frames, access and control links, and local variables when the execution reaches program point (*A*). 2. Give the ILOC RISC code for the expressions at program points (*A*) and (*B*). The value of the expressions need to be loaded into a register. The particular register numbers are not important here

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!