i386/x86_64 segment register issuses
Ross Ridge
rridge@csclub.uwaterloo.ca
Mon Mar 28 10:39:00 GMT 2005
> asm volatile("movl %%gs,%0" : "=g" (gsindex));
>
>The new assembler will disallow them since those instructions with
>memory operand will only use the first 16bits. If the memory operand
>is 16bit, you won't see any problems. But if the memory destinatin
>is 32bit, the upper 16bits may have random values.
I'm pretty sure this isn't the case. The memory operand can only
be 16-bit, as any operand size prefix (or lack thereof) is ignored.
It's only when the destination is a 32-bit register that the upper
16-bits are undefined.
I think gas should accept both "movl" and "movw" when moving between
a segment register and a memory operand. Regardless of which suffix
is used the assembler should never emit an operand size prefix for
the instruction.
Ross Ridge
--
l/ // Ross Ridge -- The Great HTMU
[oo][oo] rridge@csclub.uwaterloo.ca
-()-/()/ http://www.csclub.uwaterloo.ca/u/rridge/
db //
More information about the Binutils
mailing list