What is Software? Software, for our purposes, is just a word meaning programs. CS1313: Software Lesson Fall

Size: px
Start display at page:

Download "What is Software? Software, for our purposes, is just a word meaning programs. CS1313: Software Lesson Fall"

Transcription

1 1. Software Outline 2. What is Software? 3. What is a Program? 4. What are Instructions? 5. What is a Programming Language? 6. What is Source Code? What is a Source File? 7. What is an Operating System? 8. Operating System Examples 9. A Simple C Program 10. Anatomy of a Simple C Program 11. Block Delimiters 12. What Is a Comment? #1 13. What Is a Comment? #2 14. Are Comments Necessary? 15. hello_world.c with Comments 16. hello_world.c without Comments 17. Flowchart for hello_world.c 18. A Less Simple C Program #1 19. A Less Simple C Program #2 20. A Less Simple C Program #3 21. A Less Simple C Program: Compile & Run 22. Flowchart for my_add.c 23. Languages 24. What Are the Ingredients of a Language? 25. Kinds of Languages 26. Natural Languages #1 27. Natural Languages #2 28. Natural Languages #3 29. Natural Languages #4 Software Outline 30. Programming Languages 31. Natural Languages vs Programming Languages 32. Programming Language Hierarchy 33. High Level Languages 34. Assembly Languages 35. Machine Languages 36. Converting Between Languages 37. Compiler 38. Interpreter 39. Assembler 40. Our Old Friend hello_world.c 41. Compiler Details 42. Compiler Details (cont d) 43. Elements of a Compiler #1 44. Elements of a Compiler #2 45. Phases of Compiling 46. Compiling a C Statement 47. Assembly Code for hello_world.c #1 48. Assembly Code for hello_world.c #2 49. Machine Code for hello_world.c 50. How to Program in Machine Language Directly 51. Why Not Do Everything in Machine Language? 52. Why Not Do Everything in Assembly Language? 53. The Programming Process 54. What is an Algorithm? 55. Algorithms 56. Algorithm Example: Eating a Bowl of Corn Flakes 57. Top-Down Design 58. Eating Cornflakes: Top Level Fall

2 What is Software? Software, for our purposes, is just a word meaning programs. Fall

3 What is a Program? A program is a set of storage locations RAM, disk, etc and a sequence of actions on those storage locations. The actions in a program are known as instructions. Fall

4 What are Instructions? The actions in a program are known as instructions. Examples: Arithmetic/Logical calculation: e.g., add, subtract, multiply, divide, square root, cosine, etc. Memory operations: load from or store into RAM I/O: read from or write to secondary storage Branch: jump to an instruction that is out of sequence Repetition Allocation of resources and many more. Fall

5 What is a Programming Language? A programming language is a well-defined set of rules for specifying a program s sequence of instructions. Examples: C, C++, Fortran 90, Java, Basic, HTML, Perl, Haskell, Prolog, Pascal, Unix shell, SAS, Pentium4 assembly language, etc. Fall

6 What is Source Code? What is a Source File? Source code is a sequence of instructions, written in a human-readable programming language, that constitutes a program, or a piece of a program. An example is shown on page 9. A source file is a file of source code. Fall

7 What is an Operating System? An operating system is a program that manages interactions between: users and hardware; users and software; hardware and software;... and so much more. Fall

8 Operating System Examples MS Windows/MS-DOS MacOS PalmOS Unix Linux (portable) FreeBSD (portable, underlies MacOS X) Solaris (Sun Microsystems) AIX (IBM) IRIX (SGI) Tru64 (Hewlett-Packard) HP-UX (Hewlett-Packard) Unicos (Cray) Fall

9 A Simple C Program % cat hello_world.c /* ************************************************* *** Program: hello_world *** *** Author: Henry Neeman (hneeman@ou.edu) *** *** Course: CS Fall 2005 *** *** Lab: Sec 011 Fridays 9:30am *** *** Description: Prints the sentence *** *** "Hello, world!" to standard output. *** ************************************************* */ #include <stdio.h> int main () { /* main */ /* ******************************** *** Execution Section (body) *** ******************************** * * Print the sentence to standard output * (i.e., to the terminal screen). */ printf("hello, world!\n"); } /* main */ % gcc -o hello_world hello_world.c % hello_world Hello, world! Fall

10 Comment block Preprocessor directive Anatomy of a Simple C Program Unix command to output to the screen % cat hello_world.c /* ************************************************* *** Program: hello_world *** *** Author: Henry Neeman (hneeman@ou.edu) *** *** Course: CS Fall 2005 *** *** Lab: Sec 011 Fridays 9:30am *** *** Description: Prints the sentence *** *** "Hello, world!" to standard output. *** ************************************************* */ #include <stdio.h> Block open Execution section (also known as the program body) Block close Main function header int main () { /* main */ /* ******************************** *** Execution Section (body) *** ******************************** * * Print the sentence to standard output * (i.e., to the terminal screen). */ printf("hello, world!\n"); } /* main */ % gcc -o hello_world hello_world.c % hello_world Hello, world! Unix command to compile Unix command to run Program output Fall

11 Block Delimiters The open curly brace, also known as the left brace, { acts as the start of a block and is known as the block open. The close curly brace, also known as the right brace, } acts as the end of a block and is known as the block close. The block open and block close are said to delimit the block: they indicate where the block begins and where the block ends. Delimit: indicate where something begins and ends. Fall

12 What Is a Comment? #1 A comment is a piece of text in a source file that: tells human beings (e.g., programmers) something useful about the program, but is ignored by the compiler, so it has absolutely no affect on how the program runs. In C, the start of a comment is indicated by /* and the end of a comment is indicated by */ All text appearing between these comment delimiters are part of the comment, and therefore are ignored by the compiler. Fall

13 What Is a Comment? #2 A comment is a piece of text in a source file that: tells human beings (e.g., programmers) something useful about the program, but is ignored by the compiler, so it has absolutely no affect on how the program runs. In C, the start of a comment is indicated by /* and the end of a comment is indicated by */ A comment can use multiple lines of text. The delimiters do not have to be on the same line. Fall

