#separator:tab
#html:true
#notetype:Basic
#tags column:3
#deck:cracked.guide::TAOCP Vol 1::1.3.2 The MIX Assembly Language
#columns:Front	Back	Tags
TAOCP §1.3.2 The MIX Assembly Language: what does it cover?	MIXAL, the assembly language for MIX: symbols, local labels, pseudo-operations, and worked programs including finding a maximum and printing a table of primes. It also shows how Knuth annotates programs with execution counts.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::about
TAOCP §1.3.2: why does it matter?	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.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::why
MIXAL: what is it?	MIXAL (MIX Assembly Language) is the symbolic assembly language Knuth defines for writing programs for the MIX computer.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::definition
MIXAL: Is MIXAL the same as MIX?	No. MIX is the machine; MIXAL is the assembly language you write MIX programs in. An assembler turns MIXAL into MIX words.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::definition
MIXAL: Can I run MIXAL online?	Yes. cracked.guide/mix assembles and runs MIXAL in the browser, and grades a set of exercises from TAOCP §1.3 when you are signed in.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::definition
TAOCP §1.3.2: what traps should you watch for?	<ul><li>Local symbols like 2H, 2F and 2B trip people up; F means the next one forward, B the previous one backward.</li><li>Simulator syntax can differ slightly from the book; check your simulator's manual for column and format rules.</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::traps
TAOCP §1.3.2, exercise 2 (rated 10, recommended): what is it asking?	Why the self-jump at the end of the max subroutine is not an infinite loop.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 4 (rated 25, recommended): what is it asking?	Assemble the primes program by hand into numeric words. Takes less time than you fear and demystifies the assembler.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 8 (rated 24, recommended): what is it asking?	Decode a short mystery program by hand without running it.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 9 (rated 25, recommended): what is it asking?	Validate an instruction word with a table-driven multiway branch instead of a chain of tests.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 10 (rated 31, recommended): what is it asking?	Find a saddle point in a matrix with two index registers. Graded on this site as the saddle exercise.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 14 (rated 31, recommended): what is it asking?	Print a table of Easter dates, with integer arithmetic and a sneaky negative remainder. Graded as easter.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 18 (rated 25): what is it asking?	Generate a Farey series with a two-term recurrence, no gcd needed. Graded as farey.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2, exercise 22 (rated 31): what is it asking?	Work out the Josephus elimination order with a table of links. Graded as josephus.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercise
TAOCP §1.3.2: how many exercises, and how are they rated?	23 exercises, rated 00 to M47.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::exercises
TAOCP §1.3.2: what should you be comfortable with first?	<ul><li>1.3.1 Description of MIX</li></ul>	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::prereqs
TAOCP §1.3.2: how should you work through it?	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.	cracked.guide cracked.guide::phase::taocp-1 cracked.guide::section::1.3.2 cracked.guide::kind::approach
