MMIX |
: MMIX may also refer to the year 2009, in Roman numerals.
MMIX is a 64-bit RISC virtual machine designed by Donald Knuth, with significant contributions by John L. Hennessy (who designed the MIPS_architecture chip) and Dick Sites (who was the architect of the Alpha chip). Knuth will be using MMIX in all future editions of his The Art of Computer Programming (TAoCP) to illustrate machine-level aspects of computer programming, especially in relation to the analysis of algorithms. It is pronounced emmix.
MMIX s predecessor, MIX, is used in current and earlier editions of TAoCP. MMIX is a completely new design, conforming to modern ideas about computer design, and is to replace the now thoroughly archaic MIX.
= Architecture =
MMIX is a binary computer with a 64-bit virtual address space and 32-bit Instructions which uses the big-endian convention.
== Instructions ==
All instructions have an associated mnemonic. For example instruction 32 is associated to 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 the rest specify the operands of the instruction. Each of these fields is eight bits wide. For example the instruction ADD $0, $1, 3 , will add the contents of register 1 and the immediate value 3 and store the result in register 0. MMIX programs are typically constructed using the page.
== Registers ==
There are 256 general purpose architectural registers in an MMIX chip, designated by $0 through $255 and 32 special physical architectural registers. They are implemented by 256-32 global physical registers and 512 local physical registers. If X is a number from 0 to 255 inclusive, then special registers rL and rG determine whether register $X refers to a local or a global physical register.
=== 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 is pushed down the stack. The arguments of the called subroutine are left in the remaining local registers. When a subroutine finishes it pops the previously pushed registers. Because there are only 512 local physical 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 are:
#;rB, the bootstrap register (trip) #: When tripping, rB|
|