Assembly

The human-readable form of the instructions a CPU actually runs.

Assembly language is a thin layer above raw machine code. Every other programming language compiles down to this. Learning it means seeing exactly what the CPU does — registers, memory, jumps, the stack. It takes more code to do simple things, but it shows you what every other language is doing underneath. We teach x86-64 NASM on Linux, the most common flavor for desktop/server work.

  • Advanced
  • 10 lessons
Not started yet
Start lesson 1

Lessons

  1. How CPUs Actually WorkBefore writing any code, you'll build a simple picture of how a CPU runs a program: registers, memory, and the fetch-decode-execute cycle. The rest of the track builds on this.
  2. Hello, World!You'll write, assemble, link and run a program that prints Hello, World!. Along the way you'll see the system call that higher-level languages normally hide from you.
  3. Registers & Data MovementYou'll learn `mov`, the most common instruction, which copies data between registers and memory (the source is left unchanged). Nearly every program you write will use it.
  4. Arithmetic & LogicYou'll learn the instructions for arithmetic and bitwise operations, and how each result updates the FLAGS register. Those flags are what conditional jumps use to make decisions.
  5. Control Flow & LoopsAssembly has no if/else or for loops, only jumps. You'll learn how to build conditions and loops from `jmp`, `cmp` and the conditional jumps.
  6. The Stack & FunctionsYou'll learn how the stack holds return addresses and local variables, and how `push`, `pop`, `call` and `ret` work together. This is how function calls and recursion work at the machine level.
  7. System CallsA system call is how a program asks the kernel to do something for it, such as reading a file or writing to the terminal. You'll learn the x86-64 Linux convention for making syscalls and use several common ones.
  8. Calling C Functions from ASMYou'll learn how to call C library functions such as printf and malloc from assembly. This lets you reuse existing code and keep assembly for the parts that need it.
  9. Mini Project: String OperationsYou'll write a small set of string functions in plain assembly without libc: strlen, strcpy, strcmp and a number-to-string converter. It brings together registers, memory access, loops and functions.
  10. x86-64 Assembly CheatsheetRegisters, instructions, and calling convention on one page.

Install it on your own computer

This track uses NASM (the Netwide Assembler) and the x86-64 Linux calling conventions, so you need a Linux environment. On Windows, WSL2 works well; on macOS, a Linux VM or container is the simplest option.

Bash
# Install WSL2 (run in PowerShell as Administrator):
wsl --install
# Restart, then in Ubuntu (WSL2):
sudo apt update && sudo apt install nasm build-essential

# Verify:
nasm --version
ld --version

What people build with Assembly

Learn the basics first, then pick up these tools when a project needs them.

Practical uses

  • Inspect what compilers and CPUs actually execute
  • Optimize tiny performance-critical routines
  • Program bootloaders and embedded targets
  • Reverse engineer binaries and debug crashes

Projects to try

  1. Hello world syscall
  2. Integer conversion routine
  3. Boot sector
  4. SIMD image-processing kernel

Common tools and packages

NASMGNU assemblerGDBLLDBobjdumpradare2GhidraCompiler Explorer

Well-known software

BootloadersCryptography kernelsGame console emulatorsOperating-system entry codeSIMD media codecsFirmware