Chapt.2 Machine Architecture Impact of languages –Support – faster, more secure Primitive Operations –e.g. nested subroutine calls »Subroutines implemented.

Slides:



Advertisements
Similar presentations
Instruction Set Design
Advertisements

Programming Languages and Paradigms
Chapter 8: Central Processing Unit
1 Lecture 4: Procedure Calls Today’s topics:  Procedure calls  Large constants  The compilation process Reminder: Assignment 1 is due on Thursday.
The Assembly Language Level
Tuan Tran. What is CISC? CISC stands for Complex Instruction Set Computer. CISC are chips that are easy to program and which make efficient use of memory.
Chapter 3 Loaders and Linkers
FIT1001- Computer Systems Lecture 12 Introduction to System Software.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
CS 31003: Compilers ANIRUDDHA GUPTA 11CS10004 G2 CLASS DATE : 24/07/2013.
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++
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
G. Levine Chapter 6 Chapter 6 Encapsulation –Why do we want encapsulation? Programmer friendliness- programmer need not know about these details –Easier.
Midterm Wednesday Chapter 1-3: Number /character representation and conversion Number arithmetic Combinational logic elements and design (DeMorgan’s Law)
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
Chapter 10 Storage Management Implementation details beyond programmer’s control Storage/CPU time trade-off Binding times to storage.
Chapter 3 Program translation1 Chapt. 3 Language Translation Syntax and Semantics Translation phases Formal translation models.
State Machines Timing Computer Bus Computer Performance Instruction Set Architectures RISC / CISC Machines.
RISC. Rational Behind RISC Few of the complex instructions were used –data movement – 45% –ALU ops – 25% –branching – 30% Cheaper memory VLSI technology.
6/27/2015G. Levine1 PROGRAMMING LANGUAGES Text: Programming Languages, Design and Implementation Pratt and Zelkowitz 4 th ed. Prentice-Hall.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
COP4020 Programming Languages
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
Chapter 17 Programming Tools The Architecture of Computer Hardware and Systems Software: An Information Technology Approach 3rd Edition, Irv Englander.
Language Systems Chapter FourModern Programming Languages 1.
CS 355 – Programming Languages
CS 403: Programming Languages Lecture 2 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
1 History of compiler development 1953 IBM develops the 701 EDPM (Electronic Data Processing Machine), the first general purpose computer, built as a “defense.
Software Overview. Why review software? Software is the set of instructions that tells hardware what to do The reason for hardware is to execute a program.
Cosc 2150: Computer Organization
Computer Systems Organization CS 1428 Foundations of Computer Science.
1 Names, Scopes and Bindings Aaron Bloomfield CS 415 Fall
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
CS 147 June 13, 2001 Levels of Programming Languages Svetlana Velyutina.
1 ENERGY 211 / CME 211 Lecture 26 November 19, 2008.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
ECEG-3202 Computer Architecture and Organization Chapter 7 Reduced Instruction Set Computers.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
1 Machine architecture Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Chapter 2.
The Instruction Set Architecture. Hardware – Software boundary Java Program C Program Ada Program Compiler Instruction Set Architecture Microcode Hardware.
How to execute Program structure Variables name, keywords, binding, scope, lifetime Data types – type system – primitives, strings, arrays, hashes – pointers/references.
1 Machine architecture Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Chapter 2.
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
1 Asstt. Prof Navjot Kaur Computer Dept PRESENTED BY.
Names, Scope, and Bindings Programming Languages and Paradigms.
CISC. What is it?  CISC - Complex Instruction Set Computer  CISC is a design philosophy that:  1) uses microcode instruction sets  2) uses larger.
Hello world !!! ASCII representation of hello.c.
Operating Systems A Biswas, Dept. of Information Technology.
1 The user’s view  A user is a person employing the computer to do useful work  Examples of useful work include spreadsheets word processing developing.
Lecture 3 Translation.
Computer Organization and Architecture Lecture 1 : Introduction
Advanced Computer Systems
Languages and Compilers (SProg og Oversættere)
Introduction to Operating Systems
Instruction sets : Addressing modes and Formats
CS 3304 Comparative Languages
Language Translation Compilation vs. interpretation.
Chapter 1 Preliminaries.
History of compiler development
Compiler Construction
Chapter 1 Introduction.
CSCE Fall 2013 Prof. Jennifer L. Welch.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
CSCE Fall 2012 Prof. Jennifer L. Welch.
Principles of Programming Languages
Presentation transcript:

