
Appendix E
MIPS and the SPIM Simulator
E.1 Introduction
In addition to compiling j-- source programs to JVM byte code, the j-- compiler can also
produce native code for the MIPS architecture. The compiler does not actually produce
binary code that can be run on such a machine, but it produces human-readable assembly
code that can be executed by a program that simulates a MIPS machine. The advantage of
using a simulator is that one can easily debug the translated program, and does not need
access to an actual MIPS machine in order to run the program. The simulator that we will
use is called SPIM (MIPS spelled backward). Chapter 7 describes the MIPS