Saturday, November 21, 2009




Register-Window(Show all the values of registers in the mips cpu)

Text Segment Window( Shows assembly instructions and corresponding machine code)


Data Segment window(shows data loaded in program memory and data of program stack)


Message Window(shows pcspim window)
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
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
MIPS assembly is a low-level programming language
The best way to learn any programming language is from live code
We will get you started by going through a few example programs and explaining the key concepts
Further, we have an Examples directory of several simple well-documented assembly programs for you to experiment with
We will not try to teach you the syntax line-by-line: pick up what you need from the book and on-line tutorials
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

Spim Tutorials

INTRODUCTION:

What is SPIM?
a simulator that runs assembly programs for MIPS R2000/R3000 RISC computers

What does SPIM do?
reads MIPS assembly language files and translates to machine language
executes the machine language instructions
shows contents of registers and memory
works as a debugger (supports break-points and single-stepping)
provides basic OS-like services, like simple I/O