PDF-Lab Subroutines and the Stack

Author : debby-jeon | Published Date : 2014-12-13

1 Objectives A subroutine is a reusable program module A main program can call or jump to t he subroutine one or more times The stack is used in several ways whe

Presentation Embed Code

Download Presentation

Download Presentation The PPT/PDF document "Lab Subroutines and the Stack" is the property of its rightful owner. Permission is granted to download and print the materials on this website for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.

Lab Subroutines and the Stack: Transcript


1 Objectives A subroutine is a reusable program module A main program can call or jump to t he subroutine one or more times The stack is used in several ways whe n subroutines are called In this lab you will learn How to write subroutines and call th. reasons for subroutines. repeat . same code, or similar code with slightly different parameters. hide . design decisions or design complexity. partition . off code likely to change. provide . for separate compilation. or, Event-driven Programming is Not the Opposite of Threaded Programming. Atul. . Adya. , Jon Howell, Marvin . Theimer. , William J. . Bolosky. , John R. Douceur. Microsoft Research. Presented by . Poonam. Subroutines . and Stacks. 1. Subroutines. Separate, independent module of program, performs a specific task. shortens code, provide reusable “tools”. High-level languages typically have libraries of subroutines.. CP212. Winter 2012. Topics. Subroutines. Functions. Modular programming. 3 Main Benefits. Variable and Subroutine Scope. Using and Passing Parameters. Module level "Global" variables. Passing arrays. Lecture 7: Subroutines and stack framesParameter passing though the stackAn exampleLocal variables and the stack frameand ULNK instructionsParameter passing through stack framesAn exampleThe need for Call . suba. Call . suba. Call . suba. Next instruction. Next instruction. Next instruction. Start of subroutine. Subroutine . suba. Jump back. Only one copy of the code is placed in memory. Whenever we wish to use the code, a jump is made to it . 2 implementations of the Stack abstract data type:. Array. Linked List. Program design: modularity, abstraction and information hiding. What is a Stack?. stack:. abstract data type that represents a collection of elements. Branches . and Subroutines. Estimated . time . to . complete this lesson: 1 hour. In this lesson, you will . learn . how to:. Code Branches . and Subroutines. . Create subroutines by . using . Sub. and . Why is starch agar used?. -To see if saliva was present and broke down the starch.. Positive control . –used to show what the change looks like. Negative control. – used to what no change looks like. Irvine, Kip R. Assembly Language for x86 Processors 7/e, 2015.. 2. Stack Frames. Stack Parameters. Local Variables. ENTER and LEAVE Instructions. LOCAL Directive. WriteStackFrame Procedure. Irvine, Kip R. Assembly Language for x86 Processors 7/e, 2015.. Lucy Rycroft-Smith & Darren Macey. . Who are you?. Probability . vs. Intuition. In the first ‘turn’ what is the probability of a 5-camel stack occurring?. If . n. camels start in a full . n. push. pop. LIFO . list - only top element is visible. t. op. Defining the ADT . "Stack". Data. :. a linear collection of data items in which all operations occur at one end, called the . top. Basic Operations. p6 red black stack results. p6 red vs p6 extreme. p6 red and black stack reviews. Technical writing jobs from home vancouver peoplesoft work at home online getting rally broker information typing job at home free download s signals brokers with. suba. Call . suba. Next instruction. Next instruction. Next instruction. Start of subroutine. Subroutine . suba. Jump back. Only one copy of the code is placed in memory. Whenever we wish to use the code, a jump is made to it .

Download Document

Here is the link to download the presentation.
"Lab Subroutines and the Stack"The content belongs to its owner. You may download and print it for personal use, without modification, and keep all copyright notices. By downloading, you agree to these terms.

Related Documents