While going back from Kraków with vid, playing with fasm, I noticed that fasm doesn't support EIP-relative addressing.
If I try to assemble the following,
I get
It should get assembled to:
DB 0x67, 0x8A, 0x0D, 0x00, 0x00, 0x00, 0x00
This addressing is not well documented and it is never referred as "EIP-relative" addressing, but in fact, it is. There are two quotes from the manuls:
RIP-relative addressing is enabled by 64-bit mode, not by a 64-
bit address-size. Conversely, use of the address-size prefix
(“Address-Size Override Prefix” on page 6) does not disable
RIP-relative addressing. The effect of the address-size prefix is
to truncate and zero-extend the computed effective address to
32 bits, like any other addressing mode.
RIP-relative addressing is enabled by 64-bit mode, not by a 64-bit address-size. The use of the
address-size prefix does not disable RIP-relative addressing. The effect of the address-size
prefix is to truncate and zero-extend the computed effective address to 32 bits.