Chapter Three Addressing Mode MOV AX, BX

Similar documents
Computer Architecture 1 ح 303

Basic characteristics & features of 8086 Microprocessor Dr. M. Hebaishy

3- ADDRESSING MODES in 8086: In this section we use the MOV instruction to describe the data-addressing modes. Figure 3-1 shows the MOV instruction.

Code segment Stack segment

Intel 8086 MICROPROCESSOR ARCHITECTURE

MICROPROCESSOR PROGRAMMING AND SYSTEM DESIGN

Intel 8086 MICROPROCESSOR. By Y V S Murthy

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

8086 Micro-Processors and Assembly Programming Forth Stage المعالجات الميكروية والبرمجة بلغة التجميع استاذة الماده: م.د ستار حبيب منعثر الخفاجي

LABORATORY 1: EXPLORING THE SOFTWARE ARCHITECTURE OF THE MICROPROCESSOR

CC411: Introduction To Microprocessors

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

Assembly Language Each statement in an assembly language program consists of four parts or fields.

BAHAR DÖNEMİ MİKROİŞLEMCİLER LAB3 FÖYÜ

Addressing Modes on the x86

Microprocessor and Assembly Language Week-5. System Programming, BCS 6th, IBMS (2017)

icroprocessor istory of Microprocessor ntel 8086:

16-Bit Intel Processor Architecture

Introduction to Microprocessor

Program controlled semiconductor device (IC) which fetches (from memory), decodes and executes instructions.

Assembling, Linking and Executing 1) Assembling: .obj obj .obj.lst .crf Assembler Types: a) One pass assembler:

Microcomputer Architecture..Second Year (Sem.2).Lecture(2) مدرس المادة : م. سندس العزاوي... قسم / الحاسبات

SPRING TERM BM 310E MICROPROCESSORS LABORATORY PRELIMINARY STUDY

SYSC3601 Microprocessor Systems. Unit 2: The Intel 8086 Architecture and Programming Model

Microprocessor. By Mrs. R.P.Chaudhari Mrs.P.S.Patil

EC-333 Microprocessor and Interfacing Techniques

MICROPROCESSOR TECHNOLOGY

Chapter 02: Computer Organization. Lesson 02: Functional units and components in a computer organization- Part 1: Processor

INTRODUCTION TO MICROPROCESSORS

Lecture 5:8086 Outline: 1. introduction 2. execution unit 3. bus interface unit

9/25/ Software & Hardware Architecture

Chapter 4: Data Movement Instructions. 4 1 MOV Revisited

ADVANCE MICROPROCESSOR & INTERFACING

Internal architecture of 8086

Hardware and Software Architecture. Chapter 2

4- MACHINE LANGUAGE CODING 4-1THE INSTRUCTION SET:

The Instruction Set. Chapter 5

Experiment 3 3 Basic Input Output

The Microprocessor and its Architecture

Northern India Engineering College, Delhi (GGSIP University) PAPER I

A Presentation created By Ramesh.K Press Ctrl+l for full screen view

8086 INTERNAL ARCHITECTURE

Assembler Programming. Lecture 2

MODE (mod) FIELD CODES. mod MEMORY MODE: 8-BIT DISPLACEMENT MEMORY MODE: 16- OR 32- BIT DISPLACEMENT REGISTER MODE

UMBC. A register, an immediate or a memory address holding the values on. Stores a symbolic name for the memory location that it represents.

CG2007 Microprocessor systems.

Chapter 11. Addressing Modes

UNIT 2 PROCESSORS ORGANIZATION CONT.

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF ECE EC6504 MICROPROCESSOR AND MICROCONTROLLER (REGULATION 2013)

1. Introduction to Assembly Language

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-11: 80x86 Architecture

Lecture 15 Intel Manual, Vol. 1, Chapter 3. Fri, Mar 6, Hampden-Sydney College. The x86 Architecture. Robb T. Koether. Overview of the x86


EE2007 Microprocessor systems.

Lecture 5: Computer Organization Instruction Execution. Computer Organization Block Diagram. Components. General Purpose Registers.

CS401 Assembly Language Solved MCQS From Midterm Papers

MPID MICROPROCESSOR AND ITS INTERFACING DEVICES EEE III II SEMESTER OBJECTIVE QUESTIONS


Arithmetic Instructions

Chapter 3: Addressing Modes

EEM336 Microprocessors I. The Microprocessor and Its Architecture

