Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,

Slides:



Advertisements
Similar presentations
Lecturer PSOE Dan Garcia
Advertisements

MIPS assembly. Review  Lat lecture, we learnt  addi,  and, andi, or, ori, xor, xori, nor,  beq, j, bne  An array is stored sequentially in the memory.
The 8051 Microcontroller and Embedded Systems
5Z032 Processor Design SPIM, a MIPS simulator Henk Corporaal
1 Procedure Calls, Linking & Launching Applications Lecture 15 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
ECE 15B Computer Organization Spring 2010 Dmitri Strukov Lecture 5: Data Transfer Instructions / Control Flow Instructions Partially adapted from Computer.
SPIM and MIPS programming
Fall EE 333 Lillevik 333f06-l4 University of Portland School of Engineering Computer Organization Lecture 4 Assembly language programming ALU and.
MIPS Function Continued
MIPS Assembly Language Programming
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
1 Computer Architecture MIPS Simulator and Assembly language.
The University of Adelaide, School of Computer Science
Assembly Language Working with the CPU.
1 COMS 361 Computer Organization Title: Instructions Date: 9/28/2004 Lecture Number: 10.
ECE 0142 Recitation #5.
Assembly Process. Machine Code Generation Assembling a program entails translating the assembly language into binary machine code This requires more than.
ENEE350 Spring07 1 Ankur Srivastava University of Maryland, College Park Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005.”
MIPS Assembler Programming
SPIM : A MIPS Simulator Archi & Net Lab 이용석
1 CS 430 Computer Architecture Clap if you like pizza! Pointless Poll.
Lecture 5: Procedures. Function call book-keeping in C main() { int i,j,k,m;... i = mult(j,k);... m = mult(i,i);... } /* really dumb mult function */
VHDL Synthesis of a MIPS-32 Processor Bryan Allen Dave Chandler Nate Ransom.
MIPS Instruction Set Advantages
19/02/2009CA&O Lecture 05 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: PCSpim Tutorial Engr. Umbreen Sabir Computer Engineering.
First Programming Assignment For MIPS R3000 Processor Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki.
IT253: Computer Organization Lecture 5: Assembly Language and an Introduction to MIPS Tonga Institute of Higher Education.
1 Compilers Modern Compiler Design Supplementary Note 2 SPIM Overview NCYU C. H. Wang.
MIPS coding. slt, slti slt $t3, $t1, $t2 – set $t3 to be 1 if $t1 < $t2 ; else clear $t3 to be 0. – “Set Less Than.” slti $t3, $t1, 100 – set $t3 to be.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
MIPS coding. Review Shifting – Shift Left Logical (sll) – Shift Right Logical (srl) – Moves all of the bits to the left/right and fills in gap with 0’s.
MIPS coding. slt, slti slt $t3, $t1, $t2 – set $t3 to be 1 if $t1 < $t2 ; else clear $t3 to be 0. – “Set Less Than.” slti $t3, $t1, 100 – set $t3 to be.
Chapter 2 — Instructions: Language of the Computer — 1 Conditional Operations Branch to a labeled instruction if a condition is true – Otherwise, continue.
EEL5708/Bölöni Lec 3.1 Fall 2006 Sept 1, 2006 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Lecture 3 Review: Instruction Sets.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
MIPS assembly syntax Home Assignment 3 Assigned. Deadline 2016 February 14, Sunday.
The Assembly Process Computer Organization and Assembly Language: Module 10.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
MIPS Assembly Language Programming
Rocky K. C. Chang Version 0.1, 25 September 2017
Prof. Hsien-Hsin Sean Lee
MIPS Instruction Set Advantages
Introduction to Lab #1 José Nelson Amaral.
CS 286 Computer Organization and Architecture
MIPS Coding Continued.
MIPS assembly syntax Comments
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Adventures in Assembly Land
MIPS coding.
Lecture 4: MIPS Instruction Set
MPIS Instructions Functionalities of instructions Instruction format
MIPS coding.
The University of Adelaide, School of Computer Science
Computer Organization and Design Assembly & Simulation
Instruction encoding The ISA defines Format = Encoding
MIPS Coding.
Instruction encoding The ISA defines Format = Encoding
COMS 361 Computer Organization
Instruction encoding The ISA defines Format = Encoding
CS 286 Computer Organization and Architecture
Instruction encoding The ISA defines Format = Encoding
MIPS coding.
Adventures in Assembly Land
MIPS Assembly Language Programming Computer Architecture
Program Assembly.
Adventures in Assembly Land
Pointless Poll Clap if you like pizza!.
MIPS R3000 Subroutine Calls and Stack
Conditional Branching (beq)
Presentation transcript:

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:

Install SPIM

Start SPIM

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.

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

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.

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

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.

Assembler Syntax (cont.)

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