tags:

views:

156

answers:

1

I want to call the Sleep function on ASM. So I wrote the following:

push 5000
call Sleep

Although everything went fine, I had the idea that everytime I pushed a value on the stack, I should also pop it(otherwise it'd get all cluttered later in the program?). Should I pop it? How should I do it?

+3  A: 

Virtually all Win32 API functions use the __stdcall calling convention, where the called function is responsible for popping the argument(s) off the stack. So in the case of Sleep(), you don't have to do anything else than what you've shown.

Greg Hewgill