SPIM_tutor - SPIM A MIPS Simulator Introduction •...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: SPIM : A MIPS Simulator Introduction • What’s SPIM? • A simulator that runs programs for the MIPS R200 0/R3000 RISC processor • What does SPIM do? • Reads and executes MIPS assembly language files • Works as a debugger • Provides some OS like services Learning MIPS & SPIM • MIPS assembly is a low-level programming language • The best way to learn any programming language is to write code • We will get you started by going through a few example programs and explaining the key concepts • Tip : Start by copying existing programs and modifying them incrementally making sure you understand the behavior at each step • Tip : The best way to understand and remember a construct or keyword is to experiment with it in code , not by reading about it PCSpim Installation • Windows Installation • copy the file pcspim.zip from the book’s CD • you can download the file from • http://www.cs.wisc.edu/~larus/SPIM/pcspim.zip • unzip the file • run the setup.exe program PCSpim Windows Interface • Registers window • shows the values of all registers i n the MIPS CPU and FPU • Text segment window • shows assembly instructions & co rresponding machine code • Data segment window • shows the data loaded into the pr ogram’s memory and the data of t he program’s stack • Messages window • shows PCSpim messages Separate console window appears for I/O Using SPIM • Loading source file • Use File -> Open menu • Simulation • Simulator -> Settings… : • in the Display section check only the first two items Save window positions and General registers in hexadecimal • in the Execution section check only Allow pseudo instruction • Simulator -> Set Value… : to load PC with address of first instruction • enter Address or Register Name as “PC” and enter Value as “0x00400000” • reason: the text area of memory, where programs are stored, starts here I m p o r t a n t ! ! Using SPIM • Simulator -> Go : run loaded program • Click the OK button in the Run Parameters pop-up window if the StartingAddress: value is “0x00400000” • Simulator -> Break : stop execution • Simulator-> Clear Registers and Reinitialize : clean-up before new run Using SPIM • Simulator -> Reload : load file again after editing • Simulator -> Single Step or Multiple Step : stepping to deb ug • Simulator -> Breakpoints : set breakpoints • Notes: • text segment window of SPIM shows assembly and corresponding machine code • pseudo-instructions each expand to more than one machine instruction MIPS Assembly Code Layout...
View Full Document

This note was uploaded on 03/28/2010 for the course ECE 3dg5 taught by Professor Fredic during the Spring '10 term at Abant İzzet Baysal University.

Page1 / 29

SPIM_tutor - SPIM A MIPS Simulator Introduction •...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online