Possible Duplicate:
What’s the purpose of the LEA instruction?
LEA instruction?
So I'm working on the binary bomb assignment for class (it has a bunch of phases where you have to step through the assembly code of a program and find a passphrase to decode the "bomb").
I can't complete my current phase because I don't understand the lea command. I've read that it's commonly used for arithmetic, but I just don't understand how it does it.
The command I'm looking at in particular is
lea -0x18(%ebp), %ebx
lea -0x8(%ebp), %esi
followed by a
mov -0x4 (%ebx), %eax
add -0x8(%ebx), %eax
in the next line eax and ebx are compared, if they're equal the program continues, else the bomb explodes.
I've figured enough out about this phase to know it wants 6 numbers, the first two being 0 and 1. After that it does some manipulations to determine if the rest of the sequence is correct (I'm assuming the lea commands are what i need to decode to find the next numbers).
Now what I couldn't find is what the -0x18 in particular refers to. what's the negative sign do? does it indicate subtraction? is it looking 18 bytes before ebp?
Thanks for any help here.