Yeah, sorta...
http://home.myfairpoint.net/fbkotler/nasmdocc.html#section-A.4.135You need "lea" (syntax: lea reg, [something]) for an address *calculation*. "lea eax, [buf]" says, "tell me the address of the variable whose address is buf." Kinda overkill. Masm users like it 'cause they don't have to write "offset" that way :) If you want the address of, say [ebp + 8] (sometimes you want contents, sometimes you want address), that's where "lea" comes in.
Since "lea" just does arithmetic - doesn't actually access any memory, you can use it for other calculations, too - must have the "form" of a valid effective address...
atoi:
mov edx, [esp + 4] ; pointer to string
xor eax, eax ; clear "result"
.top:
movzx ecx, byte [edx]
inc edx
cmp ecx, byte '0'
jb .done
cmp ecx, byte '9'
ja .done
; we have a valid character - multiply
; result-so-far by 10, subtract '0'
; from the character to convert it to
; a number, and add it to result.
lea eax, [eax + eax * 4]
lea eax, [eax * 2 + ecx - 48]
jmp short .top
.done
ret
Sort of a clever one a C compiler taught me...
Best,
Frank