From: Bernd Jendrissek <berndj@prism.co.za>
To: "H. J. Lu" <hjl@lucon.org>, "Allan B. Cruse" <cruse@cs.usfca.edu>,
binutils@sources.redhat.com
Subject: Re: PATCH: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report)
Date: Fri, 14 Jan 2005 07:04:00 -0000 [thread overview]
Message-ID: <20050114065505.GB23382@prism.co.za> (raw)
In-Reply-To: <20050114000528.GA3408@bubble.modra.org>
-----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-----
next prev parent reply other threads:[~2005-01-14 7:04 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20050111210753.0C8CB219E0@nexus.cs.usfca.edu>
2005-01-12 19:10 ` H. J. Lu
2005-01-13 3:44 ` Alan Modra
2005-01-13 17:09 ` H. J. Lu
2005-01-13 17:27 ` H. J. Lu
2005-01-14 0:06 ` Alan Modra
2005-01-14 0:27 ` H. J. Lu
2005-01-14 0:59 ` Alan Modra
2005-01-14 21:49 ` H. J. Lu
2005-01-14 7:04 ` Bernd Jendrissek [this message]
2005-01-13 17:42 Allan B. Cruse
2005-01-14 6:11 Allan B. Cruse
2005-01-14 7:32 ` Bernd Jendrissek
2005-01-14 17:19 ` E. Weddington
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050114065505.GB23382@prism.co.za \
--to=berndj@prism.co.za \
--cc=binutils@sources.redhat.com \
--cc=cruse@cs.usfca.edu \
--cc=hjl@lucon.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).