Format 3: Move/Compare/Add/Subtract Immediate; Operations; Instruction Cycle Times - Samsung S3C2500B User Manual

Table of Contents

Advertisement

INSTRUCTION SET

3.22 FORMAT 3: MOVE/COMPARE/ADD/SUBTRACT IMMEDIATE

15
14
13
0
0
0

3.22.1 OPERATIONS

The instructions in this group perform operations between a Lo register and an 8-bit immediate value. The
THUMB assembler syntax is shown in Table 3-10.
OP
THUMB Assembler
00
MOV Rd, #Offset8
01
CMP Rd, #Offset8
10
ADD Rd, #Offset8
11
SUB Rd, #Offset8

3.22.2 INSTRUCTION CYCLE TIMES

All instructions in this format have an equivalent ARM instruction as shown in Table 3-10. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
Examples
MOV
CMP
ADD
SUB
3-70
12
11
10
Rd
Op
[7:0] Immediate Value
[10:8] Source/Destination Register
[12:11] Opcode
0 = MOV
1 = CMP
2 = ADD
3 = SUB
Figure 3-32. Format 3
All instructions in this group set the CPSR condition codes.
Table 3-10. Summary of Format 3 Instructions
ARM Equivalent
MOVS Rd, #Offset8
CMP Rd, #Offset8
ADDS Rd, Rd, #Offset8
SUBS Rd, Rd, #Offset8
R0, #128
R2, #62
R1, #255
R6, #145
8
7
NOTE
Move 8-bit immediate value into Rd.
Compare contents of Rd with 8-bit immediate
value.
Add 8-bit immediate value to contents of Rd and
place the result in Rd.
Subtract 8-bit immediate value from contents of
Rd and place the result in Rd.
; R0 : = 128 and set condition codes
; Set condition codes on R2 - 62
; R1 : = R1 + 255 and set condition codes
; R6 : = R6 - 145 and set condition codes
Offset8
Action
S3C2500B
0

Advertisement

Table of Contents
loading

Table of Contents