ARM 아키텍처는 다양한 명령어를 제공하여 다양한 응용 분야에서 사용된다. 이 글에서는 주요 ARM 명령어를 요약해 본다.
ARM Instruction Format
Arm Instruction set 포맷은 아래와 같다.
ARM Instruction Summary
Branch 명령어
Mnemonic | Instruction | Action |
B | Branch | R15(PC) := address |
BL | Branch w/ Link | R14(LR) := R15, R15(PC) := address |
BX | Branch and Exchange | R15 := Rn, T bit := Rn[0] |
Data Processing 명령어
Mnemonic | Instruction | Action |
AND | AND | Rd := Rn AND Op2 |
EOR | Exclusive OR | Rd := (Rn AND NOT Op2) OR (Op2 AND NOT Rn) |
SUB | Subtract | Rd := Rn – Op2 |
ADD | Add | Rd := Rn + Op2 |
ADC | Add w/ carry | Rd := Rn + Op2 + Carry |
SBC | Subtract w/ Carry | Rd := Rn – Op2 – 1 + Carry |
RSC | Reverse Subtract with Carry | Rd := Op2 – Rn – 1 + Carry |
TST | Test bits | CPSR flags := Rn AND Op2 |
TEQ | Test bitwise equality | CPSR flags := Rn EOR Op2 |
CMP | Compare | CPSR flags := Rn – Op2 |
CMN | Compare Negative | CPSR flags := Rn + Op2 |
ORR | OR | Rd := Rn OR Op2 |
MOV | Move register or constant | Rd : = Op2 |
BIC | Bit Clear | Rd := Rn AND NOT Op2 |
MVN | Move negative register | Rd := 0xFFFFFFFF EOR Op2 |
PSR Transfer 명령어
Mnemonic | Instruction | Action |
MRS | Move PSR status/flags to register | Rn := PSR |
MSR | Move register to PSR status/flags | PSR := Rm |
Multiply 명령어
Mnemonic | Instruction | Action |
MUL | Multiply | Rd := Rm * Rs |
MLA | Multiply Accumulate | Rd := (Rm * Rs) + Rn |
Single Data Transfer 명령어
Mnemonic | Instruction | Action |
LDR | Load register from memory | Rd := (address) |
STR | Store register to memory | <address> := Rd |
Block Data Transfer (LDM, STM)
Mnemonic | Instruction | Action |
LDM | Load multiple registers | Stack manipulation (Pop) |
STM | Store Multiple | Stack manipulation (Push) |
Single Data Swap 명령어
Mnemonic | Instruction | Action |
SWP | Swap register with memory | Rd := [Rn], [Rn] := Rm |
Software Interrupt 명령어
Mnemonic | Instruction | Action |
SWI | Software Interrupt | OS call |
Coprocessor Register Transfers 명령어
Mnemonic | Instruction | Action |
MRC | Move from coprocessor register to CPU register | Rn := cRn {cRm} |
MCR | Move CPU register to coprocessor register | cRn := rRn {cRm} |
참고
관련