You are on page 1of 16

INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

IT2623-MODULE 6
ADDRESSING
MODES OF 8086

Picture/s from Google


INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

• The different ways in


which a processor
can access data are
called
addressing
modes
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

• 8086 accesses code bytes using


contents of CS & IP register

• 8086 accesses stack using contents


of SS & SP register
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

How 8086 accesses data?


• 8086 assembly language instructions
can be used to illustrate the
addressing modes

• Format of MOV instruction


MOV destination, source
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

• Source of data can be


– Immediate data
– A specified register
– A memory location specified in 1 of 24
different ways
• Destination of data can be
– A specified register
– A memory location specified in 1 of 24
different ways
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

ADDRESSING MODES OF 8086


1) Immediate addressing mode
2) Register addressing mode
3) Direct memory addressing mode
4) Register based indirect addressing
mode
5) Register relative addressing mode
6) Base indexed addressing mode
7) Relative based indexed addressing mode
8) Implied addressing mode
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

1) Immediate addressing mode


• In this mode, the operand is specified in the instruction
itself. Instructions are longer but the operands are easily
identified.
• Immediate data is a part of instruction.
• The immediate data may be 8-bit or 16-bit in size.

Example:
• MVI CL, 12H
• MOV AX, 0005H
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

2) Register addressing mode


• In this mode, operands are specified using registers. This
addressing mode is normally preferred because the
instructions are compact and fastest executing of all
instruction forms.
• Registers may be used as source operands, destination
operands or both.
• Source/Destination Can Be One Of The 8086 Registers

Example:

• MOV AX, BX
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

3) Direct memory addressing mode


• In this mode, address of the operand is directly specified in the
instruction. Here only the offset address is specified, the
segment being indicated by the instruction.

• Memory Address (Offset) Is Directly Specified In The


Instruction .
• By default, DS register is used for accessing data from memory

• 16-bit offset can be specified in many ways

Example:
• MOV CL, [4321H]
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

Different ways of specifying


offset
• Direct memory addressing
• Register Indirect addressing
• Based addresing
• Indexed addressing
• Based Indexed addressing
• String addressing
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

4) Register based indirect addressing mode


• In this mode, the effective address of the
memory may be taken directly from one of the
base register or index register specified by
instruction. If register is SI, DI and BX then DS
is by default segment register.

• If BP is used, then SS is by default segment


register.

Example:
• MOV CX, [BX]
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

5) Register relative addressing mode

• In this mode, the operand address is


calculated using one of the base
registers and an 8 bit or a 16 bit
displacement.
• Specifies the operand as a 8-bit signed
displacement relative to PC
Example:
• MOV CL, [BX + 04H]
• JNC 08H
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

6) Base indexed addressing mode


• Here, operand address is calculated as base
register plus an index register.
• Effective address is sumof
– 16-bit offset given ininstruction
– Contents of index register SI or DI
– Contents of base register BX or BP
• Segment register is DS
Example:
• MOV CL, [BX + SI]
• MOV AX, 4[BX][SI]
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

7) Relative based indexed addressing


mode
• In this mode, the address of the operand
is calculated as the sum of base register,
index register and 8 bit or 16 bit
displacement.

Example:
• MOV CL, [BX + DI + 20]
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

8) Implied addressing mode


• In this mode, the operands are
implied and are hence not specified
in the instruction.
• No operands are specified

Example:
• STC
• CLC
INSTITUTE OF INFORMATION AND COMPUTING SCIENCES

Asst. Prof. Maria Lourdes L. Edang

Picture/s from Google

You might also like