9.2 Structured Programming Flashcards
When running a program what items are stored in memory (segments of memory)
What is the purpose of the stack
- Subroutine state and local variables
What is a stack overflow and its implications
Stack expands and can overwrite program etc.
Note: Stack grows downwards
What steps are required to implement subroutine calls using the stack
In HEX-8, what instructions are used to implement subroutine calls using the stack
What is the stack frame (subroutine)
Current ‘state’ frame of the subroutine. Params, return address, local variables etc.
Do real computers use the stack for program counter and return addresses
Not usually. Most have special Stack Pointer and link registers.
What is an exception
How can the logic regarding subroutines on the stack be translated to dealing with exceptions
Branches to exception handlers similar to subroutine branches with return addresses.