Re: [i386] Questions regarding provisional page tables initialization

Brian Gerst
2007-07-02T12:20:09Z

Ahmed S. Darwish wrote:
> now back to head.S code:
> leal 0x007(%edi),%ecx /* Create PDE entry */
>
> Isn't the above line the same condition (bytes, not bits displacement) ?.
> Thanks for your patience !.

The leal instruction (Load Effective Address) is often used as a way to
add a constant to one register and store the result in another register
in a single instruction. The values don't even have to be addresses at
all, since no memory is actually referenced. Otherwise this would be
written as:

movl %edi,%ecx
addl $0x007, %ecx

--
Brian Gerst