MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Addressing Mode.

Slides:



Advertisements
Similar presentations
Block Diagram of Intel 8086 Engr.M.Zakir Shaikh
Advertisements

Register In computer architecture, a processor register is a small amount of storage available on the CPU whose contents can be accessed more quickly than.
Registers of the 8086/ /2002 JNM.
There are two types of addressing schemes:
Introduction to 8086 Microprocessor
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
Introduction to Microprocessor
CEN 226: Computer Organization & Assembly Language :CSC 225 (Lec#3) By Dr. Syed Noman.
Princess Sumaya Univ. Computer Engineering Dept. د. بســام كحـالــه Dr. Bassam Kahhaleh.
Azir ALIU 1 What is an assembly language?. Azir ALIU 2 Inside the CPU.
Princess Sumaya University
1 ICS 51 Introductory Computer Organization Fall 2006 updated: Oct. 2, 2006.
8-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL x86 Instructions Part.
ICS312 Set 3 Pentium Registers. Intel 8086 Family of Microprocessors All of the Intel chips from the 8086 to the latest pentium, have similar architectures.
80x86 Processor Architecture
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
Unit-1 PREPARED BY: PROF. HARISH I RATHOD COMPUTER ENGINEERING DEPARTMENT GUJARAT POWER ENGINEERING & RESEARCH INSTITUTE Advance Processor.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
The 8086 Microprocessor The 8086, announced in 1978, was the first 16-bit microprocessor introduced by Intel Corporation 8086 is 16-bit MPU. Externally.
CEG 320/520: Computer Organization and Assembly Language ProgrammingIntel Assembly 1 Intel IA-32 vs Motorola
An Introduction to 8086 Microprocessor.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 Microprocessor Architecture.
1 Fundamental of Computer Suthida Chaichomchuen : SCC
Types of Registers (8086 Microprocessor Based)
Faculty of Engineering, Electrical Department,
Computers organization & Assembly Language Chapter 1 THE 80x86 MICROPROCESSOR.
Intel 8086 (8088) Microprocessor Structure
3.4 Addressing modes Specify the operand to be used. To generate an address, a segment register is used also. Immediate addressing: the operand is a number.
6-4 CPU-Registers, effective address General registers vs Segment registers Computer Studies (AL)
Introduction to Microprocessors Chapter 3. Programming Model (8086)  Shows the various internal registers that are accessible to the programmer.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
Internal Programming Architecture or Model
Intel 8086 MICROPROCESSOR ARCHITECTURE
Computer Organization & Assembly Language University of Sargodha, Lahore Campus Prepared by Ali Saeed.
Intel MP Organization. Registers - storage locations found inside the processor for temporary storage of data 1- Data Registers (16-bit) AX, BX, CX, DX.
SOFTWARE ARCHITECTURE OF THE 8088 AND 8086 MICROPROCESSORS
PS02CINS02 Unit 1 Advanced Microprocessors. Comparison between 8085 and Size8-bit16-bit Address Bus and Memory16-bit/64kB20-bit/1MB Instruction.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
Chapter 12 Processor Structure and Function. Central Processing Unit CPU architecture, Register organization, Instruction formats and addressing modes(Intel.
Instruction set Architecture
An Introduction to 8086 Microprocessor.
Part of the Assembler Language Programmers Toolbox
UNIT Architecture M.Brindha AP/EIE
Introduction to 8086 Microprocessor
8086 Microprocessor.
Computer Organization & Assembly Language Chapter 3
ADDRESSING MODES.
Intel 8086 MICROPROCESSOR Architecture.
EE3541 Introduction to Microprocessors
Microcomputer Programming
ADDRESSING MODES.
University of Gujrat Department of Computer Science
Intel 8088 (8086) Microprocessor Structure
Microcomputer & Interfacing Lecture 1
Symbolic Instruction and Addressing
Introduction to Assembly Language
Microprocessor & Assembly Language
Intel 8088 (8086) Microprocessor Structure
8086 Registers Module M14.2 Sections 9.2, 10.1.
CS-401 Computer Architecture & Assembly Language Programming
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
CS 301 Fall 2002 Computer Organization
Symbolic Instruction and Addressing
CNET 315 Microprocessor & Assembly Language
Computer Architecture CST 250
Unit-I 80386DX Architecture
Intel 8086.
Chapter 8: Instruction Set 8086 CPU Architecture
Part I Data Representation and 8086 Microprocessors
Presentation transcript:

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR1 Addressing Mode

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR Microprocessor Register 8086 Registers Category CategoryBitRegister Name General Purpose Register16AX,BX,CX,DX General Purpose Register8AH,AL,BH,BL,CH,CL,DH,DL Pointer Register16SP (Stack Pointer) BP (Base Pointer) Index Register16SI (Source Index) DI (Destination Index) Segment Register16CS (Code Segment) DS (Data Segment) SS (Stack Segment) ES (Extra Segment) Instruction Pointer Register16IP (Instruction Pointer) Status Register (Flag)16DR (Flag Register)

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 3 General Purpose Registers This register is used for general data manipulation Even CPU able to operate on the data stored in memory, the same data can be process much faster if it is in register The function for 16-bit 8086 microprocessor register is as follows RegisterFunction AXAccumulator Register For arithmetic, logic and data transfer operation BXBase Register Also as address register CXCount Register Used for loop counter, shift and rotate bits DXData Register Used in division and multiplication also I/O operation

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 4 8-bit Data Division from 16-bit 16-bit register can be divided into two 8-bit register (i.e AX=AH&AL, BX=BH&BL, CX=CH&CL, DX=DH&DL) Figure 1: 8-bit Data Division from 16-bit

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 5 Segment Register Main memory management in 8086 use segment concept The following show the usage of segment in memory SegmentUsage Code (CS)Space to store program that will be executed Data (DS)Space to store data that will be processed Stack (SS)Special space to store information needed by microprocessor to execute subroutine or interrupt service Extra (ES)Function is the same as DS

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 6 Instruction Pointer Register (IP) Register which stores instruction address to be executed Each time instruction is fetch from memory to be executed in processor, IP content will be added so that it always show to the next instruction If branch instruction, the IP content will be loaded with new value which is the branch address

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 7 Index Register and Pointer This registers is used for storing relative shifting value for memory address location There are 2 pointer register:  Stack Pointer (SP) – point to the top stack  Base Pointer (BP) – used for fetch data in data segment There are 2 index register:  Source Index (SI) – contains offset address for source operand in data segment  Destination Index (DI) - contains offset value for destination operand in DS

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 8 Flag/Status Register Flag bit status register is used to determine flow control when conditional branch instruction is executed R = Register U = Undefined OF = Overflow Flag DF = Direction Flag IF= Instruction Flag TF = Trap Flag SF = Sign Flag ZF = Zero Flag AF = Auxiliary Flag PF = Parity Flag CF = Carry Flag

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 9 Addressing Mode Concept from Computer Science Are an aspect of the Instruction Set Architecture (ISA) in most CPU design How machine language instruction in that architecture identify operand of each instruction Primarily interest the compiler writer and those who write code directly in assembly language

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 10 Addressing Mode Addressing Mode is a technique to determine which operand to be fetched. (Operand = argument for an operator or for machine language instruction) Addressing mode is used for:  Give flexible programming to user using pointers to memory, counter for loop control, index for data and program replacement  Reduce bit numbers in address field for an instruction There are 7 types of addressing mode in 8086 register:  Register addressing mode  Immediate addressing mode  Direct addressing mode  Indirect addressing mode  Base relative addressing mode  Index relative addressing mode  Base index relative addressing mode

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 11 Addressing Mode AdvantageDisadvantage RegisterNo memory referenceLimited address space ImmediateNo memory referenceLimited operand magnitude DirectEasyLimited address space IndirectLarge address spaceMore reference to memory Base relativeFlexibleComplex Index relativeFlexibleComplex Base index relativeFlexibleComplex

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 12 Register Addressing Mode Simplest mode and often used Involved register usage Data obtained from operation is stored in other register EA = R EA = Effective Address (EA) for one location which contain reference operand R = Address field content in instruction which refer to register (R)

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 13 Register Addressing Mode Figure: Register Addressing Mode (EA=R)

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 14 Register Addressing Mode Example: Destination operand Source operand Copy DX value to BX

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 15 Register Addressing Mode

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 16 Immediate Addressing Mode Data is coded directly into machine code instruction Operand for source is a constant and is part of instruction Operand = A (where A = content for address field in instruction Figure: Immediate Addressing Mode (Operand = A) Example:Load value 2550H to AX Destination operand Source operand

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 17 Immediate Addressing Mode Can’t be used with data segment (DS) and flag register (DF) This problem can be overcome by loading 0123H to one general purpose register and then the register value is copied to segment register as the following: Invalid Example: Load value directly to DS Destination operand Source operand

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 18 Immediate Addressing Mode

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 19 Direct Addressing Mode Operand is stored in memory location, commonly data segment (DS) Source operand is the address not immediate data (written in [ ]) This address is effective address which is the address of 16-bit offset for operand storage location (from current DS value) Effective address need to be coupled with DS content to get the true operand address (physical address) EA = A EA = Effective address for location that contains referred operand A = Content for address field in one instruction

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 20 Direct Addressing Mode Example Effective Address given is = If DS content is 2000 therefore physical address is Physical Address = Segment Address + Effective Address

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 21 Indirect Addressing Mode This mode use register as substitute to constant (in direct addressing mode) to determine 16-bit offset address for an operand Offset address where data is placed might be in base pointer register (BP), base register (BX), index register (DI,SI) In ambiguity case, assembler use BYTE PTR and WORD PTR to show the size of data address using memory pointer R= content for address field in instruction which referred to register

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 22 Indirect Addressing Mode It is often used to access data table from memory Example: Effective Address given is = If DS content is 1010 therefore physical address is Physical Address = Segment Address + Effective Address

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 23 Base Relative Addressing Mode Operand located in address obtained from addition of 8 or 16 bit displacement into one of BX or BP and the result is then combined with segment data (DS/SS) This 8 or 16- bit displacement must be specified in operand field and translated as signed two’s compliment For 8-bit, displacement must in the range of -128 to +127 For 16-bit, displacement must in the range of to Effective Address = [Base register] + displacement Physical Address = DS/SS = [Base register] + displacement

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 24 Base Relative Addressing Mode Effective Address = Register [BX] + displacement Example: If DS content is 4000 therefore physical address is: Physical Address = Segment Address + Effective Address

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 25 Indexed Relative Addressing Mode The same as base addressing except that index register (SI/DI) is used Operand is at given address by signed 8 or 16-bit displacement addition to one of SI or DI and the result is then added with segment register (DS=Default) Example MOV DX, ARRAY [SI] Effective address = register [SI] + ARRAY = H = 6234H If DS content is 2000, therefore the physical address is Physical address = Segment address + Effective address = 20000H H =26234H

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 26 Indexed Relative Addressing Mode

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 27 Base Indexed Relative Addressing Mode Combine base addressing mode and indexed addressing mode Base register (BX?BP) is added to index register (DI/SI) as positive integer (each register is in the range of 0 to 65535) As default, segment address is obtained from DS except for BP register which is obtained form SS Effective Address = [base address] + [index register] + displacement Example Let say BX = 1000X, SI = 2000H, BETA = 1234H, DS =1200H Effective Address = register [BX] + register [SI] + ARRAY Physical Address = Segment address + Effective address

MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 28 Base Indexed Relative Addressing Mode