I am trying to make a program that translate a c code to the assembly code
like complier. But i stacked when i deal with local variable.
what i want to do is,
1, save esp to a variable which is declared in data segment
2, push a variable into stack.
3, access the stack to find out the variable
The problem is this program uses the stack all the time. So, esp is
changing all the time. Even though i saved the pointer of the variable,
i still cannot access the variable in the stack.
Because, We can't access the memory space like.
mov eax, dword ptr [mem + di]
;mem is a variable that declared in data segment
;mem has the value of esp
Is there any easy way to access the data in specific place of stack.
Without waring about the esp.
Sorry for my break English, I am not sure, have i explained clearly.
Feel free to ask me, if you didn't understand my question.
Thank you all & have a good night.