Registers

Main x86 and x64 registers

There is 8 General Purpose Registers (GPRs) in x86 and x64 architectures.

x86x64nameUsage

EAX

RAX

Accumulator

Store the results of arithmetic and logical operations

EBX

RBX

Base

Store the base address of memory operands

ECX

RCX

Counter

Store the count of iterative instructions

EDX

RDX

Data

Store the results of multiplication and division operations

ESP

RSP

Stack Pointer

Store the stack pointer

EBP

RBP

Base Pointer

Store the base pointer

ESI

RSI

Source Index

Store the source index for string operations

EDI

RDI

Destination Index

Store the destination index for string operations

Two groups are distinguished :

  • EAX/RAX, EBX/RBX, ECX/RCX and EDX/RDX have to store temporary data for the processor.

  • ESP/RSP, EBP/RBP, ESI/RSI and EDI/RDI are instead used as pointers and indexes

There is three other main registers :

x86x64NameUsage

EFLAGS

RFLAGS

Flags

Store the current state of the CPU's flags, which are special bits that are used to control the execution of instructions

EIP

RIP

Instruction Pointer

Store the current instruction pointer, which is the address of the next instruction to be executed by the CPU. The instruction pointer is automatically updated by the CPU as instructions are executed, and it is used to determine the order in which instructions are executed

CS

CS

Code Segment

Store the code segment selector, which is a value that specifies the current segment of memory that is being used to store the instructions that are executed by the CPU

There is other registers like the segment registers (DS, ES, FS, GS, and SS), the control registers (CR0, CR1, CR2, CR3, and CR4), and the debug registers (DR0, DR1, DR2, DR3, DR4, DR5, DR6, and DR7). However, this is not a complete list, and there may be other registers that are available on some 32-bit x86 CPUs.

Last updated