CSCI 221 F20Lec 09-1MIPS32 Programming Below are several examples of MIPS32 programs that can be run within the SPIM simulator. They are all variations of summing a sequence of integers, many of them using SPIM’s sum1to100.s You can run each of these in the SPIM simulator. To obtain a copy of the simulator click on this “tarball” link. You’ll obtain a compressed binary archive file that contains the C source code for the simulator. Type the following commands in the console while in your MIPS work folder:
This will make the SPIM simulator as an executable file named
The last line will actually run SPIM on a simple MIPS32 assembly program, one that greets the world. To instead run our sample code, type something like
It will run to completion, doing its work silently. A more interesting program to run is
There are several resources you can access to learn the details of MIPS and SPIM, listed below: |