Sunteți pe pagina 1din 3

MAP notes

Chapter 3: Instruction set of 8086 Microprocessor Part 1


Addressing modes:

The different addressing modes are as follows:

1. Implicit addressing mode

2. Register addressing mode

3. Immediate addressing mode

4. Direct addressing mode

5. Register Indirect addressing mode

6. Register relative addressing mode

7. Based indexed addressing mode

8. Relative based indexed addressing mode

1. Immediate addressing mode

In this addressing mode the data (operand) is present in the instruction itself.

Eg.

Mov bl,02h

This instruction when executed will move immediate data 02h into the bl register

Assume

After execution bl = 02h

bl = 9fh before execution

2. Direct addressing mode

In this addressing mode, the data is present in the memory i.e. data segment, and the effective
address (offset address) where the data is present is given in the instruction.

Eg.

Mov al, [1234h]

This instruction moves the data present at the effective address 1234h

Assume data at the address ds : 1234 = 78h;

After execution al = 78h

al = 90h

3. Register addressing mode

In this addressing mode the data is present in any of the general purpose registers.

The name of the register is mentioned in the instruction itself.


Eg:

Mov al,bl

When this instruction is executed the contents of bl register is copied to al register

If BL = 55h;

After instruction is executed


BL = 55h;

AL = 00h

AL = 55h

4. Register indirect addressing mode

In this addressing mode the data is present in the memory location and the address of the
memory location is not given directly in the instruction but instead is stored in some register
pair or index register.

For this purpose three registers are used viz. BX, SI, and DI

Eg.

Mov al,[si]

It moves the contents at the memory location whose offset address is given by si register

Assume al = 00h, si = 145Ah, now square brackets in the instruction indicates address

Let data at the location DS : 145AH = 34h


After execution al = 34h

5. Register relative addressing mode

In this addressing mode, data is present in the memory and to access this data we require its
address.

The address is not given directly in the instruction but instead is obtained by adding the
contents of the base register and displacement or index register and displacement.

Eg. Mov al,[si+08]

si = 1002h, displacement = 08, therefore effective address = 1002h + 08h = 100Ah

The above instruction will move the content at the memory location 100Ah which is formed
by adding si and displacement in al register.

Assume data at location DS : 100Ah = 56h

Therefore al = 56h after execution

6. Based indexed addressing mode

In this addressing mode the data is present in the memory whose address is not given directly
in the instruction but instead is calculated by adding the contents in the base register and
index register.

Eg. Mov al,[bx][si]

Let bx = 1087h, si = 2004h, si+bx = 308Bh = effective address or offset address

This instruction will mov the data present at the memory location 308Bh into al register.

Lets assume al = 09h before execution and address 308Bh contains 8Ch data.

After execution al = 8Ch

7. Relative based indexed addressing mode

In this addressing mode the data is present in the memory and to access this data, we require
its address which is not present directly in the instruction.

The address is calculated by adding the contents in the base register and index register and
displacement

Eg. Mov al, [si+01][bx]

Let si = 1000h, bx = 1200h, displacement = 1h, EA = 1000h+1200h+1h = 2201h

When the above instruction is executed the data at the location 2201h will be copied in the al
register.

Assume al = 23h before execution, data at the location 2201h = 6Fh

After execution al = 6Fh

8. Implicit addressing mode

In the addressing mode the data is neither present in the instruction, nor any register, nor at
any memory location.

There are some instructions which work on some registers directly such addressing scheme is
called as implicit addressing mode.

Eg.

STI

;set interrupt flag

CLD

;clear direction flag

STD

;set direction flag

S-ar putea să vă placă și