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: disassembler bug


Shaun Jackman <sjackman@home.com> writes:

> try this...
> 
> #!/bin/sh
> cat > foo.s << END
> mov (%esp),%ebx
> mov %ebx,(%esp)
> END
> as foo.s
> objdump -D
> 
> ----- Result -----
> a.out:     file format elf32-i386
>  
> Disassembly of section .text:
>  
> 00000000 <.text>:
>    0:   8b 1c 24                mov    (%esp,1),%ebx
>    3:   89 1c 24                mov    %ebx,(%esp,1)
>    6:   89 f6                   mov    %esi,%esi
> Disassembly of section .data:
> ------------------
> 
> Should those (%esp,1) be (%esp)?

(%esp) looks nicer but (%esp,1) is the same, %esp as displacement, 0
as index and 1 as multiplikator giving: %esp+0*1=%esp.

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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