x86reference icon indicating copy to clipboard operation
x86reference copied to clipboard

SIB Notes are wrong/misleading

Open d0sboots opened this issue 5 years ago • 0 comments

The mini-tables at http://ref.x86asm.net/coder.html#sib64_base_101 are very misleading. It claims, for instance, that with no REX.X and mod bits=01, the scaled index base="RBP/EBP+disp8". However, with mod bits=01, the offset of +disp8 is already accounted for in the table "32/64-bit ModR/M Byte", under Effective Address (which must be "[sib]+disp8" in this case).

This gives the impression that the offset is added twice (or maybe there are two offsets?), when this is not the case. The base should be listed as simply "RBP/EBP", to match the other bases in the table "32/64-bit SIB Byte" (which don't have the offset added, because it's accounted for in the original ModR/M calculation).

The same goes for the bits=02 case, and the table at http://ref.x86asm.net/coder.html#sib32_base_101.

d0sboots avatar Jul 24 '20 04:07 d0sboots