Abstract
This program simulates a simplified version of the MMIX computer. Its main goal is to help people create and test MMIX programs for The Art of Computer Programming and related publications. It provides only a rudimentary terminal-oriented interface, but it has enough infrastructure to support a cool graphical user interface — which could be added by a motivated reader. (Hint, hint.)
MMIX is simplified in the following ways:
-
There is no pipeline, and there are no caches. Thus, commands like SYNC and SYNCD and PREGO do nothing.
-
Simulation applies only to user programs, not to an operating system kernel. Thus, all addresses must be nonnegative; “privileged” commands such as PUT rK,z or RESUME 1 or LDVTS x,y,z are not allowed; instructions should be executed only from addresses in segment 0 (addresses less than #2000000000000000). Certain special registers remain constant: rF = 0, rK = #ffffffffffffffff, rQ = 0; rT = #8000000500000000, rTT= #8000000600000000, rV=#369c200400000000.
-
No trap interrupts are implemented, except for a few special cases of TRAP that provide rudimentary input-output.
-
All instructions take a fixed amount of time, given by the rough estimates stated in the MMIX documentation. For example, MUL takes 10ν, LDB takes μ + ν; all times are expressed in terms of μ and ν, “mems” and “oops.” The simulated clock increases by 232 for each μ and 1 for each ν. But the interval counter rI decreases by 1 for each ν; and the usage count field of rU may increase by 1 (modulo 247) for each instruction.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 1999 Author and Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Knuth, D.E. (1999). MMIX-SIM. In: MMIXware. Lecture Notes in Computer Science, vol 1750. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46611-8_8
Download citation
DOI: https://doi.org/10.1007/3-540-46611-8_8
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-66938-8
Online ISBN: 978-3-540-46611-6
eBook Packages: Springer Book Archive