I was asked to create a small program in the assembly using the functions of C. At the same time, I was interested to learn something specific.
I know that when working with the assembly, wherever I want to call the C function, I have to push its arguments to the stack, and after the function returns, I have to put these arguments (or add 4x times to esp, where x represents the number of pressed arguments).
My question is:
When calling the C function exitin particular, I must first press the argument for the state. Let's say I want to press 0 to indicate that my program worked without errors.
Knowing that the function exitdoes not return and that I have to use it and cannot simply cause the interruption of the exit system, how can I pull this out of the stack in this case? Does the function exitdo this for me?
source
share