You copied the Doc URL to your clipboard.

ARM Compiler armasm User Guide : STR (register offset)

STR (register offset)

Store with register offset, pre-indexed register offset, or post-indexed register offset.

Syntax

STR{type}{cond} Rt, [Rn, ±Rm {, shift}] ; register offset

STR{type}{cond} Rt, [Rn, ±Rm {, shift}]! ; pre-indexed ; A32 only

STR{type}{cond} Rt, [Rn], ±Rm {, shift} ; post-indexed ; A32 only

STRD{cond} Rt, Rt2, [Rn, ±Rm] ; register offset, doubleword ; A32 only

STRD{cond} Rt, Rt2, [Rn, ±Rm]! ; pre-indexed, doubleword ; A32 only

STRD{cond} Rt, Rt2, [Rn], ±Rm ; post-indexed, doubleword ; A32 only

where:

type

can be any one of:

B
Byte
H
Halfword
-
omitted, for Word.
cond
is an optional condition code.
Rt
is the register to store.
Rn
is the register on which the memory address is based.
Rm
is a register containing a value to be used as the offset. –Rm is not permitted in T32 code.
shift
is an optional shift.
Rt2
is the additional register to store for doubleword operations.

Not all options are available in every instruction set and architecture.

Offset register and shift options

The following table shows the ranges of offsets and availability of this instruction:

Table 13-16 Options and architectures, STR (register offsets)

Instruction +/–Rm a shift    
A32, word or byte +/–Rm LSL #0-31 LSR #1-32  
    ASR #1-32 ROR #1-31 RRX
A32, halfword +/–Rm Not available
A32, doubleword +/–Rm Not available
32-bit encoding, word, halfword, or byte +Rm LSL #0-3    
T32 16-bit encoding, all except doubleword b +Rm Not available

Register restrictions

In the pre-index and post-index forms, Rn must be different from Rt.

Doubleword register restrictions

For A32 instructions:

  • Rt must be an even-numbered register.
  • Rt must not be LR.
  • ARM strongly recommends that you do not use R12 for Rt.
  • Rt2 must be R(t + 1).
  • Rn must be different from Rt2 in the pre-index and post-index forms.

Use of PC

In A32 instructions you can use PC for Rt in STR word instructions, and you can use PC for Rn in STR instructions with register offset syntax (that is, the forms that do not writeback to the Rn). However, this is deprecated.

Other uses of PC are not permitted in A32 instructions.

Use of PC in STR T32 instructions is not permitted.

Use of SP

You can use SP for Rn.

In A32 code, you can use SP for Rt in word instructions. You can use SP for Rt in non-word A32 instructions but this is deprecated.

You can use SP for Rm in A32 instructions but this is deprecated.

In T32 code, you can use SP for Rt in word instructions only. All other use of SP for Rt in this instruction is not permitted in T32 code.

Use of SP for Rm is not permitted in T32 state.

Related reference

a 

Where +/–Rm is shown, you can use –Rm, +Rm, or Rm. Where +Rm is shown, you cannot use –Rm.

b 

Rt, Rn, and Rm must all be in the range R0-R7.

Was this page helpful? Yes No