COP 4600 Operating Systems Fall 2010

Slides:



Advertisements
Similar presentations
CPU Review and Programming Models CT101 – Computing Systems.
Advertisements

Chapter 9 TRAP Routines and Subroutines. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 9-2 Subroutines.
MIPS ISA-II: Procedure Calls & Program Assembly. (2) Module Outline Review ISA and understand instruction encodings Arithmetic and Logical Instructions.
ECE 232 L6.Assemb.1 Adapted from Patterson 97 ©UCBCopyright 1998 Morgan Kaufmann Publishers ECE 232 Hardware Organization and Design Lecture 6 MIPS Assembly.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
CS1104 – Computer Organization PART 2: Computer Architecture Lecture 4 Assembly Language Programming 2.
The University of Adelaide, School of Computer Science
Functions Functions and Parameters. History A function call needs to save the registers in use The called function will use the registers The registers.
Intro to Computer Architecture
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00 – 6:00 PM.
COP 5611 Operating Systems Spring 2010 Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM.
COP 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00-6:00 PM.
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
Communication Tran, Van Hoai Department of Systems & Networking Faculty of Computer Science & Engineering HCMC University of Technology.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
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.
Computer Architecture Instruction Set Architecture Lynn Choi Korea University.
CS41B MACHINE David Kauchak CS 52 – Fall Admin  Midterm Thursday  Review question sessions tonight and Wednesday  Assignment 3?  Assignment.
COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM.
(a) Parameter passing in a local procedure call: the stack before the call (b) The stack while the called procedure is active. count =
Lecture 18: 11/5/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Procedure Calls and the Stack (Lectures #18) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
Procedure Basics Computer Organization I 1 October 2009 © McQuain, Feng & Ribbens Procedure Support From previous study of high-level languages,
Procedure (Method) Calls Ellen Spertus MCS 111 September 25, 2003.
MAL 3 - Procedures Lecture 13. MAL procedure call The use of procedures facilitates modular programming. Four steps to transfer to and return from a procedure:
Computer Architecture CSE 3322 Lecture 4 crystal.uta.edu/~jpatters/cse3322 Assignments due 9/15: 3.7, 3.9, 3.11.
ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson Slides4-2.ppt Modification date: March 23, Procedures Essential ingredient of high level.
Chapter 10 Instruction Sets: Characteristics and Functions Felipe Navarro Luis Gomez Collin Brown.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
COMPUTER ORGANIZATION LECTURE 3: ISA YASSER MOHAMMAD.
COT 4600 Operating Systems Fall 2009 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:00-4:00 PM.
Efficient Software-Based Fault Isolation Authors: Robert Wahbe Steven Lucco Thomas E. Anderson Susan L. Graham Presenter: Gregory Netland.
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.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00 – 6:00 PM.
LECTURE 19 Subroutines and Parameter Passing. ABSTRACTION Recall: Abstraction is the process by which we can hide larger or more complex code fragments.
COT 4600 Operating Systems Spring 2011 Dan C. Marinescu Office: HEC 304 Office hours: Tu-Th 5:00 – 6:00 PM.
COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM.
WORKING OF SCHEDULER IN OS
COP 4600 Operating Systems Fall 2010
Computer Science 210 Computer Organization
Lecture 6: Assembly Programs
Procedures (Functions)
Procedures (Functions)
Functions and Procedures
COP 4600 Operating Systems Fall 2010
CS 301 Fall 2002 Control Structures
Subroutines … a 1st look procedures and functions in high level languages are modeled on subroutines typically, assembly code is very modular with.
COT 4600 Operating Systems Fall 2010
Instructions - Type and Format
CGS 3763 Operating Systems Concepts Spring 2013
COP 4600 Operating Systems Spring 2011
COT 5611 Operating Systems Design Principles Spring 2012
COT 5611 Operating Systems Design Principles Spring 2014
MIPS Instructions.
September 5 Fang-Yi’s Office Hours Friday 10am  12pm (and another TBD) Programming Language Issues (JAVA vs. C, Pointers vs. Arrays) Representations Instructions.
The University of Adelaide, School of Computer Science
COP 5611 Operating Systems Spring 2010
COP 4600 Operating Systems Fall 2010
CGS 3763 Operating Systems Concepts Spring 2013
COT 4600 Operating Systems Fall 2010
COP 5611 Operating Systems Spring 2010
COT 4600 Operating Systems Fall 2010
Program and memory layout
Program and memory layout
Program and memory layout
Program and memory layout
Procedure Support From previous study of high-level languages, we know the basic issues: - declaration: header, body, local variables - call and return.
Presentation transcript:

COP 4600 Operating Systems Fall 2010 Dan C. Marinescu Office: HEC 439 B Office hours: Tu-Th 3:30-4:30 PM

Lecture 9 – Tuesday September 21, 2010 Last time: Computer System Organization. Hardware and software modules. Optimization. DMA, memory mapped I/O. The file abstraction. Case studies: UNIX File System; URLs Today Soft modularity Procedure call conventions and the memory map; the stack. Errors. Strongly-typed languages help enforce modularity. Enforced modularity; message passing and the client-server model. Example of a client –server system: WWW. Client-server organization. Heterogeneity; little-endian and big-endian representation Timing, response time. Trusted intermediaries. Case study the X11 system. Peer-to-peer systems. Remote Procedure Call (RPC) Lecture10

Example: procedure MEASURE (func) start_time  GET_TIME(SECONDS) funct() end_time GET_TIME(SECONDS) return (end_time-start_time) procedure GET_TIME (units) timeCLOCK time  CONVERT_TO_UNITS(time,units) return time Lecture10

Machine code for MEASURE 100 ST R1,SP //save content of R1 on the stack 104 ADD 4, SP //increment stack pointer 108 ST R2, SP //save content of R2 on the stack 112 ADD 4, SP //increment stack pointer 116 LA R1, SECONDS //load address of the argument in R1 120 ST R1, SP // store address of the argument on the stack 124 ADD 4, SP // increment stack pointer 128 L A R1,148 // load return address in R1 132 ST R1, SP // store return address on the stack 136 ADD 4, SP //adjust top stack pointer 140 L A R1, 200 // load address of GET_TIME in R1 144 JMP R1 //transfer control to GET_TIME 148 S 4,SP // decrement stack pointer 152 L R2, SP // restore the contents of R2 156 S 4,SP // decrement stack pointer 160 L R1,SP // restore the contents of R1 164 S 4,SP // decrement stack pointer 168 ST R0, start // store result passed by GET_TIME in Ro into start Lecture10

Machine code for GET_TIME 200 L R1,SP //load address of the stack pointer in R1 204 S R1,8 //increment stack pointer 208 L R2, R1 //load address of the argument in R2 212 code for the body of GET_TIME 216 code for the body of GET_TIME 220 L R0, time // load in R0 the result 224 L R1,SP // reload in R1 address of the stack pointer 228 S R1,4 // decrement the stack pointer 231 L PC,R1 // load return address from stack into PC Lecture10

Procedure call convention Caller saves on the stack (after each operation it adjusts the SP) registers arguments return address transfers control to the calle (jump to its starting address) Calee loads from the stack the arguments carries out the desired calculation and load the results in a register (R0) transfers control back to the caller loads in the PC the return address to the caller adjusts the stack restores its registers Lecture10