14 Are Comments Necessary? Comments are ignored by the compiler, so strictly speaking they aren t needed to compile and run. But, if you don t put them into one of your CS1313 programming projects, YOU MAY LOSE A FULL LETTER GRADE OR MORE on that project. Why? Comments tell human beings useful things about your program. They help programmers including you, a month later when you ve forgotten everything about your program to understand your program. They also tell graders that you know what the heck you re doing. Fall

15 hello_world.c with Comments % cat hello_world.c /* ************************************************* *** Program: hello_world *** *** Author: Henry Neeman (hneeman@ou.edu) *** *** Course: CS Fall 2005 *** *** Lab: Sec 011 Fridays 9:30am *** *** Description: Prints the sentence *** *** "Hello, world!" to standard output. *** ************************************************* */ #include <stdio.h> int main () { /* main */ /* ******************************** *** Execution Section (body) *** ******************************** * * Print the sentence to standard output * (i.e., to the terminal screen). */ printf("hello, world!\n"); } /* main */ % gcc -o hello_world hello_world.c % hello_world Hello, world! Fall

16 hello_world.c without Comments % cat hello_world.c #include <stdio.h> int main () { printf("hello, world!\n"); } % gcc -o hello_world hello_world.c % hello_world Hello, world! Fall

17 Flowchart for hello_world.c int main () { printf("hello, world!\n"); } Start An oval denotes either the start or the end of the program, or a halt operation within the program (which we ll learn about later). References: Output Hello, world! End A parallelogram denotes either an input operation or an output operation. An arrow denotes the flow of the program. home/k5htm/f2.htm#flowchart symbol Fall

18 A Less Simple C Program #1 /* ************************************************ *** Program: my_add *** *** Author: Henry Neeman (hneeman@ou.edu) *** *** Course: CS Fall 2005 *** *** Lab: Sec 011 Fridays 9:30am *** *** Description: Input two integers, compute *** *** their sum and output the result. *** ************************************************ */ #include <stdio.h> int main () { /* main */ /* *************************** *** Declaration Section *** *************************** * ***************************** * Named Constant Subsection * ***************************** */ const int program_success_code = 0; /* ***************************** * Local Variable Subsection * ***************************** * * addend: the addend value that the user inputs. * augend: the augend value that the user inputs. * sum: the sum of the addend and the augend, * which is output. */ int addend, augend, sum; Continued on the next slide. Fall

19 A Less Simple C Program #2 /* ************************* *** Execution Section *** ************************* * *********************** * Greeting Subsection * *********************** * * Tell the user what the program does. */ printf("i ll add a pair of integers.\n"); /* ******************** * Input subsection * ******************** * * Prompt the user to input the addend & augend. */ printf("what two integers do you want to add?\n"); /* * Input the integers to be added. */ scanf("%d %d", &addend, &augend); Continued on the next slide. Fall

20 A Less Simple C Program #3 /* ************************** * Calculation Subsection * ************************** * * Calculate the sum. */ sum = addend + augend; /* ********************* * Output Subsection * ********************* * * Output the sum. */ printf("the sum of %d and %d is %d.\n", addend, augend, sum); return program_success_code; } /* main */ Fall

21 A Less Simple C Program: Compile & Run % gcc -o my_add my_add.c % my_add I ll add a pair of integers. What two integers do you want to add? 5 7 The sum of 5 and 7 is 12. % my_add I ll add a pair of integers. What two integers do you want to add? The sum of 1593 and 9832 is Fall

22 Flowchart for my_add.c A rectangle denotes an operation other than I/O or branching (e.g., calculation). Fall

23 What is a language? Kinds of languages Natural languages Languages Programming languages (also known as Formal languages) Converting between programming languages Compilers Interpreters Assemblers Fall

24 What Are the Ingredients of a Language? Symbols: a set of words and punctuation (in computing, words and punctuation are together known as tokens) Grammar (also known as syntax): a set of rules for putting tokens together to get valid statements Semantics: a set of rules for interpreting the meaning of a valid statement Fall

25 Kinds of Languages Natural languages: used in human communication Programming languages (also known as formal languages): used by computers (among others) Fall

26 Natural Languages #1 Examples: English, Chinese, Swahili, Navajo, Quechua, Maori Typically can be described by formal rules (grammar), but often are not rigidly governed by these rules in everyday use: Any noun can be verbed. I might could get me one o them there computers. Fall

27 Natural Languages #2 Can mix words from different languages and even syntax (elements of grammar) from different languages in a single sentence: Hey, amigo, is it all right by you if I kibbitz your parcheesi game while we watch your anime? Fall

28 Natural Languages #3 Can be ambiguous: When did he say she was going? could be interpreted as: State the time at which he said, She was going. According to him, at what time was she going? Fall

29 Natural Languages #4 Plenty of flexibility regarding correctness; e.g., ain t, split infinitives, ending a sentence with a preposition That is something up with which I will not put. Fall

30 Programming Languages Examples: C, Java, HTML, Haskell, Prolog, SAS Also known as formal languages Completely described and rigidly governed by formal rules Cannot mix the words of multiple languages, or the syntax of multiple languages, in the same program Cannot be ambiguous Words and syntax must be EXACTLY correct in every way Fall

31 Natural Languages vs Programming Languages PROPERTY NAT L PROG Completely described and rigidly governed by formal rules CAN mix the words of multiple languages, or Y N the syntax of multiple languages, in the same program CAN be ambiguous Y N N Y Words and syntax must be EXACTLY correct in every way N Y Fall

32 Programming Language Hierarchy High Level Languages Assembly Languages Machine Languages Fall

33 High Level Languages Human-readable Most are standardized, so they can be used on just about any kind of computer. Examples: C, Fortran 90, Java, HTML, Haskell, SAS Typically they are designed for a particular kind of application; for example: C for operating system design Fortran 90 for scientific & engineering applications Java for web applets and embedded systems HTML for hypertext (webpages) SAS for statistics But often, their uses in real life are broader their original purpose. Fall

