What does lea 0x4(%esp),%ecx mean in at&t assembly?
What really is 0x4(%esp)?
It's %esp + 0x4.
LEA stands for Load Effective Address. It's, in this case, a simple addition, as shown above. Typically people and compilers don't really use it anymore because CPUs now ship with a nifty address generation unit (otherwise called AGU), which lets you use all kinds of fancy arithmetics to compute addresses from registers and values. In short, whatever you did with lea, you can now embed it inside any other instruction.
lea ecx,[esp+4]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With