# x86 architecture

Registers

CS: Code Segment
IP: Instruction Pointer (EIP/RIP)
DS: Data Segment
AX: Accumulator (AL/AH/./EAX/RAX)
BX: Base (BL/BH/./EBX/RBX)
CX: Counter (CL/CH/./ECX/RCX)
DX: Data (DL/DH/./EDX/RDX)
SI: Source Index (SIL/./ESI/RSI)
DI: Destination Index (DSIL/./EDI/RDI)
R8: (R8B/R8W/R8D/.)
R9: (R9B/R9W/R9D/.)
R10: (R10B/R10W/R10D/.)
R11: (R11B/R11W/R11D/.)
R12: (R12B/R12W/R12D/.)
R13: (R13B/R13W/R13D/.)
R14: (R14B/R14W/R14D/.)
R15: (R15B/R15W/R15D/.)
ES: Extra Segment (Data)
FS: Extra Segment (Data)
GS: Extra Segment (Data)
SS: Stack Segment
BP: Base Pointer (BPL/./EBP/RBP)
SP: Stack Pointer (SPL/./ESP/RSP)

Operating modes

Real mode

- 16-bit registers
- 1MB of memory can be addressed (16-bit --> 20-bit)
- Sub-modes: plain (CS=DS=SS=64KB) or segmented (CS=SS=64KB and multiple data segments of 64 KB)

Protected mode

- 32-bit registers
- 4GB of memory can be addressed
- Boot process: real mode --> protected mode (backward compatibility)
- Plain memory (no segments --> descriptors)
- Sub-mode: virtual 8086 (run real mode programs under a protected mode supervisor OS).

Long mode

- 64-bit registers
- 16EB of memory can be addresses
- Plain memory (no segments)

No comments: