Introduction Chapter 1 S. Dandamudi. Outline  A user’s view of computer systems  What is assembly language?  Relationship to machine language  Advantages.

Slides:



Advertisements
Similar presentations
1 CIS 461 Compiler Design and Construction Fall 2014 Instructor: Hugh McGuire slides derived from Tevfik Bultan, Keith Cooper, and Linda Torczon Lecture-Module.
Advertisements

Assembly Language for x86 Processors 6 th Edition Chapter 1: Introduction to ASM (c) Pearson Education, All rights reserved. You may modify and copy.
Chapter 1 An Overview of Computers and Programming Languages.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
1 Experiment 0 COE 205 Computer Organization & Assembly Language Programming Term 043.
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.
Course: Introduction to Computers
1 ENG236: Introduction (1) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
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.
Course Introduction C++ An Introduction to Computing.
An Introduction Chapter Chapter 1 Introduction2 Computer Systems  Programmable machines  Hardware + Software (program) HardwareProgram.
Introduction Chapter 1 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer, 2005.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Computer organization & Assembly Language Programming
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
Programming Language Rico Yu. Levels of Programming Languages 1.Low level languages 2.High level languages.
1 Introduction to Information Systems Essentials for the Internetworked E-Business Enterprise C h a p t e r Computer Software 1.
Overview of Computer Organization Chapter 1 S. Dandamudi.
Introduction Chapter 1 S. Dandamudi. Outline A user’s view of computer systems What is assembly language? – Relationship to machine language Advantages.
C o n f i d e n t i a l 1 Course: BCA Semester: III Subject Code : BC 0042 Subject Name: Operating Systems Unit number : 1 Unit Title: Overview of Operating.
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 7 Low-Level Programming Languages. 2 Chapter Goals List the operations that a computer can perform Discuss the relationship between levels of.
Addressing Modes Chapter 6 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer,
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
Computer Software Types Three layers of software Operation.
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
Experiment 0 COE 205 Computer Organization & Assembly Language Programming Term 052.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Installing Java on a Home machine For Windows Users: Download/Install: Go to downloads html.
Getting ready. Why C? Design Features – Efficiency (C programs tend to be compact and to run quickly.) – Portability (C programs written on one system.
OCR A Level F453: The function and purpose of translators Translators a. describe the need for, and use of, translators to convert source code.
Programming 2 Intro to Java Machine code Assembly languages Fortran Basic Pascal Scheme CC++ Java LISP Smalltalk Smalltalk-80.
Week 6 Dr. Muhammad Ayaz Intro. to Assembly Language.
Suffolk County Community College Mathematics and Computer Science Ammerman Campus CST 121Spring 2013 Section 151CRN: Computer Organization And System.
INTRODUCTION TO COMPUTER PROGRAMMING ITC-314. Computer Programming  Computer Programming means creating a sequence of instructions to enable a computer.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Game programming 1.
Computer Language
Computer Applications in Business
CSC235 Computer Organization & Assembly Language
Installing Java on a Home machine
Why don’t programmers have to program in machine code?
Assembler, Compiler, MIPS simulator
Visit for more Learning Resources
Morgan Kaufmann Publishers
Assembly Language for x86 Processors 6th Edition
Operating System Interface between a user and the computer hardware
Programming Language Hierarchy, Phases of a Java Program
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Why to use the assembly and why we need this course at all?
Introduction
Microprocessor and Assembly Language
A451 Theory – 7 Programming 7A, B - Algorithms.
Teaching Computing to GCSE
CSCI/CMPE 3334 Systems Programming
Unit# 8: Introduction to Computer Programming
TRANSLATORS AND IDEs Key Revision Points.
Teaching Computing to GCSE
Translators & Facilities of Languages
Programming Languages
Installing Java on a Home machine
Central Processing Unit
What is an Operating System?
Translators & Types of Languages
Programming Languages
University of Gujrat Department of Computer Science
Introduction to Microprocessor Programming
Presentation transcript:

Introduction Chapter 1 S. Dandamudi

Outline  A user’s view of computer systems  What is assembly language?  Relationship to machine language  Advantages of high- level languages  Faster program development  Easier maintenance  Portability  Why program in assembly language?  Time-efficiency  Space-efficiency  Accessibility to hardware  Typical applications  Why learn assembly language?  Performance: C versus assembly language  Multiplication example 2005 To be used with S. Dandamu di, “Introduct ion to Assembly Language Programm ing,” Second Edition, Springer, S. Dandamudi Chapter 1: Page 2

A User’s View of Computer Systems  Depends on the degree of abstraction provided by the underlying software  We consider a hierarchy of five levels  Moving to the top of hierarchy shields the user from the lower-level details  The top two levels are system independent  The lower four levels are system dependent  Assembly and machine languages are specific to a particular processor  One-to-one correspondence between assembly language and machine language 2005 To be used with S. Dandamu di, “Introduct ion to Assembly Language Programm ing,” Second Edition, Springer, S. Dandamudi Chap ter 1: Page 3

A User’s View of Computer Systems (cont’d) To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer, S. Dandamudi Chapter 1: Page 4

What Is Assembly Language?  Low-level language  Each instruction performs a much lower-level task compared to a high-level language instruction  One-to-one correspondence between assembly language and machine language instructions  For most assembly language instructions, there is a machine language equivalent  Assembler translates assembly language instructions to machine language instructions  Directly influenced by the instruction set and architecture of the processor (CPU) To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer, Chapter 1: Page 5

What Is Assembly Language? (Cont’d)  Some example assembly language instructions: inc result mov class_size,45 and mask1,128 add marks,10  Some points to note:  Assembly language instructions are cryptic  Mnemonics are used for operations  inc for increment, mov for move (i.e., copy)  Assembly language instructions are low level  Cannot write instructions such as mov marks, value To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer, S. Dandamudi Chapter 1: Page 6 MIPS Examples andi $t2,$t1,15 addu $t3,$t1,$t2 move $t2,$t1

What Is Assembly Language? (Cont’d)  Some simple high-level language instructions can be expressed by a single assembly instruction Assembly Language C inc resultresult++; mov class_size,45class_size = 45; and mask1,128mask1 &= 128; add marks,10marks += 10; S. Dandamudi

What Is Assembly Language? (Cont’d)  Most high-level language instructions need more than one assembly instruction C Assembly Language size = value;mov AX,value mov size,AX sum += x + y + z;mov AX,sum add AX,x add AX,y add AX,z mov sum,AX,” Second Edition, Springer, S. Dandamudi Chapter 1: Page 8

What Is Assembly Language? (Cont’d)  Readability of assembly language instructions is much better than the machine language instructions  Machine language instructions are a sequence of 1s and 0s Assembly Language Machine Language (in Hex) inc result FF060A00 mov class_size,45 C7060C002D00 and mask, E0080 add marks, F000A S. Dandamudi Chapter 1: Page 9

What Is Assembly Language? (Cont’d)  MIPS examples Assembly Language Machine Language (in Hex) nop move $t2,$t15 000A2021 andi $t2,$t1,15 312A000F addu $t3,$t1,$t2 012A5821 Second Edition, Springer, S. Dandamudi Chap ter 1: Page 10

Advantages of High-level Languages  Program development is faster  High-level instructions  Fewer instructions to code  Programs maintenance is easier  For the same reasons as above  Programs are portable  Contain few machine-dependent details  Can be used with little or no modifications on different types of machines  Compiler translates to the target machine language  Assembly language programs are not portable S. Dandamudi Chapter 1: Page 11

Why Program in Assembly Language?  Two main reasons:  Efficiency  Space-efficiency  Time-efficiency  Accessibility to system hardware  Space-efficiency  Assembly code tends to be compact  Time-efficiency  Assembly language programs tend to run faster  Only a well-written assembly language program runs faster  Easy to write an assembly program that runs slower than its high-level language equivalent Second Edition, Springer, S. Dandamudi Chapter 1: Page 12

Typical Applications  Application that need one of the three advantages of the assembly language  Time-efficiency  Time-convenience  Good to have but not required for functional correctness  Graphics  Time-critical  Necessary to satisfy functionality  Real-time applications  Aircraft navigational systems  Process control systems  Robot control software  Missile control software Second Edition, Springer, S. Dandamudi Chapter 1: Page 13

Typical Applications (cont’d)  Accessibility to system hardware  System software typically requires direct control of the system hardware devices  Assemblers, linkers, compilers  Network interfaces, device drivers  Video games  Space-efficiency  Not a big plus point for most applications  Code compactness is important in some cases  Portable and hand-held device software  Spacecraft control software Second Edition, Springer, S. Dandamudi Chapter 1: Page 14

Why Learn Assembly Language?  Some applications require programming in assembly language  Typically only a small part of an application is coded in assembly language (rest written in a high-level language)  Such programs are called mixed mode programs  Assembly language can be used as a tool to learn computer organization  You will know more about the organization and internal workings of a computer system  Personal satisfaction of learning something something complicated and useful Second Edition, Springer, S. Dandamudi Chapter 1: Page 15

Performance: C versus Assembly Language To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer, S. Dandamudi Chapter 1: Page 16 Last slide