Reading Assembly

Assembly, for people who will never write it

What did your code actually become?

This course does not teach you to write assembly. It teaches you toread compiler output with an accurate model of the machine, and to judge a performance claim on evidence — including your own team’s.

The organising claim: assembly is a contract, not a description. It records what the program asked for; the silicon decides what happens. Assembly presents four convenient fictions — sixteen registers, sequential execution, flat memory, one instruction per operation — and each is wrong in a way that costs money. Parts 1 to 3 make you fluent in the fictions, because you cannot read anything without them. Part 4 takes all four apart.

Lessons
29
Honest hours
17
Threshold concepts
6
Done
0
How to use this, in one paragraph

Every C and Rust snippet has x86-64 andARM64 buttons that compile it live and show the real assembly. Never press one before committing a prediction — thePredict boxes ask how many instructions, or whether there will be a branch, and guessing in writing is what makes the answer land. Rate your confidence honestly;Calibration shows you where you are overconfident, which for an experienced engineer is the main obstacle. Come back to Review most days.

New here? Start with0.1 — Why you will never write this. Coming fromReading Rust? You arrive unusually well prepared, and3.6 is where that course’s promises finally get checked.

PART 0

Orientation

What reading assembly is for, why you will never write it, and the frame that holds the rest together.

PART 1

The register machine

Fiction one. Sixteen named boxes, no types at all, and arithmetic hiding inside something that looks like a memory access.

PART 2

The calling contract

How code composes when nothing enforces the rules. Stack, ABI, prologues, and who is responsible for what.

PART 3

Reading compiler output

The central skill and the largest part. What -O2 does to your source, and how to check a performance claim instead of repeating it.

PART 4

Where the fictions break

All four fictions, dismantled. The listing is a dependency graph, a mov can cost 100x another mov, and the ISA is not the machine.

PART 5

SIMD and the modern ISA

Vector registers, why the compiler usually fails to use them, and how to read the output when it succeeds.

PART 6

Speaking performance

The vocabulary, how to read a profiler, and how to stop your team hand-optimising things that do not matter.