Sei sulla pagina 1di 12

Addressing Mode

Addressing Mode
Addressing type:1- Register Operand Addressing Mode. 2- Immediate Operand Addressing Mode. 3- Memory Operand Addressing.

Register Operand Addressing Mode


Before Execution

After Execution
Address Memory Instruction content 01000 8B MOV AX , BX 01001 C3 01002 XX next ins.

Immediate Operand Addressing Mode


Before Execution

After Execution
Address Memory Instruction content 01000 B0 MOV AX , 15h 01001 15 01002 XX next ins.

Memory Operand Addressing


Direct Addressing mode. Register indirect addressing mode. Base Addressing mode. Indexed Addressing mode. Base Indexed Addressing mode .

Direct Addressing Mode PA= Segment(CS,DS,SS,ES) : Direct address


Before Execution

After Execution
Address Memory Instruction 01000 8B MOV CX , [1234H] 01001 0E 01002 34 01003 12 01004 xx next ins. . . 02000 xx . . 03234 ED Source oper. 03235 BE

Register indirect addressing mode


PA= Segment(CS,DS,SS,ES) : InDirect address(BX,BP,SI,DI)

EX: MOV AX , [SI] SI=1234 ,DS=0200 PH=DS:SI =2000+1234 = 03234

Base Addressing mode.


PA= Segment(CS,DS,SS,ES) : Base (BX,BP) +(displacement) MOV [BX]+1234H,AL BX=1000 ,DS= 0200 PH=DS:BX+ Displacement PH= 2000+1000+1234 = 4234

Indexed Addressing Mode


PA= Segment(CS,DS,SS,ES) : Index ( SI , DI) + Displacement EX: MOV AL , [SI] + 1234H SI=2000 ,DS=0200 PH=2000 +2000+1234= 5234

Base Indexed Addressing mode


PH= Segment(CS,DS,SS,ES) : Base (BX,BP) +Index ( SI , DI) + Displacement

EX: MOV AH,[BX][SI]+1234H DS=0200 BX=1000 SI=2000 PH=2000 + 1000 + 2000 + 1234 =6234

REVIEW PROBLEMS
Identify the addressing modes used for source and the destination operand in the instruction that follow, and compute the physical address .

CS=0A00 DS=0B00 SI=0100 DI=0200 BX = 0300 A - MOV AL , BL B - MOV AX,0FFH C - MOV [DI] , AX D - MOV DI,[SI] E - MOV [BX] + 0400H , CX F - MOV [DI] + 0400H , AH G- MOV [BX][DI] + 0400H, AH

Answers
A - source: register Destination :register B - source: Immediate Destination :register C- source: register Destination : index PH=DS:DI = B200 D- source: index PH=DS:SI= B100 Destination : register E- source: register Destination : Base PH=DS:BX + Displacement. = B700 F- source: register index Destination : PH=DS:DI + Displacement. = B600

Potrebbero piacerti anche