| |||
| Home > The Cortex-M3 Instruction Set > Instruction set summary | |||
The processor implements a version of the Thumb instruction set. Table 3.1 lists the supported instructions.
In Table 3.1:
angle brackets, <>, enclose alternative forms of the operand
braces, {}, enclose optional operands
the Operands column is not exhaustive
Op2 is a flexible second operand that
can be either a register or a constant
most instructions can use an optional condition code suffix.
For more information on the instructions and operands, see the instruction descriptions.
Table 3.1. Cortex-M3 instructions
| Mnemonic | Operands | Brief description | Flags | See |
|---|---|---|---|---|
ADC, ADCS |
| Add with Carry | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
ADD, ADDS |
| Add | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
ADD, ADDW |
| Add | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
ADR |
| Load PC-relative Address | - | ADR |
AND, ANDS |
| Logical AND | N,Z,C | AND, ORR, EOR, BIC, and ORN |
ASR, ASRS |
| Arithmetic Shift Right | N,Z,C | ASR, LSL, LSR, ROR, and RRX |
B |
| Branch | - | B, BL, BX, and BLX |
BFC |
| Bit Field Clear | - | BFC and BFI |
BFI |
| Bit Field Insert | - | BFC and BFI |
BIC, BICS |
| Bit Clear | N,Z,C | AND, ORR, EOR, BIC, and ORN |
BKPT |
| Breakpoint | - | BKPT |
BL |
| Branch with Link | - | B, BL, BX, and BLX |
BLX |
| Branch indirect with Link | - | B, BL, BX, and BLX |
BX |
| Branch indirect | - | B, BL, BX, and BLX |
CBNZ |
| Compare and Branch if Non Zero | - | CBZ and CBNZ |
CBZ |
| Compare and Branch if Zero | - | CBZ and CBNZ |
CLREX | - | Clear Exclusive | - | CLREX |
CLZ |
| Count Leading Zeros | - | CLZ |
CMN |
| Compare Negative | N,Z,C,V | CMP and CMN |
CMP |
| Compare | N,Z,C,V | CMP and CMN |
CPSID |
| Change Processor State, Disable Interrupts | - | CPS |
CPSIE |
| Change Processor State, Enable Interrupts | - | CPS |
DMB |
| Data Memory Barrier | - | DMB |
DSB |
| Data Synchronization Barrier | - | DSB |
EOR, EORS |
| Exclusive OR | N,Z,C | AND, ORR, EOR, BIC, and ORN |
ISB |
| Instruction Synchronization Barrier | - | ISB |
IT | - | If-Then condition block | - | IT |
LDM |
| Load Multiple registers, increment after | - | LDM and STM |
LDMDB, LDMEA |
| Load Multiple registers, decrement before | - | LDM and STM |
LDMFD, LDMIA |
| Load Multiple registers, increment after | - | LDM and STM |
LDR |
| Load Register with word | - | Memory access instructions |
LDRB, LDRBT |
| Load Register with byte | - | Memory access instructions |
LDRD |
| Load Register with two bytes | - | LDR and STR, immediate offset |
LDREX |
| Load Register Exclusive | - | LDREX and STREX |
LDREXB |
| Load Register Exclusive with Byte | - | LDREX and STREX |
LDREXH |
| Load Register Exclusive with Halfword | - | LDREX and STREX |
LDRH, LDRHT |
| Load Register with Halfword | - | Memory access instructions |
LDRSB, LDRSBT |
| Load Register with Signed Byte | - | Memory access instructions |
LDRSH, LDRSHT |
| Load Register with Signed Halfword | - | Memory access instructions |
LDRT |
| Load Register with word | - | Memory access instructions |
LSL, LSLS |
| Logical Shift Left | N,Z,C | ASR, LSL, LSR, ROR, and RRX |
LSR, LSRS |
| Logical Shift Right | N,Z,C | ASR, LSL, LSR, ROR, and RRX |
MLA |
| Multiply with Accumulate, 32-bit result | - | MUL, MLA, and MLS |
MLS |
| Multiply and Subtract, 32-bit result | - | MUL, MLA, and MLS |
MOV, MOVS |
| Move | N,Z,C | MOV and MVN |
MOVT |
| Move Top | - | MOVT |
MOVW, MOV |
| Move 16-bit constant | N,Z,C | MOV and MVN |
MRS |
| Move from Special Register to general register | - | MRS |
MSR |
| Move from general register to Special Register | N,Z,C,V | MSR |
MUL, MULS |
| Multiply, 32-bit result | N,Z | MUL, MLA, and MLS |
MVN, MVNS |
| Move NOT | N,Z,C | MOV and MVN |
NOP | - | No Operation | - | NOP |
ORN, ORNS |
| Logical OR NOT | N,Z,C | AND, ORR, EOR, BIC, and ORN |
ORR, ORRS |
| Logical OR | N,Z,C | AND, ORR, EOR, BIC, and ORN |
POP |
| Pop registers from stack | - | PUSH and POP |
PUSH |
| Push registers onto stack | - | PUSH and POP |
RBIT |
| Reverse Bits | - | REV, REV16, REVSH, and RBIT |
REV |
| Reverse byte order in a word | - | REV, REV16, REVSH, and RBIT |
REV16 |
| Reverse byte order in each halfword | - | REV, REV16, REVSH, and RBIT |
REVSH |
| Reverse byte order in bottom halfword and sign extend | - | REV, REV16, REVSH, and RBIT |
ROR, RORS |
| Rotate Right | N,Z,C | ASR, LSL, LSR, ROR, and RRX |
RRX, RRXS |
| Rotate Right with Extend | N,Z,C | ASR, LSL, LSR, ROR, and RRX |
RSB, RSBS |
| Reverse Subtract | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
SBC, SBCS |
| Subtract with Carry | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
SBFX |
| Signed Bit Field Extract | - | SBFX and UBFX |
SDIV |
| Signed Divide | - | SDIV and UDIV |
SEV | - | Send Event | - | SEV |
SMLAL |
| Signed Multiply with Accumulate (32 x 32 + 64), 64-bit result | - | UMULL, UMLAL, SMULL, and SMLAL |
SMULL |
| Signed Multiply (32 x 32), 64-bit result | - | UMULL, UMLAL, SMULL, and SMLAL |
SSAT |
| Signed Saturate | Q | SSAT and USAT |
STM |
| Store Multiple registers, increment after | - | LDM and STM |
STMDB, STMEA |
| Store Multiple registers, decrement before | - | LDM and STM |
STMFD, STMIA |
| Store Multiple registers, increment after | - | LDM and STM |
STR |
| Store Register word | - | Memory access instructions |
STRB, STRBT |
| Store Register byte | - | Memory access instructions |
STRD |
| Store Register two words | - | LDR and STR, immediate offset |
STREX |
| Store Register Exclusive | - | LDREX and STREX |
STREXB |
| Store Register Exclusive Byte | - | LDREX and STREX |
STREXH |
| Store Register Exclusive Halfword | - | LDREX and STREX |
STRH, STRHT |
| Store Register Halfword | - | Memory access instructions |
STRT |
| Store Register word | - | Memory access instructions |
SUB, SUBS |
| Subtract | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
SUB, SUBW |
| Subtract | N,Z,C,V | ADD, ADC, SUB, SBC, and RSB |
SVC |
| Supervisor Call | - | SVC |
SXTB |
| Sign extend a byte | - | SXT and UXT |
SXTH |
| Sign extend a halfword | - | SXT and UXT |
TBB |
| Table Branch Byte | - | TBB and TBH |
TBH |
| Table Branch Halfword | - | TBB and TBH |
TEQ |
| Test Equivalence | N,Z,C | TST and TEQ |
TST |
| Test | N,Z,C | TST and TEQ |
UBFX |
| Unsigned Bit Field Extract | - | SBFX and UBFX |
UDIV |
| Unsigned Divide | - | SDIV and UDIV |
UMLAL |
| Unsigned Multiply with Accumulate (32 x 32 + 64), 64-bit result | - | UMULL, UMLAL, SMULL, and SMLAL |
UMULL |
| Unsigned Multiply (32 x 32), 64-bit result | - | UMULL, UMLAL, SMULL, and SMLAL |
USAT |
| Unsigned Saturate | Q | SSAT and USAT |
UXTB |
| Zero extend a Byte | - | SXT and UXT |
UXTH |
| Zero extend a Halfword | - | SXT and UXT |
WFE | - | Wait For Event | - | WFE |
WFI | - | Wait For Interrupt | - | WFI |