Answered step by step
Verified Expert Solution
Question
1 Approved Answer
For this assignment, you will need to install a MIPS simulator called QTSpim. Install QTSpim here: http://spimsimulator.sourceforge.net/ Download and examine this code: sillycode-1.s . .text
For this assignment, you will need to install a MIPS simulator called QTSpim.
- Install QTSpim here: http://spimsimulator.sourceforge.net/
- Download and examine this code: sillycode-1.s .
- .text is an assembler directive to indicate the assembler that whatever follows is the code section. If you want to declare some global variable, do so under .data section. You can use this code snippet as a template for your own work. You can use a word editor like notepad to write code, but note that the extension is .s.
- Load this code into your simulator (File -> Load File -> sillycode.s). You may need to reinitialize simulator (Simulator -> Reinitialize) if you get an error during loading. The code can be run by clicking on the play button, but a better way is observing step by step command execution (F10).
- In sillycode, use F10 to navigate to the line of code highlighted below. jal main indicates the starting point of your line of code. The first column is the address of each line in instruction memory, the second column is the machine code translation (in hex) of the command being executed, the next two columns are the commands in assembly language. Note that some commands in 3rdand 4th columns look different, but one is a pseudo code representation of the other.
- You can keep using F10 to rerun the code. Also note how the last line of code is li $v0, 10 syscall Remember to always put these two lines at the end of every code piece you write on this simulator
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started