Anda di halaman 1dari 3

# MAP notes

## 8. Relative based indexed 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

## bl = 9fh before execution

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

## After execution al = 78h

al = 90h

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

Eg:

Mov al,bl

If BL = 55h;

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

contents of the base register and displacement or index register and displacement.

## 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.

## 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.

## 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.

## 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

## 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.

## After execution al = 6Fh

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

Eg.

STI

CLD

STD