From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9132 invoked by alias); 14 Jan 2005 07:04:23 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 8984 invoked from network); 14 Jan 2005 07:04:12 -0000 Received: from unknown (HELO prism.co.za) (196.25.143.130) by sourceware.org with SMTP; 14 Jan 2005 07:04:12 -0000 Received: from source by zebra.wetton.example.org with local (Exim 4.20) id 1CpLMP-000697-BZ; Fri, 14 Jan 2005 08:55:05 +0200 Date: Fri, 14 Jan 2005 07:04:00 -0000 From: Bernd Jendrissek To: "H. J. Lu" , "Allan B. Cruse" , binutils@sources.redhat.com Subject: Re: PATCH: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report) Message-ID: <20050114065505.GB23382@prism.co.za> References: <20050111210753.0C8CB219E0@nexus.cs.usfca.edu> <20050112191052.GA12463@lucon.org> <20050113034440.GG30985@bubble.modra.org> <20050113170849.GA30644@lucon.org> <20050114000528.GA3408@bubble.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050114000528.GA3408@bubble.modra.org> User-Agent: Mutt/1.4i X-Comment: Exim: I am on zebra.wetton.prism.co.za (internal name) X-Comment: and my boss is berndj@prism.co.za X-Comment: Call him at +27 82 2960717 if any problems occur. X-SW-Source: 2005-01/txt/msg00144.txt.bz2 -----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-----