Lab #1 PCSpim SPIM is a software simulator that loads and executes assembly language programs for the MIPS RISC computers. Download and install PCSpim.

Slides:



Advertisements
Similar presentations
SPIM Tutorial CSE 410 Computer Systems. Introduction SPIM: MIPS simulator –Reads/executes assembly source programs Does not execute binaries Download.
Advertisements

MIPS Assembly Language CPSC 321 Computer Architecture Andreas Klappenecker.
SPRING 2015 QtSpim Demo & Tutorial. 2 By DGP Outline How to write your own MIPS assembly language program How to use QtSpim simulator.
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.
Syscall in MIPS Xinhui Hu Yuan Wang.
MIPS Function Continued
MIPS Assembly Language Programming
Fibonacci with Loop int fib1(int i) { int f1 = 1; int f2 = 1; int f3;
1 Computer Architecture MIPS Simulator and Assembly language.
IT253: Computer Organization Lecture 6: Assembly Language and MIPS: Programming Tonga Institute of Higher Education.
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.
Chap.2: Instructions: Language of the computer Jen-Chang Liu, Spring 2006 Adapted from
ECE 232 L7.Simul.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 7 MIPS Assembly.
MIPS Assembly Language I Computer Architecture CPSC 321 Andreas Klappenecker.
SPIM : A MIPS Simulator Archi & Net Lab 이용석
1 Capstone projects supervised by Yinong Chen (1) Implementation of a Shell on Palm Hand Held Device (2) Building a Programmer’s Interface to the Palm.
1 Lecture 6: Compilers, the SPIM Simulator Today’s topics:  SPIM simulator  The compilation process Additional TA hours: Liqun Cheng, legion at.
On Textbook CD: SPIM Jen-Chang Liu, Simulation of a virtual machine Virtual machine (simulator) Differences between SPIM and real MIPS? No delayed.
MIPS Instruction Set Advantages
Computer Organization - Syscalls David Monismith Jan. 28, 2015 Based on notes from Patterson and Hennessy Text and from Dr. Bill Siever.
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
1 MIPS Assembly Language Programming CDA 3101 Discussion Section 03.
Hello World 2 What does all that mean?.
First Programming Assignment For MIPS R3000 Processor Department of Computer Science Southern Illinois University Edwardsville Fall, 2015 Dr. Hiroshi Fujinoki.
Comp Sci vars & expns 1 Ch. 4 Variables and Expressions.
2013 Computer Architecture Project MIPS Programming : Merge Sort ChangHyun Yun Room 236, Engineering Building.
2011 Computer Architecture Project #1 MIPS Programming: Merge Sort Ki Sup Hong Room 236, Engineering Building.
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.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Lecture # 1 SPIM & MIPS Programming. SPIM SPIM is a MIPS32 simulator that reads and executes assembly language program written for SPIM. Platform -Unix,
Ch2b- 2 EE/CS/CPE Computer Organization  Seattle Pacific University Thanks for all the Memory! When 32 registers just won’t do. Many times (almost.
Lecture 10: MIPS Simulator Today’s topic –SPIM Simulator Readings –Appendix B 1.
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.
More on MIPS programs n SPIM does not support everything supported by a general MIPS assembler. For example, –.end doesn’t work Use j $ra –.macro doesn’t.
Lecture 161 Lets examine a SPIM program in detail. io.asm This program is a simple routine which demonstrates input/output using assembly code. SPIM.
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.
The MIPS Processor Computer Organization The MIPS Processor Appendix A.
Intro to SPIM Justin Fiore Nathan Parish. Installing SPIM on Windows Download pcspim.zip from the SPIM website:
3-Apr-2006cse spim © 2006 DW Johnson and University of Washington1 SPIM simulator CSE 410, Spring 2006 Computer Systems
Computer Programming A simple example /* HelloWorld: A simple C program */ #include int main (void) { printf (“Hello world!\n”); return.
The Assembly Process Computer Organization and Assembly Language: Module 10.
CS334: Number Systems&& Mars simulator Lab 1_2. Ins.Ebtesam AL-Etowi Quizzes/Participation/Absence 5% Logisim/MIPS Programming5% CPU Design Project10%
MIPS simulators There are 3 widely used MIPS simulators PC-SPIM, MARS, QTSPIM. PC-SPIM (the one we should use) the oldest one with poor graphics Very simple.
Control Structures Computer Organization I 1 October 2009 © McQuain, Feng & Ribbens Conditional Control Structure if ( i < j ) goto A; else.
CS 312 Computer Architecture & Organization
Compsci 210 Tutorial Five.
MIPS Assembly Language Programming
MIPS Assembly Language Programming
MIPS Instruction Set Advantages
Introduction to Lab #1 José Nelson Amaral.
CS 286 Computer Organization and Architecture
ACOE301: Computer Architecture II Labs
MIPS coding.
Hello World 2 What does all that mean?.
Week 5 Computers are like Old Testament gods; lots of rules and no mercy. Joseph Campbell.
Assembler Directives Example program: .data # DATA segment city: .asciiz “Seattle” .align 2 num: .word 2210, 2341, 26, 0x022ec,
MIPS coding.
COMS 361 Computer Organization
CS 286 Computer Organization and Architecture
Review.
MIPS coding.
MIPS Assembly Language Programming Computer Architecture
Program Assembly.
CS 286 Computer Architecture & Organization
Week 5 Computers are like Old Testament gods; lots of rules and no mercy. Joseph Campbell.
Introduction to SPIM Simulator
Presentation transcript:

Lab #1 PCSpim SPIM is a software simulator that loads and executes assembly language programs for the MIPS RISC computers. Download and install PCSpim from Introduction to PCSpim can also be found there

Sample Program ## Your first MIPS assembly program ## Notice the stylized format of the code: 3 columns: ## (1) Optional labels, ## (2) Machine instructions, assembler directives and operands, ## (3) Optional comments: right of a '#' until end of line is ## ignored..data# "data section" global, static modifiable data SID:.word 50 spc1:.asciiz " " nl:.asciiz "\n" msg1:.asciiz "Hello, World\n" msg2:.asciiz "My name is: XXXXXXXXX\n" msg3:.asciiz "\nMy name is still XXXXXXXXX !\n"

Sample Program (cont’d).text# "text section" code and read-only data.globl main # declare main as a global symbol main:la $a0, msg1 li $v0, 4# "print string" system call syscall la $a0, msg2 li $v0, 4 syscall lw $a0, SID la $a1, spc1 Loop:beq $0, $a0, Exit add $a0, $a0, -1 li $v0, 1# "print int" system call syscall

Sample Program (cont’d) move $t0, $a0 move $a0, $a1 li $v0, 4 syscall move $a0, $t0 j Loop Exit:la $a0, msg3 li $v0, 4 syscall ## Exit from program li $v0, 10# "Exit" system call syscall

Requirements Type the MIPS sample program into a file using a text editor. Replace XXXXX by your name. Name the new file lab1.s Run PCSpim and load lab1.s Write a report (text file) on what the program does. Name the file lab1.rep Package the two files as lab1.zip and to grader Z. Yue with subject 350lab1 Due date 2/9 (Wed) 11:30 AM.