.\" $Header: /var/home/larus/Software/larus/SPIM/RCS/xspim.man,v 1.1 1992/12/14 16:55:49 larus Exp $
.TH spim 1
xspim \- A MIPS R2000/R3000 Simulator
[\|\fI-asm/-bare\fP \fI-trap/-notrap\fP \fI-quiet/-noquiet\fP
\fI-file file\fP \fI-execute file\fP
\fI-stext size\fP \fI-sdata size\fP \fI-sstack size\fP \fI-sktext
size\fP \fI-skdata size\fP
\fI-ldata size\fP \fI-lstack size\fP \fI-lkdata size\fP
SPIM S20 is a simulator that runs programs for the MIPS R2000/R3000
RISC computers. (For a description of the real machines, see Gerry
Kane and Joe Heinrich, \fIMIPS RISC Architecture,\fP Prentice Hall,
1992.) SPIM can read and immediately execute files containing assembly
language or MIPS executable files. SPIM is a self-contained system
for running these programs and contains a debugger and interface to a
few operating system services.
SPIM comes in two versions. The plain version is called \fIspim\fP.
It runs on any type of terminal. It operates like most programs of
this type: you type a line of text, hit the \fIreturn\fP key, and
\fIspim\fP executes your command. The fancier version of SPIM is
called \fIxspim\fP. It uses the X-window system, so you must have a
bit-mapped display to run it. \fIxspim\fP, however, is a much easier
program to learn and use because its commands are always visible on
the screen and because it continually displays the machine's
\fIxspim\fP has many options:
.IP \fB-asm\fP 10
Simulate the virtual MIPS machine provided by the assembler. This is
.IP \fB-bare\fP 10
Simulate a bare MIPS machine without pseudo-instructions or the
additional addressing modes provided by the assembler. Implies
.IP \fB-trap\fP 10
Load the standard exception handler and startup code. This is the default.
.IP \fB-notrap\fP 10
Do not load the standard exception handler and startup code. This
exception handler handles exceptions. When an exception occurs, SPIM
jumps to location 0x80000080, which must contain code to service the
exception. In addition, this file contains startup code that invokes
the routine \fImain\fP. Without the startup routine, SPIM begins
execution at the instruction labeled \fI__start\fP.
.IP \fB-quiet\fP 10
Print a message when an exception occurs. This is the default.
.IP \fB-noquiet\fP 10
Do not print a message at exceptions.
.IP \fB-mapped_io\fP 10
Enable the memory-mapped IO facility. Programs that use SPIM syscalls
to read from the terminal \fBcannot\fP also use memory-mapped IO.
.IP \fB-nomapped_io\fP 10
Disable the memory-mapped IO facility.
.IP \fB-file file\fP 10
Load and execute the assembly code in the file.
.IP \fB-execute file\fP 10
Load and execute the MIPS \fIexecutable\fP (a.out) file. Only works
on systems using a MIPS processors.
.IP "\fB-stext size\fP \fB-sdata size\fP \fB-sstack size\fP \fB-sktext size\fP \fB-skdata size\fP" 10
Sets the initial size of memory segment \fPseg\fP to be \fIsize\fP
bytes. The memory segments are named: \fItext\fP, \fIdata\fP,
\fIstack\fP, \fIktext\fP, and \fIkdata\fP. The \fItext\fP segment
contains instructions from a program. The \fIdata\fP segment holds
the program's data. The \fIstack\fP segment holds its runtime stack.
In addition to running a program, SPIM also executes system code that
handles interrupts and exceptions. This code resides in a separate
part of the address space called the \fIkernel\fP. The \fIktext\fP
segment holds this code's instructions and \fIkdata\fP holds its data.
There is no \fIkstack\fP segment since the system code uses the same
stack as the program. For example, the pair of arguments \fI-sdata
2000000\fP starts the user data segment at 2,000,000 bytes.
.IP "\fB-ldata size\fP \fB-lstack size\fP \fB-lkdata size\fP" 10
Sets the limit on how large memory segment \fIseg\fP can grow to be
\fIsize\fP bytes. The memory segments that can grow are \fIdata\fP,
\fIstack\fP, and \fIkdata\fP.
.IP \fB-hexgpr\fP 10
Disply the general purpose registers (GPRs) in hexadecimal.
.IP \fB-nohexgpr\fP 10
Disply the general purpose registers (GPRs) in decimal.
.IP \fB-hexfpr\fP 10
Disply the floating-point registers (FPRs) in hexadecimal.
.IP \fB-nohexfpr\fP 10
Disply the floating-point registers (FPRs) as floating-point values
Instruction opcodes cannot be used as labels.
.SH "SEE ALSO"
James R. Larus, ``SPIM S20: A MIPS R2000 Simulator,''
included with SPIM distribution.
James R. Larus (email@example.com), Computer Sciences Department,
University of Wisconsin\-Madison.