1,634 views
0 votes
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?

f(a,b)

{

a(e,f)

}

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?

3 Answers

0 votes
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
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
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

0 votes
0 votes
1 answer
2
ryan sequeira asked May 14, 2016
1,167 views
What is the difference between an Activation Record and Program Control Block?Could anyone define each of them first, and then describe how they are different.
1 votes
1 votes
1 answer
4
sripo asked Nov 3, 2018
2,132 views
Does Heap Allocation support both recursion and dynamic memory allocation? Because,a stack can be implemented using dynamic memory allocation.Please correct me.Test Serie...