Modern imperative programming languages typically have local variables.
In c, cpp all variables written within function or passed as arguments are local to its function which are not accessible outside that function. These are called as local variables.
Each invocation of a function has its own instantiation of local variables
Recursive calls to a function require several instantiations to exist simultaneously.
Functions return only after all functions it calls have returned μ last-in-first-out
A LIFO structure called a stack is used to hold each instantiation
The portion of the stack used for an invocation of a function is called the function’s
stack frame or activation record.
Stack Frame Organization
How is data organized in stack frame?
Compiler can use any layout scheme that is convenient.
Microprocessor manufactures specify “standard” layout schemes used by all compilers.
Sometimes referred to as Calling Conventions.
If all compilers use the same calling conventions, then functions compiled with one compiler can call functions compiled with another.
Stack frame organization is Essential for interaction with OS/libraries.