Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1J7UCW-0001m6-Kd for mharc-grub-devel@gnu.org; Wed, 26 Dec 2007 06:13:28 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1J7UCU-0001hZ-9c for grub-devel@gnu.org; Wed, 26 Dec 2007 06:13:26 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1J7UCR-0001cz-35 for grub-devel@gnu.org; Wed, 26 Dec 2007 06:13:25 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1J7UCQ-0001cs-VX for grub-devel@gnu.org; Wed, 26 Dec 2007 06:13:23 -0500 Received: from py-out-1112.google.com ([64.233.166.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1J7UCQ-0004WC-Rv for grub-devel@gnu.org; Wed, 26 Dec 2007 06:13:22 -0500 Received: by py-out-1112.google.com with SMTP id a73so4994201pye.14 for ; Wed, 26 Dec 2007 03:13:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=Y8gdrp19iqKN/ODEwuXh/DB//5gwj7lePClMdT2D2qE=; b=YBmcBIqT/TB6AGlhu/lDSBRGyX++jF2O8O0V63IXCQGNU09gIhUj0Zu7xChIBoV6dVW3B0BNex9v8AU8ZQN7ISzoF16NZJ0jRZmMVpvFOQ7BKhIbslYWT+ebIv2z8iO1NqhWDaUhC3aiiAqCTaeszPyRzd1D3s3HJlKfFg3M1QE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=S/Nen3XjIiwUvnVl9c6RrqbjVDIlS4IjW736CdmtpoArKQqXhiuRwEka048DVHEG+Lk1O4yqqXwCHMLUDCTluDl1m0ZTFAdMCk2WqDNLJXEer/gpUDjzgcSjeM9ovMN4qR4vDpFuJDcO4KhIdmiBqBi8kNmKGAwrMAozCUTrEII= Received: by 10.35.87.8 with SMTP id p8mr8101912pyl.16.1198667602234; Wed, 26 Dec 2007 03:13:22 -0800 (PST) Received: by 10.35.76.20 with HTTP; Wed, 26 Dec 2007 03:13:22 -0800 (PST) Message-ID: Date: Wed, 26 Dec 2007 19:13:22 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20071226071732.GB8632@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1198575687.6484.25.camel@latsun.main.fg> <20071225110756.GA22389@thorin> <1198581793.6484.30.camel@latsun.main.fg> <20071226071732.GB8632@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: Failed to build grub2 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Dec 2007 11:13:26 -0000 On Dec 26, 2007 3:17 PM, Robert Millan wrote: > On Tue, Dec 25, 2007 at 07:37:04PM +0800, Bean wrote: > > > > I use the 32-bit address to save space, maybe your compiler doesn't > > support it. anyway, you can try the following transformation: > > > > leal 0x200 + data_start - data_next(%ebx,%eax), %eax > > > > -> > > > > addl %ebx, %eax > > addl $(0x200 + data_start - data_next), %eax > > > > ----------- > > > > leal (%esi, %eax), %esi > > leal (%edi, %eax), %edi > > > > -> > > > > addl %eax, %esi > > addl %eax, %edi > > I think it has more to do with the op being "leal" instead of "leaw" than > with the addressing argument having 3 members. It's a trick to do fast arithmetic using the 32-bit address mode, for example, leal 10 (%ebx, %eax, 4) , %ecx means %ecx = %ebx + %eax * 4 + 10 But some assembler might not allow to use 32-bit address in 16-bit mode, so you can follow the slow path, for example, movl %eax, %ecx shll $2, %ecx addl %ebx, %ecx addl $10, %ecx The two code segment will get the same result, but the second one doesn't use 32-bit address , so it wouldn't trigger an error. -- Bean