From WikiChip
Difference between revisions of "arm/armv1"
< arm

(Instruction Listing)
(Instruction Listing: I think this is all)
Line 59: Line 59:
 
{{inst|mn=SBC |col 1=SBC<cond>{S} Rd, Rn, #imm          |col 2=Subtract with carry immed        |col 3 =Rd = Rn - imm - {{l|not|C}}}}
 
{{inst|mn=SBC |col 1=SBC<cond>{S} Rd, Rn, #imm          |col 2=Subtract with carry immed        |col 3 =Rd = Rn - imm - {{l|not|C}}}}
 
{{inst|mn=SBC |col 1=SBC<cond>{S} Rd, Rn, Rm{, <shift>}  |col 2=Subtract with carry              |col 3 =Rd = Rn - {shifted Rm} - {{l|not|C}}}}
 
{{inst|mn=SBC |col 1=SBC<cond>{S} Rd, Rn, Rm{, <shift>}  |col 2=Subtract with carry              |col 3 =Rd = Rn - {shifted Rm} - {{l|not|C}}}}
 +
{{inst|mn=SUB |col 1=SUB<cond>{S} Rd, Rn, #imm          |col 2=Subtract immed                    |col 3 =Rd = Rn - imm}}
 +
{{inst|mn=SUB |col 1=SUB<cond>{S} Rd, Rn, Rm{, <shift>}  |col 2=Subtract                          |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>}}
Line 69: Line 71:
 
{{inst|mn=ORR |col 1=ORR<cond>{S} Rd, Rn, #imm          |col 2=Logical OR immed  |col 3 =Rd = {{l|lor2|Rn|imm}}}}
 
{{inst|mn=ORR |col 1=ORR<cond>{S} Rd, Rn, #imm          |col 2=Logical OR immed  |col 3 =Rd = {{l|lor2|Rn|imm}}}}
 
{{inst|mn=ORR |col 1=ORR<cond>{S} Rd, Rn, Rm{, <shift>} |col 2=Logical OR        |col 3 =Rd = {{l|lor2|Rn|{shifted Rm} }}}}
 
{{inst|mn=ORR |col 1=ORR<cond>{S} Rd, Rn, Rm{, <shift>} |col 2=Logical OR        |col 3 =Rd = {{l|lor2|Rn|{shifted 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}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
{{inst|mn=xxxxxxx  |col 1=xxxxxxxxxxxxxx    |col 2=xxxxxxxxxx                      |col 3 =xxxxxxxxxxxxxxxxx}}
 
  
 
{{inst|cols=5|section=<span id="comparison_instructions">'''Comparison Instructions'''</span>}}
 
{{inst|cols=5|section=<span id="comparison_instructions">'''Comparison Instructions'''</span>}}
Line 85: Line 77:
 
{{inst|mn=CMP  |col 1=CMP<cond> Rn, #imm          |col 2=Compare immed          |col 3 =CPSR flags set on (Rn - imm)}}
 
{{inst|mn=CMP  |col 1=CMP<cond> Rn, #imm          |col 2=Compare immed          |col 3 =CPSR flags set on (Rn - imm)}}
 
{{inst|mn=CMP  |col 1=CMP<cond> Rn, Rm{, <shift>} |col 2=Compare                |col 3 =CPSR flags set on (Rn - {shifted Rm})}}
 
{{inst|mn=CMP  |col 1=CMP<cond> Rn, Rm{, <shift>} |col 2=Compare                |col 3 =CPSR flags set on (Rn - {shifted Rm})}}
 +
{{inst|mn=TEQ  |col 1=TEQ<cond> Rn, #imm          |col 2=Test equality immed    |col 3 =CPSR flags set on ({{l|xor|Rn|imm}})}}
 +
{{inst|mn=TEQ  |col 1=TEQ<cond> Rn, Rm{, <shift>} |col 2=Test equality          |col 3 =CPSR flags set on ({{l|xor|Rn|{shifted Rm} }})}}
 +
{{inst|mn=TST  |col 1=TST<cond> Rn, #imm          |col 2=Test bits immed        |col 3 =CPSR flags set on ({{l|land2|Rn|imm}})}}
 +
{{inst|mn=TST  |col 1=TST<cond> Rn, Rm{, <shift>} |col 2=Test bits              |col 3 =CPSR flags set on ({{l|land2|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=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|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>}}
 
+
{{inst|mn=SWI |col 1=SWI<cond> imm |col 2=Software interrupt |col 3 =LR = RET<br>Execute SWI vector in supervisor mode}}
 
}}
 
}}

Revision as of 19:33, 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 8 classes of instruction:

ARMv1 ISA
Mnemonic Syntax Description Action
Movement Instructions
MOVMOV<cond>{S} Rd, #immMove value immedRd = immed
MOVMOV<cond>{S} Rd, Rm, {, <shift>}Move valueRd = {shifted Rm}
MVNMVN<cond>{S} Rd, #immMove NOT value immedRd = ¬immed
MVNMVN<cond>{S} Rd, Rm, {, <shift>}Move NOT valueRd = ¬{shifted Rm}
Load Instructions
LDMLDM<cond><type> Rn{!}, <reglist>{^}Load multipleaddr = Rn
for each Rd in {reglist}:
     Rd = [addr]
     update address based on {type}
LDRLDR<cond>{B} Rd, [Rn {, #imm}]{!}Load register immedRd = [Rn + imm]
If !: Rn = Rn + imm
LDRLDR<cond>{B} Rd, [Rn, Rm {, <shift>}]{!}Load registerRd = [Rn + {shifted Rm}]
If !: Rn = Rn + {shifted Rm}]
LDRLDR<cond>{B}{T} Rd, [Rn], #immLoad register, post indexRd = [Rn]
Rn = Rn + imm
LDRLDR<cond>{B}{T} Rd, [Rn], Rm {, <shift>}Load register, post indexRd = [Rn]
Rn = Rn + {shifted Rm}
Store Instructions
STMSTM<cond><type> Rn{!}, <reglist>{^}Store multipleaddr = Rn
for each Rd in {reglist}:
     [addr] = Rd
     update address based on {type}
STRSTR<cond>{B} Rd, [Rn {, #imm}]{!}Store register immed[Rn + imm] = Rd
If !: Rn = Rn + imm
STRSTR<cond>{B} Rd, [Rn, Rm {, <shift>}]{!}Store register[Rn + {shifted Rm}] = Rd
If !: Rn = Rn + {shifted Rm}]
STRSTR<cond>{B}{T} Rd, [Rn], #immStore register, post index[Rn] = Rd
Rn = Rn + imm
STRSTR<cond>{B}{T} Rd, [Rn], Rm {, <shift>}Store register, post index[Rn] = Rd
Rn = Rn + {shifted Rm}
Arithmetic Instructions
ADCADC<cond>{S} Rd, Rn, #immAdd and carry immedRd = Rn + imm + C
ADCADC<cond>{S} Rd, Rn, Rm{, <shift>}Add and carryRd = Rn + {shifted Rm} + C
ADDADD<cond>S Rd, Rn, #immAdd immedRd = Rn + imm
ADDADD<cond>S Rd, Rn, Rm{, <shift>}AddRd = Rn + {shifted Rm}
RSBRSB<cond>S Rd, Rn, #immReverse subtract immedRd = imm - Rn
RSBRSB<cond>S Rd, Rn, Rm{, <shift>}Reverse subtractRd = {shifted Rm} - Rn
RSCRSB<cond>S Rd, Rn, #immReverse subtract with carry immedRd = imm - Rn - ¬C
RSCRSB<cond>S Rd, Rn, Rm{, <shift>}Reverse subtract with carryRd = {shifted Rm} - Rn - ¬C
SBCSBC<cond>{S} Rd, Rn, #immSubtract with carry immedRd = Rn - imm - ¬C
SBCSBC<cond>{S} Rd, Rn, Rm{, <shift>}Subtract with carryRd = Rn - {shifted Rm} - ¬C
SUBSUB<cond>{S} Rd, Rn, #immSubtract immedRd = Rn - imm
SUBSUB<cond>{S} Rd, Rn, Rm{, <shift>}SubtractRd = Rn - {shifted Rm}
Logical Instructions
ANDAND<cond>{S} Rd, Rn, #immAND immedRd = Rn & imm
ANDAND<cond>{S} Rd, Rn, Rm{, <shift>}ANDRd = Rn & {shifted Rm}
BICBIC<cond>{S} Rd, Rn, #immBit clear immedRd = Rn & ¬imm
BICBIC<cond>{S} Rd, Rn, Rm{, <shift>}Bit clearRd = Rn & ¬Rm
EOREOR<cond>{S} Rd, Rn, #immExclusive OR immedRd = Rn ⊕ imm
EOREOR<cond>{S} Rd, Rn, Rm{, <shift>}Exclusive ORRd = Rn ⊕ {shifted Rm}
ORRORR<cond>{S} Rd, Rn, #immLogical OR immedRd = Rn ∥ imm
ORRORR<cond>{S} Rd, Rn, Rm{, <shift>}Logical ORRd = Rn ∥ {shifted Rm}
Comparison Instructions
CMNCMN<cond> Rn, #immCompare negative immedCPSR flags set on (Rn + imm)
CMNCMN<cond> Rn, Rm{, <shift>}Compare negativeCPSR flags set on (Rn + {shifted Rm})
CMPCMP<cond> Rn, #immCompare immedCPSR flags set on (Rn - imm)
CMPCMP<cond> Rn, Rm{, <shift>}CompareCPSR flags set on (Rn - {shifted Rm})
TEQTEQ<cond> Rn, #immTest equality immedCPSR flags set on (Rn ⊕ imm)
TEQTEQ<cond> Rn, Rm{, <shift>}Test equalityCPSR flags set on (Rn ⊕ {shifted Rm})
TSTTST<cond> Rn, #immTest bits immedCPSR flags set on (Rn & imm)
TSTTST<cond> Rn, Rm{, <shift>}Test bitsCPSR flags set on (Rn & {shifted Rm})
Branch Instructions
BB<cond> immBranch relativePC = PC + address
BLBL<cond> immBranch and link relativeLR = RET
PC = PC + address
Miscellaneous Instructions
SWISWI<cond> immSoftware interruptLR = RET
Execute SWI vector in supervisor mode