spim(1)
π« spim(1) β the manual page, but make it cute π«
okay bestie, gather round, because this is the spim(1) page from the General Commands Manual and it is genuinely iconic. it's giving "your fave simulator finally got a glow-up." π¦
β¨ NAME β¨
spim β a MIPS32 Simulator π
β¨ SYNTAX β¨
no cap, here's the whole vibe, exactly as it is:
spim [-asm/-bare -exception/-noexception -quiet/-noquiet
-mapped_io/-nomapped_io
-delayed_branches -delayed_loads
-stext size -sdata size -sstack size -sktext size
-skdata size -ldata size -lstack size -lkdata size
-file file <args> -execute file <args> ]
β¨ DESCRIPTION β¨
so SPIM S20 is a simulator that runs programs for the MIPS32 RISC computers. literally. SPIM can read files containing assembly language or MIPS executable files and immediately execute them. it's a whole self-contained system for running these programs, and it comes with a debugger plus an interface to a few operating system services. main character energy fr fr. π
SPIM shows up in two versions:
- the plain one is called
spimπΈ it runs on any type of terminal. it operates like most programs of this type: you type a line of text, hit the return key, andspimexecutes your command. simple, effective, we love her. - the fancier one is called
xspim⨠it uses the X-window system, so you must have a bit-mapped display to run it. that said,xspimis 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 registers. it's the upgraded version, iykyk.
β¨ OPTIONS β¨
spim has so many options. not me listing all of them. yes i am, obviously:
-asmβ simulate the virtual MIPS machine provided by the assembler. this one is the default, she's the moment.-bareβ simulate a bare MIPS machine with no pseudo-instructions and none of the additional addressing modes the assembler gives you. this implies-quiet.-exceptionβ load the standard exception handler and startup code. this is the default.-noexceptionβ do not load the standard exception handler and startup code. heads up though: this exception handler is the thing that handles exceptions. when an exception occurs, SPIM jumps to location0x80000080, which must contain code to service the exception. also, this file contains startup code that invokes the routinemain. without the startup routine, SPIM begins execution at the instruction labeled__start. so likeβ¦ know what you're doing, bestie. π-quietβ print a message when an exception occurs. this is the default.-noquietβ do not print a message at exceptions.-mapped_ioβ enable the memory-mapped IO facility. π«Ά real talk though: programs that use SPIM syscalls to read from the terminal cannot also use memory-mapped IO. pick a lane.-nomapped_ioβ disable the memory-mapped IO facility.-delayed_branchesβ simulate MIPS's delayed control transfers by executing the instruction after a branch, jump, or call before transferring control. SPIM's default is to simulate non-delayed transfers, unless the-bareflag is set.-delayed_loadsβ simulate MIPS's original, non-interlocked load instructions. SPIM's default is to simulate non-delayed loads, unless the-bareflag is set.-stext size,-sdata size,-sstack size,-sktext size,-skdata sizeβ sets the initial size of memory segment seg to be size bytes. the memory segments are named:text,data,stack,ktext, andkdata. here's the tea: thetextsegment contains instructions from a program. thedatasegment holds the program's data. thestacksegment holds its runtime stack. and in addition to running a program, SPIM also executes system code that handles interrupts and exceptions β that code resides in a separate part of the address space called the kernel. thektextsegment holds this code's instructions andkdataholds its data. there is nokstacksegment, since the system code uses the same stack as the program. for example, the pair of arguments-sdata 2000000starts the user data segment at 2,000,000 bytes. π-ldata size,-lstack size,-lkdata sizeβ sets the limit on how large memory segment seg can grow to be size bytes. the memory segments that can grow aredata,stack, andkdata. glow-up limits, basically. π±-file file <args>β load and execute the assembly code in the file with arguments <args>.-execute file <args>β load and execute the MIPS executable (a.out) file with arguments <args>. β οΈ only works on systems using MIPS processors, so vibe check your machine first.
β¨ BUGS β¨
instruction opcodes cannot be used as labels. that's it, that's the bug. not me exposing her like this π
β¨ SEE ALSO β¨
xspim(1)π- James R. Larus, ``SPIM S20: A MIPS R2000 Simulator,'' included with SPIM distribution.
β¨ AUTHOR β¨
James R. Larus, Computer Sciences Department, University of Wisconsin-Madison. current address: James R Larus (larus@microsoft.com), Microsoft Research. π
and that's the whole page, bestie β courtesy of the General Commands Manual, filed under spim(1), and yes it's spim(1) all the way down at the bottom too. slay. π
π¦ where this page comes from
- debian bookworm: spim 8.0+dfsg-6.1+b1
- debian trixie: spim 8.0+dfsg-7
- ubuntu jammy: spim 8.0+dfsg-6.1
- ubuntu noble: spim 8.0+dfsg-7
- ubuntu questing: spim 8.0+dfsg-8
- ubuntu resolute: spim 8.0+dfsg-8build1
- ubuntu stonking: spim 8.0+dfsg-8build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms