Addressing modes : Data addressing mode

 Addressing modes

         Addressing modes are the different way (methods) of specifying the location of data to the microprocessor. Using different addressing modes we tell microprocessor where data is stored. Following are different addressing modes of 8086 microprocessor.

1)      Data addressing mode

2)      Program memory addressing mode

3)      Stack memory addressing mode

 

1)      Data addressing mode

The data addressing modes are used to specify the location of data that is stored in

Register, memory location or immediately. Following are different type of data addressing mode.

                    I.            Register addressing mode

In this addressing mode both operand are registers i.e. 8-bit or 16-bit .

For example,

             MOV AL,BL instruction will copy data stored in BL (source operand) into AL (destination operand).

            MOV AX,BX             ; copy the content/data in BX into AX

            ADD CX,DX             ; Add the data/ content in DX with content in CX & final result  

   stored in CX.

 

                    II.            Immediate addressing mode

In this addressing mode 8-bit or 16-bit data is specified in the instruction itself. In another words in this addressing mode data is a part of instruction.

MOV AL,04 H           ;04H immediate no./data is move or copy in AL register.

MOV AX,1234H        ; 1234H immediate no./ data is move in AX register

ADD AL,04 H      ; 04H immediate no./ data add with the content/ data in AL reg. & Result store in AL register.

 

                   III.            Direct addressing mode          

The addressing mode used when data is stored in memory location. In this addressing mode the 16-bit offset address of memory location is specified directly in the instruction. For example.

MOV AL,[3000]   ;copy data stored on 3000 memory location into AL register.

MOV CX,[2000]  ;copy data stored on 2000 memory location into CX register.

            ADD AL,[2000]   ; Add data stored on 1000 memory location with data in AL

                                Register & result stored in AL register.

 

                IV.            Register indirect addressing mode

This addressing mode is also used when data is stored in memory location. In this addressing mode the offset addressing of memory location is stored in either base or index register i.e. BP,BX,SI,DI

      Effective address =[BP,BX,SI,DI]

Examples,

MOV AL,[SI]       ; data on memory location is stored in si reg. copy into AL reg.

MOV AX,[BX]    ;copies the data from the data segment offset address of select by contented BX into register AX.

             V.            Base addressing with displacement

This addressing mode is also used when data is store in memory location.

In this addressing mode the offset address is sum(addition) of contents of base registers & 8/16 bit displacement.

Effective address= [BP/BX + 8/16 bit displacement ]

Example ,

 MOV AX, [BX+4]    ; Loads AX from the data segment address formed by contained of BX plus 4.

MOV [BX+2], 1234H            ; 1234H immediate data is loaded data segment address formed by contents of BX plus 2.

 

                   VI.            Indexed addressing with displacement

This addressing mode is also used when data is stored in memory location. In this addressing mode the offset address is sum (addition) of index registers & 8/16 bit displacement.

      Effective address = [SI/DI+8/16 bit displacement]

Examples,

1) MOV AX,[SI+4]          ; load AX register from memory location formed by adding

                                            contents of SI plus 4.

2)MOV [DI+1345H], 1234H       ;1234H immediate data is copy on memory location     

  formed by content of DI pulse 1345H

          

                VII     Base plus index addressing mode:-

                        This addressing mode is also used when data is stored in memory location. In this

addressing mode the offset address is sum (addition) of contents of index registers and

base registers. Effective address=[SI/DI+BX/BP]

Example,

1)MOV AX,[SI+BP]              ;load AX register from memory location address formed                 by contents of SI plus BP.

2)MOV [DI+BX], 1234H      ;1234H immediate data is copy on memory location address formed by content of DI plus BX.

 

              VIII      Base plus index addressing mode with displacement

                        This addressing mode is also used when data is stored in memory in memory location. In this addressing mode the offset address is sum (addition) of contents of index register, base registers & 8/16 bit displacement

Post a Comment

0 Comments