Format 9: Load/Store With Immediate Offset; Operation - Samsung S3C2500B User Manual

Table of Contents

Advertisement

S3C2500B

3.28 FORMAT 9: LOAD/STORE WITH IMMEDIATE OFFSET

15
14
13
0
1
1

3.28.1 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
L
B
THUMB Assembler
0
0
STR Rd, [Rb, #Imm]
0
1
LDR Rd, [Rb, #Imm]
1
0
STRB Rd, [Rb, #Imm] STRB Rd, [Rb, #Imm] Calculate the target address by adding together the
1
1
LDRB Rd, [Rb, #Imm] LDRB Rd, [Rb, #Imm] Calculate source address by adding together the
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.
11
10
12
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
Table 3-16. Summary of Format 9 Instructions
ARM Equivalent
STR Rd, [Rb, #Imm]
LDR Rd, [Rb, #Imm]
3
6
5
Rb
Action
Calculate the target address by adding together the
value in Rb and Imm. Store the contents of Rd at
the address.
Calculate the source address by adding together the
value in Rb and Imm. Load Rd from the address.
value in Rb and Imm. Store the byte value in Rd at
the address.
value in Rb and Imm. Load the byte value at the
address into Rd.
INSTRUCTION SET
2
0
Rd
3-81

Advertisement

Table of Contents
loading

Table of Contents