From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6852 invoked by alias); 13 Jan 2005 17:09:03 -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 6193 invoked from network); 13 Jan 2005 17:08:50 -0000 Received: from unknown (HELO rwcrmhc12.comcast.net) (216.148.227.85) by sourceware.org with SMTP; 13 Jan 2005 17:08:50 -0000 Received: from lucon.org ([24.6.212.230]) by comcast.net (rwcrmhc12) with ESMTP id <200501131708490140016mhge>; Thu, 13 Jan 2005 17:08:50 +0000 Received: by lucon.org (Postfix, from userid 1000) id 776F7640F4; Thu, 13 Jan 2005 09:08:49 -0800 (PST) Date: Thu, 13 Jan 2005 17:09:00 -0000 From: "H. J. Lu" To: "Allan B. Cruse" , binutils@sources.redhat.com Subject: Re: PATCH: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report) Message-ID: <20050113170849.GA30644@lucon.org> References: <20050111210753.0C8CB219E0@nexus.cs.usfca.edu> <20050112191052.GA12463@lucon.org> <20050113034440.GG30985@bubble.modra.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050113034440.GG30985@bubble.modra.org> User-Agent: Mutt/1.4.1i X-SW-Source: 2005-01/txt/msg00125.txt.bz2 On Thu, Jan 13, 2005 at 02:14:40PM +1030, Alan Modra wrote: > On Wed, Jan 12, 2005 at 11:10:52AM -0800, H. J. Lu wrote: > > > .byte 0x8B, 0x04, 0x63 # effect is: movl (%ebx), %eax > [snip] > > > 8048081: 8b 04 63 mov (%ebx,2),%eax > > I don't agree that this is a problem. In fact, I think that this > disassembly is more accurate than "mov (%ebx),%eax". Note that gas > accepts "mov (%ebx,2),%eax" giving > Warning: scale factor of 2 without an index register But it generates "8b 03", not "8b 04 63". > > Yes, I agree that the effect of executing these byte sequences is the > same as "mov (%ebx),%eax", but that's beside the point. For example, > plenty of x86 instructions execute as a nop, but that doesn't mean they > should all be disassembled as "nop". The disassembler ought to reflect > the machine encoding as closely as possible, and in this case that means > printing the ignored scale factor. > > I think this change should be reverted. > IA-32 instruction reference manual says when INDEX == 0x4, scaled index is "[none]". Displaying "(%ebx,2)" is simply wrong here. H.J.