The Cortex-M4 Instruction Set
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
3-25
ID121610
Non-Confidential
Operation
LDR
instructions load one or two registers with a value from memory.
STR
instructions store one or two register values to memory.
Load and store instructions with immediate offset can use the following addressing modes:
Offset addressing
The offset value is added to or subtracted from the address obtained from the
register
Rn
. The result is used as the address for the memory access. The register
Rn
is unaltered. The assembly language syntax for this mode is:
[
Rn
, #
offset
]
Pre-indexed addressing
The offset value is added to or subtracted from the address obtained from the
register
Rn
. The result is used as the address for the memory access and written
back into the register
Rn
. The assembly language syntax for this mode is:
[
Rn
, #
offset
]!
Post-indexed addressing
The address obtained from the register
Rn
is used as the address for the memory
access. The offset value is added to or subtracted from the address, and written
back into the register
Rn
. The assembly language syntax for this mode is:
[
Rn
], #
offset
The value to load or store can be a byte, halfword, word, or two words. Bytes and halfwords can
either be signed or unsigned. See
.
shows the ranges of offset for immediate, pre-indexed and post-indexed forms.
Table 3-6 Offset ranges
Instruction type
Immediate offset
Pre-indexed
Post-indexed
Word, halfword, signed
halfword, byte, or signed byte
−
255 to 4095
−
255 to 255
−
255 to 255
Two words
multiple of 4 in the
range
−
1020 to 1020
multiple of 4 in the
range
−
1020 to 1020
multiple of 4 in the
range
−
1020 to 1020