Title: Addressing Modes
1Addressing 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
2- Register Operand Addressing
- MOV AX, BX
- Immediate Operand Addressing Mode
- MOV AL,15h
- Memory Addressing Modes
- One must calculate the PA (physical address)
3Register Operand Addressing
MOV AX, BX
C38B16
Before execution
4After execution
5Immediate 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
6MOV AL, 15H15B016
7(No Transcript)
8Direct Addressing ModeMOV CX, 1234h12340E8B16
9(No Transcript)
10Register Indirect Addressing ModeMOV AX, SI
048B16
11(No Transcript)
12Based Addressing Mode MOV CX,BX10 PA
(DS)0 (BX) 10 MOV AL,BP5 PA (SS)0
(BP) 5
13MOV BX1234H,AL1234878816
14(No Transcript)
15Indexed Addressing Mode MOV DX,SI5 PA (DS)
0 (SI) 5 MOV CL,DI20 PA (DS) 0 DI 20
16MOV AL, SI 1234H 1234848A16
17(No Transcript)
18Based Indexed Addressing Mode
- MOV CX,BXDI8h PA (DS)0 (BX) (DI) 8h
- MOV AH,BPSI29 PA (SS)0 (BP) (SI) 2
- Other notations possible MOV AH,BPSI29
- or MOV AH, SIBP29
- HoweverMOV AX, SIDI displacement is illegal
19(No Transcript)
20Example Based-Indexed Addressing ModesMOV AH,
BXSI 1234H1234A08A16
21(No Transcript)
22Segment Override
23The 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
24Example
- Copy the contents of a block of memory (16 bytes)
starting at location 20100H to another block of
memory starting at 20120H - MOV AX, 2000H
- MOV DS, AX
- MOV SI, 100h
- MOV DI, 120h
- MOV CX, 10h
- NXTPT MOV, AH, SI
- MOV DI, AH
- INC SI
- INC DI
- DEC CX
- JNZ NXTPT