
* Question
What types of ARM data processing instructions are there?
* Answer
ARM processors support a variety of data processing instructions, which perform operations on registers and immediate values. These instructions can be categorized into the following types:
Table of Contents
Toggle1. Arithmetic Instructions
These perform basic arithmetic operations:
- ADD– Addition (Rd = Rn + Operand2)
- ADC– Addition with carry (Rd = Rn + Operand2 + Carry)
- SUB– Subtraction (Rd = Rn – Operand2)
- SBC– Subtraction with carry (Rd = Rn – Operand2 – NOT Carry)
- RSB– Reverse subtract (Rd = Operand2 – Rn)
- RSC– Reverse subtract with carry (Rd = Operand2 – Rn – NOT Carry)
2. Logical Instructions
These perform bitwise logical operations:
- AND– Bitwise AND (Rd = Rn & Operand2)
- ORR– Bitwise OR (Rd = Rn | Operand2)
- EOR– Bitwise Exclusive OR (Rd = Rn ^ Operand2)
- BIC– Bitwise Clear (Rd = Rn & ~Operand2)
3. Comparison Instructions
These set condition flags based on the result but do not store the result:
- CMP– Compare (Rn – Operand2)
- CMN– Compare with negate (Rn + Operand2)
- TST– Test bits using AND (Rn & Operand2)
- TEQ– Test bits using XOR (Rn ^ Operand2)
4. Shift and Rotate Instructions
These modify register values using shift or rotate operations:
- LSL (Logical Shift Left)– Shifts bits left, filling with zeros.
- LSR (Logical Shift Right)– Shifts bits right, filling with zeros.
- ASR (Arithmetic Shift Right)– Shifts bits right, preserving the sign bit.
- ROR (Rotate Right)– Rotates bits right without carry.
- RRX (Rotate Right with Extend)– Rotates bits right through the carry flag.
5. Multiply and Multiply-Accumulate Instructions
Used for multiplication operations:
- MUL– Multiply (Rd = Rn * Rm)
- MLA– Multiply-Accumulate (Rd = (Rn * Rm) + Ra)
- UMULL– Unsigned Multiply Long (RdLo, RdHi = Rn * Rm)
- UMLAL– Unsigned Multiply-Accumulate Long (RdLo, RdHi = (Rn * Rm) + RdLo, RdHi)
- SMULL– Signed Multiply Long (RdLo, RdHi = Rn * Rm)
- SMLAL– Signed Multiply-Accumulate Long (RdLo, RdHi = (Rn * Rm) + RdLo, RdHi)
6. Bit Manipulation Instructions (for ARMv6 and later)
- CLZ– Count leading zeros in a register.
- REV, REV16, REVSH– Byte reversal operations.
7. Saturation Instructions (for DSP extensions)
Used in DSP (Digital Signal Processing) applications:
- SSAT– Signed saturation.
- USAT– Unsigned saturation.
8. Miscellaneous Instructions
- MOV– Move (Rd = Operand2)
- MVN– Move NOT (Rd = ~Operand2)
These instructions allow efficient data manipulation, arithmetic computation, and logical operations in ARM architectures.
COMMENTS