Professional Documents
Culture Documents
B
B.1 Data-processing Instructions
B.2 Memory Instructions
B.3 Branch Instructions
B.4 Miscellaneous Instructions
B.5 Condition Flags
Digital
Circuits
Analog +
Circuits
Devices
Physics
Digital Design and Computer Architecture, Second Edition. DOI: 10.1016/B978-0-12-800056-4.00017-0 535
2016 Elsevier Inc. All rights reserved.
536 APPENDIX B ARM Instructions
rot imm8
Data-processing
I=1
31:28 27:26 25 24:21 20 19:16 15:12 11:0 11:7 6:5 4 3:0
cond op
00
I cmd S Rn Rd Src2 Register shamt5 sh 0 Rm
funct I=0
11:8 7 6:5 4 3:0
Rs 0 sh 1 Rm
Register-shifted
Register
1000 (S = 1) TST Rd, Rn, Src2 Test Set flags based on Rn & Src2
1001 (S = 1) TEQ Rd, Rn, Src2 Test Equivalence Set flags based on Rn ^ Src2
1011 (S = 1) CMN Rn, Src2 Compare Negative Set flags based on Rn+Src2
1101 Shifts:
I = 1 OR MOV Rd, Src2 Move Rd Src2
(instr11:4 = 0)
I = 0 AND LSL Rd, Rm, Rs/shamt5 Logical Shift Left Rd Rm << Src2
(sh = 00;
instr11:4 0)
I = 0 AND LSR Rd, Rm, Rs/shamt5 Logical Shift Right Rd Rm >> Src2
(sh = 01)
(continued)
B.1 Data-processing Instructions 537
NOP (no operation) is typically encoded as 0xE1A000, which is equivalent to MOV R0, R0.
B . 1 . 1 Multiply Instructions
Multiply instructions use the encoding in Figure B.2 The 3-bit cmd field
specifies the type of multiply, as given in Table B.2.
Multiply
31:28 27:26 25:24 23:21 20 19:16 15:12 11:8 7:4 3:0
Figure B.2 Multiply instruction
cond op 00 cmd S Rd Ra Rm 1001 Rn encoding
00
4 bits 2 bits 6 bits 4 bits 4 bits 4 bits 4 bits 4 bits
001 MLA Rd, Rn, Rm, Ra Multiply Rd (Rn Rm)+Ra (low 32 bits)
Accumulate
101 UMLAL Rd, Rn, Rm, Ra Unsigned Multiply {Rd, Ra} (Rn Rm)+{Rd, Ra}
Accumulate Long (all 64 bits, Rm/Rn unsigned)
111 SMLAL Rd, Rn, Rm, Ra Signed Multiply {Rd, Ra} (Rn Rm)+{Rd, Ra}
Accumulate Long (all 64 bits, Rm/Rn signed)
538 APPENDIX B ARM Instructions
cond op I P U B W L Rn Rd Src2
01 11:7 6:5 4 3:0
funct shamt5 sh 1 Rm
I=1
Register
funct 0000 Rm
I=0
Register
Branch
31:28 27:26 25:24 23:0
Figure B.4 Branch instruction
cond op
10 1L
imm24 encoding
funct