34 Assembly Languages Human-readable Specific to a particular CPU family; for example: Intel Pentium4/AMD Athlon XP (PC) Motorola PowerPC G5 (Macintosh) Intel Itanium2 (servers) So, for example, a program in Pentium4 assembly language cannot be directly run on a G5 machine. Set of simple commands; for example: Load a value from a location in main memory Add two numbers Branch to an instruction out of sequence Fall

35 Machine Languages Not human-readable, except with immense effort Binary code that the CPU family understands directly Binary representation of the CPU family s assembly language Fall

36 Converting Between Languages Compilers, interpreters and assemblers are programs that convert programs that people can read into actions that computers can perform. Fall

37 Compiler Converts a human-readable high level language source code of a program into a machine language executable program Converts an entire source code all at once Must be completed before executing the program Examples: Fortran 90, C, C++, Pascal Fall

38 Interpreter Converts a human-readable high level language source code into actions that are immediately performed Converts and executes one statement at a time Conversion and execution alternate Examples: Perl, HTML, SAS, Mathematica, Unix shell (interactive system within Unix) Fall

39 Assembler Converts a human-readable CPU-specific assembly code into CPU-specific machine language Like a compiler, but for a low level assembly language instead of for a high level language Fall

40 Our Old Friend hello_world.c % cat hello_world.c /* ************************************************* *** Program: hello_world *** *** Author: Henry Neeman (hneeman@ou.edu) *** *** Course: CS Fall 2005 *** *** Lab: Sec 011 Fridays 9:30am *** *** Description: Prints the sentence *** *** "Hello, world!" to standard output. *** ************************************************* */ #include <stdio.h> int main () { /* main */ /* ******************************** *** Execution Section (body) *** ******************************** * * Print the sentence to standard output * (i.e., to the terminal screen). */ printf("hello, world!\n"); } /* main */ % gcc -o hello_world hello_world.c % hello_world Hello, world! Fall

41 Compiler Details Fall

42 Compiler Details (cont d) Fall

43 Elements of a Compiler #1 Lexical Analyzer: identifies program s word elements Comments (ignored by compiler) Keywords (e.g., int, while) Constants (e.g., 5, 0.725, "Hello, world!") User-defined Identifiers (e.g., addend) Operators; for example: Arithmetic: + - * / % Relational: ==!= < <= > >= Logical: &&! Fall

44 Elements of a Compiler #2 Parser: determines the program s grammar Semantic Analyzer: determines what the program does Intermediate Code Generator: expresses, as an assembly-like program, what the program does Optimizer: makes code more efficient (faster) Assembly Code Generator: produces the final assembly code that represents what the program does Fall

45 Compiler Phases of Compiling Assembler: turns assembly code into machine code Linker/loader: turns machine code into an executable file Both the assembler and the linker/loader are invoked automatically by the compiler, so you don t have to worry about them. Fall

46 Compiling a C Statement Fall

47 Assembly Code for hello_world.c #1 On Pentium4 Using gcc On IBM POWER4 Using gcc pushl %ebp movl %esp, %ebp subl $8, %esp subl $12, %esp pushl $.LC0 call printf addl $16, %esp leave ret Different opcodes! mflr 0 stw 31,-4(1) stw 0,8(1) stwu 1,-64(1) mr 31,1 lwz 3,LC..1(2) bl.printf nop lwz 1,0(1) lwz 0,8(1) mtlr 0 lwz 31,-4(1) blr Fall

48 Assembly Code for hello_world.c #2 On Pentium4 Using gcc (GNU compiler) pushl %ebp movl %esp, %ebp subl $8, %esp subl $12, %esp pushl $.LC0 call printf addl $16, %esp leave ret Different sequences of instructions! On Pentium4 Using icc (Intel compiler) pushl %ebp movl %esp, %ebp subl $3, %esp andl $-8, %esp addl $4, %esp push $ STRING.0 call printf xorl %eax, %eax popl %ecx movl %ebp, %esp popl %ebp ret Fall

49 Machine Code for hello_world.c Fall

50 How to Program in Machine Language Directly 1. Write the assembly code for the program directly by hand; i.e., not in a high level language. 2. For each assembly language instruction, look up the bit pattern of the associated machine code. 3. On the computer console, flip switches to match the bit pattern of the machine code. 4. Press the Run button. Actually, on modern computers, programming directly in machine language is just about impossible. Fall

51 Why Not Do Everything in Machine Language? Incredibly tedious and ridiculously error prone! Fun and easy! Not nearly as tedious or error-prone! Fall

52 Why Not Do Everything in Assembly Language? Can t be run on any other kind of computer. May be completely obsolete in a few years. Portable to many kinds of computers. Will still be useable in 20 years ( legacy codes). Fall

53 The Programming Process Formulate Problem Compile Construct Algorithm Bugs? Yes Debug No Choose Programming Language Run Write Program Bugs? Yes No Get an A/Impress Your Boss/Sell for Zillions! Fall

54 What is an Algorithm? An algorithm is: a step-by-step method that is written in a natural language (e.g., English) or in pseudocode (something that sort of looks like a programming language but isn t as precise), rather than in a programming language, that solves a well-defined (but not necessarily useful) problem on a well-defined set of inputs (which may be empty), using finite resources (e.g., computing time and memory) and that produces a well-defined set of outputs (which may be empty). Fall

55 Algorithms An algorithm is a language-independent way of expressing the method of solving a problem; that is, an algorithm could be expressed in two different languages (e.g., English and Japanese) and still be the same algorithm. A program, by contrast, is a language-dependent implementation of the method of solving a problem; that is, the same set of steps expressed in two different programming languages would be two different programs, even if the two programs accomplished exactly the same result. Many programs, but not all programs, implement algorithms. Fall

