MIPS Lab CMPE 142 – Operating Systems. MIPS Simulator First Time Startup Setting Options.

Slides:



Advertisements
Similar presentations
The University of Adelaide, School of Computer Science
Advertisements

Introduction to SPIM Simulator
©UCB CS 161 Lecture 4 Prof. L.N. Bhuyan
ECE 232 L6.Assemb.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 6 MIPS Assembly.
B1010 Assembly ENGR xD52 Eric VanWyk Fall Today Context of Assembly Your First Assembly Programs.
Procedure Calls Prof. Sirer CS 316 Cornell University.
MIPS Calling Convention Chapter 2.7 Appendix A.6.
Instruction Set Architecture Classification According to the type of internal storage in a processor the basic types are Stack Accumulator General Purpose.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
Procedures II (1) Fall 2005 Lecture 07: Procedure Calls (Part 2)
1 Computer Architecture MIPS Simulator and Assembly language.
The University of Adelaide, School of Computer Science
Procedure call frame: Hold values passed to a procedure as arguments
331 W02.1Spring 05 Announcements  HW1 is due on this Friday  Appendix A (on CD) is very helpful to HW1.
1 CSE SUNY New Paltz Chapter 3 Machine Language Instructions.
Intro to Computer Architecture
RISC Concepts, MIPS ISA and the Mini–MIPS project
CS162 Operating Systems and Systems Programming Lecture 4 Thread Dispatching September 10, 2008 Prof. John Kubiatowicz
331 W02.1Fall 2003 Announcements  HW1 is due on this Friday (Sept 12 th )  Appendix A is very helpful to HW1. Check out system calls on Page A-48. 
7/13/20151 Topic 3: Run-Time Environment Memory Model Activation Record Call Convention Storage Allocation Runtime Stack and Heap Garbage Collection.
331 Practice Exam.1Fall 2003 Naming Conventions for Registers 0$zero constant 0 (Hdware) 1$atreserved for assembler 2$v0expression evaluation & 3$v1function.
CS162 Operating Systems and Systems Programming Lecture 4 Thread Dispatching September 9, 2009 Prof. John Kubiatowicz
Calling Conventions Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University See P&H 2.8 and 2.12.
Some material taken from Assembly Language for x86 Processors by Kip Irvine © Pearson Education, 2010 Slides revised 2/2/2014 by Patrick Kelley.
Memory/Storage Architecture Lab Computer Architecture MIPS Instruction Set Architecture ( Supporting Procedures )
Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth.
CSE331 W02.1Irwin Fall 2001 PSU Computer Architecture Discussion Lecture # 2 MIPS Programming.
Functions and Procedures. Function or Procedure u A separate piece of code u Possibly separately compiled u Located at some address in the memory used.
Lecture 4: MIPS Subroutines and x86 Architecture Professor Mike Schulte Computer Architecture ECE 201.
1 CS/EE 362 Hardware Fundamentals Lecture 10 (Chapter 3: Hennessy and Patterson) Winter Quarter 1998 Chris Myers.
CSC139 Operating Systems Lecture 4 Thread Dispatching Adapted from Prof. John Kubiatowicz's lecture notes for CS162
Lecture 18: 11/5/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
1 Control Abstraction (Section ) CSCI 431 Programming Languages Fall 2003 A compilation of material developed by Felix Hernandez-Campos and Michael.
OCC - CS/CIS CS116-Ch00-Orientation Morgan Kaufmann Publishers ( Augmented & Modified by M.Malaty) 1CS 116 Fall 2003 Not quite finished Creating.
Lecture 19: 11/7/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Procedure Basics Computer Organization I 1 October 2009 © McQuain, Feng & Ribbens Procedure Support From previous study of high-level languages,
Computer Organization CS224 Fall 2012 Lessons 9 and 10.
1 Computer Architecture COSC 3430 Lecture 3: Instructions.
R3000/001 Assembly Programming using MIPS R3000 CPU R3000 CPU Chip Manufactured by IDT What is MIPS R3000 Processor? A 32-bit RISC CPU developed by MIPS.
Procedure (Method) Calls Ellen Spertus MCS 111 September 25, 2003.
Calling Conventions Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University See P&H 2.8 and 2.12.
Calling Conventions Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See P&H 2.8 and 2.12.
MicroComputer Engineering IntroLab1 page 1 Introduction Lab1  A crash course in assembler programming  Learn how a processor works!  Decode a coded.
Calling Conventions Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See P&H 2.8 and 2.12.
Computer Architecture CSE 3322 Lecture 4 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/10/09
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 8: MIPS Procedures and Recursion.
© G. Drew Kessler and William M. Pottenger1 Subroutines, Part 2 CSE 262, Spring 2003.
Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.
1 CS/COE0447 Computer Organization & Assembly Language Chapter 2 Part 3.
Function Calling. Mips Assembly Call and Return Steps for procedure calling –Save the return address –Jump to the procedure (function) –Execute the procedure.
DR. SIMING LIU SPRING 2016 COMPUTER SCIENCE AND ENGINEERING UNIVERSITY OF NEVADA, RENO Session 12 Procedure Calling.
CS35101 Computer Architecture Spring 2006 Week 2.
Computer Architecture & Operations I
Storage Classes There are three places in memory where data may be placed: In Data section declared with .data in assembly language in C - Static) On the.
Computer Science 210 Computer Organization
Computer structure: Procedure Calls
MIPS Assembly Language Programming
Procedures (Functions)
Procedures (Functions)
Assembly Programming using MIPS R3000 CPU
Application Binary Interface (ABI)
MIPS Instructions.
The University of Adelaide, School of Computer Science
Program and memory layout
Assembly Programming using MIPS R3000 CPU
Where is all the knowledge we lost with information? T. S. Eliot
Program and memory layout
Introduction Lab1 A crash course in assembler programming
MIPS R3000 Subroutine Calls and Stack
Presentation transcript:

