This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Glitches in gas/objdump handling of i386 STR, SLDT, SMSW instructions


On Sun, Nov 11, 2001 at 04:19:11PM -0800, Zack Weinberg wrote:
> 
> First and most seriously: gas incorrectly thinks STR is invalid except
> with a 16-bit operand.  In reality, STR works like most i386
> word/long/quad instructions: the operand size prefixes apply.  To

Hmm, that's true when the destination is a register.  It's not true for
a memory destination according to my reference;  You only get 16 bits
in memory regardless of operand size.

> 	* include/opcode/i386.h: Change "str" instruction to
> 	wlq_Suf|Modrm, WordReg|WordMem.
> 	* opcodes/i386-dis.c: Change "sldt", "str", and "smsw" entries
> 	to "sldtQ", "strQ", "smswQ" respectively; all with Ev operand
> 	category instead of Ew.

Thanks, please apply.  Note that strictly speaking, sldt, smsw and str
should probably all be ShortMem rather than WordMem.  There's absolutely
no difference in gas behaviour because all the *Mem's are the same, but
it's nice to document what the instruction really does.  Well, what the
Intel reference claims the instruction does... ;-)

Alan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]