Microprocessor and Assembly Language

Slides:



Advertisements
Similar presentations
Assembly Language for x86 Processors 6 th Edition Chapter 1: Introduction to ASM (c) Pearson Education, All rights reserved. You may modify and copy.
Advertisements

Assembly Language for Intel-Based Computers, 4 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and.
Computers Organization & Assembly Language Chapter 1 THE 80x86 MICROPROCESSOR.
Basic Concepts COE 205 Computer Organization and Assembly Language
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Basic Concepts Computer Organization & Assembly Language Programming
Basic Concepts COE 205 Computer Organization and Assembly Language
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
Basic Concepts COE 205 Computer Organization and Assembly Language Computer Engineering Department King Fahd University of Petroleum and Minerals.
Basic Concepts Computer Organization and Assembly Language.
Computer Organization and Assembly Language
Chapter 2 Software Tools and Assembly Language Syntax.
Assembly Language for Intel-Based Computers, 5 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify.
1 Chapter-01 Introduction to Computers and C++ Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and copy this slide show for your personal use, or for.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Introduction Chapter 1 S. Dandamudi To be used with S. Dandamudi, “Introduction to Assembly Language Programming,” Second Edition, Springer, 2005.
High-level Languages.
High level & Low level language High level programming languages are more structured, are closer to spoken language and are more intuitive than low level.
Summer 2014 Chapter 1: Basic Concepts. Irvine, Kip R. Assembly Language for Intel-Based Computers 6/e, Chapter Overview Welcome to Assembly Language.
Assembly Language for x86 Processors 7th Edition
Tranlators. Machine Language The lowest-level programming languageprogramming language Machine languages are the only languages understood by computers.languagescomputers.
Chapter 1: Basic Concepts
Debug and Assembler By, B.R.Chandavarkar Lect. COMP Department NITK, Surathkal.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Assembly Language for x86 Processors 7 th Edition Chapter 1: Basic Concepts (c) Pearson Education, All rights reserved. You may modify and copy this.
Introduction Chapter 1 S. Dandamudi. Outline A user’s view of computer systems What is assembly language? – Relationship to machine language Advantages.
Chapter 19 Number Systems. Irvine, Kip R. Assembly Language for Intel-Based Computers, Translating Languages English: Display the sum of A times.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
1 Text Reference: Warford. 2 Computer Architecture: The design of those aspects of a computer which are visible to the programmer. Architecture Organization.
 Programming - the process of creating computer programs.
