Logo
Articles Compilers Libraries Books MiniBooklets Assembly C++ Linux Others Videos
Advertisement

Article by Ayman Alheraki on January 11 2026 10:37 AM

ARMv8-A AArch64 architecture

ARMv8-A AArch64 architecture

which is utilized by processors like the Snapdragon X Elite. Below is a comprehensive overview of:

  • General-Purpose Registers

  • Condition Flags (NZCV)

  • Instruction Encoding with Hexadecimal Examples

  • AI/ML Instruction Extensions (NEON, SVE)


General-Purpose Registers (GPRs)

ARMv8-A defines 31 general-purpose 64-bit registers, labeled X0 through X30. Each can also be accessed as 32-bit W0–W30. Register X31 serves as the zero register (when used as a source) or the stack pointer (SP) (when used as a destination).Wikipedia+7Stack Overflow+7cs140e.sergio.bz+7

Register64-bit Name32-bit NameDescription
X0–X7X0–X7W0–W7Function arguments / return values
X8X8W8Indirect result location register
X9–X15X9–X15W9–W15Temporary registers
X16–X17X16–X17W16–W17Intra-procedure-call scratch registers
X18X18W18Platform register (reserved)
X19–X28X19–X28W19–W28Callee-saved registers
X29FPW29Frame pointer
X30LRW30Link register (return address)
X31SP or ZRWSP or WZRStack pointer or zero register

 


⚑ Condition Flags (NZCV)

The PSTATE register holds condition flags that reflect the outcomes of operations. These flags are:Arm Community+2Stack Overflow+2Arm Documentation Service+2

FlagBit PositionDescription
N31Negative: Set if the result is negative
Z30Zero: Set if the result is zero
C29Carry: Set if there's a carry out
V28Overflow: Set if there's an overflow

 

These flags are updated by instructions that have an 'S' suffix, such as ADDS or SUBS.arm-condition-flags.vercel.app


Instruction Encoding with Hexadecimal Examples

ARMv8-A instructions are uniformly 32 bits (4 bytes) in length and are encoded in little-endian format. Below are examples of common instructions with their hexadecimal representations:Stack Overflow

Arithmetic Instructions

InstructionDescriptionHex Encoding
MOV X0, #1Move immediate value 1 into X00xD2800020
ADD X1, X2, X3Add X2 and X3, store result in X10x8B030041
SUB X4, X5, #10Subtract immediate 10 from X5, store in X40xD1001454

 

Logical Instructions

InstructionDescriptionHex Encoding
AND X6, X7, X8Bitwise AND of X7 and X8, result in X60x8A0800E6
ORR X9, X10, X11Bitwise OR of X10 and X11, result in X90xAA0B0149
EOR X12, X13, X14Bitwise XOR of X13 and X14, result in X120xCA0E01AC

 

Branch Instructions

InstructionDescriptionHex Encoding
B labelUnconditional branch to label0x14000000
BL labelBranch with link (call function)0x94000000
CBZ X0, labelCompare X0 with zero, branch if zero0xB4000000

 

Note: The actual hexadecimal encoding for branch instructions depends on the offset to the label.


AI/ML Instruction Extensions

ARMv8-A introduces extensions like NEON and SVE (Scalable Vector Extension) to accelerate AI and machine learning workloads.

NEON (Advanced SIMD)

NEON provides 128-bit vector operations. Examples include:

InstructionDescriptionHex Encoding
ADD V0.4S, V1.4S, V2.4SAdd four 32-bit integers from V1 and V2, store in V00x4E208020
MUL V3.4S, V4.4S, V5.4SMultiply four 32-bit integers from V4 and V5, store in V30x6E205883

 

SVE (Scalable Vector Extension)

SVE allows for vector lengths beyond 128 bits, adapting to the hardware's capabilities. Instruction encodings for SVE are more complex and depend on the specific vector length implemented in the hardware.


References

For detailed information on ARM instruction encodings and extensions:

  • ARM A64 Instruction Set Architecture

  • Condition Codes and Flags in ARM

Advertisements

Responsive Counter
General Counter
1001618
Daily Counter
818