CSCE 212 Quiz 2 – 2/2/11 1.What is the purpose of the jal instruction? 2.What are the two conditional branching (if, goto; not the slt instruction) instructions.

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

Procedures 2 Intructions Supporting Procedures Making Use of a Stack.
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.
Branches Two branch instructions:
The University of Adelaide, School of Computer Science
Lecture 20: 11/12/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /15/2013 Lecture 11: MIPS-Conditional Instructions Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER.
Solution 2nd Exam.
Lecture 6: MIPS Instruction Set Today’s topic –Control instructions –Procedure call/return 1.
Assembly Code Example Selection Sort.
The University of Adelaide, School of Computer Science
Computer Organization CS224
Computer Architecture CSCE 350
1 Nested Procedures Procedures that don't call others are called leaf procedures, procedures that call others are called nested procedures. Problems may.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
The University of Adelaide, School of Computer Science
Apr. 12, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 6: Branching and Procedures in MIPS* Jeremy R. Johnson Wed. Apr. 12, 2000.
Lecture 8: MIPS Instruction Set
Solution to Problem Recitation #1 (Week 2) ECEN350 Prof. Choi.
MIPS Assembly Language
MIPS Coding. Exercise – the bubble sort 5/8/2015week04-3.ppt2.
CSCE 212 Quiz 8 – 3/23/11 1.What type of element is the ALU (combinational or state) and what does it mean for an element to be that type? 2.What is the.
Intro to Computer Architecture
CSCE 212 Quiz 9 – 3/30/11 1.What is the clock cycle time based on for single-cycle and for pipelining? 2.What two actions can be done to resolve data hazards?
1 Answers to Test 2, Question 1 The functions receives the radius and height of a cylinder (גליל) and returns its volume (נפח). const float PI=3.14 float.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Hao Ji.
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 */
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
Procedures 2a MIPS code examples Making Use of a Stack.
CSCI-365 Computer Organization Lecture Note: Some slides and/or pictures in the following are adapted from: Computer Organization and Design, Patterson.
1 Branches and Procedure Calls Lecture 14 Digital Design and Computer Architecture Harris & Harris Morgan Kaufmann / Elsevier, 2007.
Procedure (Method) Calls Ellen Spertus MCS 111 September 25, 2003.
April 23, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 9: Assemblers, Linkers, and Loaders * Jeremy R. Johnson Mon. April 23,
Lecture 4: MIPS Instruction Set
Subroutines, parameters and the stack Bryan Duggan.
Computer Architecture CSE 3322 Lecture 4 crystal.uta.edu/~jpatters/cse3322 Assignments due 9/15: 3.7, 3.9, 3.11.
1 Answer #1, Quiz #1 Lp:slt $t0,$s1,$s2 # $t0 = a
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
MIPS Subroutines Subroutine Call – jal subname Saves RA in $31 and jumps to subroutine entry label subname Subroutine Return – jr $31 Loads PC with return.
CMPUT Computer Organization and Architecture I1 CMPUT229 - Fall 2003 Topic4: Procedures José Nelson Amaral.
CPEG323 Homework Review I Long Chen October, 17 th, 2005.
Computer Architecture & Operations I
Function Calls in MIPS To call a function: jal func
Rocky K. C. Chang Version 0.1, 25 September 2017
MIPS Procedures.
Lecture 4: MIPS Instruction Set
ELEN 468 Advanced Logic Design
Computer Architecture & Operations I
Decision Making.
Procedures (Functions)
Instructions for Making Decisions
CSCI206 - Computer Organization & Programming
MIPS Procedures.
Addressing in Jumps jump j Label go to Label op address 2 address
MIPS Functions.
ECE232: Hardware Organization and Design
The University of Adelaide, School of Computer Science
MIPS Functions.
Lecture 5: Procedure Calls
MIPS functions.
MIPS Procedures.
MIPS function continued
Systems Architecture I
MIPS e pipelining Tecniche di base.
MIPS assembly.
Computer Architecture
7/6/
9/13/
MIPS instructions.
Presentation transcript:

CSCE 212 Quiz 2 – 2/2/11 1.What is the purpose of the jal instruction? 2.What are the two conditional branching (if, goto; not the slt instruction) instructions and what does each do? 3.What are the two instructions needed to push the value of $s4 onto the stack?

CSCE 212 Quiz 2 Answers 1.What is the purpose of the jal instruction? – Simultaneously jumps and stores the next instruction’s address in the $ra register

CSCE 212 Quiz 2 Answers 2.What are the two conditional branching (if, goto; not the slt instruction) instructions and what does each do? – beq (branch if equal): branches to a given place if the values in 2 registers are equal; eg. beq $s1, $s2, L1 – bne (branch if not equal: branches if the values are not equal; eq. bne $a0, $t3, Exit

CSCE 212 Quiz 2 Answers 3.What are the two instructions needed to push the value of $s4 onto the stack? – addi $sp, $sp, -4 sw $s4, 0($sp)