The Gateway to Computer Science Excellence
0 votes
As actual parameters are stored in the Actual parameter field in case of Activation record then where does formal parameters will be stored?





Here e,f are actual parameters that will be stored in actual parameter field,but where does formal parameters a,b will be stored for f activation record?
in Compiler Design by | 605 views

3 Answers

0 votes
In call by value the calling procedure passes the r-value of the actual parameters and the compiler puts that into called procedure’s activation record.
0 votes

During a function call, the parameters are passed via stack or registers (depends on ABI). So, only words are passed. The words may (or may not) be addresses. The address can be in text or data or stack or bss or heap, etc.

0 votes
A general activation record consist of the following things:
Local variables: hold the data that is local to the execution of the procedure.
Temporary values: stores the values that arise in the evaluation of an expression.
Machine status: holds the information about status of machine just before the function call.
Access link (optional): refers to non-local data held in other activation records.
Control link (optional): points to activation record of caller.
Return value: used by the called procedure to return a value to calling procedure
Actual parameters

Source: G4G

So formal parameter are like local variables to the called function, hence stored in local variable part.

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
52,315 questions
60,430 answers
95,242 users