Sahar Mosleh California State University San MarcosPage 1 Assembly language and Digital Circuit By Sahar Mosleh California State University San Marcos.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Basic Concepts Computer Organization & Assembly Language Programming Instructor: Maram Alsahafi [Some of the contents Adapted from slides Dr Adnan Gutub,
The Development Process Compilation. Compilation - Dr. Craig A. Struble 2 Programming Process Problem Solving Phase We will spend significant time on.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Skill Area 311 Part B. Lecture Overview Assembly Code Assembler Format of Assembly Code Advantages Assembly Code Disadvantages Assembly Code High-Level.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Computer Software.
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.
Suffolk County Community College Mathematics and Computer Science Ammerman Campus CST 121Spring 2013 Section 151CRN: Computer Organization And System.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Evolution and History of Programming Languages
Computer Applications in Business
CSC235 Computer Organization & Assembly Language
Why don’t programmers have to program in machine code?
Assembly Language for x86 Processors 6th Edition
Assembly Language (CSW 353)
CSCI-235 Micro-Computer Applications
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Instructor: Chien-Ho Ko
A451 Theory – 7 Programming 7A, B - Algorithms.
Assembly Language for x86 Processors 6th Edition
Assembler, Compiler, Interpreter
Programming Languages
Assembly Language for Intel-Based Computers
Introduction Chapter 1 S. Dandamudi. Outline  A user’s view of computer systems  What is assembly language?  Relationship to machine language  Advantages.
Computer Organization and Assembly Language
Assembler, Compiler, Interpreter
University of Gujrat Department of Computer Science
Presentation of Architecture Assembly Language Topic: Assembly Language Group Members: Izaz Ahmad Roll no.6 Imanullah Roll no.54.
Introduction COE 301 Computer Organization
Introduction COE 301 Computer Organization Prof. Aiman El-Maleh
Computer Organization and Assembly Language
System Programming By Prof.Naveed Zishan.
Presentation transcript:

Microprocessor and Assembly Language Introduction to Assembly

Assembly Assembly-, Machine-, and High-Level Languages Programmer’s View of a Computer System Assembly Language Programming Tools Data Representation

Some Important Questions to Ask What is Assembly Language? Why Learn Assembly Language? What is Machine Language? How is Assembly related to Machine Language? What is an Assembler? How is Assembly related to High-Level Language? Is Assembly Language portable?

A Hierarchy of Languages

Assembly and Machine Language Native to a processor: executed directly by hardware Instructions consist of binary code: 1s and 0s Assembly language Slightly higher-level language Readability of instructions is better than machine language One-to-one correspondence with machine language instructions Assemblers translate assembly to machine code Compilers translate high-level programs to machine code Either directly, or Indirectly via an assembler

Compiler and Assembler

Translating Languages English: D is assigned the sum of A times B plus 10. High-Level Language: D = A * B + 10 A statement in a high-level language is translated typically into several machine-level instructions Intel Assembly Language: mov eax, A mul B add eax, 10 mov D, eax Intel Machine Language: A1 00404000 F7 25 00404004 83 C0 0A A3 00404008

Advantages of High-Level Languages Program development is faster High-level statements: fewer instructions to code Program maintenance is easier For the same above reasons Programs are portable Contain few machine-dependent details Can be used with little or no modifications on different machines Compiler translates to the target machine language However, Assembly language programs are not portable

Why Learn Assembly Language? Two main reasons: Accessibility to system hardware Assembly Language is useful for implementing system software Also useful for small embedded system applications Space and time efficiency Understanding sources of program inefficiency Tuning program performance Writing compact code

Assembly vs High-Level Languages Some representative types of applications:

Next … Assembly-, Machine-, and High-Level Languages Programmer’s View of a Computer System Assembly Language Programming Tools

Programmer’s View of a Computer System Application Programs High-Level Language Assembly Language Operating System Instruction Set Architecture Microarchitecture Digital Logic Level 0 Level 1 Level 2 Level 3 Level 4 Level 5 Increased level of abstraction Each level hides the details of the level below it

Programmer's View – 2 Application Programs (Level 5) Written in high-level programming languages Such as Java, C++, Pascal, Visual Basic . . . Programs compile into assembly language level (Level 4) Assembly Language (Level 4) Instruction mnemonics are used Have one-to-one correspondence to machine language Calls functions written at the operating system level (Level 3) Programs are translated into machine language (Level 2) Operating System (Level 3) Provides services to level 4 and 5 programs Translated to run at the machine instruction level (Level 2)

Programmer's View – 3 Instruction Set Architecture (Level 2) Specifies how a processor functions Machine instructions, registers, and memory are exposed Machine language is executed by Level 1 (microarchitecture) Microarchitecture (Level 1) Controls the execution of machine instructions (Level 2) Implemented by digital logic (Level 0) Digital Logic (Level 0) Implements the microarchitecture Uses digital logic gates Logic gates are implemented using transistors

Next … Assembly-, Machine-, and High-Level Languages Programmer’s View of a Computer System Assembly Language Programming Tools

Assembler Software tools are needed for editing, assembling, linking, and debugging assembly language programs An assembler is a program that converts source-code programs written in assembly language into object files in machine language Popular assemblers have emerged over the years for the Intel family of processors. These include … TASM (Turbo Assembler from Borland) NASM (Netwide Assembler for both Windows and Linux), and GNU assembler distributed by the free software foundation You will use MASM (Macro Assembler from Microsoft)

Linker and Link Libraries You need a linker program to produce executable files It combines your program's object file created by the assembler with other object files and link libraries, and produces a single executable program LINK32.EXE is the linker program provided with the MASM distribution for linking 32-bit programs We will also use a link library for input and output Called Irvine32.lib developed by Kip Irvine Works in Win32 console mode under MS-Windows

Debugger Allows you to trace the execution of a program Allows you to view code, memory, registers, etc. You will use the 32-bit Windows debugger

Editor Allows you to create assembly language source files Some editors provide syntax highlighting features and can be customized as a programming environment