CIS-77 Home http://www.c-jump.com/CIS77/CIS77syllabus.htm

Instruction Operand Addressing on x86


  1. Indirect Memory Operands
  2. Address Displacements
  3. Multiple Address Displacements
  4. Specifying Operand Size
  5. Indirect Syntax Options
  6. Scaling Factors
  7. Relation of Base Registers to Memory Segments
  8. Addressing Instruction Operands Summary

1. Indirect Memory Operands


2. Address Displacements


3. Multiple Address Displacements


4. Specifying Operand Size


5. Indirect Syntax Options


6. Scaling Factors


  • You can use scaling to index into arrays with different sizes of elements.

  • For example, the scaling factor is

    • 1 for byte arrays (no scaling needed),

    • 2 for word arrays,

    • 4 for doubleword arrays,

    • and 8 for quadword arrays.

  • There is no performance penalty for using a scaling factor.

  • Scaling is illustrated in the following examples:

        mov     eax, darray[edx*4]     ; Load double of double array
        mov     eax, [esi*8][edi]      ; Load double of quad array
        mov     ax, wtbl[ecx+2][edx*2] ; Load word of word array
    
  •   base, scaling factor, and displacement generating a 32-bit address

7. Relation of Base Registers to Memory Segments


8. Addressing Instruction Operands Summary