ARM Instruction Reference
4-18 Copyright © 2000, 2001 ARM Limited. All rights reserved. ARM DUI 0068B
4.2.4 LDM and STM
Load and store multiple registers. Any combination of registers r0 to r15 can be
transferred.
Syntax
op{cond}mode Rn{!}, reglist{^}
where:
op
is either
LDM
or
STM
.
cond
is an optional condition code (see Conditional execution on page 4-4).
mode
is any one of the following:
IA
increment address after each transfer
IB
increment address before each transfer
DA
decrement address after each transfer
DB
decrement address before each transfer
FD
full descending stack
ED
empty descending stack
FA
full ascending stack
EA
empty ascending stack.
Rn
is the base register, the ARM register containing the initial address for the
transfer.
Rn
must not be r15.
!
is an optional suffix. If
!
is present, the final address is written back into
Rn
.
reglist
is a list of registers to be loaded or stored, enclosed in braces. It can
contain register ranges. It must be comma separated if it contains more
than one register or register range (see Examples on page 4-19).
^
is an optional suffix. You must not use it in User mode or System mode.
It has two purposes:
• If
op
is
LDM
and
reglist
contains the pc (r15), in addition to the
normal multiple register transfer, the
SPSR
is copied into the
CPSR
.
This is for returning from exception handlers. Use this only from
exception modes.
• Otherwise, data is transferred into or out of the User mode registers
instead of the current mode registers.