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 Mon, 12 Nov 2001, Zack Weinberg wrote:

> {"str",    1, 0x0f00, 1, Cpu286, NoSuf|Modrm|Size32,	{ Reg16, 0, 0} },
> {"str",    1, 0x0f00, 1, Cpu286, wlq_Suf|Modrm,         { WordReg, 0, 0} },
> {"str",    1, 0x0f00, 1, Cpu286, w_Suf|Modrm|IgnoreSize,{ ShortMem, 0, 0} },
[...]
> My test case
> 
>         str     %bx
>         str     %ebx
>         nop
>         strw    %bx
>         strl    %ebx
>         nop
>         str     (%ebx)
>         strw    (%ebx)
> 
> now generates
> 
>    0:   0f 00 cb                str    %ebx
>    3:   0f 00 cb                str    %ebx
>    6:   90                      nop    
>    7:   66 0f 00 cb             strw   %bx
>    b:   0f 00 cb                str    %ebx
>    e:   90                      nop    
>    f:   0f 00 0b                str    (%ebx)
>   12:   0f 00 0b                str    (%ebx)

 Have you checked the prefixes are got right in the 16-bit mode, either?

> and that produces an identical object file when fed back into the
> assembler.  So we're now almost correct.  The remaining problem is
> that suffix_always mode will disassemble 0f 00 0b as strl (%ebx),
> which is wrong and will be rejected by the assembler when fed back in.

 Do you need a suffix in the disassembly at all?

> Also I wonder if any of the other [sl]<seg> instructions need the same
> treatment.

 [sl]ldt has exactly the same semantics as do moves from/to segment
registers.  [sl]msw has, too, even though it doesn't operate on
selectors. 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


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