SPIM provides a simple terminal and a X-window interface. Both
provide equivalent functionality, but the X interface is generally
easier to use and more informative.
spim, the terminal version, and xspim, the X version, have
the following command-line options:
- -bare
Simulate a bare MIPS machine without
pseudoinstructions or the additional addressing modes provided by the
assembler. Implies -quiet -delayed_branches -delayed_loads.
- -asm
Simulate the virtual MIPS machine
provided by the assembler. This is the default.
- -delayed_branches
Simulate the branch delay
feature of bare MIPS machines; the instruction following a branch is
always executed, even if the branch succeeded.
- -delayed_loads
Simulate the load delay
feature of bare MIPS machines; a value loaded from memory is not
available in the register until two instruction cycles after the load.
- -pseudo
Accept pseudoinstructions in assembly
code.
- -nopseudo
Do not accept pseudoinstructions in
assembly code.
- -notrap
Do not load the standard trap
handler. This trap handler has two functions that must be assumed by
the user's program. First, it handles traps. When a trap occurs,
SPIM jumps to location 0x80000080, which should contain code to
service the exception. Second, this file contains startup code that
invokes the routine main. Without the trap handler, execution
begins at the instruction labeled __start.
- -trap
Load the standard trap handler. This
is the default.
- -trap_file
Load the trap handler in the file.
- -noquiet
Print a message when an exception
occurs. This is the default.
- -quiet
Do not print a message at an
exception.
- -nomapped_io
Disable the memory-mapped IO
facility (see Section
).
- -mapped_io
Enable the memory-mapped IO facility
(see Section
). Programs that use SPIM syscalls (see
Section
) to read from the terminal should not also use
memory-mapped IO.
- -file
Load and execute the assembly code in
the file.
- -sseg size Sets the initial size of memory segment
seg to be size bytes. The memory segments are named:
text, data, stack, ktext, and kdata.
For example, the pair of arguments -sdata 2000000 starts the
user data segment at 2,000,000 bytes.
- -lseg size Sets the limit on how large memory segment
seg can grow to be size bytes. The memory segments
that can grow are: data, stack, and kdata.
Subsections
Ian Moor
2009-03-11