Scaled-Index Addressing
Scaled-index addressing uses two 32-bit registers (a base register and an index register) to access the memory. The second register (index) is multiplied by a scaling factor. The scaling factor can be.A scaling factor of is implied and need not be included in the assembly language instruction (MOV AL,[ EBX+ECX ]). A scaling factor of is used to address word-sized memory arrays,a scaling factor of is used with double word-sized memory arrays,and a scaling factor of is used with quad word-sized memory arrays. An example instruction is MOV AX,[EDI+2*ECX]. This instruction uses a scaling factor of , which multiplies the contents of ECX by 2 before adding it to the EDI register to form the memory address. If ECX contains a 00000000H, word-sized memory element 0 is addressed; ifECX contains a 00000001H, word-sized memory element 1 is accessed, and so forth. This scalesthe index (ECX) by a factor of 2 for a word-sized memory array. The MOV EAX,[ 4*EDI ] is a scaled-index instruction that...
Comments
Post a Comment