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


(Removing GNU/Linux groups from the output)

H. J. Lu dixit:

>I am proposing to change i386 assembler/disassembler for SIB with
>INDEX==4
>
>http://sources.redhat.com/bugzilla/show_bug.cgi?id=658

The intel output looks even more weird, is this a shortcoming
in the assembler?

(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]
tg@odem:/home/tg $ cat >y.s
.intel_syntax noprefix
mov    eax,DWORD PTR [ebx]
mov    eax,DWORD PTR [ebx*2]
mov    eax,DWORD PTR [ebx*4]
mov    eax,DWORD PTR [ebx*8]
tg@odem:/home/tg $ gcc -c y.s
tg@odem:/home/tg $ objdump -d y.o

y.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:   8b 03                   mov    (%ebx),%eax
   2:   8b 04 5d 00 00 00 00    mov    0x0(,%ebx,2),%eax
   9:   8b 04 9d 00 00 00 00    mov    0x0(,%ebx,4),%eax
  10:   8b 04 dd 00 00 00 00    mov    0x0(,%ebx,8),%eax
tg@odem:/home/tg $ objdump -d -M intel y.o

y.o:     file format elf32-i386

Disassembly of section .text:

00000000 <.text>:
   0:   8b 03                   mov    eax,DWORD PTR [ebx]
   2:   8b 04 5d 00 00 00 00    mov    eax,DWORD PTR [ebx*2]
   9:   8b 04 9d 00 00 00 00    mov    eax,DWORD PTR [ebx*4]
  10:   8b 04 dd 00 00 00 00    mov    eax,DWORD PTR [ebx*8]

//mirabile


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