COE 205 - 3 Computer Organization & Assembly Language Introduction HLL vs. Assembly Programming Languages.

Slides:



Advertisements
Similar presentations
Week 3. Assembly Language Programming  Difficult when starting assembly programming  Have to work at low level  Use processor instructions >Requires.
Advertisements

The Assembly Language Level
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.
COE Computer Organization & Assembly Language
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
Fall 2001CS 4471 CS 447: Fall 2001 Chapter 1: Computer Abstraction and Technology (Introduction to the course)
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Overview of Programming Paradigms
Table 1. Software Hierarchy Levels.. Essential Tools An assembler is a program that converts source-code programs into a machine language (object file).
1-1 Embedded Software Development Tools and Processes Hardware & Software Hardware – Host development system Software – Compilers, simulators etc. Target.
Introduction to a Programming Environment
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 1, Lab.
1 Introduction Chapter 1 n What is Assembly Language? n Data Representation.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#1) By Dr. Syed Noman.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Chapter-01 Introduction to Computers and C++ Programming.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
P51UST: Unix and Software Tools Unix and Software Tools (P51UST) Compilers, Interpreters and Debuggers Ruibin Bai (Room AB326) Division of Computer Science.
Course Introduction C++ An Introduction to Computing.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
An intro to programming. The purpose of writing a program is to solve a problem or take advantage of an opportunity Consists of multiple steps:  Understanding.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Evolution of Programming Languages Generations of PLs.
Programming With C.
Introduction to Computers and Programming 1. History of computers (4 slides) 2. What is a computer system? 3. What is a software? 4. What is programming?
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
The LC-3 – Chapter 7 COMP 2620 Dr. James Money COMP
PROGRAMMING LANGUAGES
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
Chapter 1.4 Programming Languages and Programming.
Computer organization Practical 1. Administrative Issues The course requirements are: –To be nice and open minded –To pass the exam (there is a boolean.
CSE:141 Introduction to Programming Faculty of Computer Science, IBA BS-I (Spring 2010) Lecture 2.
Chapter 1 Introduction. Chapter 1 -- Introduction2  Def: Compiler --  a program that translates a program written in a language like Pascal, C, PL/I,
CS-303 Introduction to Programming
1 Compiler & its Phases Krishan Kumar Asstt. Prof. (CSE) BPRCE, Gohana.
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
The Instruction Set Architecture. Hardware – Software boundary Java Program C Program Ada Program Compiler Instruction Set Architecture Microcode Hardware.
Introduction to Language Programming Hierarchy of programming lang. Based on machine independences: 1. Machine language 2. Assembly language 3. Higher.
8086/8088 Instruction Set, Machine Codes and Addressing Modes.
Basic Concepts Computer Organization & Assembly Language Programming Instructor: Maram Alsahafi [Some of the contents Adapted from slides Dr Adnan Gutub,
Compiler Construction CPCS302 Dr. Manal Abdulaziz.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
The Functions and Purposes of Translators Translators, Interpreters and Compilers - High Level Languages.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Computer Software.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Programming Languages
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.
A LECTURE NOTE. Introduction to Programming languages.
CHAPTER NINE.
Component 1.6.
Assembler, Compiler, MIPS simulator
Chapter 1 Introduction.
Operating System Interface between a user and the computer hardware
CSCI-235 Micro-Computer Applications
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Microprocessor and Assembly Language
Chapter 1 Introduction.
Chapter 3 Machine Language and Assembly Language.
Chapter 3 Machine Language and Assembly Language.
Unit# 8: Introduction to Computer Programming
Teaching Computing to GCSE
Programming Languages
Lectures 2 & 3: Computer Organization
Lesson Objectives Aims Key Words Compiler, interpreter, assembler
University of Gujrat Department of Computer Science
Chapter 1 Introduction.
Presentation transcript:

COE Computer Organization & Assembly Language Introduction HLL vs. Assembly Programming Languages

Term 042 COE 205 Dr.Talal AlKharobi 2 Programming Language  Computers only understand programs in their own machine language.  It is extremely impractical to ask programmers to write their programs in machine language.  So what is the solution to this dilemma?  The answer is in what are called programming languages  Programming language can be a High-level languages (HLL) or a low level language (assembly)

Term 042 COE 205 Dr.Talal AlKharobi 3 High-Level Languages (HLL)  HLLs are programming languages that look like natural language text.  They make programming easier and more abstract, i.e. the programmer does not need to come up with the detailed machine instructions  HLL programs are machine independent. They can be run on different hardware platforms (i.e. different computers with different instruction sets)  To run a HLL program on a specific machine, it has to be translated to its machine language  This is done through the use of a compiler: a program that translates a HLL program to a machine language program of a specific platform  The Machine language program produced by the compiler is usually referred to as the executable program  Hence by using the appropriate compiler we can execute HLL programs on any platform

Term 042 COE 205 Dr.Talal AlKharobi 4 Mapping Between HLL and Machine Language  Translating HLL programs to machine language programs is not a one-to-one mapping  A HLL instruction (usually called a statement) will be translated to one or more machine language instructions  The number of mapped machine instructions depends on the efficiency of the compiler in producing optimized machine language programs from the HLL programs  Usually, machine language programs produced by compilers are not efficient (i.e. they contain many unnecessary instructions that increase processing and slow down execution).

Term 042 COE 205 Dr.Talal AlKharobi 5 Data Type in HLL vs Machine Language  High-Level Language supports many primitive data types such as  integers & real numbers  strings & characters  Boolean  HLL allows the programmer to define new and complex data types using the primitive data types  HLL compilers strictly enforce data typing, preventing the programmer from making mistakes.  Machine Language just operate on binary numbers and dose not enforce any data typing.

Term 042 COE 205 Dr.Talal AlKharobi 6 Assembly Language  The assembly language is a programming language that uses symbolic names to represent operations, registers and memory locations.  Programs are written in a natural language style.  Each assembly language instruction (or statement) would correspond to a single machine language instruction.  This makes it easier for the programmer to produce efficient machine language programs.

Term 042 COE 205 Dr.Talal AlKharobi 7 Why Learn Assembly Language?  Writing assembly programs gives the computer designer the needed deep understanding of the instruction set and how to design one  To be able to write compilers for HLLs, we need to be expert with the machine language. Assembly programming provide this experience  Sometimes very efficient machine codes are required to do some specific functions and these can not be produced by HLL and compilers. In this case assembly language has to be used  Sometimes we want to access specific memory addresses or I/O ports. This is very difficult to do using HLLs. In these cases Assembly language would be the better choice  Embeded-controllers that find numerous applications nowadays usually contain special-purpose processors. Assembly programming is usually the only practical way to program these processors.

Term 042 COE 205 Dr.Talal AlKharobi 8 Mapping Between Assembly Language and HLL  The mapping between HLL constructs and Assembly language instructions is many-to-many, as it was between HLL and machine language.  The table shows some examples of mapping between some HLL instructions and 8086 assembly language instructions Instruction Class HLLAssembly Language Data Movement a = 5MOV a, 5 Arithmeticb = a + 5MOV ax, a ADD ax, 5 MOV b, ax Control FlowGoto LBLJMP LBL logicalB=B or CMOV ax, C Or B, ax

Term 042 COE 205 Dr.Talal AlKharobi 9 The Assembler & Linker  The program that translates from assembly language to machine language is called an Assembler  It allows the programmer to specify the memory locations for his data and programs and symbolically refer to them in his assembly code.  It will translate these symbolic addresses to actual (physical) addresses in the produced machine code.  The linker is the program that is used to link together separately assembled/compiled programs into a single executable code.  It allows the programmers to develop different parts of a large program separately (some in HLL and others in Assembly depending on the best choice for that part), test them separately and ‘freeze’ them for future use.  This produces modular programs and greatly enables the management of large programming projects.

Term 042 COE 205 Dr.Talal AlKharobi 10 Debugger & Monitor  Tools that allow the assembly programmers to:  Display and alter the contents of memory and registers while running their code,  Perform disassembly of their machine code (show the assembly language equivalent)  Permit them to run their programs, stop (or halt) them, run them step-by-step or insert break points