56 Algorithm Example: Eating a Bowl of Corn Flakes Get bowl from cupboard Get spoon from drawer Get box of corn flakes from pantry Get jug of milk from refrigerator Place bowl, spoon, corn flakes and milk on table Open box of corn flakes Pour corn flakes from box into bowl Open jug of milk Pour milk from jug into bowl Close jug of milk Go to table Pick up spoon Repeat until bowl is empty of corn flakes Using spoon, pick up corn flakes and milk from bowl Put spoon with corn flakes and milk into mouth Pull spoon from mouth, leaving corn flakes and milk Repeat... Chew... until mouthful is mush Swallow Leave mess for housemates to clean up Fall

57 Top-Down Design Algorithms for most non-trivial problems tend to be fairly complicated. As a result, it may be difficult to march from an algorithm s beginning to its end in a straight line, because there may be too many details to keep in your head all at one time. Instead, you can use a technique called top-down design: start with the whole problem, then break it into a few pieces, then break each of those pieces into a few pieces, then break each of those pieces into a few pieces, and so on, until each piece is pretty small. Fall

58 Eating Cornflakes: Top Level Get stuff Transport stuff Set up stuff Eat Finish Fall

Software Lesson 2 Outline

Software Lesson 2 Outline Software Lesson 2 Outline 1. Software Lesson 2 Outline 2. Languages 3. Ingredients of a Language 4. Kinds of Languages 5. Natural Languages #1 6. Natural Languages #2 7. Natural Languages #3 8. Natural

More information

Software Lesson 1 Outline

Software Lesson 1 Outline Software Lesson 1 Outline 1. Software Lesson 1 Outline 2. What is Software? A Program? Data? 3. What are Instructions? 4. What is a Programming Language? 5. What is Source Code? What is a Source File?

More information

C Introduction Lesson Outline

C Introduction Lesson Outline Outline 1. Outline 2. hello_world.c 3. C Character Set 4. C is Case Sensitive 5. Character String Literal Constant 6. String Literal Cannot Use Multiple Lines 7. Multi-line String Literal Example 8. Newline

More information

Arithmetic Expressions Lesson #1 Outline

Arithmetic Expressions Lesson #1 Outline Outline 1. Outline 2. A Less Simple C Program #1 3. A Less Simple C Program #2 4. A Less Simple C Program #3 5. A Less Simple C Program #4 6. A Less Simple C Program: Compile & Run 7. Flowchart for my_add.c

More information

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006

C Compilation Model. Comp-206 : Introduction to Software Systems Lecture 9. Alexandre Denault Computer Science McGill University Fall 2006 C Compilation Model Comp-206 : Introduction to Software Systems Lecture 9 Alexandre Denault Computer Science McGill University Fall 2006 Midterm Date: Thursday, October 19th, 2006 Time: from 16h00 to 17h30

More information

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017 Programming 1 Lecture 1 COP 3014 Fall 2017 August 28, 2017 Main Components of a computer CPU - Central Processing Unit: The brain of the computer. ISA - Instruction Set Architecture: the specific set of

More information

Compiler Construction D7011E

Compiler Construction D7011E Compiler Construction D7011E Lecture 8: Introduction to code generation Viktor Leijon Slides largely by Johan Nordlander with material generously provided by Mark P. Jones. 1 What is a Compiler? Compilers

More information

Question 4.2 2: (Solution, p 5) Suppose that the HYMN CPU begins with the following in memory. addr data (translation) LOAD 11110

Question 4.2 2: (Solution, p 5) Suppose that the HYMN CPU begins with the following in memory. addr data (translation) LOAD 11110 Questions 1 Question 4.1 1: (Solution, p 5) Define the fetch-execute cycle as it relates to a computer processing a program. Your definition should describe the primary purpose of each phase. Question

More information

Preview from Notesale.co.uk Page 6 of 52

Preview from Notesale.co.uk Page 6 of 52 Binary System: The information, which it is stored or manipulated by the computer memory it will be done in binary mode. RAM: This is also called as real memory, physical memory or simply memory. In order

More information

What is a Compiler? Compiler Construction SMD163. Why Translation is Needed: Know your Target: Lecture 8: Introduction to code generation

What is a Compiler? Compiler Construction SMD163. Why Translation is Needed: Know your Target: Lecture 8: Introduction to code generation Compiler Construction SMD163 Lecture 8: Introduction to code generation Viktor Leijon & Peter Jonsson with slides by Johan Nordlander Contains material generously provided by Mark P. Jones What is a Compiler?

More information

Running a C program Compilation Python and C Variables and types Data and addresses Functions Performance. John Edgar 2

Running a C program Compilation Python and C Variables and types Data and addresses Functions Performance. John Edgar 2 CMPT 125 Running a C program Compilation Python and C Variables and types Data and addresses Functions Performance John Edgar 2 Edit or write your program Using a text editor like gedit Save program with

More information

Outline. Compiling process Linking libraries Common compiling op2ons Automa2ng the process

