Addressing Modes Ppt
-
Upload
nikitasingla -
Category
Documents
-
view
323 -
download
11
Transcript of Addressing Modes Ppt
![Page 1: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/1.jpg)
Addressing Modes• When the 8088 executes an instruction, it
performs the specified function on data• These data, called operands,
– May be a part of the instruction– May reside in one of the internal registers – May be stored in memory
• To access these operands, 8088 is provided with various addressing modes
• An addressing mode is a method of specifying an operand
![Page 2: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/2.jpg)
Register Operand AddressingMOV AX, BXImmediate Operand Addressing ModeMOV AL,15hMemory Addressing ModesOne must calculate the PA (physical address)
![Page 3: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/3.jpg)
Register Operand Addressing
MOV AX, BX
C38B16
Before execution
![Page 4: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/4.jpg)
After execution
![Page 5: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/5.jpg)
Immediate Addressing Mode
• In immediate addressing, source operand is a constant
• Used to load information to some registers– MOV AX,2550h– MOV CX, 625 ; decimal 625– MOV BL,40h
![Page 6: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/6.jpg)
MOV AL, 15H15B016
![Page 7: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/7.jpg)
![Page 8: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/8.jpg)
Direct Addressing ModeMOV CX, [1234h]12340E8B16
![Page 9: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/9.jpg)
![Page 10: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/10.jpg)
Register Indirect Addressing ModeMOV AX, [SI] 048B16
![Page 11: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/11.jpg)
![Page 12: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/12.jpg)
Based Addressing Mode• MOV CX,[BX]+10 PA = (DS)0 + (BX) + 10
• MOV AL,[BP]+5 PA = (SS)0 + (BP) + 5
![Page 13: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/13.jpg)
MOV [BX]+1234H,AL1234878816
![Page 14: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/14.jpg)
![Page 15: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/15.jpg)
Indexed Addressing Mode• MOV DX,[SI]+5 PA= (DS) 0 + (SI) + 5
• MOV CL,[DI]+20 PA= (DS) 0 + DI + 20
![Page 16: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/16.jpg)
MOV AL, [SI] +1234H1234848A16
![Page 17: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/17.jpg)
![Page 18: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/18.jpg)
Based Indexed Addressing Mode
• MOV CX,[BX][DI]+8h PA= (DS)0 + (BX) + (DI) + 8h
• MOV AH,[BP][SI]+29 PA: (SS)0 + (BP) + (SI) + 2
• Other notations possible– MOV AH,[BP+SI+29] or– MOV AH, [SI+BP+29]
• HoweverMOV AX, [SI][DI] + displacement is illegal
![Page 19: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/19.jpg)
![Page 20: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/20.jpg)
Example: Based-Indexed Addressing ModesMOV AH, [BX][SI] +1234H1234A08A16
![Page 21: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/21.jpg)
![Page 22: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/22.jpg)
Segment Override
![Page 23: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/23.jpg)
The PTR Operator
• MOV AL,[20h] ; 8 bit data copied into AL
• MOV AX,[20h] ; 16 bit data copied into AX
• INC [20h] ; 8 bit or 16 bits incremented”?
• Byte or word or doubleword?
• To clarify we use the PTR operator– INC BYTE PTR [20h]– INC WORD PTR [20h]– INC DWORD PTR [20h]
![Page 24: Addressing Modes Ppt](https://reader033.fdocuments.in/reader033/viewer/2022061121/546e4cd0b4af9fe4518b45ca/html5/thumbnails/24.jpg)
ExampleCopy the contents of a block of memory (16 bytes)
starting at location 20100H to another block of memory starting at 20120H
MOV AX, 2000HMOV DS, AXMOV SI, 100hMOV DI, 120hMOV CX, 10h
NXTPT: MOV, AH, [SI]MOV [DI], AHINC SIINC DIDEC CXJNZ NXTPT