mov %eax,(%esp)

arc picture arc · Oct 19, 2012 · Viewed 11.3k times · Source

What is the difference between the following statements?

mov %eax,%esp
mov %eax,(%esp)

I'm working on diffusing a binary bomb and am having trouble with a few of the mov and leal commands early on in the assembly.

Answer

Dirk Holsopple picture Dirk Holsopple · Oct 19, 2012

This copies the value in %eax into %esp.

mov %eax,%esp

This copies the value from %eax to the location in memory that %esp points to.

mov %eax,(%esp)