Search code examples
assemblyx86machine-codeopcode

What does [--][--] mean in the Intel x86 Assembly docs?


Searching the Intel Volume 2A docs only reveals 4 uses of [--][--], and only says one short sentence of its meaning:

The [--][--] nomenclature means a SIB follows the ModR/M byte.

Referring to this for the SIB byte:


enter image description here


So, what does this mean? How do you use it, in the table in which it appears:

enter image description here

I am starting to get a sense of how to use this table to understand the bottom left corner box of this table, and it's relation to the top column headers, but have yet to understand the rest of this table. I think I can figure out how this computed address stuff works, but what does the [--][--] mean? Do you fill in the -- with registers, so it would be like [eax][eax]? Or, I don't have any idea. Please help.

What are some examples of instruction calls that demonstrate its usage?


Solution

  • -- is a placeholder / wild-card. That table entry tells you to use that r/m encoding to signal a SIB for any indexed addressing mode.

    They seem to be using a weird asm-level syntax where a 2-register addressing mode would look like [edi][eax] or whatever, instead of the more modern-standard [edi+eax]. Although I think MASM does allow [edi][eax].

    If your addressing mode matches that [*][*] pattern (i.e. has 2 registers), then you use that entry (and thus signal the presence of a SIB byte).