This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Change i386 assembler/disassembler for SIB with INDEX==4


On Fri, Jan 14, 2005 at 12:14:53AM +0000, Thorsten Glaser wrote:
> The intel output looks even more weird, is this a shortcoming
> in the assembler?

Yes, that's plainly a bug, since the disassembled code is specifying
ebx as an index register, not a base register.  ie. In intel mode
we should be showing

   0:   8b 04 23                mov    eax,DWORD PTR [ebx+0*1]
   3:   8b 04 63                mov    eax,DWORD PTR [ebx+0*2]
   6:   8b 04 a3                mov    eax,DWORD PTR [ebx+0*4]
   9:   8b 04 e3                mov    eax,DWORD PTR [ebx+0*8]

or something like that.

> (Use -M intel, not -m i386:intel, the latter gave me 64 bit output!)
> 
> tg@odem:/home/tg $ objdump -d -M intel x.o
> 
> x.o:     file format elf32-i386
> 
> Disassembly of section .text:
> 
> 00000000 <.text>:
>    0:   8b 04 23                mov    eax,DWORD PTR [ebx]
>    3:   8b 04 63                mov    eax,DWORD PTR [ebx*2]
>    6:   8b 04 a3                mov    eax,DWORD PTR [ebx*4]
>    9:   8b 04 e3                mov    eax,DWORD PTR [ebx*8]

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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