Cortex-M3 Processor (Reference Material)
UG0331 User Guide Revision 15.0
59
•
Rt
is the register to load or store.
•
Rn
is the register on which the memory address is based.
•
offset
is an offset from
Rn
. If
offset
is omitted, the address is the contents of
Rn
.
•
Rt2
is the additional register to load or store for two-word operations.
3.6.4.2.2
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. Refer to
The following table lists the ranges of offset for immediate, pre-indexed and post-indexed forms.
3.6.4.2.3
Restrictions
For load instructions:
•
Rt
can be SP or PC for word loads only
•
Rt
must be different from
Rt2
for two-word loads
•
Rn
must be different from
Rt
and
Rt2
in the pre-indexed or post-indexed forms.
When
Rt
is PC in a word load instruction:
•
bit[0] of the loaded value must be 1 for correct execution
•
a branch occurs to the address created by changing bit[0] of the loaded value to 0
•
if the instruction is conditional, it must be the last instruction in the IT block.
For store instructions:
•
Rt
can be SP for word stores only
•
Rt
must not be PC
Table 31 •
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
Содержание SmartFusion2 MSS
Страница 1: ...UG0331 User Guide SmartFusion2 Microcontroller Subsystem ...
Страница 166: ...Cortex M3 Processor Reference Material UG0331 User Guide Revision 15 0 132 ...
Страница 200: ...Embedded NVM eNVM Controllers UG0331 User Guide Revision 15 0 166 Figure 87 System Builder Window ...
Страница 407: ...Universal Serial Bus OTG Controller UG0331 User Guide Revision 15 0 373 ...
Страница 806: ...Fabric Interface Controller UG0331 User Guide Revision 15 0 772 Figure 345 FIC Master AHB Lite Subsystem ...