Skip to content

Registers Reference

  • Register is a temporary storage built into the CPU itself. So it can contains 64-bit data, (can be a value or a memory address).

General-purpose registers

 organization .

  • Callee-saved (%rbx, %rbp, %r12-%r15): when procedure P calls procedure Q, Q must preserve the values of these registers, ensuring that they have the same values when Q returns to P as they did when Q was called.
  • Caller-saved (all other except %rsp): they can be modified by any function

Special registers

  • Flag register (rFlags): used for status and CPU control information. The rFlag register is updated by the CPU after each instruction and not directly accessible by programs. This register stores status information about the instruction that was just executed. Of the 64-bits in the rFlag register, many are reserved for future use.

    NameSymbolBitUse
    CarryCF0Used to indicate if the previous operation results in a carry
    ParityPF2Used to indicate if the last byte has an even number of 1’s (even parity)
    AdjustAF4Used to support Binary Coded Decimal
    ZeroZF6Used to indicate if the previous operation resulted in a zero result
    SignSF7Used to indicate if the previous operation resulted in a 1 in the MSB
    DirectionDF10Used to specify the direction (increment or decrement) for some string operations
    OverflowOF11Used to indicate if the previous operation resulted in an overflow
  • Instruction Pointer Register (%rip): used by the CPU to point to the next instruction to be executed.

Sizes of C data types in x86-64

 organization .

Operand Forms .