Some SPIM Examples

 

Some simple SPIM programs to get you started. These are taken from the chapter on SPIM Programming from the reading assignments page

 

Program

Description

data.segment.s

Initializing the data segment

memory.example.s

Reading and writing the data segment

io.example.s

Console I/O

byte.example.s

Manipulating bytes from/to the data segment

constant.example.s

Constructing 32-bit constant

logical.example.s

Performing bit-wise logical operations

matrix.mult.s

More complex example of iterations, procedure calls and arithmetic