I know how to pass parameters to a user-defined function and how to create local variables inside such function. But what I want is to create local variables for the main function.
So the main function is the first thing that executes when the program starts, but what is the initial value of esp when main starts executing? i.e what is on top of the stack when main starts executing, is it the command line arguments?
If I want to create local variables inside main, should I save the value of esp into ebp and then increment esp by how much data I need just like I do inside of a user-defined function?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…