| |||||||||||||||||||||||||||||||||||||
Technical Support On-Line Manuals Assembler User Guide | Stack implementation using LDM and STM
The load and store multiple instructions can update the base register. For stack operations, the base register is usually the stack pointer, SP. This means that you can use these instructions to implement push and pop operations for any number of registers in a single instruction. The load and store multiple instructions can be used with several types of stack:
To make it easier for the programmer, stack-oriented suffixes can be used instead of the increment or decrement, and before or after suffixes. Table 10 shows the stack-oriented suffixes and their equivalent addressing mode suffixes for load and store instructions. Table 10. Stack-oriented suffixes and equivalent addressing mode suffixes
Table 11 shows the load and store multiple instructions with the stack-oriented suffixes for the various stack types. Table 11. Suffixes for load and store multiple instructions
For example:
STMFD sp!, {r0-r5} ; Push onto a Full Descending Stack
LDMFD sp!, {r0-r5} ; Pop from a Full Descending Stack
NoteThe Procedure Call Standard for the ARM Architecture (AAPCS), and ARM and Thumb C and C++ compilers always use a full descending stack. The | ||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||