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:

CategoryDescription

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

This is just a brief overview of some of the main instruction categories in the aarch32 ISA. There are many other instruction categories and specific instructions within each category, each of which serves a specific purpose and can be used in various ways to implement a given algorithm or program.

Data porcessing

InstructionDescription

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

Note that this is not an exhaustive list of data processing instructions in the aarch32 instruction set. There are many other instructions that can be used to perform a wide range of operations on data. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Load/Store

InstructionDescription

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

Note that this is not an exhaustive list of load/store instructions in the aarch32 instruction set. There are many other instructions that can be used to load and store data from memory using a variety of addressing modes and data types. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Control flow

InstructionDescription

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

Note that this is not an exhaustive list of control flow instructions in the aarch32 instruction set. There are many other instructions that can be used to control the flow of execution in a program, such as conditional branches and subroutine calls. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Exception-generating

InstructionDescription

SVC

Trigger a supervisor call (SVC) exception

BKPT

Trigger a breakpoint exception

HVC

Trigger a hypervisor call (HVC) exception

Note that this is not an exhaustive list of exception-generating instructions in the aarch32 instruction set. There are many other instructions that can be used to trigger different types of exceptions or interrupts, such as data abort and undefined instruction exceptions. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Synchronization

InstructionDescription

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

Note that this is not an exhaustive list of synchronization instructions in the aarch32 instruction set. There are many other instructions that can be used to manage concurrent access to shared data by multiple threads or processes. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

System

InstructionDescription

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

Note that this is not an exhaustive list of system instructions in the aarch32 instruction set. There are many other instructions that can be used to access system resources or perform other privileged operations. The specific instructions available and their exact behavior may vary depending on the implementation of the aarch32 instruction set.

Last updated