MIPS Lab CMPE 142 – Operating Systems

MIPS Simulator First Time Startup Setting Options

Startup Screen e.g. No Program Loaded Yet.

After Loading a MIPS Assembly Source

Registers Code Segment Data Segment

0zero constant 0 1atreserved for assembler 2v0expression evaluation & 3v1function results 4a0arguments 5a1 6a2 7a3 8t0temporary: caller saves...(callee can clobber)‏ 15t7 16s0callee saves... (caller can ignore)‏ 23s7 24t8 temporary (cont’d)‏ 25t9 26k0reserved for OS kernel 27k1 28gpPointer to global area 29spStack pointer 30fpframe pointer 31raReturn Address (HW)‏ MIPS: Software conventions for Registers Before calling procedure: –Save caller-saves regs –Save v0, v1 –Save ra After return, assume –Callee-saves reg OK –gp, sp, fp OK (restored!)‏ –Other things trashed A()‏B()‏ A() { B() ; }

Examples Try these out… Load them (source in zip file) and single step execution in the simulator

Simple Stack Example

Single Step This Code… File: mips.stack.register.s

Challenge Problem Try to implement in MIPS Assembly the following slide from Lecture. HINT: Read Section 3.1 Function Environments and Linkage and Look at the TREESORT.ASM example in the MIPS Assembly Tutorial Also, use MIPS SDE Lite to view MIPS Assembly for the C code.

Execution Stack Example Stack holds temporary results Permits recursive execution Crucial to modern languages A(int tmp) { if (tmp<2)‏ B(); printf(tmp); } B() { C(); } C() { A(2); } main() { A(1); } A: tmp=2 ret=C+1 Stack Pointer Stack Growth A: tmp=1 ret=exit B: ret=A+2 C: ret=b+1

Register Usage is by Convention

MIPS Instruction Set Overview

END LAB