100% found this document useful (1 vote)
508 views6 pages

QtSpim Tutorial

This document provides an overview and instructions for installing and using QtSPIM, a MIPS assembly language simulator. It discusses: 1. How to install QtSPIM and its dependencies on Linux. 2. The main components of the QtSPIM interface - the register panel, memory panel, and messages panel. 3. How to load and run a sample MIPS assembly program called example1.asm using the QtSPIM interface. Users can step through the program instruction-by-instruction or run it to completion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
508 views6 pages

QtSpim Tutorial

This document provides an overview and instructions for installing and using QtSPIM, a MIPS assembly language simulator. It discusses: 1. How to install QtSPIM and its dependencies on Linux. 2. The main components of the QtSPIM interface - the register panel, memory panel, and messages panel. 3. How to load and run a sample MIPS assembly program called example1.asm using the QtSPIM interface. Users can step through the program instruction-by-instruction or run it to completion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

QtSpimTutorial

Contents
1.
2.
3.
4.

Installation
Usage
Overview
FirstProgram

Installation
WewillbeusingSPIM,aMIPSsimulator,inordertolearnassemblyprogramming.Thecurrent
versionofSPIMis"QtSPIM",akaSPIMusingtheQtcrossplatformapplicationGUIframework:
InstalltheQtframeworkthatSPIMrequires:
unix>sudoaptgetinstallqt4devtoolsqt4doclibqt4help

DownloadaprepackagedversionofSPIMforLinuxthatusestheQtGUIframework:(Ifyouare
runninganolder32bitLinuxinstallation,change64to32below)
unix>wgethttp://sourceforge.net/projects/spimsimulator/files/qtspim_9.1.12_linux64.deb

InstalltheQtSPIMpackage:
unix>sudodpkgiqtspim_9.1.12_linux64.deb

Usage
TolaunchQtSPIM:
unix>qtspim&

Overview
AfterlaunchingQtSPIM,themainwindowshouldappearasshownbelow.


Therearethreeprimarysectionscontainedwithinthiswindow:TheRegisterpanel,Memorypanel,
andMessagespanel.
RegisterPanel
TheRegisterpanel(shownbelow)showsthecontentsofalltheMIPSregisters.Therearetwotabsin
thispanel:oneforthefloatingpointregistersandonefortheintegerregisters.Theintegerregisters
includegeneralpurposeregisters(R1R31),alongwithspecialpurposeregisterssuchasthe
ProgramCounter(PC).


MemoryPanel
TheMemorypanelhastwotabs:DataandText.TheTexttabshowsthecontentsoftheProgram
memoryspace.Fromlefttoright,thisincludes:
1. Thememoryaddressofaninstructioninhexadecimal(showninbrackets)
2. Thecontentsofthatmemoryaddressinhexadecimal.Inbinaryform,thisistheactualMIPS
instructionthattheprocessorruns!
3. The"humanreadable"assemblylanguageinstructionusingthehardwareregisternumbers
(showninbold).
4. Theassemblylanguageprogramyouwroteusingsymbolicregisternamesandmemory
addresssymbols(showninitalics)


TheDatatabshowsthecontentsoftheDatamemoryspace.Thisincludesthevariablesandarray
datayoucreate,alongwiththestackcontent.


MessagesPanel
TheMessagespaneldisplaysmessagesfromQtSPIMtotheuser.

FirstProgram
AvarietyofMIPSexampleprogramsareavailabletoyou.Startwiththefirstprogram
example1.asmbydownloadingittoyourcomputer.
LoadyourfirstprogrambyselectingFile>ReinitializeandLoadFile.(RecallthatthenewUbuntu
"Unity"GUIdoesn'tshowthetopofscreenmenubaruntilyoumouseoverit).Thisclearstheregister
spaceandresetsthesimulator.(Otherwise,youcouldloadandrunseveralprogramsinarowonthe
samemachinestate.)
YoucanscrolldownintheTextpanetoseethattheassemblycodehasbeenloadedintoProgram
memoryspace.Inthiscase,thefirstinstructionisatmemorylocation0x00400024.(Whydoesn'tit
startatmemoryaddresszero?Theprogramstartswiththefunctionmain(),butthereissomecode

thatrunsbeforemain).
Nowthattheprogramhasbeenloaded,youcanrunasimulationoftheassemblyinstructions.You
havethreechoices:
1. Runtheprogramfrombeginningtoend(viathe"play"Run/ContinuebuttonorF5).Thisisuseful
forseeingthefinaloutputoftheprogram.
2. Stepthroughtheprogramonelineatatime(viathe"123"SingleStepbuttonorF10).Thisis
usefultoseehoweachassemblyinstructionaffectsthemachinestate(i.e.memoryandregister
values).
3. Runtheprogramuntilyoureachabreakpoint(whichcanbesetbyrightclickingonanylinein
theMemorypanel.

Stepthroughthecompleteprogram,figureoutwhatitdoes,andmakesureyouunderstandhowthe
QtSPIMenvironmentworks.

You might also like