Contents

General Purpose Registers

x86 has 16 general purpose registers that can be used for any kind of data, however, only eight are accessible outside of Long Mode. In addition, despite the name "general purpose", some registers have defined functionality. For example, instructions operating on the stack will implicitly utilize register 4 (stack pointer), and there is no way to change this.

Register List

This is a list of the general purpose registers. The register number listed alongside each one is the number that would be encoded in an instruction to access it. For example, if an instruction calls for an operand to be encoded into ModRM.reg, and the provided operand is EBX, ModRM.reg will be set to 4 (100 in binary).

  • RAX (accumulator, register 0)
    Also accessible as:
    • EAX - lower 32 bits
    • AX - lowest 16 bits
    • AH - the higher 8 bits of AX
    • AL - lowest 8 bits
  • RCX (counter, register 1)
    Also accessible as:
    • ECX - lower 32 bits
    • CX - lowest 16 bits
    • CH - the higher 8 bits of CX
    • CL - lowest 8 bits
  • RDX (data, register 2)
    Also accessible as:
    • EDX - lower 32 bits
    • DX - lowest 16 bits
    • DH - the higher 8 bits of DX
    • DL - lowest 8 bits
  • RBX (base, register 3)
    Also accessible as:
    • EBX - lower 32 bits
    • BX - lowest 16 bits
    • BH - the higher 8 bits of BX
    • BL - lowest 8 bits
  • RSP (stack pointer, register 4)
    Also accessible as:
    • ESP - lower 32 bits
    • SP - lowest 16 bits
    • SPL - lowest 8 bits (Long Mode only)
  • RBP (base pointer, register 5)
    Also accessible as:
    • EBP - lower 32 bits
    • BP - lowest 16 bits
    • BPL - lowest 8 bits (Long Mode only)
  • RSI (source index, register 6)
    Also accessible as:
    • ESI - lower 32 bits
    • SI - lowest 16 bits
    • SIL - lowest 8 bits (Long Mode only)
  • RDI (destination index, register 7)
    Also accessible as:
    • EDI - lower 32 bits
    • DI - lowest 16 bits
    • DIL - lowest 8 bits (Long Mode only)

These registers are only accessible in Long Mode.

  • R8 (register 8)
    Also accessible as:
    • R8D - lower 32 bits
    • R8W - lowest 16 bits
    • R8L - lowest 8 bits
  • R9 (register 9)
    Also accessible as:
    • R9D - lower 32 bits
    • R9W - lowest 16 bits
    • R9L - lowest 8 bits
  • R10 (register 10)
    Also accessible as:
    • R10D - lower 32 bits
    • R10W - lowest 16 bits
    • R10L - lowest 8 bits
  • R11 (register 11)
    Also accessible as:
    • R11D - lower 32 bits
    • R11W - lowest 16 bits
    • R11L - lowest 8 bits
  • R12 (register 12)
    Also accessible as:
    • R12D - lower 32 bits
    • R12W - lowest 16 bits
    • R12L - lowest 8 bits
  • R13 (register 13)
    Also accessible as:
    • R13D - lower 32 bits
    • R13W - lowest 16 bits
    • R13L - lowest 8 bits
  • R14 (register 14)
    Also accessible as:
    • R14D - lower 32 bits
    • R14W - lowest 16 bits
    • R14L - lowest 8 bits
  • R15 (register 15)
    Also accessible as:
    • R15D - lower 32 bits
    • R15W - lowest 16 bits
    • R15L - lowest 8 bits