ARM Instruction Reference
4-16
Copyright © 2000, 2001 ARM Limited. All rights reserved.
ARM DUI 0068B
Zero offset
The value in
Rn
is used as the address for the transfer.
Pre-indexed offset
The offset is applied to the value in
Rn
before the transfers take place. The result is used
as the memory address for the transfers. If the
!
suffix is used, the address is written
back into
Rn
.
Program-relative
This is an alternative version of the pre-indexed form. The assembler calculates the
offset from the PC for you, and generates a pre-indexed instruction with the PC as
Rn
.
You cannot use the
!
suffix.
Post-indexed offset
The value in
Rn
is used as the memory address for the transfer. The offset is applied to
the value in
Rn
after the transfer takes place. The result is written back into
Rn
.
Offset syntax
Both pre-indexed and post-indexed offsets can be either of the following:
#
expr
{-}
Rm
where:
-
is an optional minus sign. If
-
is present, the offset is subtracted from
Rn
.
Otherwise, the offset is added to
Rn
.
expr
is an expression evaluating to an integer in the range –255 to +255. This
is often a numeric constant (see examples below).
Rm
is a register containing a value to be used as the offset. For loads,
Rm
must
not be the same as
Rd
or
R(d+1)
.
This is the same offset syntax as for
LDR and STR, halfwords and signed bytes
on
page 4-12.
Address alignment
The address must be a multiple of eight for doubleword transfers.