Assembly Language for Intel-Based Computers, 5th Edition Chapter 1

20 downloads 1309 Views 371KB Size Report
Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007. Web site. Examples. 2. Printing this Slide Show. To print this slide show with black ...
Assembly Language for Intel-Based Computers, 5th Edition Kip Irvine

Chapter 1: Basic Concepts

Slides prepared by the author Revision date: June 3, 2006

(c) Pearson Education, 2006-2007. All rights reserved. You may modify and copy this slide show for your personal use, or for use in the classroom, as long as this copyright statement, the author's name, and the title are not changed.

Printing this Slide Show To print this slide show with black characters on a white background, do the following: •Select Print... from the File menu. •Select Handouts in the Print what drop-down box. •Select 2 or 3 in the Slides per page drop-down box. •Select the Pure black and white check box (optional) •Click on OK to begin printing.

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

2

Chapter 1 Overview • 1.1 Welcome to Assembly Language • 1.2 Virtual Machine Concept • 1.3 Data Representation • 1.4 Boolean Operations

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

3

1.1 Welcome to Assembly Language • 1.1.1 Some Good Questions to Ask • 1.1.2 Assembly Language Applications

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

4

2.1.1 Questions to Ask • What is an assembler? •A program that converts source-code programs from assembly language into machine language •MASM (Microsoft Assembler), TASM (Borland Turbo Assembler)

• Linker (a companion program of Assembler) combines individual files created by an assembler into a single executable program. • Debugger provides a way for a programmer to trace the execution of a program and examine the contents of memory.

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

5

2.1.1 Questions to Ask (cont) • What hardware/software do I need? • A computer with an Intel386, Intel486 or one of the Pentium processors (IA-32 processor family) • OS: Microsoft Windows, MS-DOS, LINUX running a DOS emulator • Editor • Assembler • Linker (Microsoft 16-bit linker: LINK.EXE, 32-bit linker: LINK32.EXE), • Debugger (16-bit MS-DOS programs: MASM CodeView, TASM Turbo Debugger. 32-bit Windows console programs: Microsoft Visual Studio –msdev.exe

• What types of programs will I create? • 16-Bit Real-Address Mode: MS-DOS, DOS emulator • 32-Bit Protected Mode: Microsoft Windows

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

6

2.1.1 Questions to Ask (cont) • How does assembly language (AL) relate to machine language? •One-to-one relationship

• How do C++ and Java relate to AL? •E.g., X=(Y+4) *3

• Is AL portable? •A language whose source program can be compiled and run on a wide variety of computer systems is said to be portable. •AL makes no attempt to be portable. •It is tied to a specific processor family

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

7

2.1.1 Questions to Ask (cont) • Why learn AL? •Embedded system programs •Programs to be highly optimized for both space and runtime speed •To gain an overall understanding of the interaction between the hardware, OS and application programs •Device driver: programs that translate general operating system commands into specific references to hardware details

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

8

1.1.2 Assembly Language Applications • Some representative types of applications: •Business application for single platform •Hardware device driver •Business application for multiple platforms •Embedded systems & computer games

(see next panel)

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

9

Comparing ASM to High-Level Languages

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

10

Chapter 1 Overview: What’ s Next • 1.1 Welcome to Assembly Language • 1.2 Virtual Machine Concept • 1.3 Data Representation • 1.4 Boolean Operations

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

11

1.2 Virtual Machine Concept • Virtual Machines • Specific Machine Levels

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

12

1.2 Virtual Machines • Virtual machine concept • In terms of programming Language : • Each computer has a native machine language (language L0) that runs directly on its hardware • A more human-friendly language is usually constructed above machine language, called Language L1 • Programs written in L1 can run two different ways: • Interpretation –L0 program interprets and executes L1 instructions one by one • Translation –L1 program is completely translated into an L0 program, which then runs on the computer hardware

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

13

1.2 Virtual Machines (Cont.) • In terms of a hypothetical computer • VM1 can execute commands written in language L1. • VM2 can execute commands written in language L2. • The process can repeat until a virtual machine VMn can be designed that supports a powerful, easy-to-use language

Irvine, Kip R. Assembly Language for Intel-Based Computers 5/e, 2007.

Web site

Examples

14

Translating Languages English: Display the sum of A times B plus C.

C++: cout