Chapt.2 Machine Architecture Impact of languages –Support – faster, more secure Primitive Operations –e.g. nested subroutine calls »Subroutines implemented with stack (ex: PL/1- recursion) IBM704 – index registers Security –e.g., data and code kept separate –O.S. kept separate –Limitations Space Time –Networks, multiprocessors, etc.

Hardware or actual computer Data / storage CELL –Main memory, cache and registers –Fixed-length words determines range of values of data Limitation on range and precision of numbers –Strictly speaking, built-in types are determined by operations Operations on data –Primitive operations manipulate data Integer, character, bit string, (1-dimensional) arrays Possibly floating-point, character string –Data operations are valid on all data cells

Hardware Sequence control (control operations) –Sequence (von Neumann architecture) Program address register (PC) incremented automatically –Jump or branch –Branch conditionally –Multiprocessing as alternative control mechanism Data access –Operation (move, load, etc.) –Operand – typically address of cell RISC (fewer hardware ops) vs CISC

Hardware Effect of current access times –Register access – 5-10 nsec –Memory access – nsec –I/O access – msec. Modular programs can make efficient use of cache and virtual memory (hits) Cost of tasking In-line modules Multi-dimensional arrays

Computer states State transitions for representing virtual machine State transition diagrams for proving correctness

Role of firmware Instructions in microprogram Emulation to create virtual computer FORTRAN hardware machine –Statements in hardware/firmware Translator is interpreter Cost in terms of flexibility, monetary, speed –Slower for running spreadsheet, for example

Translators Translators allow for the creation of virtual machines A program language defines its own machine –May restrict data operations e.g., pure LISP does not have use floating point operations –May restrict control operations Typically does not allow use of primitive i/o operations –Adds its own data and control structures

Translators Interpreter – decodes and executes each hardware machine instruction or higher level statement (initially Basic, Snobol, LISP, Perl, Smalltalk, Java) –Does not create object code –Each statement (even in a loop) must be repeatedly translated Assembler – specific to hardware; translates almost 1-1 to hardware machine instruction

Translators Virtual machine is portable, user friendly(?) Compiler creates object code in assembler or hardware machine language –Quick and dirty –Optimizing Cross compiler – translates to machine language of another machine (simulation) –Useful for designing code for small chips Load or link editor - source code is typically relocatable and object code is a single executable program with external references resolved Preprocessor or macroprocessor –Source and object code both in high level language –Initial pass for expanding macros, constants, C++, etc.

Hierarchies of virtual machines Hardware machine- gates, switches Augmented by microcode Operating System virtual machine –Denies some functions –Adds some capabilities e.g., i/o, semaphores C virtual computer –Hides/ adds capabilities –C library routines Web virtual machine –Browser executing HTML, XML pages

Binding Times Binding of data: association with cell(s) Binding of operation: association with hardware primitive operation(s) Typically several intermediate steps Flexibility versus efficiency/ reliability –Late binding provides greater flexibility, less efficiency, typically less reliability

Binding Times –During program execution Module entry- semi-dynamic Arbitrary run times – dynamic –During compile/ translation time Bindings chosen by the programmer –Ex: types and their operations –Array and record size Bindings chosen by the translator –Ex: position of data on the stack Bindings chosen by the loader, linker –Ex: storage location or displacement

Binding Times During language implementation for specific hardware –possibly number implementation Cs int Issue of portability During language definition type –The ability to define more operations for a type –The ability to define new data types

Binding Times: example Statement X = X + 10 –Association of Type with X Language definition determines possible range of types (int, short int, float, complex, user defined, etc.) Xs type may be chosen statically (C), or dynamically (SNOBOL) –Association of Value with X Language implementation may determine range and representation of value Xs value is determined at arbitrary pts of execution –Association of + Language definition determines what + can be (or sum, etc.) Binding of + to hardware or software op –Compile time in FORTRAN, C –At arbitrary pts of execution in C++ – polymorphism

Binding time: example static int X = 10; –In C Xs range of types, meaning of = are determined at language definition X is assigned 10 only upon first execution X retains value between calls

Do we need to know about the hardware? High speed, large memories shield us from many of the problems that earlier programmers had Speed of translating and executing Java is small in relation to network transmission, user response time Can careful language design shield us from hardware? – not entirely