In order to expand the answer of Andrei, in addition to increasing the stack pointer on the popped element, the popped element is also copied to the destination address or register.
The instruction you gave is more or less equivalent to the two instructions (Intel syntax)
add esp, 4
I think this is in the syntax of att (gas)
add $4, %esp mov -4(%esp), %ebp
Of course, pop does not change the flags (so imagine that you are doing add with LEA), and this is not interrupted between loading and adding.
For the pop esp special case, executing the second load in pseudo-code repeats the actual documented behavior of the increment before the data from the old stack top location is written to ESP. And doing the increment before calculating the address for the destination pop memory, using %esp as part of the addressing mode, like popl 12(%esp, %edx, 4)
Geoff reedy
source share