IP addressing four

6, base-plus-indexed addressing mode:

 

  Operand in the register, effective address operation by:

 

  Contents of one of the base register and index register contents are added to one of

 

  BX SI

 

  即: EA = +

 

  BP IN

 

  In general, if the contents of BP as part of an effective address, then the contents of the SS for the segment value, or has DS

 

  For the value segment.

 

  E.g:

 

  MOV AX, [BX] [DI]

 

  Such as: (DS) = 2100H,

 

  (BX)=0158H,

 

  (DI) = 10A5H

 

  The EA = 0158 + 10A5 = 11FD

 

  Physical Address = 21000 + 11FD = 221FDH

 

  Content 221FDH address: 1234H

 

  After executing the instruction AX = 1234H

 

  The following instruction, destination operand using base-plus-indexed addressing,

 

  Segment registers are referenced DS: MOV DS: [BP + SI], AL

 

  The following instruction, the source operand using base-plus-indexed addressing,

 

  Reference segment registers ES: MOV AX, ES: [BX + SI]

 

  This mode uses the table or array processing. First address register stores a base address of the array, and register with variably

 

  Locating each element in the array, or vice versa. Since the two registers can change, so it can be more flexible access number

 

  Group or table of elements.

 

  The following two representations are equivalent:

 

  MOV AX, [BX + DI]

 

  MOV AX, [IN] [BX]

 

  7, the relative base-plus-indexed addressing mode:

 

  Operand in the memory, the operation result of one effective address of one of the contents of the base register and the index register

 

  Contents and instructions given 8-bit or 16-bit shift amount is obtained by adding.

 

  BX SI 8 Wei

 

  Namely: EA = + + displacement amount

 

  BP OF 16 位

 

  In general, if the content of BP, as part of a valid address, then the contents of the segment register SS segment

 

  Value, otherwise the contents of DS segment register to segment value.

 

  In the instruction given 8-bit or 16-bit shift amount using complement format.

 

  In calculating the effective address, if the shift amount is 8 bits, then the sign-extended into 16 bits.

 

  When the operation of the resulting effective address FFFFH, on whichever of the mold 64K

 

  E.g:

 

  MOV AX, [BX + DI-2]

 

  Suppose, (DS) = 5000H, (BX) = 1223H, DI = 54H, (51275) = 54H, (51276) = 76H

 

  Physical Address = 50000 + 1223 + 0054 + FFFE (-2 you add a last bit invert) = 51275H

 

  After executing the command (AX) = 7654H

 

  Representation of relative index of this base plus a variety of addressing mode, the following four methods are equivalent:

 

  MOV AX, [BX + DI + 1234h], MOV AX, 1234h [BX] [DI]

 

  AX 1234h MOV [BX + DI], MOV AX, 1234h [IN] [BX]

Guess you like

Origin www.cnblogs.com/123zhangyue/p/11954943.html