X86 寻址模式

REGISTER ADDRESSING MODE

  MOV BX, DX; 将DX的内容赋给BX

  ADD AL, BH; 将BH的内容与AL的内容相加后存入AL中

------------------------------------------------------------

IMMEDIATE ADDRESS MODE

  MOV AX,2550H; 将2550H赋给AX  

  MOV CX,625;   将十进制的625赋给CX

  不能直接将值赋给段寄存器,需要将值先赋给除段寄存器外的寄存器,再由该寄存器赋给段寄存器

如:MOV AX,2550H

    MOV DS,AX

----------------------------------------------------------

DIRECT ADDRESSING MODE

  MOV DL,[2400]; 将 DS:2400H的内容赋给DL 

--------------------------------------------------------

REGISTER INDIRECT ADDRESSING MODE 

  MOV AL,[BX]; 将 DS:BX的内容赋给AL

  MOV CL,[SI]; 将DS:SI的内容赋给CL 

  MOV [DI],AH;将AH 的内容赋给DS:DI 

---------------------------------------------------------

BASED RELATIVE ADDRESSING MODE

  MOV CX,[BX]+10; 将DS:BX+10与DS:BX+10+1的内容赋给CX 

  MOV CX,[BX+10]或MOV CX,10[BX] 均与上相同;   BX+10称为有效地址值 

---------------------------------------------------------

INDEXED RELATIVE ADDRESSING MODE

  MOV DX,[SI]+5; PA = DS(左移)+ SI + 5

  MOV CL,[DI]+20; PA = DS(左移) + DI +20 

-------------------------------------------------------- 

BASED INDEXED ADDRESSING MODE

  MOV CL,[BX][DI]+8; PA = DS(左移) + BX + DI + 8

  MOV CH,[BX][SI]+20; PA = DS(左移) + BX + SI + 20

  MOV AH,[BP][DI]+12; PA = SS(左移) + BP + DI + 12

  MOV AH,[BP][SI]+29; PA = SS(左移) + BP + DI + 29

 -------------------------------------------------------

不同段寄存器的偏移寄存器: 

CS: IP

DS: SI,DI,BX

ES: SI,DI,BX

SS: SP,BP

你可能感兴趣的:(汇编语言)