Re: About instruction lea
- From: "Norbert Juffa" <spamtrap@xxxxxxxxxx>
- Date: Wed, 26 Oct 2005 06:51:15 +0000 (UTC)
"jukka@xxxxxxxxxxxx" <spamtrap@xxxxxxxxxx> wrote in message news:1130183511.793228.306550@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Yes, because it is instruction which exposes the address generation
> logic
>
> If you do this:
>
> add eax,ebx
> vs.
> lea eax,[ebx+eax]
>
> You won't gain anything, but when you do something like this instead:
[...]
LEA also implements a three operand addition, which is useful in the
context of the otherwise two-operand x86 architecture. Instead of
coding c = a + b as
mov ecx, eax
add ecx, ebx
one can use a single LEA instruction as follows
lea ecx, [eax + ebx]
In some cases, one might even want to do c = a + b + <const>, which maps
still to a single LEA instruction
lea ecx, [eax + ebx + <const>]
-- Norbert
.
- References:
- About instruction lea
- From: Zheng Da
- Re: About instruction lea
- From: jukka@xxxxxxxxxxxx
- About instruction lea
- Prev by Date: Re: compiler generated output
- Next by Date: Having trouble posting?
- Previous by thread: Re: About instruction lea
- Index(es):
Relevant Pages
|