The Intel 8086 Microprocessor
The Intel 8086 Microprocessor
LECTURE - 5
Abdullah Al Noman
Lecturer
Computer Science and Engineering Department
Shahjalal University of Science and Technology
Addressing modes of 8086
Microprocessor
ADDRESSING MODES OF 8086 MICROPROCESSOR
o Addressing modes are techniques used in computer architecture and assembly language
programming to specify how the operands of an instruction are located or accessed in
memory. In other words, addressing modes define the way in which the CPU calculates
the effective address of an operand before performing an operation.
o The addressing modes of 8086 microprocessor can be classified into five groups:
1. Addressing modes for accessing immediate and register data (register and
immediate mode)
2. Addressing modes for accessing data in memory (memory modes)
3. Addressing modes for accessing data from I/O ports (I/O modes)
4. Relative addressing mode
5. Implied addressing mode
ADDRESSING MODES OF 8086 MICROPROCESSOR
MOV DX, CX
Note that in the above both source and destination operands are in register mode.
MOV CL, DL
MOV BX, CH
ADDRESSING MODES OF 8086 MICROPROCESSOR
Example:
MOV CL, 03H
MOV DX, 0502H
Note that in both of the above MOV instructions, the source operand is in immediate mode
and the destination operand is in register mode.
A constant such as "VALUE" can defined by the assembler EQUATE directive such as
VALUE EQU 35H.
MOV BH, VALUE
Note: These immediate data are considered as part of the instruction.
ADDRESSING MODES OF 8086 MICROPROCESSOR
Example:
MOV CX; DS:START
Lets say,
START EQU 0040H
[DS] = 3050H
What will happen next considering the above instruction?
ADDRESSING MODES OF 8086 MICROPROCESSOR
Now, if [DS] = 5004H, [DI] = 0020H, and [BX] = 2456H, then after executing MOV [DI], BX instruction,
what will happen?
ADDRESSING MODES OF 8086 MICROPROCESSOR
BX → DS and BP → SS
Note: SP is called the system stack pointer and BP is called the user stack pointer.
Based mode
Example:
MOV AL, START [BX]
The displacement START can be either unsigned 16-bit or signed 8-bit. The 8086 sign-extends the 8-bit
displacement and then adds it to [BX] in the above MOV instruction for determining EA. On the other hand,
the 8086 adds an unsigned 16-bit displacement directly with [BX] for determining EA.
ADDRESSING MODES OF 8086 MICROPROCESSOR
Example:
MOV BH, ARRAY[SI]
Here the 20-bit physical address is calculated from the displacement ARRAY, SI, and DS. The displacement
is provided by the programmer using an assembler directive such as EQU (ARRAY EQU XXXXH).
For 16-bit displacement, the EU adds this to SI to determine EA. On the other hand, for 8-bit displacement
the EU sign-extends it to 16 bits and then adds to SI for determining EA.
ADDRESSING MODES OF 8086 MICROPROCESSOR
Example:
MOV ALPHA [SI] [BX], CL
If [BX] = 0200H, value of ALPHA = 08H, [SI] = 1000H, and [DS] = 3000H, then 8-bit content of CL is
moved to 20-bit physical address 31208H.
Based indexed addressing mode provides a convenient way for a subroutine to address an array allocated on
a stack. Since in the based indexed mode, the contents of two registers such as BX and SI can be varied,
two-dimensional arrays such as matrices can also be accessed.
ADDRESSING MODES OF 8086 MICROPROCESSOR
2005H
[DF] → 0
[DS] → 2000H and [SI] → 0500H. So, [DS] + [SI] → [20500H] = 38H
[ES] → 4000H and [DI] → 0300H. So, [ES] + [DI] → [40300H] = 45H
Example:
OUT 05H, AL
ADDRESSING MODES OF 8086 MICROPROCESSOR
Example:
IN AL, DX
If [DX] = 5040H, then what will happen after executing this instruction?
IN AX, DX
What will happen after executing this instruction?
Note that 8-bit and 16-bit I/O transfers must take place via AL and AX, respectively.
ADDRESSING MODES OF 8086 MICROPROCESSOR
Example:
STD → Set direction flag
CLC → Clear carry flag
CLD → Clear direction flag
8086 BUS Cycle
HOW THE 8086 DEMULTIPLEXES THE ADDRESS AND DATA BUSES?
Read Cycle
8086 BUS CYCLE
Write Cycle
THANK YOU