The MMIX Supplement to The Art of Computer Programming


Documentation, Sources, Binaries, Links, Examples, Contributions

Table of Content

Content

This page provides materials relating to The MMIX Supplement to The Art of Computer Programming. This Book (ISBN-13: 978-0133992311, ISBN-10: 0133992314) is available from Amazon or other bookstores. It contains the programs from Donald Knuths famous books rewritten for the MMIX computer. It is the final result of the MMIXmasters project.

Programs and Test cases

You can download all the .mms and .tst files as one zip file: supplement.zip.

Tools

Several tools were designed for the programs as given above:
  • mmstotex, a utility to convert mms files to TeX files.

  • mmstort, a utility to extract instruction counts from mms files, add them up, and compare them to a given sum.

  • testgen, a utility taking a tst file (the test description) and possible several mms files producing a series of mms files as output. Each output file is a complete MMIX program that can be assembled and run to execute the test in question.

  • ftoo, a preprocessor to convert floating point numbers to their hexadecimal representation. It can be used as a preprocessor for mms files (or tst files) that need to use floating point constants.

  • rsixfour.c, a simple C program to generate random numbers for testing.

  • toocta.c and tolocta.c two simple C programs that turn list of numbers into MMIX programs containing OCTA declarations for testing. The latter program adds a zero OCTA (for the link field) to every data OCTA.