Outline. Compiling process Linking libraries Common compiling op2ons Automa2ng the process Compiling Programs Outline Compiling process Linking libraries Common compiling op2ons Automa2ng the process Program compilation Programmers usually writes code in high- level programming languages (e.g.

More information

Simple C Program. Assembly Ouput. Using GCC to produce Assembly. Assembly produced by GCC is easy to recognize:

Simple C Program. Assembly Ouput. Using GCC to produce Assembly. Assembly produced by GCC is easy to recognize: Simple C Program Helloworld.c Programming and Debugging Assembly under Linux slides by Alexandre Denault int main(int argc, char *argv[]) { } printf("hello World"); Programming and Debugging Assembly under

More information

CS Computer Programming in Fortran 90 & C

CS Computer Programming in Fortran 90 & C CS 1313 010 Computer Programming in Fortran 90 & C Instructor: Dr. Henry Neeman TAs: Ashwin Seshadri, Hisham Qureshi Prerequisite: MATH 1523 (Elementary Functions) or equivalent Class Meetings: Tues/Thurs

More information

Computers and Computation. The Modern Computer. The Operating System. The Operating System

Computers and Computation. The Modern Computer. The Operating System. The Operating System The Modern Computer Computers and Computation What is a computer? A machine that manipulates data according to instructions. Despite their apparent complexity, at the lowest level computers perform simple

More information

Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang

Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang Introduction to C CMSC 104 Spring 2014, Section 02, Lecture 6 Jason Tang Topics History of Programming Languages Compilation Process Anatomy of C CMSC 104 Coding Standards Machine Code In the beginning,

More information

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1

Chapter 2. Designing a Program. Input, Processing, and Output Fall 2016, CSUS. Chapter 2.1 Chapter 2 Input, Processing, and Output Fall 2016, CSUS Designing a Program Chapter 2.1 1 Algorithms They are the logic on how to do something how to compute the value of Pi how to delete a file how to

More information

Programming 1 - Honors

Programming 1 - Honors Programming 1 - Honors Lecture 1 COP 3014 Spring 2017 January 10, 2017 Main Components of a computer CPU - Central Processing Unit: The brain of the computer. ISA - Instruction Set Architecture: the specific

More information

Computer Organization & Assembly Language Programming

Computer Organization & Assembly Language Programming Computer Organization & Assembly Language Programming CSE 2312 Lecture 11 Introduction of Assembly Language 1 Assembly Language Translation The Assembly Language layer is implemented by translation rather

More information

CS101 Introduction to Programming Languages and Compilers

CS101 Introduction to Programming Languages and Compilers CS101 Introduction to Programming Languages and Compilers In this handout we ll examine different types of programming languages and take a brief look at compilers. We ll only hit the major highlights

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C Chapter 11 Introduction to Programming in C C: A High-Level Language Gives symbolic names for containers of values don t need to know which register or memory location Provides abstraction of underlying

More information

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG) SKILL AREA 304: Review Programming Language Concept Computer Programming (YPG) 304.1 Demonstrate an Understanding of Basic of Programming Language 304.1.1 Explain the purpose of computer program 304.1.2

More information

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007 CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007 Course Web Site http://www.nps.navy.mil/cs/facultypages/squire/cs2900 All course related materials will be posted

More information

Intel assembly language using gcc

Intel assembly language using gcc QOTD Intel assembly language using gcc Assembly language programming is difficult. Make no mistake about that. It is not for wimps and weaklings. - Tanenbaum s 6th, page 519 These notes are a supplement

More information

Introduction to Java Programming

Introduction to Java Programming Introduction to Java Programming Lecture 1 CGS 3416 Spring 2017 1/9/2017 Main Components of a computer CPU - Central Processing Unit: The brain of the computer ISA - Instruction Set Architecture: the specific

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C Chapter 11 Introduction to Programming in C C: A High-Level Language Gives symbolic names to values don t need to know which register or memory location Provides abstraction of underlying hardware operations

More information

Chapter 1 INTRODUCTION

Chapter 1 INTRODUCTION Chapter 1 INTRODUCTION A digital computer system consists of hardware and software: The hardware consists of the physical components of the system. The software is the collection of programs that a computer

More information

You may work with a partner on this quiz; both of you must submit your answers.

You may work with a partner on this quiz; both of you must submit your answers. Instructions: Choose the best answer for each of the following questions. It is possible that several answers are partially correct, but one answer is best. It is also possible that several answers are

More information

x86 assembly CS449 Fall 2017

x86 assembly CS449 Fall 2017 x86 assembly CS449 Fall 2017 x86 is a CISC CISC (Complex Instruction Set Computer) e.g. x86 Hundreds of (complex) instructions Only a handful of registers RISC (Reduced Instruction Set Computer) e.g. MIPS

More information

Welcome to... CS113: Introduction to C

Welcome to... CS113: Introduction to C Welcome to... CS113: Introduction to C Instructor: Erik Sherwood E-mail: wes28@cs.cornell.edu Course Website: http://www.cs.cornell.edu/courses/cs113/2005fa/ The website is linked to from the courses page

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College February 9, 2016 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College February 9, 2016 Reading Quiz Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between

More information

The Compilation Process

The Compilation Process Crash Course in C Lecture 2 Moving from Python to C: The compilation process Differences between Python and C Variable declaration and strong typing The memory model: data vs. address The Compilation Process

More information

C - Basics, Bitwise Operator. Zhaoguo Wang

C - Basics, Bitwise Operator. Zhaoguo Wang C - Basics, Bitwise Operator Zhaoguo Wang Java is the best language!!! NO! C is the best!!!! Languages C Java Python 1972 1995 2000 (2.0) Procedure Object oriented Procedure & object oriented Compiled

More information

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018

CS 31: Intro to Systems ISAs and Assembly. Kevin Webb Swarthmore College September 25, 2018 CS 31: Intro to Systems ISAs and Assembly Kevin Webb Swarthmore College September 25, 2018 Overview How to directly interact with hardware Instruction set architecture (ISA) Interface between programmer

More information

Reversing. Time to get with the program

Reversing. Time to get with the program Reversing Time to get with the program This guide is a brief introduction to C, Assembly Language, and Python that will be helpful for solving Reversing challenges. Writing a C Program C is one of the

More information

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017

CS 31: Intro to Systems ISAs and Assembly. Martin Gagné Swarthmore College February 7, 2017 CS 31: Intro to Systems ISAs and Assembly Martin Gagné Swarthmore College February 7, 2017 ANNOUNCEMENT All labs will meet in SCI 252 (the robot lab) tomorrow. Overview How to directly interact with hardware

More information

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1

Defining Program Syntax. Chapter Two Modern Programming Languages, 2nd ed. 1 Defining Program Syntax Chapter Two Modern Programming Languages, 2nd ed. 1 Syntax And Semantics Programming language syntax: how programs look, their form and structure Syntax is defined using a kind

More information

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2016

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2016 COMP-202: Foundations of Programming Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2016 Learn about cutting-edge research over lunch with cool profs January 18-22, 2015 11:30

More information

Follow us on Twitter for important news and Compiling Programs

