Format 12: Load Addres; Operation - Samsung S3C2500B User Manual

Table of Contents

Advertisement

S3C2500B

3.31 FORMAT 12: LOAD ADDRES

15
14
13
1
0
1

3.31.1 OPERATION

These instructions calculate an address by adding an 10-bit constant to either the PC or the SP, and load the
resulting address into a register. The THUMB assembler syntax is shown in the following table.
SP
THUMB Assembler
0
ADD Rd, PC, #Imm
1
ADD Rd, SP, #Imm
NOTE: The value specified by #Imm is a full 10-bit value, but this must be word-aligned (ie with bits 1:0 set to 0)
since the assembler places #Imm >> 2 in field Word 8.
Where the PC is used as the source register (SP = 0), bit 1 of the PC is always read as 0. The value of the PC
will be 4 bytes greater than the address of the instruction before bit 1 is forced to 0.
The CPSR condition codes are unaffected by these instructions.
11
10
12
0
SP
Rd
[7:0] 8-bit Unsigned Constant
[10:8] Destination Register
[11] Source
0 = PC
1 = SP
Figure 3-41. Format 12
Table 3-19. Load Address
ARM Equivalent
ADD Rd, R15, #Imm
ADD Rd, R13, #Imm
8
7
Add #Imm to the current value of the program counter
(PC) and load the result into Rd.
Add #Imm to the current value of the stack pointer (SP)
and load the result into Rd.
INSTRUCTION SET
Word 8
Action
0
3-85

Advertisement

Table of Contents
loading

Table of Contents