From WikiChip
Difference between revisions of "arm/armv1"
(→Instruction Listing) |
(→Instruction Listing) |
||
Line 45: | Line 45: | ||
{{inst|cols=5|section=<span id="arithmetic_instructions">'''Arithmetic Instructions'''</span>}} | {{inst|cols=5|section=<span id="arithmetic_instructions">'''Arithmetic Instructions'''</span>}} | ||
− | {{inst|mn=ADC |col 1=ADC<cond>{S} Rd, Rn, #imm |col 2=Add and carry immed |col 3 =Rd = Rn + | + | {{inst|mn=ADC |col 1=ADC<cond>{S} Rd, Rn, #imm |col 2=Add and carry immed |col 3 =Rd = Rn + imm + C}} |
{{inst|mn=ADC |col 1=ADC<cond>{S} Rd, Rn, Rm[, <shift>] |col 2=Add and carry |col 3 =Rd = Rn + {shifted Rm} + C}} | {{inst|mn=ADC |col 1=ADC<cond>{S} Rd, Rn, Rm[, <shift>] |col 2=Add and carry |col 3 =Rd = Rn + {shifted Rm} + C}} | ||
− | {{inst|mn=ADD |col 1=ADD<cond>S Rd, Rn, #imm |col 2=Add immed |col 3 =Rd = Rn + | + | {{inst|mn=ADD |col 1=ADD<cond>S Rd, Rn, #imm |col 2=Add immed |col 3 =Rd = Rn + imm}} |
{{inst|mn=ADD |col 1=ADD<cond>S Rd, Rn, Rm[, <shift>] |col 2=Add |col 3 =Rd = Rn + {shifted Rm} }} | {{inst|mn=ADD |col 1=ADD<cond>S Rd, Rn, Rm[, <shift>] |col 2=Add |col 3 =Rd = Rn + {shifted Rm} }} | ||
{{inst|cols=5|section=<span id="logical_instructions">'''Logical Instructions'''</span>}} | {{inst|cols=5|section=<span id="logical_instructions">'''Logical Instructions'''</span>}} | ||
− | {{inst|mn=AND |col 1=AND<cond>{S} Rd, Rn, #imm |col 2=AND immed |col 3 =Rd = {{l|and|Rn| | + | {{inst|mn=AND |col 1=AND<cond>{S} Rd, Rn, #imm |col 2=AND immed |col 3 =Rd = {{l|and|Rn|imm}}}} |
− | {{inst|mn=AND |col 1=AND<cond>{S} Rd, Rn, Rm[, <shift>] |col 2=AND |col 3 =Rd = {{l|and|Rn|{ | + | {{inst|mn=AND |col 1=AND<cond>{S} Rd, Rn, Rm[, <shift>] |col 2=AND |col 3 =Rd = {{l|and|Rn|{shifted Rm} }}}} |
+ | {{inst|mn=BIC |col 1=BIC<cond>{S} Rd, Rn, #imm |col 2=Bit clear immed |col 3 =Rd = {{l|and|Rn|{{l|not|imm}}}}}} | ||
+ | {{inst|mn=BIC |col 1=BIC<cond>{S} Rd, Rn, Rm[, <shift>] |col 2=Bit clear |col 3 =Rd = {{l|and|Rn|{{l|not|Rm}}}}}} | ||
{{inst|mn=xxxxxxx |col 1=xxxxxxxxxxxxxx |col 2=xxxxxxxxxx |col 3 =xxxxxxxxxxxxxxxxx}} | {{inst|mn=xxxxxxx |col 1=xxxxxxxxxxxxxx |col 2=xxxxxxxxxx |col 3 =xxxxxxxxxxxxxxxxx}} | ||
Line 65: | Line 67: | ||
{{inst|cols=5|section=<span id="comparison_instructions">'''Comparison Instructions'''</span>}} | {{inst|cols=5|section=<span id="comparison_instructions">'''Comparison Instructions'''</span>}} | ||
+ | {{inst|mn=CMN |col 1=CMN<cond> Rn, #imm |col 2=Compare negative immed |col 3 =CPSR flags set on (Rn + imm)}} | ||
+ | {{inst|mn=CMN |col 1=CMN<cond> Rn, Rm[, <shift>] |col 2=Compare negative |col 3 =CPSR flags set on (Rn + {shifted Rm})}} | ||
{{inst|cols=5|section=<span id="branch_instructions">'''Branch Instructions'''</span>}} | {{inst|cols=5|section=<span id="branch_instructions">'''Branch Instructions'''</span>}} | ||
+ | {{inst|mn=B |col 1=B<cond> #imm |col 2=Branch relative |col 3 =PC = PC + address}} | ||
+ | {{inst|mn=BL |col 1=BL<cond> #imm |col 2=Branch and link relative |col 3 =LR = RET<br>PC = PC + address}} | ||
{{inst|cols=5|section=<span id="miscellaneous_instructions">'''Miscellaneous Instructions'''</span>}} | {{inst|cols=5|section=<span id="miscellaneous_instructions">'''Miscellaneous Instructions'''</span>}} | ||
}} | }} |
Revision as of 17:15, 27 June 2017
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.
Overview
The ARMv1 is a simple architecture. Each instruction is 32-bit in size and operates on two 32-bit operands. There is a program counter which is 26 bits in size allowing for an address space of up to 64 MiB of data.
Registers
There are 16 general purpose 32-bit registers. With the exception of register 15, all registers are orthogonal with no specific designated purpose.
Instruction Listing
The ARMv1 is broken down into 7 classes of instruction:
- Load Instructions
- Store Instructions
- Arithmetic Instructions
- Logical Instructions
- Comparison Instructions
- Branch Instructions
- Miscellaneous Instructions
ARMv1 ISA | ||||
---|---|---|---|---|
Mnemonic | Syntax | Description | Action | |
Load Instructions | ||||
LDR | LDR{cond} Rd, address | Load Word | Rd = [address] | |
LDRT | LDRT{cond} Rd, address | Load Word, User Mode Privilege | Rd = [address] | |
LDRB | LDRB{cond} Rd, address | Load Byte | Rd = ZeroExtend([address]) | |
LDRBT | LDRBT{cond} Rd, address | Load Byte, User Mode Privilege | Rd = ZeroExtend([address]) | |
LDM | LDM{cond}{type} Rn[!], {reglist} | Load Multiple | addr = Rn for each Rd in {reglist}: Rd = [addr] addr += {type} | |
LDM | LDM{cond}{type} Rn[!], {reglist, PC} | Load Multiple | addr = Rn for each Rd in {reglist}: Rd = [addr] addr += {type} R15 = [addr] | |
Store Instructions | ||||
STR | STR{cond} Rd, address | Store Word | [address] = Rd | |
STRT | STRT{cond} Rd, address | Store Word, User Mode Privilege | [address] = Rd | |
STRB | STRB{cond} Rd, address | Store Byte | [address][7:0] = Rd[7:0] | |
STRBT | STRBT{cond} Rd, address | Store Byte, User Mode Privilege | [address][7:0] = Rd[7:0] | |
STM | STM{cond}{type} Rn[!], {reglist} | Store Multiple | addr = Rn for each Rd in {reglist}: [addr] = Rd addr += {type} | |
STM | STM{cond}{type} Rn[!], {reglist}^ | Store Multiple, User Mode Privilege | addr = Rn for each Rd in {reglist}: [addr] = Rd Rn += {type} | |
Arithmetic Instructions | ||||
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 + {shifted 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 + {shifted Rm} | |
Logical Instructions | ||||
AND | AND<cond>{S} Rd, Rn, #imm | AND immed | Rd = Rn · imm | |
AND | AND<cond>{S} Rd, Rn, Rm[, <shift>] | AND | Rd = Rn · {shifted 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 | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
xxxxxxx | xxxxxxxxxxxxxx | xxxxxxxxxx | xxxxxxxxxxxxxxxxx | |
Comparison Instructions | ||||
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 + {shifted Rm}) | |
Branch Instructions | ||||
B | B<cond> #imm | Branch relative | PC = PC + address | |
BL | BL<cond> #imm | Branch and link relative | LR = RET PC = PC + address | |
Miscellaneous Instructions |