Follow us on Twitter for important news and Compiling Programs Follow us on Twitter for important news and updates: @ACCREVandy Compiling Programs Outline Compiling process Linking libraries Common compiling op2ons Automa2ng the process Program compilation Programmers

More information

CS 4120 and 5120 are really the same course. CS 4121 (5121) is required! Outline CS 4120 / 4121 CS 5120/ = 5 & 0 = 1. Course Information

CS 4120 and 5120 are really the same course. CS 4121 (5121) is required! Outline CS 4120 / 4121 CS 5120/ = 5 & 0 = 1. Course Information CS 4120 / 4121 CS 5120/5121 Introduction to Compilers Fall 2011 Andrew Myers Lecture 1: Overview Outline About this course Introduction to compilers What are compilers? Why should we learn about them?

More information

What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope. C Flow Control.

What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope. C Flow Control. C Flow Control David Chisnall February 1, 2011 Outline What the CPU Sees Basic Flow Control Conditional Flow Control Structured Flow Control Functions and Scope Disclaimer! These slides contain a lot of

More information

Lecture #16: Introduction to Runtime Organization. Last modified: Fri Mar 19 00:17: CS164: Lecture #16 1

Lecture #16: Introduction to Runtime Organization. Last modified: Fri Mar 19 00:17: CS164: Lecture #16 1 Lecture #16: Introduction to Runtime Organization Last modified: Fri Mar 19 00:17:19 2010 CS164: Lecture #16 1 Status Lexical analysis Produces tokens Detects & eliminates illegal tokens Parsing Produces

More information

Programming. Dr Ben Dudson University of York

Programming. Dr Ben Dudson University of York Programming Dr Ben Dudson University of York Outline Last lecture covered the basics of programming and IDL This lecture will cover More advanced IDL and plotting Fortran and C++ Programming techniques

More information

CSC 2400: Computing Systems. X86 Assembly: Function Calls"

CSC 2400: Computing Systems. X86 Assembly: Function Calls CSC 24: Computing Systems X86 Assembly: Function Calls" 1 Lecture Goals! Challenges of supporting functions" Providing information for the called function" Function arguments and local variables" Allowing

More information

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A

CSCE150A. Administrivia. Overview. Hardware. Software. Example. Program. Pseudocode. Flowchart. Control Structures. Hello World Program CSCE150A Computer Science & Engineering 150A Problem Solving Using Computers Lecture 01 - Course Introduction Stephen Scott (Adapted from Christopher M. Bourke) Roll Syllabus Course Webpage: http://cse.unl.edu/~sscott/teach/classes/cse150af09/

More information

Computer Science & Engineering 150A Problem Solving Using Computers

Computer Science & Engineering 150A Problem Solving Using Computers Computer Science & Engineering 150A Problem Solving Using Computers Lecture 01 - Course Introduction Stephen Scott (Adapted from Christopher M. Bourke) 1 / 43 Fall 2009 Roll Syllabus Course Webpage: http://cse.unl.edu/~sscott/teach/classes/cse150af09/

More information

Introduction Presentation A

Introduction Presentation A CSE 2421/5042: Systems I Low-Level Programming and Computer Organization Introduction Presentation A Read carefully: Bryant Chapter 1 Study: Reek Chapter 2 Skim: Reek Chapter 1 08/22/2018 Gojko Babić Some

More information

Chapter 2 A Quick Tour

Chapter 2 A Quick Tour Chapter 2 A Quick Tour 2.1 The Compiler Toolchain A compiler is one component in a toolchain of programs used to create executables from source code. Typically, when you invoke a single command to compile

More information

SOFTWARE ARCHITECTURE 5. COMPILER

SOFTWARE ARCHITECTURE 5. COMPILER 1 SOFTWARE ARCHITECTURE 5. COMPILER Tatsuya Hagino hagino@sfc.keio.ac.jp slides URL https://vu5.sfc.keio.ac.jp/sa/ 2 Programming Language Programming Language Artificial language to express instructions

More information

CS : Programming for Non-majors, Fall 2018 Programming Project #2: Census Due by 10:20am Wednesday September

CS : Programming for Non-majors, Fall 2018 Programming Project #2: Census Due by 10:20am Wednesday September CS 1313 010: Programming for Non-majors, Fall 2018 Programming Project #2: Census Due by 10:20am Wednesday September 19 2018 This second assignment will introduce you to designing, developing, testing

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C C: A High-Level Language Chapter 11 Introduction to Programming in C Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University! Gives

More information

Introduction to Compilers

Introduction to Compilers Introduction to Compilers Compilers are language translators input: program in one language output: equivalent program in another language Introduction to Compilers Two types Compilers offline Data Program

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C Chapter 11 Introduction to Programming in C C: A High-Level Language Gives symbolic names to values don t need to know which register or memory location Provides abstraction of underlying hardware operations

More information

Physics 306 Computing Lab 1: Hello, World!

Physics 306 Computing Lab 1: Hello, World! 1. Introduction Physics 306 Computing Lab 1: Hello, World! In today s lab, you will learn how to write simple programs, to compile them, and to run them. You will learn about input and output, variables,

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C Chapter 11 Introduction to Programming in C Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University C: A High-Level Language! Gives

More information

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008. Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008. Outline. Abstractions for telling a computer how to do things. Computational Paradigms. Language Definition, Translation.

More information

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site)

Function Calls COS 217. Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) Function Calls COS 217 Reading: Chapter 4 of Programming From the Ground Up (available online from the course Web site) 1 Goals of Today s Lecture Finishing introduction to assembly language o EFLAGS register

More information

Problem Solving and Program Design - Chapter 1. Cory L. Strope

Problem Solving and Program Design - Chapter 1. Cory L. Strope Problem Solving and Program Design - Chapter 1 Cory L. Strope Overview of Computers and Programming Computer Hardware Computer Software Software Development (Problem Solving) Pseudocode Flowchart Intro.

More information

Chapter 2: Programming Concepts

Chapter 2: Programming Concepts Chapter 2: Programming Concepts Objectives Students should Know the steps required to create programs using a programming language and related terminology. Be familiar with the basic structure of a Java

