There is nothing to hand in for this assignment, but you should bring questions to class
on Wednesday.
Goals
- Read and understand a simple MIPS program
- Run a MIPS program on the MARS Simulator
Getting MARS
- Make sure you have Java 8 (or later) installed. You can tell that you have version 8 by
executing "java -version" or "javac -version"--it should reply with 1.8.something.
Java 8 is installed on macOS in the CS labs CMC 102, 304, 306, and 307, and in Weitz 138.
- Get the MARS Simulator.
(That's a Carleton-local copy of the file. You can also get it at the
MARS home page.)
- You should be able to just double-click on the Mars4_5.jar file to launch the simulator.
A first MIPS program
- Get the sum_odds.asm program.
- Launch MARS
- File->Open to open sum_odds.asm. You may have to move a sub-window boundary in MARS to see its text.
- Run->Assemble. (This operation is similar to "javac Whatever.java"—that is, it translates the MIPS
assembly language program into a MIPS machine language program.)
- Run->Go. Does it print out "25"? Yay, or yea, or however you wish to spell your delight.
What else
Read Chapter 2 to help you make sense of what's going on. Bring lots of questions on Wednesday.