Assembly Language -- Overview CISP 310 Prof. Chapman.

Slides:



Advertisements
Similar presentations
CSE 105 Structured Programming Language (C)
Advertisements

ITCS 3181 Logic and Computer Systems 2015 B. Wilkinson slides3.ppt Modification date: March 16, Addressing Modes The methods used in machine instructions.
The Assembly Language Level
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
COE Computer Organization & Assembly Language
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#4)
COE Computer Organization & Assembly Language Introduction HLL vs. Assembly Programming Languages.
CS 201 Overview of Computers & Programming Debzani Deb.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computers: Tools for an Information Age
Program Flow Charting How to tackle the beginning stage a program design.
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
Elements of the Computer (How a processor works)
Guide To UNIX Using Linux Third Edition
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
CIS 260 Computer Programming I in C Prof. Timothy Arndt.
CS2422 Assembly Language & System Programming September 26, 2006.
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#1) By Dr. Syed Noman.
Chapter 1 - Introduction. Ch 1Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Assembly & Machine Languages
Chapter 2 Software Tools and Assembly Language Syntax.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
1 - buttons Click “Step Forward” to execute one line of the program. Click “Reset” to start over. “Play,” “Stop,” and “Step Back” are disabled in this.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
Computer Organization & Assembly Language
David Evans CS201j: Engineering Software University of Virginia Computer Science Lecture 18: 0xCAFEBABE (Java Byte Codes)
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Programming Languages: Telling the Computers What to Do Chapter 16.
ICS312 Set 4 Program Structure. Outline for a SMALL Model Program Note the quiz at the next lecture will be to reproduce this slide.MODEL SMALL.586 ;
Languages and Environments Higher Computing Unit 2 – Software Development.
ITEC 352 Lecture 11 ISA - CPU. ISA (2) Review Questions? HW 2 due on Friday ISA –Machine language –Buses –Memory.
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
General Computer Science for Engineers CISC 106 Lecture 02 Dr. John Cavazos Computer and Information Sciences 09/03/2010.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
RM2D Let’s write our FIRST basic SPIN program!. The Labs that follow in this Module are designed to teach the following; Turn an LED on – assigning I/O.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Programming With C.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Introduction to Programming Instructor: Yong Tang Brookhaven National Laboratory Working on accelerator control (BNL Phone #)
Assembly Language for x86 Processors 7th Edition Chapter 13: High-Level Language Interface (c) Pearson Education, All rights reserved. You may modify.
Introduction to C CMSC 104, Section 4 Richard Chang 1.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CHAPTER 1: Introduction to Computers and Programming CSEB113 PRINCIPLES of PROGRAMMING CSEB134 PROGRAMMING I by Badariah Solemon 1BS (May 2012)
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
EEL 3801 Part IV The Assembler. OFFSET Operator Returns address of variable used as operand. Actually, it represents the offset from the beginning of.
COMPUTER ARCHITECTURE & OPERATIONS I Instructor: Yaohang Li.
1 Overview of Programming Principles of Computers.
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
Hello world !!! ASCII representation of hello.c.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Operating Systems A Biswas, Dept. of Information Technology.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE
Chapter 6 Programming the basic computer
Presentation transcript:

Assembly Language -- Overview CISP 310 Prof. Chapman

CRC CISP 310Chapman Assembly Language Is… Not A High-Level Language

CRC CISP 310Chapman High-Level Languages (HLL) void main() { do something } *.c file Compiler not text, binary *.obj file not text, binary *.exe file Linker C library files (existing *.obj files)

CRC CISP 310Chapman High-Level Languages (HLL) C language program *.c file Programmer’s focus is on getting the syntax and structured logic correct in the source code

CRC CISP 310Chapman High-Level Languages C++ language program Object-oriented (OO) *.cpp file Programmer’s focus is on getting the syntax and OO logic correct

CRC CISP 310Chapman HLL Development Techniques Compiler catches syntax mistakes Compiler translates from text into processor-specific binary codes (object file)

CRC CISP 310Chapman HLL Development Techniques Memory for data storage and program code itself is automatically allocated Linker creates *.exe file

CRC CISP 310Chapman Assembly is Not a HLL An assembly programmer has to deal directly with the processor memory (RAM) The instructions are much more cryptic like “move data to a different memory address”

CRC CISP 310Chapman Assembly is Not a HLL We must write code to enable I/O between keyboard, files, and monitor (generally using operating system procedures) We must use a different design philosophy besides OO

CRC CISP 310Chapman Assembly is Not a HLL Loop and if logic is implemented differently in assembly than with HLL

CRC CISP 310Chapman HLL OO Procedure Let’s look at the code that defines the effect of clicking this Button control (VB.NET language)

CRC CISP 310Chapman ' called when Call Peedy button is clicked Private Sub btnCall_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCall.Click m_objMSpeaker.Show(0) ' move Peedy to a specified location m_objMSpeaker.MoveTo(Convert.ToInt16(Cursor.Position.X - 100), Convert.ToInt16(Cursor.Position.Y + 130)) m_objMSpeaker.Play("Wave") ' tell Peedy what to say m_objMSpeaker.Speak("Hello, I'm Peedy. Please say or select the name of the person whose phone number you would like to find.", "") m_objMSpeaker.Speak("If you wish to say the name, press the Scroll Lock key then speak the name.", "") m_objMSpeaker.Play("RestPose") cboName.Enabled = True btnCall.Enabled = False End Sub ' btnCall_Click HLL comment subroutine with 7 HLL statements

CRC CISP 310Chapman HLL Translated Into Assembly Every high-level instruction is equivalent to a group of many assembly instructions Each assembly instruction is cryptic

CRC CISP 310Chapman m_objMSpeaker.Speak("Hello, I'm Peedy. Please say or select the name of the person whose phone number you would like to find.", "") This HLL statement Eight Assembly statements f5 mov esi,dword ptr [ebx ECh] fb push dword ptr ds:[ h] mov ecx,esi mov edx,dword ptr ds:[020529C4h] mov eax,dword ptr [ecx] b mov eax,dword ptr [eax+0Ch] e mov eax,dword ptr [eax ACh] call dword ptr [eax+5Ch] =

CRC CISP 310Chapman Assembly Sample Assembly Instruction f5 mov esi,dword ptr [ebx ECh] operation code operands register (memory) hexadecimal constant

CRC CISP 310Chapman Assembly Language Is… Not Self-Documenting

CRC CISP 310Chapman What Does This Accomplish? f5 mov esi,dword ptr [ebx ECh] fb push dword ptr ds:[ h] mov ecx,esi mov edx,dword ptr ds:[020529C4h] mov eax,dword ptr [ecx] b mov eax,dword ptr [eax+0Ch] e mov eax,dword ptr [eax ACh] call dword ptr [eax+5Ch] nop Huh?

CRC CISP 310Chapman What’s Difficult About Assembly? Cannot easily see purpose of code segment (see previous slide) Not portable (separate assembly instructions for Intel, Motorola, … processors)

CRC CISP 310Chapman What’s Right With Assembly? Every language is based on machine code, and assembly is closest to machine code Assembly is necessary to write high-level language translators Java/C++/C#/VB.NET/Fortran/…)

CRC CISP 310Chapman What’s Right With Assembly? We can write I/O code to communicate between our program and peripherals (cameras, iPods, etc.) We can write instructions that are optimized for our processor, creating very very small and very very fast programs

CRC CISP 310Chapman What You Will Learn At the end of this course, you will be able to create simple command-line programs that accept input from the keyboard and display text output to the monitor You will finally understand the structure of memory and the inner workings of the processor chip

CRC CISP 310Chapman Ending Metaphor HLL programmers: authors who develop the content of a book but leave the details of typesetting, printing, sales, and distribution to someone else Assembly programmers: authors who can both write and publish, sell, and distribute their own books. They understand programming at a deeper level than a HLL programmer.