I’m performing a couple of processes that already require the use of a source index. If I need to use a source index that’s already being used for another item, how can I do that? Is there a way to save edi as data and then retrieve it when necessary?
Thanks.
The stack is for that:
Always pay attention to the order. Also, use the appropiate version of
push/pop.If you need to save and access different values at the same time, making your own stackframe is a better solution.
Example (at the beginning of the function, AT&T syntax):
Now you can reference memory locations in reference to %ebp, example:
Similiary, you could save your first variable in -4(%ebp) and your second in -8(%ebp).
To the destroy the stackframe and return:
You don’t need to clear the memory, as it’ll be overwritten once that space is used again.