I saw this question, but I didn’t find my answer in it..
So, why would I prefer to use add esp, 4 or add esp, 8 instead of using pop one or two times? Is there any difference (performance, safety, etc.) at all or it’s a matter of personal choice?
popdoesadd esp, 4too, it simply saves whatever there is on the top of the stack in its operand before. If you need what’s on the stack probablypopis faster thanmov wherever, [esp]; add esp, 4but if you simply need to clear the stackadd esp, 4will be fine.