The Stack
We need to store the processor state when making nested calls.
The multiple data transfer instructions provide a mechanism for storing
state on the stack (pointed to by R13).
The STM and LDM instructions’ modes have
aliases for accessing stacks:
FD
- Full Descending
ED
- Empty Descending
FA
- Full Ascending
EA
- Empty Ascending
Remarks
Examples
STMFD r13!, {r4-r7} – Push R4,R5,R6 and R7 onto the stack.
LDMFD r13!, {r4-r7} – Pop R4,R5,R6 and R7 from the stack.
As you’ll recall R13 points to the stack.
FD= Full DescendingSTMFD/LDMFD=STMDB/LDMIAED= Empty DescendingSTMED/LDMED=STMDA/LDMIBFA= Full AscendingSTMFA/LDMFA=STMIB/LDMDAEA= Empty AscendingSTMEA/LDMEA=STMIA/LDMDBAnything but a full descending stack is rare!