The x86 Architecture

Assembly Language. Dr. Esam Al_Qaralleh CE Department Princess Sumaya University for Technology. Overview of Assembly Language

UNIT 1. Introduction to microprocessor. Block diagram of simple computer or microcomputer.

EXPERIMENT WRITE UP. LEARNING OBJECTIVES: 1. Get hands on experience with Assembly Language Programming 2. Write and debug programs in TASM/MASM

6/20/2011. Introduction. Chapter Objectives Upon completion of this chapter, you will be able to:

Module 3 Instruction Set Architecture (ISA)

EC 333 Microprocessor and Interfacing Techniques (3+1)

Computer Organization & Assembly Language Programming. CSE 2312 Lecture 15 Addressing and Subroutine

Assembly Language Lab #5

Unit I Introduction. Department of Electronics and Communication Engineering VARDHAMAN COLLEGE OF ENGINEERING Shamshabad, Hyderabad , India.

EEM336 Microprocessors I. Addressing Modes

The 8086 Microprocessor

Interfacing Compiler and Hardware. Computer Systems Architecture. Processor Types And Instruction Sets. What Instructions Should A Processor Offer?

FIFTH SEMESTER B.TECH DEGREE EXAMINATION MODEL TEST QUESTION PAPER, NOVEMBER CS 305: Microprocessor and Microcontrollers PART A

EEM336 Microprocessors I. Data Movement Instructions

EC-333 Microprocessor and Interfacing Techniques

Tutorial Letter 103/3/2012 Computer Organization COS2621 Semesters 1 & 2

Vidyalankar. Vidyalankar T.E. Sem. V [CMPN] Microprocessors Prelim Question Paper Solution. 1. (a)

Summer 2003 Lecture 4 06/14/03

Ex : Write an ALP to evaluate x(y + z) where x = 10H, y = 20H and z = 30H and store the result in a memory location 54000H.

THE UNIVERSITY OF TRINIDAD & TOBAGO

Marking Scheme. Examination Paper Department of CE. Module: Microprocessors (630313)

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMMUNICATION ENGINEERING REG 2008 TWO MARKS QUESTION AND ANSWERS

Lecture (02) The Microprocessor and Its Architecture By: Dr. Ahmed ElShafee

Introduction to IA-32. Jo, Heeseung

Intel x86 Memory. Architecture. The x86 isn't all that complex it just doesn't make a lot of sense. Program Segments. x86 Data and Address Ranges

Basic Execution Environment

INTRODUCTION TO IA-32. Jo, Heeseung

Intel 8086: Instruction Set

Computer Processors. Part 2. Components of a Processor. Execution Unit The ALU. Execution Unit. The Brains of the Box. Processors. Execution Unit (EU)

EXPERIMENT 1. FAMILIARITY WITH DEBUG, x86 REGISTERS and MACHINE INSTRUCTIONS

Computer Architecture and System Software Lecture 07: Assembly Language Programming

The x86 Microprocessors. Introduction. The 80x86 Microprocessors. 1.1 Assembly Language

INSTRUCTOR: ABDULMUTTALIB A. H. ALDOURI

UNIT-I. 1.Draw and explain the Architecture of a 8085 Microprocessor?

Data Movement Instructions

Chapter Four Instructions Set

if 2 16bit operands multiplied the result will be

UNIT II OVERVIEW MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Introduction to 8086 microprocessors. Architecture of 8086 processors

Transcription:

Chapter Three The 8086 The 8086 When the 8086 executes an instruction, it performs the specified function on data. The data are called its operands and may be part of the instruction reside in one of the internal registers of the 8086, stored at an address in memory, or held at an I/O port. To access these different types of operands, the 8086 is provided with various addressing modes: 1. Register :- With the register addressing mode, the operand to be accessed is specified as residing in an internal register of the 8086, an example of an instruction that uses this addressing mode is MOV AX, BX This stands for move the contents of BX, the source operand, to AX, the destination operand. Both the source and destination operands have been specified as the content of the internal registers of the 8086. See Figure 10(a, b). 1

2. Immediate :- If a source operand is part of the instruction instead of the contents of a register or memory location, it represents what is called an immediate operand and is accessed using the immediate addressing mode. Typically, immediate operands represent constant data. Immediate operands can be either a byte or word of data. In the instruction MOV AL, 015H The source operand 15H is an example of a byte-wide immediate source operand. Note that the value of the immediate operand must always be preceded by a zero. See Figure 11(a, b). 3. Direct :- Direct addressing differs from immediate addressing in that the locations following the instruction opecode hold an effected memory address (EA) instead of data. This effective address is a 16- bit offset of the storage location of the operand from the current value in the 2

