Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9 . - [ Stack mechanism and code generation ] ( 1 1 points ) . Consider the program described below and give the generated

9.-[Stack mechanism and code generation](11 points). Consider the program described below
and give the generated code for the statements at 1,2, and 3. Procedures are called as shown
below.
BIGSUB calls SUB2
SUB2 calls SUB3
SUB3 calls SUB1
(Assume the ARs have SL, DL, and RA. If errors occur, indicate where it is detected and what is
the cause of the error.
procedure BIGSUB;
var A, B, C : integer;
procedure SUB1;
var A, K : integer;
begin { SUB1}
B := C + A; <-----------------------1
end; { SUB1}
procedure SUB2(X : integer);
var B, F, E : integer;
procedure SUB3;
var C, K, E : integer;
begin { SUB3}
SUB1;
K := B * E; <--------------------2
end; { SUB3}
begin { SUB2}
SUB3;
K := E + A; <-----------------------3
end; { SUB2}
begin { BIGSUB }
SUB2(9);
end; { BIGSUB }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

How do SMIS increase social capital?

Answered: 1 week ago