Tuesday, November 20, 2012

The 8086 Addressing Modes


- 8086 memory addressing modes provide flexible access to memory, allowing you to easily access variables, arrays, records, pointers, and other complex data types.
-12 addressing modes classified in 5 groups
i ) Addressing modes for register and immediate data
1. Register addressing
-the instruction will specify the name of the register which holds the data to be operated by the instruction
-ex: MOV CL, DH : content of 8-bit DH register is moved to another 8-bit register CL
2. Immediate addressing
-an 8-bit or 16-bit data is specified as a part of the instruction
-ex: MOV DL, 08H : The 8-bit data (08H) given in the instruction is moved to DL register
ii) Addressing modes for memory data
3. Direct addressing
-an unsigned 16-bit displacement or signed 8-bit displacement will be specified in the instruction
-ex: MOV DX, [08H]
EA=0008H (sign extended 8-bit displacement)
BA= (DS)*16; MA=BA+EA
(DX)<= (MA) OR DL<= (MA)
DH<= (MA+1)
4. Register indirect addressing
-the name of the register which holds the effective address will be specified in the instruction
-ex: MOV CX, [BX]
5. Based addressing
-BX or BP register is used to hold a base value for effective address and a signed 8-bit or unsigned 16-bit displacement will be specified in the instruction
-ex: MOV AX, [BX+08H]
6. Indexed addressing
-SI or DI reg. is used to hold an index value for memory data and a signed 8-bit displacement or unsigned 16-bit displacement will be specified in the instruction
-ex: MOV CX,[SI+0A2H]
7. Based index addressing
-the EA is given by the sum of base value and 8-bit or 16-bit displacement specified in the instruction
-ex: MOV DX,[BX+SI+0AH]
8. String addressing
-for string instructions
-EA of source data is stored in SI reg. and the EA of destination data is stored in DI reg.
iii) Addressing modes for I/O ports
9. Direct I/O port addressing
-used to access data from standard I/O mapped devices or ports.
-ex: IN AL, [09H]: the content of port with address 09H is moved to AL
10. Indirect I/O port addressing
-is used to access data from standard I/O mapped devices or ports and the instruction will specify the name of the register which holds the port address.
-ex: OUT [DX], AX : the content of AX is moved to port whose address is specified by DX
iv) Relative addressing modes
11. Relative addressing
-EA of the pgm instruction is specified relative to IP by an 8-bit displacement
-ex: JZ 0AH
v) Implied addressing modes
12. Implied addressing
-in this the instruction itself will specify the data to be operated by the instruction
-ex: CLC: clear carry

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More