ArticleslgStudy

computer science

MMIX

MMIX is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand MMIX rather than just read about it. In short: MMIX (pronounced em-mix) is a 64-bit reduced instruction set computer (RISC) architecture designed by Donald Knuth, with significant contributions by John L. Hennessy (who contributed to the design of the MIPS architecture) and Richard L.

Key takeaways

  • MMIX belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect MMIX to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of MMIX from memory before moving on to harder problems.

Reference excerpt

MMIX (pronounced em-mix) is a 64-bit reduced instruction set computer (RISC) architecture designed by Donald Knuth, with significant contributions by John L. Hennessy (who contributed to the design of the MIPS architecture) and Richard L. Sites (who was an architect of the Alpha architecture).

Knuth has said that: "MMIX is a computer intended to illustrate machine-level aspects of programming. In my books The Art of Computer Programming, it replaces MIX, the 1960s-style machine that formerly played such a role… I strove to design MMIX so that its machine language would be simple, elegant, and easy to learn. At the same time I was careful to include all of the complexities needed to achieve high performance in practice, so that MMIX could in principle be built and even perhaps be competitive with some of the fastest general-purpose computers in the marketplace." Knuth started the design of MMIX in 1999, and released the stable version of the design in 2011. The processor is numbered as "2009" with Knuth explaining that this is the arithmetic mean from the numbers of other computer architectures; as well as being "MMIX" in Roman numerals.

Architecture MMIX is a big-endian 64-bit reduced instruction set computer (RISC), with 256 64-bit general-purpose registers, 32 64-bit special-purpose registers, fixed-length 32-bit instructions and a 64-bit virtual address space. The MMIX instruction set comprises 256 opcodes, one of which is reserved for future expansion. MMIX uses IEEE 754 floating-point numbers.

Instructions All instructions have an associated mnemonic. For example, instruction #20 (32 decimal) is associated with ADD. Most instructions have the symbolic form OP X,Y,Z, where OP specifies the sort of instruction, X specifies the register used to store the result of the instruction, and Y, Z specify the operands of the instruction. Each of these fields is eight bits wide. For example, ADD $0,$1,3 means "Set $0 to the sum of $1 and 3." Some instructions treat Y and Z as a combined 16 bit immediate operand, YZ. Most instructions can take either immediate values or register contents; thus a single instruction mnemonic may correspond to one of two opcodes. MMIX programs are typically constructed using the MMIXAL assembly language. The below is a simple MMIXAL program, which prints the string "Hello, world!":

Registers There are 256 directly addressable general-purpose architectural registers in an MMIX chip, designated by $0 through $255, and 32 special-purpose architectural registers. The special-purpose registers can be accessed with the GET and PUT instructions. Two of the special registers, rL and rG, determine which of the general registers are local and which are global. All registers from $0... ([rL] − 1) are local registers, and represent a window into an internal stack of registers. Registers from [rL]... ([rG] − 1) are "marginal registers", they always return 0 if they are used as a source in an operation. Using a marginal register as the destination of an operation will cause the machine to automatically increase rL to include that register. All registers [rG]... $255 are called global registers, and are not part of the register stack.

Local register stack The local register stack provides each subroutine with its own rL local registers, designated by $0 through $(rL − 1). Whenever a subroutine is called, a number of local registers are pushed down the stack (by shifting the start of the window). The arguments of the called subroutine are left in the remaining local registers. When a subroutine finishes it pops the previously pushed registers. Because the internal stack can contain only a finite number of registers, it may be necessary to store a part of the stack in memory. This is implemented with the special registers rO and rS which record which part of the local register stack is in memory and which part is still in local physical registers. The register stack provides for fast subroutine linkage.

Special registers The 32 special physical architectural registers, by code number, are as follows:

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with MMIX

Start with the simplest possible case. Write down what MMIX claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to MMIX before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about MMIX ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of MMIX

In research
MMIX appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses MMIX in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
MMIX is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer-related introductions in 2011, Donald Knuth, Educational abstract machines, so understanding it makes those chapters shorter.
In everyday life
Look for MMIX outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “MMIX” →

How to study MMIX in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what MMIX means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain MMIX out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is MMIX in simple terms?

MMIX (pronounced em-mix) is a 64-bit reduced instruction set computer (RISC) architecture designed by Donald Knuth, with significant contributions by John L. Hennessy (who contributed to the design of the MIPS architecture) and Richard L.

Why does MMIX matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study MMIX?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on MMIX.

Tags

  • Computer-related introductions in 2011
  • Donald Knuth
  • Educational abstract machines
  • Instruction set architectures

Keep exploring