| |||
| Home > Introduction > Instruction set summary > Thumb instruction summary | |||
The Thumb instruction set formats are shown in Figure 1.6.
Refer to the ARM Architectural Reference Manual for more information about the ARM instruction set formats.
The Thumb instruction set summary is listed in Table 1.7.
Table 1.7. Thumb instruction set summary
Operation | Assembly syntax | |
|---|---|---|
Move | Immediate | MOV Rd, #8bit_Imm |
High to Low | MOV Rd, Hs | |
Low to High | MOV Hd, Rs | |
High to High | MOV Hd, Hs | |
Arithmetic | Add | ADD Rd, Rs, #3bit_Imm |
Add Low, and Low | ADD Rd, Rs, Rn | |
Add High to Low | ADD Rd, Hs | |
Add Low to High | ADD Hd, Rs | |
Add High to High | ADD Hd, Hs | |
Add Immediate | ADD Rd, #8bit_Imm | |
Add Value to SP | ADD SP, #7bit_Imm ADD SP, #-7bit_Imm | |
Add with carry | ADC Rd, Rs | |
Subtract | SUB Rd, Rs, Rn SUB Rd, Rs, #3bit_Imm | |
Subtract Immediate | SUB Rd, #8bit_Imm | |
Subtract with carry | SBC Rd, Rs | |
Negate | NEG Rd, Rs | |
Multiply | MUL Rd, Rs | |
Compare Low, and Low | CMP Rd, Rs | |
Compare Low, and High | CMP Rd, Hs | |
Compare High, and Low | CMP Hd, Rs | |
Compare High, and High | CMP Hd, Hs | |
Compare Negative | CMN Rd, Rs | |
Compare Immediate | CMP Rd, #8bit_Imm | |
Logical | AND | AND Rd, Rs |
EOR | EOR Rd, Rs | |
OR | ORR Rd, Rs | |
Bit clear | BIC Rd, Rs | |
Move NOT | MVN Rd, Rs | |
Test bits | TST Rd, Rs | |
Shift/Rotate | Logical shift left | LSL Rd, Rs, #5bit_shift_imm LSL Rd,
Rs |
Logical shift right | LSR Rd, Rs, #5bit_shift_imm LSR Rd,
Rs | |
Arithmetic shift right | ASR Rd, Rs, #5bit_shift_imm ASR Rd,
Rs | |
Rotate right | ROR Rd, Rs | |
Branch | Conditional | - |
| BEQ label | |
| BNE label | |
| BCS label | |
| BCC label | |
| BMI label | |
| BPL label | |
| BVS label | |
| BVC label | |
| BHI label | |
| BLS label | |
| BGE label | |
| BLT label | |
| BGT label | |
| BLE label | |
Unconditional | B label | |
Long branch with link | BL label | |
Optional state change | - | |
| BX Rs | |
| BX Hs | |
Load | With immediate offset | - |
| LDR Rd, [Rb, #7bit_offset] | |
| LDRH Rd, [Rb, #6bit_offset] | |
| LDRB Rd, [Rb, #5bit_offset] | |
With register offset | - | |
| LDR Rd, [Rb, Ro] | |
| LDRH Rd, [Rb, Ro] | |
| LDRSH Rd, [Rb, Ro] | |
| LDRB Rd, [Rb, Ro] | |
| LDRSB Rd, [Rb, Ro] | |
PC-relative | LDR Rd, [PC, #10bit_Offset] | |
SP-relative | LDR Rd, [SP, #10bit_Offset] | |
Address | - | |
| ADD Rd, PC, #10bit_Offset | |
| ADD Rd, SP, #10bit_Offset | |
Multiple | LDMIA Rb!, <reglist> | |
Store | With immediate offset | - |
| STR Rd, [Rb, #7bit_offset] | |
| STRH Rd, [Rb, #6bit_offset] | |
| STRB Rd, [Rb, #5bit_offset] | |
With register offset | - | |
| STR Rd, [Rb, Ro] | |
| STRH Rd, [Rb, Ro] | |
| STRB Rd, [Rb, Ro] | |
SP-relative | STR Rd, [SP, #10bit_offset] | |
Multiple | STMIA Rb!, <reglist> | |
Push/Pop | Push registers onto stack | PUSH <reglist> |
Push LR, and registers onto stack | PUSH <reglist, LR> | |
Pop registers from stack | POP <reglist> | |
Pop registers, and PC from stack | POP <reglist, PC> | |
Software Interrupt | - | SWI 8bit_Imm |