More information

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 1

BIL 104E Introduction to Scientific and Engineering Computing. Lecture 1 BIL 104E Introduction to Scientific and Engineering Computing Lecture 1 Introduction As engineers and scientists why do we need computers? We use computers to solve a variety of problems ranging from evaluation

More information

User Defined Functions 2 Outline

User Defined Functions 2 Outline User Defined Functions 2 Outline 1. User Defined Functions 2 Outline 2. Argument Order When Passing Arrays #1 3. Argument Order When Passing Arrays #1 4. Code Reuse Is GOOD GOOD GOOD #1 5. Code Reuse Is

More information

From High Level to Machine Code. Compilation Overview. Computer Programs

From High Level to Machine Code. Compilation Overview. Computer Programs From High Level to Algorithm/Model Java, C++, VB Compilation Execution Cycle Hardware 27 October 2007 Ariel Shamir 1 Compilation Overview Algorithm vs. Programs From Algorithm to Compilers vs. Interpreters

More information

Chapter 1: An Overview of Computers and Logic

Chapter 1: An Overview of Computers and Logic Chapter 1: An Overview of Computers and Logic Programming Logic and Design, Third Edition Comprehensive Objectives After studying Chapter 1, you should be able to: Understand computer components and operations

More information

3/13/2012. ESc101: Introduction to Computers and Programming Languages

3/13/2012. ESc101: Introduction to Computers and Programming Languages ESc101: Introduction to Computers and Programming Languages Instructor: Krithika Venkataramani Semester 2, 2011-2012 The content of these slides is taken from previous course lectures of Prof. R. K. Ghosh,

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

Motivation was to facilitate development of systems software, especially OS development.

Motivation was to facilitate development of systems software, especially OS development. A History Lesson C Basics 1 Development of language by Dennis Ritchie at Bell Labs culminated in the C language in 1972. Motivation was to facilitate development of systems software, especially OS development.

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C C: A High-Level Language Chapter 11 Introduction to Programming in C Original slides from Gregory Byrd, North Carolina State University Modified slides by Chris Wilcox, Colorado State University Gives

More information

Syntax and Grammars 1 / 21

Syntax and Grammars 1 / 21 Syntax and Grammars 1 / 21 Outline What is a language? Abstract syntax and grammars Abstract syntax vs. concrete syntax Encoding grammars as Haskell data types What is a language? 2 / 21 What is a language?

More information

COSC121: Computer Systems: Runtime Stack

COSC121: Computer Systems: Runtime Stack COSC121: Computer Systems: Runtime Stack Jeremy Bolton, PhD Assistant Teaching Professor Constructed using materials: - Patt and Patel Introduction to Computing Systems (2nd) - Patterson and Hennessy Computer

More information

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012

Assembly level Programming. 198:211 Computer Architecture. (recall) Von Neumann Architecture. Simplified hardware view. Lecture 10 Fall 2012 19:211 Computer Architecture Lecture 10 Fall 20 Topics:Chapter 3 Assembly Language 3.2 Register Transfer 3. ALU 3.5 Assembly level Programming We are now familiar with high level programming languages

More information

Linkers and Loaders. CS 167 VI 1 Copyright 2008 Thomas W. Doeppner. All rights reserved.

Linkers and Loaders. CS 167 VI 1 Copyright 2008 Thomas W. Doeppner. All rights reserved. Linkers and Loaders CS 167 VI 1 Copyright 2008 Thomas W. Doeppner. All rights reserved. Does Location Matter? int main(int argc, char *[ ]) { return(argc); } main: pushl %ebp ; push frame pointer movl

More information

Chapter 11 Introduction to Programming in C

Chapter 11 Introduction to Programming in C Chapter 11 Introduction to Programming in C Original slides from Gregory Byrd, North Carolina State University Modified by Chris Wilcox, Yashwant Malaiya Colorado State University C: A High-Level Language

More information

Assembly Language: Function Calls

Assembly Language: Function Calls Assembly Language: Function Calls 1 Goals of this Lecture Help you learn: Function call problems: Calling and returning Passing parameters Storing local variables Handling registers without interference

More information

CPS104 Recitation: Assembly Programming

CPS104 Recitation: Assembly Programming CPS104 Recitation: Assembly Programming Alexandru Duțu 1 Facts OS kernel and embedded software engineers use assembly for some parts of their code some OSes had their entire GUIs written in assembly in

More information

Syntax. A. Bellaachia Page: 1

Syntax. A. Bellaachia Page: 1 Syntax 1. Objectives & Definitions... 2 2. Definitions... 3 3. Lexical Rules... 4 4. BNF: Formal Syntactic rules... 6 5. Syntax Diagrams... 9 6. EBNF: Extended BNF... 10 7. Example:... 11 8. BNF Statement

More information

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York CSc 10200! Introduction to Computing Lecture 1 Edgardo Molina Fall 2013 City College of New York 1 Introduction to Computing Lectures: Tuesday and Thursday s (2-2:50 pm) Location: NAC 1/202 Recitation:

More information

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development Technology In Action, Complete, 14e (Evans et al.) Chapter 10 Behind the Scenes: Software Programming 1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem

More information

Assembly Language: Function Calls" Goals of this Lecture"

Assembly Language: Function Calls Goals of this Lecture Assembly Language: Function Calls" 1 Goals of this Lecture" Help you learn:" Function call problems:" Calling and returning" Passing parameters" Storing local variables" Handling registers without interference"

More information

C Language, Token, Keywords, Constant, variable

C Language, Token, Keywords, Constant, variable C Language, Token, Keywords, Constant, variable A language written by Brian Kernighan and Dennis Ritchie. This was to be the language that UNIX was written in to become the first "portable" language. C

More information

CS187 - Science Gateway Seminar for CS and Math

CS187 - Science Gateway Seminar for CS and Math CS187 - Science Gateway Seminar for CS and Math Fall 2013 Class 6 Sep. 19, 2013 Programming and Programming Languages Why, How and What? A programming language is a formal language (vs. natural language)

