<<< REG Field of the MOD-REG-R/M Byte     Index     SIB (Scaled Index Byte) Layout >>>

9. MOD R/M Byte and Addressing Modes

  • MOD R/M Addressing Mode
    === === ================================
     00 000 [ eax ]
     01 000 [ eax + disp8 ]               (1)
     10 000 [ eax + disp32 ]
     11 000 register  ( al / ax / eax )   (2)
     00 001 [ ecx ]
     01 001 [ ecx + disp8 ]
     10 001 [ ecx + disp32 ]
     11 001 register  ( cl / cx / ecx )
     00 010 [ edx ]
     01 010 [ edx + disp8 ]
     10 010 [ edx + disp32 ]
     11 010 register  ( dl / dx / edx )
     00 011 [ ebx ]
     01 011 [ ebx + disp8 ]
     10 011 [ ebx + disp32 ]
     11 011 register  ( bl / bx / ebx )
     00 100 SIB  Mode                     (3)
     01 100 SIB  +  disp8  Mode
     10 100 SIB  +  disp32  Mode
     11 100 register  ( ah / sp / esp )
     00 101 32-bit Displacement-Only Mode (4)
     01 101 [ ebp + disp8 ]
     10 101 [ ebp + disp32 ]
     11 101 register  ( ch / bp / ebp )
     00 110 [ esi ]
     01 110 [ esi + disp8 ]
     10 110 [ esi + disp32 ]
     11 110 register  ( dh / si / esi )
     00 111 [ edi ]
     01 111 [ edi + disp8 ]
     10 111 [ edi + disp32 ]
     11 111 register  ( bh / di / edi )
    
  •  

  1. Addressing modes with 8-bit displacement fall in the range -128..+127 and require only a single byte displacement after the opcode (Faster!)

  2. The size bit in the opcode specifies 8 or 32-bit register size. To select a 16-bit register requires a prefix byte.

  3. The so-called scaled indexed addressing modes, SIB = scaled index byte mode.

  4. Note that there is no [ ebp ] addressing. It's slot is occupied by the 32-bit displacement only addressing mode. Intel decided that programmers can use [ ebp+ disp8 ] addressing mode instead, with its 8-bit displacement set equal to zero (instruction is a little longer, though.)


<<< REG Field of the MOD-REG-R/M Byte     Index     SIB (Scaled Index Byte) Layout >>>