1327 Addressing Modes Of 8086

30,789 views

Published on

visit: www.techbed.blogspot.com

Published in: Education, Technology
3 Comments
37 Likes
Statistics
Notes
No Downloads
Views
Total views
30,789
On SlideShare
0
From Embeds
0
Number of Embeds
44
Actions
Shares
0
Downloads
2,148
Comments
3
Likes
37
Embeds 0
No embeds

No notes for slide

1327 Addressing Modes Of 8086

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

×