data segment (DS) register. EA is combined with the contents of DS in the BIU to produce the physical address for its source operand is MOV CX, BETA This stands for move the contents of the memory location which is offset by BETA from the current value in DS into internal register CX. See Figure 12(a, b). Notice that the value assigned to constant BETA is 1234H. PA = 02000H + 1234H = 03234H 4. Register Indirect :- Register indirect addressing is similar to direct addressing in that an effective address is combined with the contents of DS to obtain a physical address. However, it differs in the way the offset is 3

specified. This time EA resides in either a pointer register or index register within the 8086. The pointer register can be either BX or BP and the index register can be SI or DI. MOV AX, [SI] This instruction moves the contents of the memory location offset by the value of EA in SI from the current value in DS to the AX register. See Figure 13(a, b). SI contains 1234H and DS contains 0200H. PA = 02000H + 1234H = 03234H 5. Based :- In the based addressing mode, the physical address of the operand is obtained by adding a direct or indirect displacement to the contents of either BX or BP and the current value in DS and SS, 4

respectively. A MOV instruction that uses based addressing to specify the location of its destination operand is as follows: MOV [BX].BETA, AL As shown in Figure 14(a, b) the fetch and execution of this instruction causes the BIU to calculate the physical address of the destination operand from the contents of DS, BX, and the direct displacement. The result is PA = 02000H + 1000H + 1234H = 04234H 6. Indexed :- Indexed addressing works identically to the based addressing, it uses the contents of one of the index registers, instead of BX or BP, in the generation of the physical address, here is an example: MOV AL, ARRAY[SI] 5

The example in Figure 15(a,b) shows the result of executing the MOV instruction. First the physical address for the source operand is calculated from DS, SI, and the direct displacement. PA = 02000H + 2000H + 1234H = 05234H Then the byte of data stored at this location, which is BEH is read into lower byte AL of the accumulator register. 7. Based Indexed :- Combining the based addressing mode and the indexed addressing mode together results in a new, more powerful mode known as based indexed addressing. Let us consider an example of a MOV instruction using this type of addressing. MOV AH, [BX].BETA[SI] 6

An example of executing this instruction is illustrated in Figure 16(a,b). The address of the source operand is calculated as PA = 02000H + 1000H + 1234H + 2000H = 06234H Execution of this instruction causes the Value stored at this location to be written into AH. 8. String :- The string instructions of the 8086's instruction set automatically use the source and destination index registers to specify the effective addresses of the source and destination operands, respectively. The move string instruction MOVS is an example. Notice that neither SI nor DI appears in the string instruction, but both are used during its execution. 7

9. Port :- Port addressing is used in conjunction with the IN and OUT instructions to access input and output ports. Any of the memory addressing modes can be used for the port address for memory mapped ports. For ports in the I/O address space, only the Direct addressing mode and an Indirect addressing mode using DX are available. For example, Direct addressing of an input port is used in the instruction IN AL, 15H This stands for input the data from the byte wide input port at address 15H of the I/O address space to register AL. Next, let us consider another example. Using Indirect port addressing for the source operand in an IN instruction, we get: IN AL, DX It means input the data from the byte wide input port whose address is specified by the contents of register DX. For instance, if DX equals 1234H the contents of the port at this I/O address are loaded into AL. Problems Which register holds a count for some instruction? What is the purpose of the IP register? The carry flag bit is set by which arithmetic operation? A number that contain 3 one bit said to have parity? Find the memory address of the next instruction execute by the micro processor for the following CS:IP combinations: a. CS=1000H and IP=2000H 8

b. CS=2000H and IP=1000H Which register or registers are used as an offset address for string instruction destination in the microprocessor? The stack memory is addressed by a combination of the segment plus offset. Which registers of the 8086 are used in memory segmentation? Categorize each flag bit of the 8086 as either a control flag or as a flag to monitor the effect of instruction execution. identify the three part of an assembly language instruction in each of the following statement: AGAIN: ADD AX, CX; ADD THE REGISTERS MOV BX, AX; SAVE RESULT Identify the source and destination operand for each of the statements in 10. 9