0% found this document useful (0 votes)
4 views

Lecture #09, Microprocessor-Addressing Modes

The document discusses the addressing modes of the 8086 microprocessor, detailing how operands are specified in instructions. It covers various addressing modes including register, immediate, direct, register indirect, based, indexed, based indexed, and based indexed with displacement. Each mode is explained with examples illustrating how data is transferred between registers and memory locations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Lecture #09, Microprocessor-Addressing Modes

The document discusses the addressing modes of the 8086 microprocessor, detailing how operands are specified in instructions. It covers various addressing modes including register, immediate, direct, register indirect, based, indexed, based indexed, and based indexed with displacement. Each mode is explained with examples illustrating how data is transferred between registers and memory locations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

EEE-3103: Microprocessor and Interfacing

Lecture #9: 8086 Microprocessor


Addressing Modes of 8086

Dr. Sharnali Islam


Department of Electrical and Electronic Engineering
University of Dhaka
[email protected]

Slides used resources from:


Prof. Sazzad M.S. Imran, PhD, EEE DU
Web resources UNDERSTANDING 8085/8086 MICROPROCESSORS - Sen
Addressing Modes
Instruction = opcode + operand.
Operand may reside in
(i) accumulator or
(ii) general purpose register or
(ii) memory location.

Addressing mode = Manner in which operand is specified in instruction.


Different addressing modes of 8086-
(i) Register operand addressing.
(ii) Immediate operand addressing.
(iii) Memory operand addressing.

Different memory addressing modes are-


(i) Direct Addressing
(ii) Register Indirect Addressing
(iii) Based Addressing
(iv) Indexed Addressing
(v) Based Indexed Addressing and
(vi) Based Indexed with displacement.
Addressing Modes
Register Addressing Mode
Transfers copy of a byte or word from source to destination register.
8-bit register = AH, AL, BH, BL, CH, CL, DH and DL.
16-bit register = AX, BX, CX, DX, SP, BP, SI, and DI.
Instructions have to use same size registers.
Example- MOV AX, BX
Immediate Addressing Mode
Data immediately follow hexadecimal opcode.
Operates upon a byte or word of data.
Transfers source into destination register or memory location.
Example- MOV AL, 015H
Value of immediate operand must always be preceded by a zero.
Direct Addressing Mode
Two basic forms are-
i) direct addressing: MOV between memory location and AL, AX
ii) displacement addressing: applies to any instruction [4 bytes].

Address =
displacement + DS (= default data segment address) or
displacement + SEG (alternate segment address).
SEG = segment override prefix.

Direct addressing moves byte or word between memory location and register.
Instruction set does not support memory-to-memory transfer, except MOVS.
Effective address follows instruction opcode. Thus-
PA = Segment base : Direct address.
= DS : EA
LDA 2050H ; (load content of 2050 into AL)

Direct Addressing Mode MOV AX, [1234H]

Example- MOV CX, [BETA]


If BETA = 1234H 0E = 0000 1110

PA = 02000H + 1234H = 03234H cx

MOV [0404H], CX [0404HCL; 0405HCH]

segment addr.

Offset addr.

Physical addr.
Register Indirect Addressing Mode
Data to be addressed at any memory location through offset address.
Offset address → BP, BX, DI, or SI.
SS DS
Transfers byte or word between register and memory location.
Direct addressing → EA = constant
Register indirect addressing → EA = variable.
DS = Default segment register.
SEG = segment override prefix → any of 4 segment registers can be referenced.
PA can be computed as-

Stack segment

Data segment
Register Indirect Addressing Mode
Example- MOV AX, [SI]
If SI = 1234H and DS = 0200H, then
PA = 02000H + 1234H = 03234H
DS = default segment register for BX, DI, or SI.
SS = default segment register for BP.
Based Addressing Mode
Operand offset address = BX/BP registers + 8-bit/16-bit displacement.
PA = Segment base : Base + Displacement

Change displacement value →


Access different elements within same data
structure.

Change base register value →


Access same element in another data structure.
different array er same element e access korbo
MOV AX, [BX + 04H]

Based Addressing Mode


Effective Address = Base Register + Offset MOV AL, [BP + 02H]

MOV BYTE [BP + 2], AL


MOV AL, BYTE [BP + 2]
Example- MOV [BX].BETA, AL BETA

PA = 02000H + 1000H + 1234H = 04234H


DS = default segment register for BX.
SS = default segment register for BP.
Indexed Addressing Mode
Operand offset address = SI or DI register + 8-bit/16-bit displacements.
PA = Segment Base : Index + Displacement

Change index register value →


Access different elements within same data
structure.

Change displacement value →


Access same element in another data
structure.
Effective Address = Index Register + Offset

Indexed Addressing Mode


MOV AL, [SI + 05H]
MOV AX, [DI + 10H]

Example- MOV AL, ARRAY[SI]


PA = DS + SI + direct displacement.
PA = 02000H + 2000H + 1234H = 05234H
Based Indexed Addressing Mode MOV AX, [BX + SI]
MOV AL, [BP + DI]
Based indexed addressing = based addressing + indexed addressing.
Offset address = Base register + Index register.
PA = Segment base : Base + Index
= DS : BX + SI or SS : BP + DI

PA

Example- MOV AL, [BX].[SI]


Assume- DS=0300H, BX=1000H, SI=1234H
PA = 03000H + 1000H + 1234H = 05234H
Based Indexed with
MOV AX, [BX + SI + 08H]
MOV AL, [BP + SI + 03H]

Displacement Addressing Mode


Offset = Base register + Index register + 8 or 16-bit displacement.
PA = Segment base : Base + Index + Displacement

Used to access two dimensional (m×n) array.

Displacement = starting position of array.

Base register = one coordinate (say m) and


Index register = other coordinate (say n).
Based Indexed with
Displacement Addressing Mode
Example- MOV AH, [BX] [SI] + BETA
PA = 02000H + 1000H + 2000H + 1234H = 06234H

You might also like