PDF-Subroutines in C

Author : tatyana-admore | Published Date : 2015-11-05

Lecture 23 Todayx2019s Goals x2022 Use multiple files to write a C program x2022 Share variables and labels between assembly files x2022 Discuss how to pass parameters

Presentation Embed Code

Download Presentation

Download Presentation The PPT/PDF document "Subroutines in C" 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.

Subroutines in C: Transcript


Lecture 23 Todayx2019s Goals x2022 Use multiple files to write a C program x2022 Share variables and labels between assembly files x2022 Discuss how to pass parameters to C functions . Style: Main program and subroutines. INF 123 – Software architecture. tdebeauv@uci.edu. 1. Outline. Some theory. Connector 1: Procedure . call . Style: Main program and subroutines. Connector 2: Socket. 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. Answer. 1. What does a connector do?. 2. Can connectors be smart? complex? domain-specific?. 3. Name 2 connectors. 4. Can subroutines have side-effects? Can they call each other?. 5. def. . concat. (. 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 1 Introduction include a new diagnostics. Summary. Step 1: name and create the new diagnostics;. Step 2: modify run_diagnostics.ncl to load the new diagnostic;. Step 3: modify ILAMB_PARA_SETUP to show up the new diagnostic;. 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 . CS. . 111. On-Line MS Program. Operating . Systems . Peter Reiher. . Introduction. Most useful abstractions an OS wants to offer can’t be directly realized by hardware. The hardware doesn’t do exactly what the abstraction requires. Functions. & . Subroutines. (. procedures. in other languages) are subprograms that allow modular coding. Function. : returns a single explicit function value for given function arguments. Subroutine. uses . a language . to implement all of the functional capability of the application.. VBA . (Visual Basic for Applications. ). . is that language.. Use VBA to tell Excel what to do:. C. reate your own new functions. Example: Our function to find the largest element of an array might be re-used in many different programs. A . subroutine. allows us to write that functionality in an . abstract way. so that we, or others, can re-use it without modification. Christoffer H. Grindheim. 1. Content. Current code. New code. Design objectives. 2. Current Code. Nrstuff. Numeric functions and subroutines. Long_v2. Functions and subroutines for time space, and conversion to phase space . 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.
"Subroutines in C"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