CSE 378: Machine Organization and Assembly Language
Getting Started With SPIM and XSPIM
-
Login to your account on an instructional unix server
(ceylon, fiji, sumatra or tahiti), and get an xterm up. Ask the lab
staff if you're unfamiliar with how to do this. I've been told that
there are icons on the desktop for each of those four machines that
will connect with ReflectionX and open an xterm. All you should need
to do is locate the appropriate icon and double-click on it.
-
Edit your .cshrc (or your .mycshrc, if you have one) file
to include the following line at the end of the file:
source /cse/courses/cse378/CurrentQtr/bin/spim-setup
You need to make the above changes only once. By including the above
line, you will have easy access to spim and xspim, as
well as the (scant) man page documentation. Logout and login again so
that the changes take effect.
If you aren't sure how to edit your .cshrc file, or you
don't want to logout and back in, you can just type the above command
into your xterm and run it.
-
You are now ready to run xspim which you do by entering:
xspim &
at the prompt. The & character tells UNIX to run xspim in the background.
This allows you to continue using the terminal window from which you started
xspim to do other work, read mail, etc...
-
After starting xspim, you should see a window like this:
![](xspim.gif)
-
Notice the 5 distinct segments:
-
Register Display. Displays the values of all registers
-
Control Buttons. Where you issue SPIM commands.
-
Text Segments. Displays addresses and assembly code.
-
Data and Stack Segments. Displays data and values on stack
-
SPIM Messages. Displays SPIM messages when running a program
-
Use the "load" button to load your assembly file.
-
There are several options to run the program:
-
Use the run button. This will run the program to completion.
-
Use the step button. This will run the program "increment" instructions
at a time. If you set the increment to 1, it will run the program instruction
by instruction.
-
Use the breakpoint command to stop the execution at a given address.
Along with the set command, this is a useful debugging tool.
Original by dugan@cs.washington.edu, Spring 1997.
Modified by cary@cs.washington.edu, Winter 2001.