SPIM and XSPIM are simulators for the MIPS Assembly Language (MAL) described Appendix B of Computer Organization & Design, by David A. Patterson and John L. Hennessy. SPIM has a command-line user interface, while XSPIM has a X-Windows based graphical user interface. SPIM and XSPIM were written by James R. Larus. There is also a PCSPIM program for the Windows platform. If you want to install any of these programs on your own machine, see SPIM: A MIPS32 Simulator.
At UMD, SPIM and XSPIM are compiled to run directly on the UNIX workstations. SPIM can be run from other machines via remote login. XSPIM can be run remotely via secure login or an XWin-32 connection. If you are not familiar with UNIX, see A UNIX Reference. Also, print out these instructions so that you will have them available in case something goes wrong.
On UNIX workstations, you will often need to enter UNIX commands.
These commands can be entered into an xterm window or
another type of command window.
Ask a lab consultant to show you how to open one of these windows.
You can obtain some example MAL programs here. These programs can be used for checking out SPIM and XSPIM.
To start up the xspim program, give the following command:
xspim &
To start up the spim program, give the following command:
spim
Each time you run a MAL program, you need to
clear button
and release it on "registers & memory".
sums.s: click on the
load button, enter sum.s in the dialog box,
and click on "assembly" or hit the return key>
run button and click on
"ok" in the dialog box.
Be sure to check the status pane at the bottom of the xspim window after the load step - this is where assembly errors are reported. If you try to run a program that did not assemble correctly, you will get strange behavior.
When you are done with your xspim session,
xspim: click the quit
button and click on "quit" in the dialog box.
For making typescript or remote logins, you should run spim
rather than xspim.
spim has the same functionality as xspim, but
it uses a command-line user interface.
The most frequently used commands are
reinit.
sums.s:
enter the command
load "sums.s".
run, and
spim:
enter the command exit.
While writing and running assembly language programs, you will often
repeat an edit-clear-load-run cycle several times during a session.
This is easier if you run both spim or xspim
and an editor simultaneously.
You can do this with xspim by starting it up with the
command
xspim &
and then starting up your favorite editor.
The ampersand tells UNIX to run the program as a background process so
that you get a new prompt.
After editing, be sure to save changes before clearing, loading, and
running in xspim.
You can also use spim in parallel with an editor, but you
will need to open two xterm windows, starting
spim in one and the editor in the other.