2.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. See 2.6.3.5 Address Alignment.

The following table lists the ranges of offset for immediate, pre-indexed and post-indexed forms.

Table 2-25. Offset Ranges
Instruction TypeImmediate OffsetPre-IndexedPost-Indexed
Word, halfword, signed halfword, byte, or signed byte-255 to 4095-255 to 255-255 to 255
Two wordsMultiple of 4 in the range -1020 to 1020Multiple of 4 in the range -1020 to 1020Multiple of 4 in the range -1020 to 1020