Registers

Register Size

  • 1 byte = 8 bits

  • 1 word = 2 bytes

  • 1 dword = 4 bytes (double word)

  • 1 qword = 8 bytes (quad word)

Registers in Different Architectures

  • Registers are very fast, temporary stores for data.

  • You get several "general purpose" registers:

    • 8085: a, c, d, b, e, h, l

    • 8086: ax, cx, dx, bx, sp, bp, si, di

    • x86: eax, ecx, edx, ebx, esp, ebp, esi, edi

    • amd64: rax, rcx, rdx, rbx, rsp, rbp, rsi, rdi, r8, r9, r10, r11, r12, r13, r14, r15

    • arm: r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14

  • The address of the next instruction is in a register:

    • eip (x86)

    • rip (amd64)

    • r15 (arm)

  • Various extensions add other registers (x87, MMX, SSE, etc).

Partial Register Access

  • Registers can be accessed partially.

  • Due to a historical oddity, accessing eax will zero out the rest of rax. Other partial access preserve untouched parts of the register.

Last updated