What does add esp, -10 mean?
I thought add in aseembly is used to do addition and sub to do subtraction..
What would happen if add esp, -10 is executed?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It would add the value -10 (wich is a sub actually but using the ADD opcode) anyway the ESP register is default used (on intel x86) as the pointer to the stack and EBP is the stack frame for functions.
So add esp, -10 is only making room in the stack.
Eye on that you can manipulate the stack with any register, ESP register is the default one for opcodes that manage the stack like push, pop, call, ret, etc, etc.