ryt
May 9th, 2008, 09:27 AM
hello,
I made this c++ program and created asm listing:
int main(){
int var = 3;
return 0;
}
asm listing:
...
_TEXT SEGMENT
_var$ = -8 ; size = 4
_main PROC
...
mov DWORD PTR _var$[ebp], 3
...
I dont understand fully this local variable in asm. There is "mov DWORD PTR", asm puts 3 in location size DWORD. "[ebp]" tells to store it at stack frame. "_var$" is an equate and tells to store it -8 from stack frame through indexing ( [_var$+ebp] ).
What I dont understand why at -8, why not at -4 since it is a first local variable. What is the meaning of $. And why asm stores equates in _TEXT ?
I made this c++ program and created asm listing:
int main(){
int var = 3;
return 0;
}
asm listing:
...
_TEXT SEGMENT
_var$ = -8 ; size = 4
_main PROC
...
mov DWORD PTR _var$[ebp], 3
...
I dont understand fully this local variable in asm. There is "mov DWORD PTR", asm puts 3 in location size DWORD. "[ebp]" tells to store it at stack frame. "_var$" is an equate and tells to store it -8 from stack frame through indexing ( [_var$+ebp] ).
What I dont understand why at -8, why not at -4 since it is a first local variable. What is the meaning of $. And why asm stores equates in _TEXT ?