Accomplishing Executables

Slides:



Advertisements
Similar presentations
Chapter 11 Introduction to Programming in C
Advertisements

Introduction to Programming Lecture 2. Today’s Lecture Software Categories Software Categories System Software System Software Application Software Application.
The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
Chapter 1: An Overview of Computers and Programming Languages
1 Starting a Program The 4 stages that take a C++ program (or any high-level programming language) and execute it in internal memory are: Compiler - C++
Systems Software.
Programming Types of Testing.
COSC 120 Computer Programming
Software Language Levels Machine Language (Binary) Assembly Language –Assembler converts Assembly into machine High Level Languages (C, Perl, Shell)
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Program Flow Charting How to tackle the beginning stage a program design.
CHAPTER 1: INTORDUCTION TO C LANGUAGE
Assembler Compiler Interpreter ASSEMBLER To convert the assembly language into machine code. Translate mnemonic operation codes to their machine language.
C++ Programming: From Problem Analysis to Program Design, Fifth Edition Chapter 1: An Overview of Computers and Programming Languages Updated by: Dr\Ali-Alnajjar.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
“C” Programming Language What is language ? Language is medium of communication. If two persons want to communicate with each other, they have to use.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
Chapter 1 What is Programming? Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
History of C 1950 – FORTRAN (Formula Translator) 1959 – COBOL (Common Business Oriented Language) 1971 – Pascal Between Ada.
Introduction to C++ Programming Language
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Memory: Relocation.
CS CS CS IA: Procedural Programming CS IB: Object-Oriented Programming.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CT1513 Introduction To java © A.AlOsaimi.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Copyright © Curt Hill Operating Systems An Introductory Overview.
Department of Electronic & Electrical Engineering Introduction to C - The Development cycle. Why C? The development cycle. Using Visual Studio ? A simple.
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Chapter 1 – Introduction to C.
Introduction to C Programming Language. History of C  C was evolved by Dennis Ritchie at AT&T Bell Laboratories in early of 1970s  Successor of: ALGOL.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
ICS312 Introduction to Compilers Set 23. What is a Compiler? A compiler is software (a program) that translates a high-level programming language to machine.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
THE SOFTWARE Computers need clear-cut instructions to tell them what to do, how to do, and when to do. A set of instructions to carry out these functions.
Binding & Dynamic Linking Presented by: Raunak Sulekh(1013) Pooja Kapoor(1008)
Introduction to Programming By: Prof. Muhammad Abu Baker Siddique 2 nd Lecture 1.
Introduction To Software Development Environment.
1 CS 192 Lecture 4 Winter 2003 December 8-9, 2003 Dr. Shafay Shamail.
Chapter 1: Introduction to Computers and Programming
Lecture 3 Translation.
Chapter 1 Introduction 2nd Semester H
Topic 2: Hardware and Software
Introduction to Computers and C++ Programming
Chapter 1: An Overview of Computers and Programming Languages
Visit for more Learning Resources
Programming languages
Instructor: Chien-Ho Ko
Chapter 1: An Overview of Computers and Programming Languages
Accomplishing Executables
Choice of Programming Language
Chapter 1: Introduction to Computers and Programming
Hello World 2 What does all that mean?.
Chapter 11 Introduction to Programming in C
Chapter 1: An Overview of Computers and Programming Languages
Copyright © by Curt Hill
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Chapter 1 Introduction(1.1)
Chapter 1: An Overview of Computers and Programming Languages
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CS IA: Procedural Programming CS IB: Object-Oriented Programming
Software Development Environment, File Storage & Compiling
Chapter 2 part #1 C++ Program Structure
SPL – PS1 Introduction to C++.
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Accomplishing Executables Briefly how this is done Copyright © 2014-2016 Curt Hill

Introduction An executable program is a series of bits that is perfectly understandable to a machine Most programs need to be coded in a textual or graphical fashion to be done by people This presentation considers how this transformation occurs Copyright © 2014-2016 Curt Hill

Types of Transformers There are two basic classes of program that accomplish this transformation: Interpreters Compilers There are many combinations of these two We shall look at several examples Copyright © 2014-2016 Curt Hill

Definitions Machine language is the only language a CPU may execute Completely different for different types of CPUs An interpreter takes in a source language program It executes it as if it were machine language program A compiler translates the source language from one form to another Most often the result is machine language Translating from a new or rare language to a common one has been done Copyright © 2014-2016 Curt Hill

Interpreters An interpreter takes a command and executes it directly The early BASICs were of this form JavaScript does this as well The interpreter is part of the web browser This is an excellent debugging environment Not as fast, because the parsing of the source code takes time Copyright © 2014-2016 Curt Hill

Simple Interpreter BASIC Interpreter BASIC Source Statements Copyright © 2014-2016 Curt Hill

Compilation Interpretation is like the butler You tell them to do something he does it Compilation is like a translator Convert a program in one language to that of another Usually the result is machine language Copyright © 2014-2016 Curt Hill

Several Steps Take the source language and convert into object code Take several object codes and libraries and link together into an executable Load the executable and run Copyright © 2014-2016 Curt Hill

Compilation Editor Compiler Linker Loader Source Library Object Executable Copyright © 2014-2016 Curt Hill

Compile Cycle The compiler translates the source into object Object is machine language Not yet executable Linker takes one or more objects and libraries and creates the executable Loader executes Copyright © 2014-2016 Curt Hill

project.cpp #include <iostream.h> … int main(void){ cout << “Enter a value”; int a, b; cin >> a >> b; } Copyright © 2014-2016 Curt Hill

Source and Object Inside that code were several types of routines The main function was a function that must be externally declared The cin and cout types are well known externals Brought in through an include Copyright © 2014-2016 Curt Hill

Object file When the C++ compiler executes it compiles project.cpp and produces and object file .OBJ on windows and .o on UNIX This object file is mostly machine language It also contains a relocation dictionary and an external symbol dictionary These are structures we will not worry about Copyright © 2014-2016 Curt Hill

Linker Takes the object files and creates an executable Reads in the object from project.cpp places in a file Finds from a library all of the routines that it needs for this program and places them in the file The cin >> function and cout Copyright © 2014-2016 Curt Hill

Loader Usually invisible to most of us Takes an executable: Part of the OS Takes an executable: Relocates it, if needed Allocates memory for it Creates a process to start it Starts it Cleans up when complete Copyright © 2014-2016 Curt Hill

Some More Thoughts The preprocessor is one additional step in the process Dev is an IDE Interactive Development Environment It manages all the pieces Includes an editor Executes the compiler, linker, etc. Keeps us from having to fuss with a lot of details Copyright © 2014-2016 Curt Hill

Finally There have been many variations on the themes given here Any interactive program can be considered an interpreter of sorts The need for speed has greatly reduced One of the reasons for scripting languages popularity as well as Java Copyright © 2014-2016 Curt Hill