Therefore, you should get your argument using. This means that the old value of ebp was not pushed to the stack, and the current value of ebp cannot be used to get arguments because you don't know where it is. However, you did not set up a stack frame. Since, above this address, there are the old value of ebp and the return address, you would normally get the first argument using. When using a stack frame, value of esp is stored into ebp, making it point to a location on the stack called the frame's base. The frame is created through two operations at the beginning of the function: push ebpĪt the end of the function, the call stack is removed using leave, which is equivalent to the reverse of those 2 operations. This frame can be used to print the call stack, as well as an offset for local variables and arguments. When creating a function, it is often customary to create a "stack frame". When you perform a call, the address of the next operation is pushed to the stack as a return value.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |