S3C4510B
INSTRUCTION SET
FORMAT 9: LOAD/STORE WITH IMMEDIATE OFFSET
11
10
3
2
15
14
13
12
6
5
0
Rb
Rd
0
1
1
B
L
Offset5
[2:0] Source/Destination Register
[5:3] Base Register
[10:6] Offset Register
[11] Load/Store Flag
0 = Store to memory
1 = Load from memory
[12] Byte/Word Flad
0 = Transfer word quantity
1 = Transfer byte quantity
Figure 3-38. Format 9
OPERATION
These instructions transfer byte or word values between registers and memory using an immediate 5 or 7-bit offset. The
THUMB assembler syntax is shown in Table 3-16
Table 3-16. Summary of Format 9 Instructions
L
B
THUMB Assembler
ARM Equivalent
Action
0
0
STR Rd, [Rb, #Imm]
STR Rd, [Rb, #Imm]
Calculate the target address by adding together the
value in Rb and Imm. Store the contents of Rd at
the address.
0
1
1
0
LDR Rd, [Rb, #Imm]
LDR Rd, [Rb, #Imm]
Calculate the source address by adding together the
value in Rb and Imm. Load Rd from the address.
STRB Rd, [Rb, #Imm] STRB Rd, [Rb, #Imm] Calculate the target address by adding together the
value in Rb and Imm. Store the byte value in Rd at
the address.
1
1
LDRB Rd, [Rb, #Imm] LDRB Rd, [Rb, #Imm] Calculate source address by adding together the
value in Rb and Imm. Load the byte value at the
address into Rd.
NOTE: For word accesses (B = 0), the value specified by #Imm is a full 7-bit address, but must be word-aligned
(ie with bits 1:0 set to 0), since the assembler places #Imm >> 2 in the Offset5 field.
3-81