On Dec 26, 2007 3:17 PM, Robert Millan <[EMAIL PROTECTED]> 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 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel