This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Fri, Jan 14, 2005 at 10:35:28AM +1030, Alan Modra wrote:
> On Thu, Jan 13, 2005 at 09:08:49AM -0800, H. J. Lu wrote:
> > IA-32 instruction reference manual says when INDEX == 0x4, scaled index
> > is "[none]". Displaying "(%ebx,2)" is simply wrong here.
>
> The IA-32 instruction reference manual specifies both instruction
> operation and instruction encoding. There isn't a one to one mapping
> between encoding and operation on IA-32, sometimes multiple encodings
> are available for a particular operation.
>
> And that's where I have a philosophical disagreement with Allan Cruse.
> I believe the disassembler should reflect the encoding as much as
> possible, while he seems to believe the disassembler should reflect
> operation. The trouble with that argument is that taken to its logical
> conclusion we should disassemble
> 0x89,0xf6 as "nop"
> 0x8d,0x76,0x00 as "nop"
> 0x8d,0x74,0x26,0x00 as "nop"
> and so on for all of the zillion different "nop" encodings.
Another nice-to-have is that the disassembled output can be re-assembled
to produce *exactly* the same output binary.
IOW if at all possible, I like to have *complete* control over the
encoding of the assembled instructions, without resorting to .byte et
al. Of course, this nice-to-have is already broken by addl %edx,%ebx:
is that 01 d3 or is it 03 da?
As to *why* I would want such totalitarian control... well I'll just
deflect and say that anyone nitpicking over (%ebx,2) vs. (%ebx) is
already at the same level of moral turpitude as I. :-)
Or maybe introduce -Mpedagogical and -Mrealprogrammer?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQFB52zC/FmLrNfLpjMRArjeAKCk8vJJSqnBUMZmWSLjR51Av1ulKgCdF9k9
YDextHIRCcWVGPwVWIRAg88=
=Jrwd
-----END PGP SIGNATURE-----