search
Log In
2 votes
822 views

Match the following with respect to activation record fields:

A 1 β†’ A, D; 2 β†’ B, C

B 1 β†’ A, C; 2 β†’ B, D

C 1 β†’ B, C; 2 β†’ A, D

D 1 β†’ B, D; 2 β†’ A, C

Doubt:- Control link points to caller activation record.Can some one confirm?

in Compiler Design
edited by
822 views
1
1-> A is correct..
0
No.Access link is not dynamic link.It is static link.And What i have read that control link point to Caller activation record and not the calling activation record.I need to confirm this but as i read it sometime back
1
what I comment is control link is the point to activation record of calling procedure.
since one function(its activation record is on a stack, even for main() activation record is on the stack) call to another procedure.
what you asked, and your comment about access link.
0

I misunderstood you first comment as that you are suggesting a as the answer.:(

If A calls B, now according to given in question A control link points to B

but shoudn't it be  B control link point to A

See https://www.cs.nmsu.edu/~rth/cs/cs471/f00/ARIs.html

"The dynamic link points to the top of the ARI of the caller." So B control link point to A.Why is this not correct?

3

According to question it simple says control link point to calling procedure like if A calls B then Control link from B points to A since A is calling procedure. B is called procudre so Control link to calling procedure or from called procedure.

Always calling procedure is pointing

1
thanks got that now.

4 Answers

0 votes
Control link is a dynamic link +

Control link pointing to the caller

 

Hence Answer=B
0 votes
Answer b: 1-A,C 2- B,D

Access link(static link) refers to non local data held on activation record.

Control link(dynamic link): point to activation record of caller.
0 votes

control link from record A points to the previous record on the stack. The chain of control links traces the dynamic execution of the program.

An access link from record A points to the record of the closest enclosing block in the program. The chain of access links traces the static structure (think: scopes) of the program.

Source: https://www.cs.hmc.edu/~benw/teaching/notes/activation.html

1 => A, C

2 => B, D

0 votes
1- option A and C

2- option B and D
ago

Related questions

2 votes
4 answers
1
963 views
Consider the following statements: S1 : Static allocation can not support recursive function. S2 : Stack allocation can support pointers but can not deallocate storage at run-time. S3 : Heap allocation can support pointers and it can allocate or deallocate storage at run-time. Which of the above statements are true? a S1 and S2 b S2 and S3 c S3 and S1 d S1, S2 and S3
asked Jan 24, 2018 in Compiler Design rahul sharma 5 963 views
1 vote
2 answers
2
516 views
The two basic operations that are often performed with the symbol table are: 1. Set and reset 2. Set and insert 3. Insert and lookup 4. Reset and lookup
asked Dec 27, 2018 in Compiler Design Prince Sindhiya 516 views
1 vote
1 answer
3
339 views
Which of the Following is True ? A. Symbol table Construction is during the analysis part of the Compiler. B. Type checking is Done during Syntax Analysis phase C. SDD with only synthesized attribute have an order of evaluation D. Both A and C Please Explain the C part only rest are easy :)
asked Oct 8, 2018 in Compiler Design Na462 339 views
1 vote
2 answers
4
344 views
can anyone tell broadly about "Arbitrary lifetime in case of heap allocation".
asked Mar 11, 2018 in Compiler Design The Technical Guy 344 views
...