The terminal interface (spim) provides the following commands:
- exit
Exit the simulator.
- quit
Synonym for exit.
- read "file"
Read file of assembly
language commands into SPIM's memory. If the file has already been
read into SPIM, the system should be cleared (see reinitialize,
below) or global symbols will be multiply defined.
- load "file"
Synonym for read.
- run <addr>
Start running a program. If the
optional address addr is provided, the program starts at that
address. Otherwise, the program starts at the global symbol __start, which is defined by the default trap handler to call the
routine at the global symbol main with the usual MIPS calling
convention.
- step <N>
Step the program for N
(default: 1) instructions. Print instructions as they execute.
- continue
Continue program execution without
stepping.
- print $N
Print register N.
- print $fN
Print floating point register N.
- print addr
Print the contents of memory at
address addr.
- print_symbols
Print the contents of the symbol
table, i.e., the addresses of the global (but not local) symbols.
- print_all_regs <hex>
Print the contents of all
registers. If hex is specified, print them in hexadecimal.
- reinitialize
Clear the memory and registers.
- breakpoint addr
Set a breakpoint at address
addr. addr can be either a memory address or symbolic
label.
- delete addr
Delete all breakpoints at address
addr.
- list
List all breakpoints.
- dump "FILE"
Write the contents of the text
segment to FILE in network (big-endian) byte order. If FILE
is not specified, save to spim.dump.
- dumpnative "FILE"
Write the contents of the text
segment to FILE in the host's native byte order. If FILE
is not specified, save to spim.dump.
- .
Rest of line is an assembly instruction
that is stored in memory.
- <nl>
A newline reexecutes previous command.
- ?
Print a help message.
Most commands can be abbreviated to their unique prefix e.g., ex, re, l, ru, s, p. More dangerous
commands, such as reinitialize, require a longer prefix.
Ian Moor
2009-03-11