More information

What are compilers? A Compiler

What are compilers? A Compiler What are compilers? Dr. Barbara G. Ryder Dept of Computer Science ryder@cs.rutgers.edu http://www.cs.rutgers.edu/~ryder 1 A Compiler A program that translates computer programs that people write, into

More information

Compilers Crash Course

Compilers Crash Course Compilers Crash Course Prof. Michael Clarkson CSci 6907.85 Spring 2014 Slides Acknowledgment: Prof. Andrew Myers (Cornell) What are Compilers? Translators from one representation of program code to another

More information

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides

Contents. Slide Set 1. About these slides. Outline of Slide Set 1. Typographical conventions: Italics. Typographical conventions. About these slides Slide Set 1 for ENCM 369 Winter 2014 Lecture Section 01 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary Winter Term, 2014 ENCM 369 W14 Section

More information

CS : Programming for Non-majors, Summer 2007 Programming Project #2: Census Due by 12:00pm (noon) Wednesday June

CS : Programming for Non-majors, Summer 2007 Programming Project #2: Census Due by 12:00pm (noon) Wednesday June CS 1313 010: Programming for Non-majors, Summer 2007 Programming Project #2: Census Due by 12:00pm (noon) Wednesday June 20 2007 This second assignment will introduce you to designing, developing, testing

More information

CMSC 201 Fall 2016 Lab 09 Advanced Debugging

CMSC 201 Fall 2016 Lab 09 Advanced Debugging CMSC 201 Fall 2016 Lab 09 Advanced Debugging Assignment: Lab 09 Advanced Debugging Due Date: During discussion Value: 10 points Part 1: Introduction to Errors Throughout this semester, we have been working

More information

Slide Set 2. for ENCM 335 in Fall Steve Norman, PhD, PEng

Slide Set 2. for ENCM 335 in Fall Steve Norman, PhD, PEng Slide Set 2 for ENCM 335 in Fall 2018 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary September 2018 ENCM 335 Fall 2018 Slide Set 2 slide

More information

How to approach a computational problem

How to approach a computational problem How to approach a computational problem A lot of people find computer programming difficult, especially when they first get started with it. Sometimes the problems are problems specifically related to

More information

Assembly Language: Function Calls" Goals of this Lecture"

Assembly Language: Function Calls Goals of this Lecture Assembly Language: Function Calls" 1 Goals of this Lecture" Help you learn:" Function call problems:" Calling and urning" Passing parameters" Storing local variables" Handling registers without interference"

More information

EP241 Computer Programming

EP241 Computer Programming EP241 Computer Programming Topic 1 Dr. Ahmet BİNGÜL Department of Engineering Physics University of Gaziantep Modifications by Dr. Andrew BEDDALL Department of Electric and Electronics Engineering Sep

More information

Compilers. Introduction. Yannis Smaragdakis, U. Athens (original slides by Sam

Compilers. Introduction. Yannis Smaragdakis, U. Athens (original slides by Sam Compilers Lecture 1 Introduction Yannis Smaragdakis, U. Athens (original slides by Sam Guyer@Tufts) Discussion What does a compiler do? Why do you need that? Name some compilers you have used 2 A Brief

More information

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program.

Language Translation. Compilation vs. interpretation. Compilation diagram. Step 1: compile. Step 2: run. compiler. Compiled program. program. Language Translation Compilation vs. interpretation Compilation diagram Step 1: compile program compiler Compiled program Step 2: run input Compiled program output Language Translation compilation is translation

More information

C and Programming Basics

C and Programming Basics Announcements Assignment 1 Will be posted on Wednesday, Jan. 9 Due Wednesday, Jan. 16 Piazza Please sign up if you haven t already https://piazza.com/sfu.ca/spring2019/cmpt125 Lecture notes Posted just

More information

Administration Computers Software Algorithms Programming Languages

Administration Computers Software Algorithms Programming Languages Administration Computers Software Algorithms Programming Languages http://www.cs.sfu.ca/cc/130/johnwill/ This course does not use Canvas John Edgar 3 Come to class Read ahead Attend the labs You get practice

More information

Administrativia. CS107 Introduction to Computer Science. Readings. Algorithms. Expressing algorithms

Administrativia. CS107 Introduction to Computer Science. Readings. Algorithms. Expressing algorithms CS107 Introduction to Computer Science Lecture 2 An Introduction to Algorithms: and Conditionals Administrativia Lab access Searles 128: Mon-Friday 8-5pm (unless class in progress) and 6-10pm Sat, Sun

More information

Introduction to Programming

Introduction to Programming Introduction to Programming Computers and Programs Python Programming, 1/e 1 The Universal Machine What is a computer program? A detailed, step-by-step set of instructions telling a computer what to do.

More information

Fundamentals of Programming. Lecture 3: Introduction to C Programming

Fundamentals of Programming. Lecture 3: Introduction to C Programming Fundamentals of Programming Lecture 3: Introduction to C Programming Instructor: Fatemeh Zamani f_zamani@ce.sharif.edu Sharif University of Technology Computer Engineering Department Outline A Simple C

More information

AN OVERVIEW OF C. CSE 130: Introduction to Programming in C Stony Brook University

AN OVERVIEW OF C. CSE 130: Introduction to Programming in C Stony Brook University AN OVERVIEW OF C CSE 130: Introduction to Programming in C Stony Brook University WHY C? C is a programming lingua franca Millions of lines of C code exist Many other languages use C-like syntax C is portable

More information

Computer Software: Introduction

Computer Software: Introduction Software: A collection of programs Computer Software: Introduction Program: Sequence of instructions for the computer to carry out Programs written using a programming language Types of languages: Machine

More information

Informatica e Sistemi in Tempo Reale

Informatica e Sistemi in Tempo Reale Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 5, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction

More information

Introduction to Computers and Java

Introduction to Computers and Java Introduction to Computers and Java Chapter 1 Chapter 1 1 Objectives overview computer hardware and software introduce program design and object-oriented programming overview the Java programming language

More information