1 / 12

Computer Architecture Discussion

Computer Architecture Discussion. Lecture # 1 SPIM & MIPS Programming. SPIM. SPIM 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:

brianam
Download Presentation

Computer Architecture Discussion

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer Architecture Discussion Lecture # 1 SPIM & MIPS Programming

  2. SPIM • SPIM 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

  3. Install SPIM

  4. Start SPIM

  5. SPIM

  6. 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.

  7. SPIM 3- 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 display windows will be empty when you first execute the program. The following list describes each display window. • The Register window:shows the values of all registers in the MIPS CPU and FPU. • The Text Segment window :shows instructions both from your program and the systemcode that is loaded automatically when PCSpim is running. • The Data Segment window :shows the data loaded into your program’s memory and the data of the program’s stack. • The Messages window :where PCSpim uses to write messages. This is where error messages appear.

  8. SPIM 4- The Status bar section is at the bottom of the application window. The status bar provides information and the current settings of the simulator.

  9. MIPS Assembly Language • Operations code: • add, sub, addi, addu, addiu, subu • lw, sw, lbu, sb, lui, ori • beq, bne, slt, slti, sltu • j , jr, jal

  10. Assembler Syntax • Comments : 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.

  11. Assembler Syntax (cont.)

  12. 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).

More Related