Errata

  • page i, line 5: replace "Programmming" by "Programming".

  • page ii, line 18: replace "Programmming" by "Programming".

  • page 2, program line 34: This line might load a formatting character as the start symbol of the permutation.
    See BUG 1.3.3 A. Further changes on
    page 3, 4, 5.

  • page 5, line 1: add a fixed space between "Eqs." and "(8).

  • page 5, line 12: replace "concerning" by "connecting".

  • page 5 and 6, program B
    lines 2, 5, 28, 34, 35, 39-44, 50, 51, 53, 56, 57, 59-63: replace register names "X" by "x", "Z" by "z", and "T" by "table";
    in line 2 replace "TLOC[T[0]]" by "tableLOC[T[0]]".
    in line 57 replace "Output Z." by "Output Z.".

  • page 6, program line 40: replace "B4.Change" by "B4. Change".

  • page 6, program line 40: replace "i" by "j".

  • page 6, program line 41: replace "j" by "i".

  • page 7, two lines above Program J: replace "C" by "C".

  • page 8, line 7: replace "lessons" by "lesson".

  • page 11, line -6: replace "red and green" by "green and red".

  • page 12, line 2: replace "SG and SR" by "GS and RS".

  • page 14, exercise 15, program line 12: replace "Lines 12-18 remain as before." by "Lines 13-18 of Program A follow.".

  • page 17, last sentence before EXERCISES: replace "instead of in a memory location" by "instead of a memory location".

  • page 27, exercise 12: replace "Algorithm A" by "Program A.".

  • page 32, program line 148: replace "Delete C" by "Delete NODE(C)".

  • page 32, line -2: replace "function" by "functions".

  • page 36, exercise 7: replace twice "D1" by "d1".

  • page 39, line -11: replace "have conveniently" by "conveniently have".

  • page 43, program line 1 and 4: replace "LDO" by LDOU".

  • page 43, program line 2 and 3: replace "." by "," and indent "jump if so."

  • page 43, section 2.3.3, first line: replace "six" by "five or six".

  • page 43, display 17: Exchange LEFT and RIGHT two times.

  • page 44, line 8: add a space between "..." and "Therefore".

  • page 45, display 7: Exchange LLINK and RLINK.

  • page 46, display 9: Exchange LLINK and RLINK.

  • page 47, exercise 33: Add "Design an algorithm ..." at the end of the exercise.

  • page 56, line -6: replace "fv" by "fv".

  • page 57, exercise 14, line 3: replace "64 bit" by "64-bit".

  • page 58, page header: replace "4.2.1" by "4.2.2".

  • page 63, Program S, line 08 and 10: replace "Carry" by "Borrow".

  • page 64, page header: replace "[267]" by "[268]".

  • page 64, Program M, line 11: replace "Initialize i" by "Initialize i ".

  • page 66, Program line 54: replace "ui+J" by "uj+i".

  • page 67, Program D, line 78: replace "j<0" by "i<0".

  • page 67, exercise 13, line 1: replace "is a" by "is".

  • page 68, line 5: replace "it" by "x.

  • page 70, Program A and Program B, line 01: add ":" before "Gcd".

  • page 70, Program B, line 12: replace "max" by "max".

  • page 72, line 5 and 7: add ":" before "Gcd".

  • page 76, line -9: replace "[82]" by "...".

  • page 78, line 2: replace "h0" by "h0".

  • page 78, program line 12: replace "Bump q, q" by "Bump p, q".

  • page 79, line -16: replace "lists heads" by "list heads".

  • page 79, Program M, line 10: remove the extra space before "M2".

  • page 80, program line 15: remove the extra space before "M3".

  • page 80, equation 19: replace the final "," by ".".

  • page 80, line -10 and -9: add a comma before "it is approximately".

  • page 81, exercise 33: replace "improve an" by "improve on".

  • page 83, program line 43: add a period at the end of the line.

  • page 83, program line 47: remove the extra space before the comment.

  • page 84, page header: replace "[117]" by "[118]".

  • page 84, line 21: add a comma at the end of the line.

  • page 85, line 13: remove the comma after "loop".

  • page 87, Program S, line 13: delete the extra space before S3.

  • page 90, L1, line 4: add a space between "..." and "and".

  • page 91, page header: replace "[166]" by "[165]".

  • page 92, exercise 9, line 2: add a space between "..." and "in".

  • page 94, line 17: remove the indentation.

  • page 95, line -7: replace "page 108" by "page [108]" because the page number refers to the original book.

  • page 97, line -3 and -2: replace "algorithm" by "program" and replace "Algorithm" by "Program".

  • page 98, Program Q', program line 04: replace "key1 + i" in the comment by "key1".

  • page 98, Program Q', program line 11: append "(next)" at the end of the comment.

  • page 106, line 4: append ")" at the end of the line.

  • page 107, line R in Table 1: The content of this line should be re-positioned one place to the right; I.e. the first entry should be empty, ‘ARE’ should be in second place, ‘FROM’ in the 4th column, ‘OR’ in the 7th column, and ‘HER’ in column 11.

  • page 108, line 9: replace "(page 446)" by "(page 440)".

  • page 109, line 9: replace "1050" by "4.6*1049".

  • page 109, line 10: replace "1042" by "2.25*1042".

  • page 109, line 11: replace "about one of" by "about five of".

  • page 109, equation 4: make the innermost parentheses a bit smaller.

  • page 110, line 4: replace "(9E 9E 9E 9E 9E 9E 9E 9E)" by "(9D 9D 9D 9D 9D 9D 9D 9D)".

  • page 110, equation 7: replace "(40 56 93 b4 62 46 5C 68)" by "(9D 43 67 B7 6B 57 5B 5F)".

  • page 113, line -12: correct quotation marks.

  • page 113, Program L, line 01, 14, and 17: replace "LDO" by "LDT" and "STO" by "STT".

  • page 114, Program D, line 01, 21, and 24: replace "LDO" by "LDT" and "STO" by "STT".

  • page 117, line 1: replace "haven" by "have".

  • page 120, Solution 7: See BUG 1.3.3 A.

  • page 124, line 5: add a space between "..." and "are".

  • page 144, exercise 28, program line 17: Add "Is " at the begin of the comment.

  • page 150, Solution 4, line 2: replace "greater or equal than" by "greater than or equal to".

  • page 151, Solution 14, line 2: replace "64 bit" by "64-bit".

  • page 152, line preceding 4.2.2: add a comma after "slower".

  • page 159, exercise 13, program line 6: replace "SL i,m,3" by "SL i,m,2".

  • page 160, exercise 19: remove the extra "F" from the constants for m2 and m3.

  • page 165, exercise 3, program line 5: replace "BNP t,1FB+2A" by "PBNP t,1FB[A]".

  • page 165, exercise 3, program line 10: replace "BNN i,2BB+3 Loop while i ≥ 0." by "PBP i,2BB+1[1] Loop while i > 0."

  • page 166, page header: replace "[621]" by "[620]".

  • page 166, lines -4 to -1: replace "These iterations ... 8 percent." by "These iterations can be avoided by inserting the instruction sequence SL c,m,1; CMP c,c,n; BNP c,=F; SUB m,n,h before line 09. This will improve the running time by about 8 percent.".

  • page 168, program line 27: replace "Ki+1" by "Ki+1".

  • page 170, program line 16: Remove the period at the end of the line.

  • page 170, program line 29: replace "Ki+1" by "Ki+1".

  • page 169, page header: replace "[627]" by "[626]".

  • page 169, program lines 01 and 10: remove the extra space before the comment "M1." and "M2.".

  • page 170, page header: replace "[629]" by "[630]".

  • page 170, program line 01: remove the extra space before the comment "M1.".

  • page 171, page header: replace "[629]" by "[630]".

  • page 171, exercise 34, program line 9: add a space before "for 1.".

  • page 172, program lines 13, 15, and 16: remove the extra space before the comments "R7.", "R6.", and "R5.".

  • page 173, program line 45: remove the extra space before the comment "S1.".

  • page 174, program line 17: remove the extra space before the comment "S3.".

  • page 175, page header: replace "[640]" by "[641]".

  • page 175, Solution 9, line 3: insert a closing parenthesis ")" before the semicolon ";".

  • page 176, program line 41: replace "ij" by "ji".

  • page 179, line 10: delete "If" after "Repeat until".

  • page 179, line -13: replace "lines 19 and 21" by "lines 19-21".

  • page 183, Solution 6, program line 03, 04, and 05: delete "+i" in the comment.

  • page 188, line 11: replace "Program 2.1A" by "Program 2.1-(5)".

  • page 188, line -5: replace the hyphen by an en-dash.

  • page 190: consolidate the entries for "Fclose", Fopen", "Fread", and "Fwrite".

  • page 191, line -4: replace "Robert" by "Ronald".

  • page 193, line -2: replace "Yuval, Yarom" by "Yarom, Yuval".

I will gladly reward any first finder of an error, be it technical, typographical, orthographical, grammatical, or otherwise, by sending her or him a nice MMIX T-shirt (as long as supplies last).

Please help to keep this site up to date! If you want to point out important material or projects that are not listed here, if you find errors or want to suggest improvements, please send email to email