Instruction set

The aarch32 instruction set is divided into several categories, each of which serves a specific purpose. The main categories of instructions in aarch32 include:

Category
Description

Data processing

Perform arithmetic and logical operations on data

Load/store

Move data between memory and registers

Control flow

Control the flow of execution in a program

Exception-generating

Trigger exceptions or interrupts

Synchronization

Manage concurrent access to shared data

System

Access system resources or perform other privileged operations

Data porcessing

Instruction
Description

ADD

Add two registers or a register and an immediate value

SUB

Subtract two registers or a register and an immediate value

MUL

Multiply two registers

DIV

Divide two registers

AND

Perform a bitwise AND operation on two registers or a register and an immediate value

OR

Perform a bitwise OR operation on two registers or a register and an immediate value

XOR

Perform a bitwise XOR operation on two registers or a register and an immediate value

NOT

Perform a bitwise NOT operation on a register

SHL

Shift the bits in a register to the left by a specified number of positions

SHR

Shift the bits in a register to the right by a specified number of positions

Load/Store

Instruction
Description

LDR

Load a word from memory into a register

STR

Store a word from a register into memory

LDRSB

Load a signed byte from memory into a register

LDRSH

Load a signed half-word from memory into a register

LDRB

Load an unsigned byte from memory into a register

LDRH

Load an unsigned half-word from memory into a register

STB

Store a byte from a register into memory

STH

Store a half-word from a register into memory

Control flow

Instruction
Description

B

Unconditionally branch to a specified address

BEQ

Branch to a specified address if two registers are equal

BNE

Branch to a specified address if two registers are not equal

BL

Branch to a specified address and save the return address in a register

BLE

Branch to a specified address if the value in a register is less than or equal to zero

BLX

Branch to a specified address and switch to Thumb mode

BX

Branch to a specified address and switch to ARM mode

Exception-generating

Instruction
Description

SVC

Trigger a supervisor call (SVC) exception

BKPT

Trigger a breakpoint exception

HVC

Trigger a hypervisor call (HVC) exception

Synchronization

Instruction
Description

DMB

Ensure that all memory accesses before this instruction have completed before any memory accesses after this instruction are performed

DSB

Ensure that all memory accesses before this instruction have completed before the processor can execute any subsequent instructions

ISB

Ensure that all instructions before this instruction have completed before any subsequent instructions are executed

System

Instruction
Description

MRS

Read the value of a system register into a register

MSR

Write a value to a system register from a register

CPS

Change the current processor mode or the state of interrupts

SYS

Perform a privileged operation or access a system resource

Last updated