1327 Addressing Modes Of 8086
description
Transcript of 1327 Addressing Modes Of 8086
![Page 1: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/1.jpg)
Addressing Modes of Addressing Modes of 80868086
Addressing Modes of Addressing Modes of 80868086
Prepared & Presented by-Prepared & Presented by-Rajvir SinghRajvir Singh
![Page 2: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/2.jpg)
• The different ways in which a processor can access data are
called addressing modes
![Page 3: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/3.jpg)
• 8086 accesses code bytes using contents of CS & IP register
• 8086 accesses stack using contents of SS & SP register
![Page 4: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/4.jpg)
How 8086 accesses data?
• 8086 assembly language instructions can be used to illustrate the addressing modes
• Format of MOV instructionMOV destination, source
![Page 5: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/5.jpg)
• Source of data can be– Immediate data– A specified register– A memory location specified in 1 of
24 different ways
• Destination of data can be– A specified register– A memory location specified in 1 of
24 different ways
![Page 6: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/6.jpg)
Classification of Addressing Modes
1. Register addressing mode2. Immediate addressing mode3. Memory addressing mode4. Port addressing mode5. Relative addressing mode6. Implied addressing mode
![Page 7: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/7.jpg)
1. Register addressing mode
• Source/destination can be one of the 8086 registers
• MOV AX, BX ; 16-bit data transfer• MOV AL, BL ; 8-bit data transfer
![Page 8: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/8.jpg)
2. Immediate addressing mode
• 8 or 16-bit data can be specified as part of the instruction
• E.g. MOV AL, 45HMOV BX, 5062H
![Page 9: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/9.jpg)
3. Memory addressing mode
• One of the operands is in memory• 8086 must use
– a segment register– A 16-bit offset (effective address)
• By default, DS register is used for accessing data from memory
• 16-bit offset can be specified in many ways
![Page 10: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/10.jpg)
Different ways of specifying offset
• Direct memory addressing• Register Indirect addressing• Based addresing• Indexed addressing• Based Indexed addressing• String addressing
![Page 11: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/11.jpg)
a. Direct Memory addressing
• Effective address is specified directly in the instruction
• E.g. MOV BX, [5062]• 20-bit physical address of memory
location is calculated using DS and offset value 5062
![Page 12: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/12.jpg)
Accessing memory
Segment register
+ = 20-bit physical address
of operand
16-bit offset
![Page 13: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/13.jpg)
b. Register indirect addressing
• The effective address of memory operand is present in one of the base or index registers [BX, BP, SI, DI]
• E.g. MOV CX, [BX]• If DS = 2000H, BX = 0004H • THEN contents of memory location
20004H are copied to register CX
![Page 14: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/14.jpg)
c. Based addressing• Effective address is sum of
– 16-bit offset given in instruction
– Contents of base register BX or
BP• Segment register is DS or SS • E.g. MOV AX, 4[BX]• E.G. PUSH CX
![Page 15: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/15.jpg)
d. Indexed addressing
• Effective address is sum of– 16-bit offset given in instruction
– Contents of index register SI or
DI• Segment register is DS• E.g. MOV AX, 4[SI]
![Page 16: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/16.jpg)
e. Based Indexed addressing
• Effective address is sum of– 16-bit offset given in instruction
– Contents of index register SI or DI– Contents of base register BX or BP
• Segment register is DS • E.g. MOV AX, 4[BX][SI]
![Page 17: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/17.jpg)
f. String addressing
• Used when string related instructions are executed
• Uses index registers• SI register points to the first byte or
word of the source string• DI register points to the first byte or
word of the destination
![Page 18: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/18.jpg)
Classification of Addressing Modes
1. Register addressing mode2. Immediate addressing mode3. Memory addressing mode4. Port addressing mode5. Relative addressing mode6. Implied addressing mode
![Page 19: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/19.jpg)
4. Port addressing
• Two I/O port addressing modes can be used
–Direct (e.g. IN AL, 02H)– Indirect (e.g. IN AL, DXH)
![Page 20: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/20.jpg)
5. Relative addressing mode
• Specifies the operand as a 8-bit signed displacement relative to PC
• E.g. JNC 08H• IF carry = 0, THEN PC is loaded
with current PC contents + 8-bit signed value
![Page 21: 1327 Addressing Modes Of 8086](https://reader033.fdocuments.in/reader033/viewer/2022061300/54c846554a795975238b4591/html5/thumbnails/21.jpg)
6. Implied addressing mode
• No operands are specified• E.g. CLC• Means clear carry flag