From:
http://en.wikipedia.org/wiki/X86%5Fcalling%5Fconventions
push c
push b
push a
call function_name
add esp, 12 ;Stack clearing
mov x, eax
Why do we need to explicitly add 12 to ESP to clear the stack since the called function should have poped the parameters off the stack therefore restoring the stack pointer...?
Another question:
Theoretically, it would be possible to implement variable parameter functions with the callee taking care of the cleanup right (for instance if you pass the number of arguments on the stack in a register)?