The Load and Store Word or Unsigned Byte addressing mode is divided into 9 submodes. They are used to calculate the address for a load and store unsigned byte instruction. The general syntax for this addressing mode is provided in the following section.
LDR|STR [condition] [B] [T] dest, addr_mode
where:
LDR |
Specifies Load Register instruction. |
STR |
Specifies Store Register instruction. |
condition |
Is one of 16 conditions. See Condition Code Status. |
B |
Extends the instruction to the Load Register Byte (LDRB) instruction or to the Store Register Byte ( STRB ) instruction. For further information see LDRB Instruction or STRB Instruction. |
T |
Extends the instruction to the Load Register with Translation (LDRT) instruction or to the Store Register with Translation ( STRT ) instruction. For further information see LDRT Instruction or STRT Instruction. |
dest |
Specifies the destination register. |
addr_mode can be one of the following 9 submodes:
Submode |
Description |
---|---|
[ basereg , #+/- value ] |
Offset option: |
[ basereg , +/- indexreg ] |
Offset option: |
[ basereg , +/- indexreg , shift # sh_imm ] |
Offset option: |
[ basereg #+/- value ]! |
Pre-indexed option: |
[ basereg , +/- indexreg ]! |
Pre-indexed option: |
[ basereg , +/- indexreg , shift # sh_imm ]! |
Pre-indexed option: |
[ basereg ], #+/- value |
Post-indexed option: |
[ basereg ], +/- indexreg |
Post-indexed option: |
[ basereg ], +/- indexreg , shift # sh_imm |
Post-indexed option: |
The following tables show the encodings for Addressing Mode 2:
31 |
|
|
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
|
|
16 |
condition |
0 |
1 |
0 |
P |
U |
B |
W |
L |
basereg |
15 |
|
|
12 |
11 |
|
|
|
|
|
|
|
|
|
|
0 |
dest |
value |
31 |
|
|
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
|
|
16 |
condition |
0 |
1 |
1 |
P |
U |
B |
W |
L |
basereg |
15 |
|
|
12 |
11 |
10 |
9 |
8 |
7 |
6 |
5 |
4 |
3 |
|
|
0 |
dest |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
indexreg |
31 |
|
|
28 |
27 |
26 |
25 |
24 |
23 |
22 |
21 |
20 |
19 |
|
|
16 |
condition |
0 |
1 |
1 |
P |
U |
B |
W |
L |
basereg |
15 |
|
|
12 |
11 |
|
|
|
7 |
6 |
5 |
4 |
3 |
|
|
0 |
dest |
sh_imm |
shift |
0 |
indexreg |
where:
P |
P
== 0 indicates post-indexed addressing. The base register value is
used for the memory address. Then the offset is applied to the base register
value and written back to the base register. |
U |
Indicates whether the offset is added to the base
or subtracted from the base: |
B |
Indicates an unsigned byte or a word access: |
L |
Indicates a Load or a Store: |
The meaning of W depends on the setting of P :
|
P==0 |
P==1 |
W==0 |
The instruction is LDR , LDRB , STR , or STRB . A normal memory access is performed. |
The base register is not updated (offset addressing). |
W==1 |
The instruction is LDRBT , LDRT , STRBT , or STRT . An unprivileged memory access is performed. |
The calculated memory address is written back to the base register (pre-indexed addressing). |