# TAOCP 1.3.2 The MIX Assembly Language

> Study guide to TAOCP 1.3.2 The MIX Assembly Language. MIXAL, the assembly language for MIX: symbols, local labels, pseudo-operations, and worked programs…

Updated October 20, 2026.

## Summary {#summary}

TAOCP 1.3.2 The MIX Assembly Language: MIXAL, the assembly language for MIX: symbols, local labels, pseudo-operations, and worked programs including finding a maximum and printing a table of primes. Budget about 8 hours; do exercises 2, 4 and 8.

It also shows how Knuth annotates programs with execution counts.

## Key facts {#key-facts}

- Week 43 of 145 on the cracked.guide path, in [TAOCP Vol 1: Fundamental Algorithms](https://cracked.guide/taocp/volume-1).
- Time budget: about 8 hours.
- 23 exercises in the section, rated 00 to M47; the guide picks 8.
- Picked exercises with Knuth's triangle for recommended: 2, 4, 8, 9, 10 and 14.
- Before you start: 1.3.1 Description of MIX.
- Terms it teaches: [MIX](https://cracked.guide/glossary/mix), [MIXAL](https://cracked.guide/glossary/mixal).

## Week 43 goals {#objectives}

By the end of week 43 you can:

- Use MIXAL symbols and the pseudo-operations EQU, ORIG, CON and END.
- Recognize local symbols like 2H, 2F and 2B.
- Trace a short MIXAL program and its execution-frequency counts.

## This week's steps {#steps}

- Read §1.3.2 The MIX Assembly Language: Type in the example programs and run them in the simulator, not just read them.
- Work the exercises (8 picked): Start with Ex 2, Ex 4, Ex 8; log what you solve below.
- Write down one thing you'd explain to someone: A few sentences in your own words in Your notes: the idea, why it works, an example. 30 words ticks this.
- Pass a MIX exercise: Write it in MIXAL in the browser; a passing program marks this section done.

## Exercises {#exercises}

This section has 23 exercises, rated 00 to M47, and Knuth marks eight of them with the triangle for recommended. Two sets: 1 to 8 are about reading MIXAL, and 9 to 23 are short programming problems. Knuth opens the second set with a list of which exercises practice which techniques (table-driven branches, two-dimensional arrays, buffering, subroutines and so on); use it to choose. Exercises 10, 14, 18 and 22 are graded on this site, along with seven more MIX programs for this section.

Worth your time:

- 2 (rated 10, recommended): Why the self-jump at the end of the max subroutine is not an infinite loop.
- 4 (rated 25, recommended): Assemble the primes program by hand into numeric words. Takes less time than you fear and demystifies the assembler.
- 8 (rated 24, recommended): Decode a short mystery program by hand without running it.
- 9 (rated 25, recommended): Validate an instruction word with a table-driven multiway branch instead of a chain of tests.
- 10 (rated 31, recommended): Find a saddle point in a matrix with two index registers. Graded on this site as the saddle exercise.
- 14 (rated 31, recommended): Print a table of Easter dates, with integer arithmetic and a sneaky negative remainder. Graded as easter.
- 18 (rated 25): Generate a Farey series with a two-term recurrence, no gcd needed. Graded as farey.
- 22 (rated 31): Work out the Josephus elimination order with a table of links. Graded as josephus.

## Why it matters {#why}

This is where you go from reading machine instructions to writing real programs. The execution-count annotations are how Knuth turns code into exact running-time formulas.

## Before you start {#before}

- 1.3.1 Description of MIX

## How to approach it {#approach}

Type in the example programs and run them in the simulator, not just read them. Then change something (print a different number of primes, find the minimum) and get it working. Add the frequency counts yourself and check them against the simulator's instruction counts.

## Common traps {#traps}

- Local symbols like 2H, 2F and 2B trip people up; F means the next one forward, B the previous one backward.
- Simulator syntax can differ slightly from the book; check your simulator's manual for column and format rules.

## Links {#links}

- [Knuth's TAOCP page (editions, errata, MIX/MMIX)](https://www-cs-faculty.stanford.edu/~knuth/taocp.html)
- [Vol 1 errata (plain text, from Knuth)](https://www-cs-faculty.stanford.edu/~knuth/err1.textxt)
- [GNU MDK: MIX assembler and simulator](https://www.gnu.org/software/mdk/mdk.html)
- [Wikipedia: MIX (abstract machine)](https://en.wikipedia.org/wiki/MIX_(abstract_machine))

---

Source: https://cracked.guide/guide/knuth-w029-0
cracked.guide: A free, dated 145-week path to getting genuinely cracked at programming.
