| |||
| Home > Writing ARM Assembly Language > Load and store multiple register instructions > Load and store multiple instructions available in ARM and Thumb | |||
The following instructions are available in both ARM and Thumb instruction sets:
LDMLoad Multiple registers.
STMStore Multiple registers.
PUSHStore multiple registers onto the stack and update the stack pointer.
POPLoad multiple registers off the stack, and update the stack pointer.
In LDM and STM instructions:
The list of registers loaded or stored can include:
in ARM instructions, any or all of r0-r15
in 32-bit Thumb-2 instructions, any or all of r0-r12, and optionally r14 or r15 with some restrictions
in 16-bit Thumb and Thumb-2 instructions, any or all of r0-r7.
The address can be:
incremented after each transfer
incremented before each transfer (ARM instructions only)
decremented after each transfer (ARM instructions only)
decremented before each transfer (not in 16-bit Thumb).
The base register can be either:
updated to point to the next block of data in memory
left as it was before the instruction.
When the base register is updated to point to the next block in memory, this is called writeback, that is, the adjusted address is written back to the base register.
In PUSH and POP instructions:
The stack pointer (sp) is the base register, and is always updated.
The address is incremented after each transfer in POP instructions,
and decremented before each transfer in PUSH instructions.
The list of registers loaded or stored can include:
in ARM instructions, any or all of r0-r15
in 32-bit Thumb-2 instructions, any or all of r0-r12, and optionally r14 or r15 with some restrictions
in 16-bit Thumb-2 and Thumb instructions, any or
all of r0-r7, and optionally r14 (PUSH only) or r15
(POP only).