logoalt Hacker News

trollbridgetoday at 1:44 PM1 replyview on HN

LEA is the equivalent of & in C. It gives you the address of something.

Fun question: what does the last line of this do?

MOV BP,12 LEA AX,[BP] MOV BX,34 LEA AX,BX


Replies

hota_mazitoday at 2:33 PM

I think OP was just making a comment on the asymmetry of the syntax. Brackets [] are usually used to dereference.

Why is this written

    lea eax, [rdi + rsi]
instead of just

    lea eax, rdi + rsi

?
show 3 replies