{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SPIM_tutor - SPIM A MIPS Simulator Introduction Whats SPIM...

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

View Full Document Right Arrow Icon
SPIM : A MIPS Simulator
Background image of page 1

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

View Full Document Right Arrow Icon
Background image of page 2
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
Background image of page 3

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

View Full Document Right Arrow Icon
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
Background image of page 4
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
Background image of page 5

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

View Full Document Right Arrow Icon
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
Background image of page 6
Background image of page 7

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

View Full Document Right Arrow Icon
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 Important!!
Background image of page 8
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
Background image of page 9

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

View Full Document Right Arrow Icon
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
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}