The encoding of memory operands with the SIB-byte allows a ›none register‹ for index as well as base. So this should be a valid instruction:
03 04 25 10 32 54 76 – add eax, dword [ 0x76543210 ]
The address should be calculated like this: 1·0+0+0x76543210 and is not based on any segment register.
In a flat memory this should not change anything, but is this different from add eax, dword ds:0x76543210
, if ds
is not zero?
In 16 and 32 bit operation modes, a SIB byte indicating no base and no index (ie.
04 +r 25
) simply encodes a 32 bit address, just as the modr/m byte05 +r
does. This does not affect segmentation,ds
is used to add a segment base address in both cases.In long mode (64 bit mode), the modr/m byte
05 +r
indicates arip
(resp.eip
) relative address whereas04 +r 25
indicates an absolute address. For example: