This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: i386/x86_64 segment register issuses
- From: rridge at csclub dot uwaterloo dot ca (Ross Ridge)
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: Ross Ridge <rridge at csclub dot uwaterloo dot ca>,binutils at sources dot redhat dot com
- Date: Mon, 28 Mar 2005 14:34:16 -0500 (EST)
- Subject: Re: i386/x86_64 segment register issuses
> 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