Logo
Articles Compilers Libraries Books MiniBooklets Assembly C++ Rust Go Linux CPU Others Videos
Advertisement

Article by Ayman Alheraki on May 12 2026 12:58 PM

Full SIB + ModRM + REX combined diagram

Full SIB + ModR/M + REX combined diagram

 

1. Full Instruction Layout (x86-64)

Not all fields are always present, but this is the maximum structure.


2. Core Decoding Pipeline (High-Level)


3. ModR/M + SIB + REX Combined View

This is the most important diagram.


4. Full Register Expansion Logic

3-bit → 4-bit transformation

So:


5. Detailed Example (Full Decode Flow)

Instruction:


Machine code (conceptual):

Example breakdown:


STEP 1 — REX decode

Split:

Meaning:

  • W = 1 → 64-bit operand

  • R = 1 → REG extended

  • X = 0 → INDEX not extended

  • B = 0 → BASE not extended


STEP 2 — ModR/M decode

Split:

Meaning:

  • MOD = 00 → memory addressing

  • REG = 000

  • R/M = 100 → indicates SIB follows


STEP 3 — SIB decode

Split:

Meaning:

  • SCALE = 10 → multiply by 4

  • INDEX = 001

  • BASE = 100


STEP 4 — Apply REX extensions

INDEX field:

BASE field:


STEP 5 — Effective address

Final expression:


6. Full Visual Execution Flow


7. Key Mental Model (Very Important)

Think of decoding like stacking layers:


8. One-Sentence Summary

REX extends register encoding, ModR/M selects operands, and SIB builds complex memory addressing like:

Advertisements

Responsive Counter
General Counter
1310718
Daily Counter
1149