Stacks Flashcards
How can stacks be imaged
As a stack of paper You can on,y out new things on the top You cannot put new things in the middle You can only take things off the top You can see the top without taking off the top
What does it mean to push an item on a stack
To place an item on the top of the stack
What does it mean to push an item off the stack
To remove an item from the top of the stack
What does SP stand for
Stack pointer
In what register is the system stack SP
R13
What are the four types of stack growth conventions
Full ascending
Full descending
Empty ascending
Empty descending
In a full ascending stack:
- Where does the SP point
- What direction does it grow in memory
- SP points at last item pushed onto the stack
2. Grows from low to high address in memory
In a full descending stack:
- Where does the SP point
- What direction does it grow in memory
- SP points to last item pushed onto stack
2. Grows from high to low address in memory
In a empty ascending stack:
- Where does the SP point
- What direction does it grow in memory
- Sp posts to the next free space in the stack
2. Grows from low to high addresses in memory
In a empty descending stack:
- Where does the SP point
- What direction does it grow in memory
- Sp points to next free space on the stack
2. Grows from low to high addresses in memory
What is it called when we reach stack size limit
Stack overflow
Does popping off get done on its own
No it’s the programmers responsibility
What does LDM do
Load multiple
What does STM so
Store multiple
Eg store contents of registers r1, r2, r3 to memory at the address in r12
STMDB R12, {r1-r3}
DB = decrement before