331 Practice Exam.1Fall 2003 Naming Conventions for Registers 0$zero constant 0 (Hdware) 1$atreserved for assembler 2$v0expression evaluation & 3$v1function.

Slides:



Advertisements
Similar presentations
1 Lecture 3: MIPS Instruction Set Today’s topic:  More MIPS instructions  Procedure call/return Reminder: Assignment 1 is on the class web-page (due.
Advertisements

Goal: Write Programs in Assembly
Review of the MIPS Instruction Set Architecture. RISC Instruction Set Basics All operations on data apply to data in registers and typically change the.
Lecture 5: MIPS Instruction Set
Branches Two branch instructions:
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
©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.
CMPT 334 Computer Organization Chapter 2 Instructions: Language of the Computer [Adapted from Computer Organization and Design 5 th Edition, Patterson.
Procedure call frame: Hold values passed to a procedure as arguments
CML CML CS 230: Computer Organization and Assembly Language Aviral Shrivastava Department of Computer Science and Engineering School of Computing and Informatics.
CSE431 L02 MIPS ISA Review.1Irwin, PSU, 2005 CSE 431 Computer Architecture Fall 2005 Lecture 02: MIPS ISA Review Mary Jane Irwin (
CSE331 W02.1Irwin&Li 2006 PSU CSE 331 Computer Organization and Design Fall 2006 Adaptado a DSD. R. Pereira Section 1: Mary Jane Irwin (
331 W05.1Fall :332:331 Computer Architecture and Assembly Language Fall 2003 Week 5 [Adapted from Dave Patterson’s UCB CS152 slides and Mary Jane.
331 Week 3. 1Spring 2005 Review: MIPS Organization Processor Memory 32 bits 2 30 words read/write addr read data write data word address (binary) 0…0000.
14:332:331 Computer Architecture and Assembly Language Spring 06 Week 4: Addressing Mode, Assembler, Linker [Adapted from Dave Patterson’s UCB CS152 slides.
331 W07.1Spring :332:331 Computer Architecture and Assembly Language Spring 2006 Week 7 ALU Design [Adapted from Dave Patterson’s UCB CS152 slides.
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.
S. Barua – CPSC 440 CHAPTER 2 INSTRUCTIONS: LANGUAGE OF THE COMPUTER Goals – To get familiar with.
Homework #2  Write a Java virtual machine interpreter  Use x86 Assembly  Must support dynamic class loading  Work in groups of 10  Due Midnight.
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. 
331 Week 3. 1Fall 2003 Head’s Up  This week’s material l MIPS control flow operations (for, while, if-the-else, …) -Reading assignment - PH 3.5  Reminders.
The MIPS 32 Our objective is to get an appreciation with: working with a “typical” computer machine language. programming in assembly language. debuging.
Lecture 7: MIPS Instruction Set Today’s topic –Procedure call/return –Large constants Reminders –Homework #2 posted, due 9/17/
Lecture 4 section 2.4-?? As opposed to CISC – Complicated Instruction Set Architecture (ala the x86)
CS.305 Computer Architecture Computer Abstractions and Technology Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
CMPT 334 Computer Organization
Some material taken from Assembly Language for x86 Processors by Kip Irvine © Pearson Education, 2010 Slides revised 2/2/2014 by Patrick Kelley.
CSE331 W03.1Irwin&Li Fall 2006 PSU CSE 331 Computer Organization and Design Fall 2006 Week 3 Section 1: Mary Jane Irwin (
Topic IIa Instruction Set Architecture and MIPS
Computer Engineering IntroLab1 page 1 Beginners explanation on how a processor works! The labs will teach you the truth.
IT253: Computer Organization Lecture 5: Assembly Language and an Introduction to MIPS Tonga Institute of Higher Education.
CSE331 W02.1Irwin Fall 2001 PSU Computer Architecture Discussion Lecture # 2 MIPS Programming.
CS35101 Computer Architecture Spring 2006 Week 5 Paul Durand ( Course url:
08/08/ COM181 Computer Hardware Lecture 4: The MIPs CPU Ian McCrumRoom 5B18, Tel: voice mail.
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.
1 Computer Architecture COSC 3430 Lecture 3: Instructions.
COSC 2021: Computer Organization Instructor: Dr. Amir Asif Department of Computer Science York University Handout # 3: MIPS Instruction Set I Topics: 1.
1 Branches and Procedure Calls Lecture 14 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
CS Computer Architecture Spring 2006 Week 4 Paul Durand ( Course url:
CSIE30300 Computer Architecture Unit 02: MIPS ISA Review Hsin-Chou Chi [Adapted from material by and
CSE 340 Computer Architecture Spring 2014 MIPS ISA Review.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
CS Computer Architecture Spring 2006 Week 6/7 Paul Durand ( Course url:
Lecture 4: MIPS Instruction Set
MicroComputer Engineering IntroLab1 page 1 Introduction Lab1  A crash course in assembler programming  Learn how a processor works!  Decode a coded.
IFT 201: Unit 1 Lecture 1.3: Processor Architecture-3
Digital Systems Design L02 MIPS ISA Review.1 Digital Systems Design Lecture 02: MIPS ISA Review Adapted from Mary Jane Irwin ( )
Intro & ISA.1 1/14 Instruction Set Architecture (ISA) (Ch: , th ed) Instructions: Language of the Computer Dr. Khaled El-Ayat.
Computer Architecture CSE 3322 Lecture 3 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/3/09 Read 2.8.
Computer Architecture CSE 3322 Lecture 4 Assignment: 2.4.1, 2.4.4, 2.6.1, , Due 2/10/09
CPE 232 MIPS ISA1 CPE 232 Computer Organization MIPS ISA Dr. Gheith Abandah [Adapted from the slides of Professor Mary Irwin ( which.
Lecture 2: Instruction Set Architecture part 1 (Introduction) Mehran Rezaei.
MIPS Lab CMPE 142 – Operating Systems. MIPS Simulator First Time Startup Setting Options.
CSE 340 Computer Architecture Summer 2016 MIPS ISA Review.
CSE331 W02.1Irwin 2007 PSU CSE 331 Computer Organization and Design Fall 2007 Week 2 Section 1: Mary Jane Irwin (
CS35101 Computer Architecture Spring 2006 Week 2.
Computer Architecture & Operations I
Lecture 4: MIPS Instruction Set
RISC Concepts, MIPS ISA Logic Design Tutorial 8.
Assembly Programming using MIPS R3000 CPU
The University of Adelaide, School of Computer Science
Lecture 4: MIPS Instruction Set
ECE232: Hardware Organization and Design
The University of Adelaide, School of Computer Science
Assembly Programming using MIPS R3000 CPU
Computer Architecture
7/6/
Presentation transcript:

331 Practice Exam.1Fall 2003 Naming Conventions for Registers 0$zero constant 0 (Hdware) 1$atreserved for assembler 2$v0expression evaluation & 3$v1function results 4$a0arguments 5$a1 6$a2 7$a3 8$t0temporary: caller saves...(callee can clobber) 15$t7 16$s0callee saves... (caller can clobber) 23$s7 24$t8 temporary (cont’d) 25$t9 26$k0reserved for OS kernel 27$k1 28$gppointer to global area 29$spstack pointer 30$fpframe pointer 31$rareturn address (Hdware)

331 Practice Exam.2Fall 2003 Review: MIPS ISA, so far CategoryInstrOp CodeExampleMeaning Arithmetic (R & I format) add0 and 32add $s1, $s2, $s3$s1 = $s2 + $s3 subtract0 and 34sub $s1, $s2, $s3$s1 = $s2 - $s3 add immediate8addi $s1, $s2, 6$s1 = $s2 + 6 or immediate13ori $s1, $s2, 6$s1 = $s2 v 6 Data Transfer (I format) load word35lw $s1, 24($s2)$s1 = Memory($s2+24) store word43sw $s1, 24($s2)Memory($s2+24) = $s1 load byte32lb $s1, 25($s2)$s1 = Memory($s2+25) store byte40sb $s1, 25($s2)Memory($s2+25) = $s1 load upper imm15lui $s1, 6$s1 = 6 * 2 16 Cond. Branch (I & R format) br on equal4beq $s1, $s2, Lif ($s1==$s2) go to L br on not equal5bne $s1, $s2, Lif ($s1 !=$s2) go to L set on less than0 and 42slt $s1, $s2, $s3if ($s2<$s3) $s1=1 else $s1=0 set on less than immediate 10slti $s1, $s2, 6if ($s2<6) $s1=1 else $s1=0 Uncond. Jump (J & R format) jump2j 2500go to jump register0 and 8jr $t1go to $t1 jump and link3jal 2500go to 10000; $ra=PC+4

331 Practice Exam.3Fall 2003 Question I: Processor Memory Addressable locations read addr/ write addr read data write data 2 32 Assume that memory has 2 32 addressable locations, and MIPS is 32-bit architecture. Please specify the width of the following address and data lines between the processor and the memory.

331 Practice Exam.4Fall 2003 Question II:  Question 3.10 on page 199 (PH text book)  Question 3.5 on page 198 (PH text book)

331 Practice Exam.5Fall 2003 Question III:  What if the branch destination is further away than can be captured in 16 bits? What can the assembler do to alleviate this problem? beq$s0, $s1, L1

331 Practice Exam.6Fall 2003 Question IV: Give the machine code for the following assembly code segment: (you may use the combination of decimal, hexidecima, and/or binary encodings.) 0x Loop:add $t1, $s3, $s3 add $t1, $t1, $t1 add $t1, $t1, $s6 lw $t0, 0($t1) bne $t0, $s5, Exit add $s3, $s3, $s4 j Loop Exit: