pop or add esp, 4 ? What is the difference?

pop does add esp, 4 too, it simply saves whatever there is on the top of the stack in its operand before. If you need what’s on the stack probably pop is faster than mov wherever, [esp]; add esp, 4 but if you simply need to clear the stack add esp, 4 will be fine.

Leave a Comment