Nepherte (dot) be

Howto: Spim on Linux

Spim is a self-contained simulator that will run MIPS32 assembly language programs. It reads and executes assembly language programs written for this processor architecture. Spim also provides a simple debugger and minimal set of operating system services. Spim does not execute binary (compiled) programs, though it can be used to simulate software you wrote in the MIPS assembly language. Spim is console based but comes together with xspim, a graphical frontend for spim. I needed it for a course and this is how I installed it on Ubuntu.

Getting the requirement
Before we can compile spim and xspim, we will need some extra packages. The following command will install all the required packages:

sudo apt-get install flex bison byacc libx11-dev libxaw7-dev build-essential linux-headers-`uname -r`

The latest version of spim can be downloaded here or can be fetched with the following command:

wget http://www.cs.wisc.edu/~larus/SPIM/spim.tar.gz


Installing Spim
tar xvfz spim.tar.gz
cd spim-7.3/spim
make
make install

Installing Xspim
cd ../xspim
xmkmf
make
make install

Now that you installed spim and xspim you can launch it by typing xspim in the console.

Leave a Reply