Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes...
-
Upload
naomi-foster -
Category
Documents
-
view
238 -
download
0
Transcript of Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes...
![Page 1: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/1.jpg)
Lecture # 1SPIM & MIPS Programming
![Page 2: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/2.jpg)
SPIMSPIM is a MIPS32 simulator that reads and
executes assembly language program written for SPIM.
Platform -Unix, Linux, Mac OS X, and Microsoft Windows
The homepage of SPIM:
http://pages.cs.wisc.edu/~larus/spim.html
![Page 3: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/3.jpg)
Install SPIM
![Page 4: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/4.jpg)
Start SPIM
![Page 5: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/5.jpg)
SPIM
![Page 6: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/6.jpg)
SPIM When PCSpim starts up, it brings up a large window on
your screen .The application window is divided into four parts:
1-The top section is the menu bar. The menu bar allows you to select File operations, set Simulator settings, select Windows views, and obtain online Help information.
2- The next section below the menu bar is the toolbar. The toolbar provides quick mouse access to many tools used in PCSpim for Windows.
![Page 7: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/7.jpg)
SPIM3- The large section in the middle of the application window is the
window display section. There are four display windows: Registers, Text Segment, Data Segment, and Messages.
To change the view of these four windows, you can select a tiled view from the menu bar: Windows->Tile.
All of the displaywindows will be empty when you first execute the program. The following list describes each display window. The Register window: display shows the values of all registers in
the MIPS CPU and FPU.The Text Segment window : display shows instructions both from
your program and the system code that is loaded automatically when PCSpim is running.
The Data Segment window :display shows the data loaded into your program’s memory and the data of the program’s stack.
The Messages window : display is the where PCSpim uses to write messages. This is where error messages appear.
![Page 8: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/8.jpg)
SPIM4- The Status bar section is at the bottom of the application
window. The status bar provides information and the current settings of the simulator.
![Page 9: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/9.jpg)
MIPS Assembly LanguageOperations code:add, sub, addi, addu, addiu, subulw, sw, lbu, sb, lui, oribeq, bne, slt, slti, sltuj , jr, jal
![Page 10: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/10.jpg)
Assembler SyntaxComments : in assembler files begin with a sharp-sign
(#).Identifers : are a sequence of alphanumeric
characters, underbars ( _ ), and dots (.) that do not begin with a number.
Opcodes : for instructions are reserved words that are not valid identifers.
Labels : are declared by putting them at the beginning of a line followed by a colon.
![Page 11: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/11.jpg)
Assembler Syntax (cont.)
![Page 12: Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,](https://reader036.fdocuments.net/reader036/viewer/2022062304/56649f2a5503460f94c44ed5/html5/thumbnails/12.jpg)
Data Types.word, .half -32/16 bit integer.byte -8 bit integer.ascii, .asciiz -string.double, .float -floating point.space n
Allocate n bytes of space in the current segment (which must be the data segment in SPIM).