1 of 26

Addressing Modes of 8086

2 of 26

The instruction set of a microprocessor is a list of all the software instructions that the processor can execute. When an instruction expressed in machine code, it is encoding using 0’s and 1’s(in hexadecimal format), A single machine instruction can take anywhere from 1 to 6 byte

  • Program:

The Sequence of Instructions

  • Instruction:

Each command in a Program is called an Instruction

  • Machine Language Code:

A Program written in machine language is referred to as

  • Assembly Language

In 8086 we Write Program in

3 of 26

4 of 26

Instruction : format :-�Ex. �START: MOV AX, BX ; copy BX into AX

LABEL:

INSTRUCTION

;COMMENT

START:

MOV AX, BX

; copy BX into AX

Address identifier

Semicolon marks the beginning of the Comment, Does not generate any machine code

5 of 26

6 of 26

7 of 26

Why study addressing modes?

Addressing modes help us to understand the types of operands and the way they are accessed while executing an instruction.

8 of 26

What are we going to study?

Addressing modes

    • We will see the types of addressing modes present in 8086.
    • We will study each addressing mode with example.

9 of 26

Types of addressing mode in 8086

  1. Immediate addressing mode
  2. Direct addressing mode
  3. Register addressing mode
  4. Register Indirect addressing mode
  5. Indexed addressing mode
  6. Register relative addressing mode
  7. Base plus index addressing mode
  8. Base relative plus index addressing mode

10 of 26

1: Immediate addressing mode

  • In this type of mode, immediate data is part of instruction and appears in the form of successive byte or bytes

MOV AX,10ABH

AX

10 ABH

11 of 26

2: Direct addressing mode

  • In this type of addressing mode a 16-bit memory address is directly specified in the instruction as a part of it.

MOV AX,[5000H]

AX

Memory

5000

5001

5002

22

33

22

33

12 of 26

3: Register addressing mode

  • In this type of addressing mode, the data is stored in the register and it can be a 8-bit or 16-bit register. All the registers, except IP, may be used in this mode.

MOV AL,BL

MOV AX,BX

AH AL

AX

FF 33

BX

10 AB

BH BL

10 AB

13 of 26

14 of 26

15 of 26

16 of 26

17 of 26

4: Register Indirect addressing mode

  • The address of the memory location which contains data or operand is determined in a indirect way, using the offset register.

MOV AX,[BX]

Memory

5000

5001

5002

22

50

00

AX

BX

33

22

33

18 of 26

Reflection Spot

Q) Which addressing does instruction above belong, and why?

MOV [7000H],CX

19 of 26

Reflection Spot

Q) Which addressing does instruction above belonging and why?

MOV [7000H],CX

Memory

7000

7001

7002

22

CX

33

Ans) Direct addressing mode

43

56

43

56

20 of 26

5: Indexed addressing mode

  • In this addressing mode, offset of the operand is stored in one of the index registers. DS is the default segment for index register SI and DI.

MOV AX,[SI]

Memory

5000

5001

5002

22

50

00

AX

SI

33

22

33

21 of 26

6: Register relative addressing mode

  • In this mode, the data is available at an effective address formed by adding an 8-bit or 16-bit displacement with the content of any one of the registers BX, BP, SI and DI in the default (either DS or ES) segment.

MOV AX, 50H[BX]

Memory

5051

5052

5053

44

50

00

AX

BX

33

Offset

+ 50H = 5050H

Final

Index

Address

44

33

22 of 26

7: Base plus index addressing mode

  • In this mode the effective address is formed by adding content of a base register (any one of BX or BP) to the content of an index register (SI or DI). Default segment register DS.

MOV AX, [BX] [SI]

3000

3001

3002

10

00

AX

BX

= 3000H

Final

Index

Address

20

00

SI

+

12

34

12

34

23 of 26

8: Base relative plus index addressing mode

  • In the effective address is formed by adding an 8 or 16-bit displacement with sum of contents of any one of the base registers (BX or BP) and any one of the index registers, in a default segment.

MOV AX,50H[BX][SI]

3050

3051

3052

10

00

AX

BX

= 3050H

Final

Index

Address

20

00

SI

12

50H +

34

12

34

24 of 26

What we have learnt

    • Different types of addressing modes present in 8086.
    • Location of operands with respect to different addressing modes.

Summery

25 of 26

References

  • Advanced Microprocessors and Peripheral

- By K Bhurchandi, A. K. Ray 

26 of 26

This presentation is licensed to the public Text is available under the Creative Commons Attribution-ShareAlike License