indexAssembly & Compiler Output#assembly#x86-64#arm64#compiler#metal

Assembly & Compiler Output

You don't need to write much assembly to benefit enormously from reading it. The goal of this branch is fluency: open Compiler Explorer, paste your C or C++, and understand the instructions that come out. We focus on x86-64 (it matches the OS target, the literature, and Godbolt's defaults), cover registers, the core instruction set, stack frames and the System V calling convention, and add an ARM64 appendix per topic — because that's your daily hardware going forward.

The compiler is not a black box. Once you can read its output, "is this fast?" and "what is this code actually doing?" stop being guesses.

Planned notes

Core sources

  • Compiler Explorer (godbolt.org) — the daily tool; see what any compiler emits. godbolt.org
  • Jonathan Bartlett — Programming from the Ground Up (free) — assembly from first principles.
  • Ed Jorgensen — x86-64 Assembly Language Programming with Ubuntu (free PDF).
  • Felix Cloutier — x86 and amd64 instruction reference — the quick lookup. felix.fr/x86 (and Intel SDM for the authority).
  • ARM64: Stephen Smith — Programming with 64-Bit ARM Assembly; Apple's ARM64 / Apple Silicon assembly docs.

Connects to: C from the Metal · Toolchain & Linking · Machine Model