How to Use This Book

Icon Legend

Every chapter uses a consistent set of callout icons. Learn them once and you will always know what kind of content you are looking at.

Icon Type Purpose
⚙️ How It Works Mechanism explanation — the CPU's perspective on what just happened
💡 Mental Model An analogy or intuition to make the concept stick
⚠️ Common Mistake An error real programmers make, and how to avoid it
🔍 Under the Hood A deeper dive into implementation details — optional but rewarding
🔐 Security Note Security implications of the current topic
Performance Note Performance implications — what makes this fast or slow
🛠️ Lab Exercise A hands-on checkpoint — stop and type this into your terminal
📐 OS Kernel Project A contribution to the MinOS progressive project
🔄 Check Your Understanding A self-test question (answer hidden, click to reveal)
📊 C Comparison The equivalent C code for the assembly being discussed

Three Learning Paths

Assembly language serves different audiences. Choose the path that matches your goals.


🏃 Fast Track — "I need to read assembly for security and RE work"

Time: approximately 80 hours Goal: Fluent at reading and analyzing x86-64 assembly without writing complex programs

Chapters: 1, 2, 3, 4, 5, 8, 9, 10, 11, 16, 17, 19, 21, 23, 34, 35, 36, 37

This path gives you the machine model (Part I), the core instruction set (key chapters of Part II), ARM64 basics (Part III), the skills to read compiler output and understand ELF binaries (Part IV selected), and the complete security and reverse engineering section (Part VII).

Skip: Chapter 6 (NASM macros, useful but not essential for reading), Chapter 12 (string instructions), Chapters 13–15 (SIMD), Chapters 18, 20, 22, 24 (advanced C interface), all of Part V and Part VI, Chapters 38–40.

First lab: Compile a C program with gcc -O2 -S, read the output. Chapter 1 sets this up.


📖 Standard Path — "I'm taking a course or doing a complete self-study"

Time: approximately 200 hours Goal: Complete mastery of x86-64 and ARM64, systems programming skills, security awareness

Chapters: All 40, in order.

Follow the chapter sequence. Each chapter assumes the previous ones. Do not skip the exercises — especially the register trace tables. If you find yourself just reading without writing any code, you will not retain the material.

First lab: Chapter 5 setup. Install NASM, GDB, and binutils. Run the hello world. Do not read Chapter 7 until you can assemble and run a program.


🔬 Deep Dive — "I want everything — the OS project, SIMD, ARM64, performance"

Time: approximately 300 hours Goal: Expert-level systems programmer, OS developer, or compiler engineer

Chapters: All 40, plus all 🔍 Under the Hood sidebars, all microarchitecture content, and the complete MinOS project (all three tracks: A, B, and C).

This path takes you through every SIMD instruction family, every page table detail, every pipeline subtlety. You will build a complete bootable OS kernel with a scheduler, filesystem, and user-space programs.

First lab: Chapter 5 setup, then immediately build MinOS Track A (bootloader only) to get QEMU working. You will come back to extend it in every Part V chapter.


The Progressive Project: MinOS

The MinOS project threads through the entire book. You are building a minimal operating system kernel that:

  1. Boots from a raw disk image — a 512-byte bootloader you write in assembly
  2. Transitions through CPU modes — real mode → protected mode → long mode
  3. Initializes the hardware — GDT, IDT, keyboard controller, timer
  4. Manages memory — a page allocator, a simple heap
  5. Handles interrupts — keyboard input, timer ticks
  6. Provides a shell — accepts typed commands and executes them

Each 📐 OS Kernel Project callout contributes a piece of MinOS. The full integration happens in Chapter 38, where all the pieces come together into a bootable image.

Three capstone tracks: - Track A (minimal): bootloader + VGA text + keyboard + simple shell - Track B (standard): Track A + preemptive scheduler + two processes - Track C (extended): Track B + a simple filesystem + loadable user programs

Chapter Dependencies

Most chapters assume all previous chapters in the same part. Cross-part dependencies:

  • Chapter 20 (C interface) requires Chapters 11 (stack/ABI) and 23 (ELF)
  • Chapter 28 (bare metal) requires Chapter 26 (interrupts) and 27 (memory management)
  • Chapters 35–37 (security) benefit significantly from Chapter 11 (stack) and Chapter 32 (memory hierarchy)
  • Chapter 38 (capstone) requires Chapters 25–29

The full dependency graph is in dependency-graph.mermaid.

The Register Trace Table

The core exercise format throughout this book is the register trace table. It looks like this:

Instruction RAX RBX RSP RFLAGS (key)
(initial) ? ? 0x7ffe1234
mov rax, 42 0x2A ? 0x7ffe1234
mov rbx, 100 0x2A 0x64 0x7ffe1234
cmp rax, rbx 0x2A 0x64 0x7ffe1234 SF=1, ZF=0

Your job: fill in each cell before running the program. Then run it in GDB and check your answers. The gap between what you expected and what happened is where learning occurs.

Assembly programming is learned by doing, not by reading. Every lab in this book is here for a reason. Run the code.