Glossary

What is MMIX?

MMIX is Knuth's modern replacement for MIX: an imaginary 64-bit RISC computer with 256 general-purpose registers. It is described in Volume 1, Fascicle 1 (2005) and used for machine-level code in Volume 4A onward.

Taught in TAOCP 7.1.3 Bitwise Tricks and Techniques (part 1), TAOCP 7.1.3 Bitwise Tricks and Techniques (part 2)

How it differs from MIX

MIX looks like a 1960s machine: five-byte words, a sign bit, an accumulator, six small index registers. MMIX looks like a modern RISC chip: 64-bit words, 256 general registers, 8-bit bytes, a load/store design and fixed-width instructions with three operands (ADD $1,$2,$3). Its name is the Roman numeral 2009, which Knuth chose as the average of the numbers of real RISC machines he considered.

Knuth has said MMIX will replace MIX in future editions of Volumes 1 to 3, but the current editions still use MIX.

Where you meet it on the path

Volume 4A shows machine code in MMIX, mostly in §7.1.3, Bitwise Tricks and Techniques, where instructions like MOR and MXOR do whole-word bit shuffles. You do not need to write much MMIX to follow it. Reading the opening of Fascicle 1, or Knuth's MMIX page, is enough.

Questions

Should I learn MIX or MMIX first?

For Volumes 1 to 3 as printed today, MIX, because that is what the programs use. Pick up MMIX when you reach Volume 4A.

Is there an MMIX simulator?

Yes. Knuth's own MMIXware package includes an assembler and simulator, and there are browser-based ones made by others.