(→Instruction Listing) |
|||
Line 7: | Line 7: | ||
== Registers == | == Registers == | ||
There are 16 [[general purpose registers|general purpose]] 32-bit registers. With the exception of {{arm|R15|register 15}} and 14, all registers are orthogonal with no specific designated purpose. | There are 16 [[general purpose registers|general purpose]] 32-bit registers. With the exception of {{arm|R15|register 15}} and 14, all registers are orthogonal with no specific designated purpose. | ||
+ | |||
+ | == Addressing Mode == | ||
+ | The ARMv1 has five addressing modes: | ||
+ | |||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Mode !! Syntax !! Operation | ||
+ | |- | ||
+ | | PC Relative || Label || Effective_Address = PC ± Offset (12 bits) | ||
+ | |- | ||
+ | | Base Register Offset<br>With Post-Increment || [Rn], offset || Effective_Address = Rn<br>Rn = Rn ± offset | ||
+ | |- | ||
+ | | Base Register Offset<br>With Pre-Increment || [Rn, offset] || Effective_Address = Rn ± offset (12 bits)<br>Rn = Rn ± offset | ||
+ | |- | ||
+ | | Base Register Index<br>With Post-Increment || [Rn], Rm || Effective_Address = Rn<br>Rn = Rn ± Rm | ||
+ | |- | ||
+ | | Base Register Index<br>With Pre-Increment || [Rn, Rm] || Effective_Address = Rn ± Rm<br>Rn = Rn ± Rm | ||
+ | |} | ||
== Instruction Listing == | == Instruction Listing == | ||
Line 92: | Line 110: | ||
== Multiplication and Floating Point == | == Multiplication and Floating Point == | ||
ARMv1 does not have support for multiplication. Software that requires multiplication will have to resort to a software implementation (e.g., [[Shift-and-Add Multiplication]]). This was considerably slow and was consequently added in later ARM versions. Likewise there was no support for hardware floating point or an ability to do such operations on an external FPU coprocessor. | ARMv1 does not have support for multiplication. Software that requires multiplication will have to resort to a software implementation (e.g., [[Shift-and-Add Multiplication]]). This was considerably slow and was consequently added in later ARM versions. Likewise there was no support for hardware floating point or an ability to do such operations on an external FPU coprocessor. | ||
+ | |||
+ | == Exception Vector Map == | ||
+ | {| class="wikitable" | ||
+ | |- | ||
+ | ! Address !! Function !! Priority | ||
+ | |- | ||
+ | | 000 0000 !! Reset | ||
+ | |- | ||
+ | | 000 0004 !! Undefined Instruction Trap | ||
+ | |- | ||
+ | | 000 0008 !! Software Interrupt | ||
+ | |- | ||
+ | | 000 000C !! Abort (Prefetch) | ||
+ | |- | ||
+ | | 000 0010 !! Abort (Data) | ||
+ | |- | ||
+ | | 000 0014 !! Address Exception | ||
+ | |- | ||
+ | | 000 0018 !! Normal Interrupt (IRQ) | ||
+ | |- | ||
+ | | 000 001C !! Fast Interrupt (FIRQ) |
Revision as of 17:18, 30 June 2017
ARM ISA | |
General | |
Variants | |
Extensions | |
Topics | |
Versions(all) | |
ARMv1 is the first ARM instruction set version. Introduced with the ARM1 on April 26 1985, the ARMv1 defines a 32-bit ISA along with 26-bit addressing space. The ARMv1 was only implemented by the ARM1 and was replaced soon after by the ARM2. Only a few hundred of those chips were ever fabricated.
Contents
Overview
The ARMv1 presents a simple instruction set architecture, albeit bigger and more complex than many of its RISC contemporaries, consisting of mostly simple operations along with a number of complex ones borrowed from early 8-bit CISC microprocessors. Each instruction is 32-bit in size and operates on two 32-bit operands. There is a 24-bit program counter allowing for a 26-bit address space of up to 64 MiB of memory.
Registers
There are 16 general purpose 32-bit registers. With the exception of register 15 and 14, all registers are orthogonal with no specific designated purpose.
Addressing Mode
The ARMv1 has five addressing modes:
Mode | Syntax | Operation |
---|---|---|
PC Relative | Label | Effective_Address = PC ± Offset (12 bits) |
Base Register Offset With Post-Increment |
[Rn], offset | Effective_Address = Rn Rn = Rn ± offset |
Base Register Offset With Pre-Increment |
[Rn, offset] | Effective_Address = Rn ± offset (12 bits) Rn = Rn ± offset |
Base Register Index With Post-Increment |
[Rn], Rm | Effective_Address = Rn Rn = Rn ± Rm |
Base Register Index With Pre-Increment |
[Rn, Rm] | Effective_Address = Rn ± Rm Rn = Rn ± Rm |
Instruction Listing
The ARMv1 ISA has 45 operations under 23 mnemonics. The ARMv1 is broken down into 8 classes of instruction:
- Movement Instructions
- Load Instructions
- Store Instructions
- Arithmetic Instructions
- Logical Instructions
- Comparison Instructions
- Branch Instructions
- Miscellaneous Instructions
ARMv1 ISA | ||||
---|---|---|---|---|
Mnemonic | Syntax | Description | Action | |
Movement Instructions Movement instructions move data between registers and operands. | ||||
MOV | MOV<cond>{S} Rd, #imm | Move value immed | Rd = immed | |
MOV | MOV<cond>{S} Rd, Rm, {, <shift>} | Move value | Rd = Shift(Rm) | |
MVN | MVN<cond>{S} Rd, #imm | Move NOT value immed | Rd = ¬immed | |
MVN | MVN<cond>{S} Rd, Rm, {, <shift>} | Move NOT value | Rd = ¬Shift(Rm) | |
Load Instructions Load instructions move the content of memory addresses into registers. | ||||
LDM | LDM<cond><type> Rn{!}, <reglist>{^} | Load multiple | addr = Rn for each Rd in {reglist}: Rd = [addr] update address based on {type} | |
LDR | LDR<cond>{B} Rd, [Rn {, #imm}]{!} | Load register immed | Rd = [Rn + imm] If !: Rn = Rn + imm | |
LDR | LDR<cond>{B} Rd, [Rn, Rm {, <shift>}]{!} | Load register | Rd = [Rn + Shift(Rm)] If !: Rn = Rn + Shift(Rm)] | |
LDR | LDR<cond>{B}{T} Rd, [Rn], #imm | Load register, post index | Rd = [Rn] Rn = Rn + imm | |
LDR | LDR<cond>{B}{T} Rd, [Rn], Rm {, <shift>} | Load register, post index | Rd = [Rn] Rn = Rn + Shift(Rm) | |
Store Instructions Store instructions moves the values from registers into memory. | ||||
STM | STM<cond><type> Rn{!}, <reglist>{^} | Store multiple | addr = Rn for each Rd in {reglist}: [addr] = Rd update address based on {type} | |
STR | STR<cond>{B} Rd, [Rn {, #imm}]{!} | Store register immed | [Rn + imm] = Rd If !: Rn = Rn + imm | |
STR | STR<cond>{B} Rd, [Rn, Rm {, <shift>}]{!} | Store register | [Rn + Shift(Rm)] = Rd If !: Rn = Rn + Shift(Rm)] | |
STR | STR<cond>{B}{T} Rd, [Rn], #imm | Store register, post index | [Rn] = Rd Rn = Rn + imm | |
STR | STR<cond>{B}{T} Rd, [Rn], Rm {, <shift>} | Store register, post index | [Rn] = Rd Rn = Rn + Shift(Rm) | |
Arithmetic Instructions Arithmetic instructions perform basic mathematical operations on two operands. | ||||
ADC | ADC<cond>{S} Rd, Rn, #imm | Add and carry immed | Rd = Rn + imm + C | |
ADC | ADC<cond>{S} Rd, Rn, Rm{, <shift>} | Add and carry | Rd = Rn + Shift(Rm) + C | |
ADD | ADD<cond>S Rd, Rn, #imm | Add immed | Rd = Rn + imm | |
ADD | ADD<cond>S Rd, Rn, Rm{, <shift>} | Add | Rd = Rn + Shift(Rm) | |
RSB | RSB<cond>S Rd, Rn, #imm | Reverse subtract immed | Rd = imm - Rn | |
RSB | RSB<cond>S Rd, Rn, Rm{, <shift>} | Reverse subtract | Rd = Shift(Rm) - Rn | |
RSC | RSB<cond>S Rd, Rn, #imm | Reverse subtract with carry immed | Rd = imm - Rn - ¬C | |
RSC | RSB<cond>S Rd, Rn, Rm{, <shift>} | Reverse subtract with carry | Rd = Shift(Rm) - Rn - ¬C | |
SBC | SBC<cond>{S} Rd, Rn, #imm | Subtract with carry immed | Rd = Rn - imm - ¬C | |
SBC | SBC<cond>{S} Rd, Rn, Rm{, <shift>} | Subtract with carry | Rd = Rn - Shift(Rm) - ¬C | |
SUB | SUB<cond>{S} Rd, Rn, #imm | Subtract immed | Rd = Rn - imm | |
SUB | SUB<cond>{S} Rd, Rn, Rm{, <shift>} | Subtract | Rd = Rn - Shift(Rm) | |
Logical Instructions Logical instructions perform logical bitwise operations on operands. | ||||
AND | AND<cond>{S} Rd, Rn, #imm | AND immed | Rd = Rn & imm | |
AND | AND<cond>{S} Rd, Rn, Rm{, <shift>} | AND | Rd = Rn & Shift(Rm) | |
BIC | BIC<cond>{S} Rd, Rn, #imm | Bit clear immed | Rd = Rn & ¬imm | |
BIC | BIC<cond>{S} Rd, Rn, Rm{, <shift>} | Bit clear | Rd = Rn & ¬Rm | |
EOR | EOR<cond>{S} Rd, Rn, #imm | Exclusive OR immed | Rd = Rn ⊕ imm | |
EOR | EOR<cond>{S} Rd, Rn, Rm{, <shift>} | Exclusive OR | Rd = Rn ⊕ Shift(Rm) | |
ORR | ORR<cond>{S} Rd, Rn, #imm | Logical OR immed | Rd = Rn ∥ imm | |
ORR | ORR<cond>{S} Rd, Rn, Rm{, <shift>} | Logical OR | Rd = Rn ∥ Shift(Rm) | |
Comparison Instructions Comparison instructions compare two values and set appropriate status flags. | ||||
CMN | CMN<cond> Rn, #imm | Compare negative immed | CPSR flags set on (Rn + imm) | |
CMN | CMN<cond> Rn, Rm{, <shift>} | Compare negative | CPSR flags set on (Rn + Shift(Rm)) | |
CMP | CMP<cond> Rn, #imm | Compare immed | CPSR flags set on (Rn - imm) | |
CMP | CMP<cond> Rn, Rm{, <shift>} | Compare | CPSR flags set on (Rn - Shift(Rm)) | |
TEQ | TEQ<cond> Rn, #imm | Test equality immed | CPSR flags set on (Rn ⊕ imm) | |
TEQ | TEQ<cond> Rn, Rm{, <shift>} | Test equality | CPSR flags set on (Rn ⊕ Shift(Rm)) | |
TST | TST<cond> Rn, #imm | Test bits immed | CPSR flags set on (Rn & imm) | |
TST | TST<cond> Rn, Rm{, <shift>} | Test bits | CPSR flags set on (Rn & Shift(Rm)) | |
Branch Instructions Branch instructions order instruction processing to start elsewhere conditionally or unconditionally. | ||||
B | B<cond> imm | Branch relative | PC = PC + address | |
BL | BL<cond> imm | Branch and link relative | LR = RET PC = PC + address | |
Miscellaneous Instructions Any instruction that doesn't belong anywhere else. | ||||
SWI | SWI<cond> imm | Software interrupt | LR = RET Execute SWI vector in supervisor mode |
Multiplication and Floating Point
ARMv1 does not have support for multiplication. Software that requires multiplication will have to resort to a software implementation (e.g., Shift-and-Add Multiplication). This was considerably slow and was consequently added in later ARM versions. Likewise there was no support for hardware floating point or an ability to do such operations on an external FPU coprocessor.
Exception Vector Map
Address | Function | Priority |
---|---|---|
000 0000 !! Reset | ||
000 0004 !! Undefined Instruction Trap | ||
000 0008 !! Software Interrupt | ||
000 000C !! Abort (Prefetch) | ||
000 0010 !! Abort (Data) | ||
000 0014 !! Address Exception | ||
000 0018 !! Normal Interrupt (IRQ) | ||
000 001C !! Fast Interrupt (FIRQ) |