Week 13: Stack Frame & Passing Parameters Flashcards
Computer programs and subroutines consist of
Data elements and procedures that operate on the data elements
The scope of a variable defines the
Range of its visibility or accessibility within a program
Global variables are visible…
from the moment they are loaded into memory to the moment the program stops running
Local variables and parameters are visible…
Within that procedure but invisible outside the procedure
When a language invokes a procedure , it is said to…
Activate the procedure
With each invocation of a procedure, there is an…
Activation record
Activation records contain…
All necessary information to execute the procedure
- Parameters
- Local variables
- Return address
The activation record is also known as the…
Frame
After an activation record has been used…
Executing a return from procedure deallocates or frees the storage taken up by the record
The stack provides…
A mechanism for implementing the dynamic memory allocation
The stack-frame is a region of
Temporary storage
At the beginning of a subroutine, the temporary storage will be
Pushed onto the stack
At the end of a subroutine, temporary storage will be
Popped from the stack
The two pointers associated with stack frames are
Stack Pointer, SP (r13)
Frame Pointer, FP (r11)
What register is the Stack Pointer?
r13