#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::1.3.1 Description of MIX
#columns:Front	Back	Tags
TAOCP §1.3.1 Description of MIX: what does it cover?	MIX, Knuth's imaginary 1960s-style computer: its words made of bytes and signs, registers, memory, comparison indicator, and the full instruction set. Every program in the original volumes is written for it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::about
TAOCP §1.3.1: why does it matter?	Reading and writing assembly for a simple machine teaches what high-level code costs. Even though modern hardware is different, the habit of counting memory references and instruction cycles is timeless.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::why
MIX: what is it?	MIX is the imaginary computer Donald Knuth designed for The Art of Computer Programming, so that every algorithm in the books could be written, run and timed on one simple machine.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition
MIX: Is MIX a real computer?	No. It was never built in hardware. It exists in Knuth's books and in emulators like GNU MDK and the one at cracked.guide/mix.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition
MIX: Do I have to learn MIX to read TAOCP?	You can skim it, but you lose the exact running-time analysis, which is the point of the books. A few weeks of MIX in Volume 1 is enough to read every program after it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition
MIX: What replaced MIX?	MMIX, a 64-bit RISC design described in Volume 1 Fascicle 1 (2005). Volume 4A and later use it; Volumes 1 to 3 have not yet been rewritten for it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::definition
TAOCP §1.3.1, a common trap: “Assuming bytes are 8 bits.” What's the catch?	A MIX byte holds at least 64 values and programs must not depend on its exact size.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::trap
TAOCP §1.3.1, a common trap: “Misreading field specs (L:R).” What's the catch?	Test them in the simulator.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::trap
TAOCP §1.3.1: what traps should you watch for?	<ul><li>Wondering whether to skip MIX for MMIX: Knuth is replacing MIX with MMIX (see the Vol 1 Fascicle 1 and his MMIX page), but the 3rd-edition text you are reading uses MIX, so learn MIX now.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::traps
TAOCP §1.3.1, exercise 6 (rated 10, recommended): what is it asking?	Predict what several loads with field specs do. Field-spec drill.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 9 (rated 15, recommended): what is it asking?	List every instruction that can touch the overflow toggle.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 13 (rated 10, recommended): what is it asking?	Subtle behavior of overflow jumps that jump to themselves.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 16 (rated 20): what is it asking?	Clear 100 words of memory two ways: shortest program, then fastest. Try MOVE.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 18 (rated 22, recommended): what is it asking?	Hand-execute a tricky little program that touches nearly every register. The best MIX fluency check there is.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 19 (rated 14, recommended): what is it asking?	Time that same program in units of u.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 21 (rated 24, recommended): what is it asking?	Set rJ to an arbitrary value without changing memory. A puzzle about how jumps set rJ.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1, exercise 22 (rated 28, recommended): what is it asking?	Compute a 13th power with minimum memory, then with minimum time. The stretch.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercise
TAOCP §1.3.1: how many exercises, and how are they rated?	26 exercises, rated 00 to 32.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::exercises
TAOCP §1.3.1: what should you be comfortable with first?	<ul><li>1.1 Algorithms</li><li>Some exposure to assembly or the TIS-100/EXAPUNKS games</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::prereqs
TAOCP §1.3.1: how should you work through it?	Install a MIX simulator first (GNU MDK is the common choice). Keep the instruction summary chart open. For every instruction family, write a two-line program and run it to see the registers change. Field specifications like (0:5) and (1:3) confuse everyone at first; spend time on them.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.1 cracked.guide::kind::approach
