Some SPIM Examples
Some simple SPIM
programs for common functions.
Program 
Description 
Reading and writing the data segment 

Console I/O 

Manipulating bytes 

Constructing a 

Performing bitwise 

Simple counting for 

Accessing elements 

Computing the sum 

Ifthenelse 

More complex 

Simple procedure 
An additional set of procedures and SPIM programs dealing arithmetic,
procedure calls, and floating point numbers can be found below (Unable
to determine the source for proper attribution but they are quite
helpful).
Program 
Description 
Arithmetic Mean of a single precision floating point array. 

Print a vector 

Print a vector of doubles 

Compute the Mean of Double Precision Numbers 

Working with Floating Point Numbers 

Unsigned Multiply 

Unsigned elementbuyelement multiply 

Example of division 

MutiplyDivide Example 

Cumulative Product 

Print Vector of Floats 