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
What register is the Frame Pointer?
r11
What is in register 11?
The Frame Pointer
What is in register 13?
The Stack Pointer
The stack pointer always points to the
Top of the stack
The frame pointer always points to the
Base of the current stack frame
The _____ may change during procedure execution, but the ______ will not
The stack pointer may change during procedure execution, but the frame pointer will not
It is strongly recommended that data in the stack frame be accessed through the
Frame Pointer
Reserving memory in the stack frame is done by
ADDing / SUBtracting x-bytes onto the Stack Pointer
Operations on the stack are ___ meaning….
Balanced, meaning if you put something onto the stack you have to remove it



