i386/x86_64 segment register issuses

Ross Ridge rridge@csclub.uwaterloo.ca
Tue Mar 29 02:06:00 GMT 2005


> The assembler in CVS generates the same binary code as
> 
> 	movw %ds,(%eax)
> 
> for
> 
> 	movl %ds,(%eax)

Which is the way I think the GNU assembler should work.  In case like
Linux kernel code you quoted, you really do want a 16-bit move when a
memory destination is used and a 32-bit move when a register destination
used.  The only problem here is that the Linux kernel doesn't ingore
the higher 16-bits of the resulting variable, which aren't guaranteed
to be zero in either case.

							Ross Ridge



More information about the Binutils mailing list