1. none change
1.1)
int a = 9;
int add1(int a,int b)
{
a = a + 1;
}
push ebp
mov ebp,esp
mov eax,dword ptr ss:[ebp+8]
add eax,1
mov dword prt ss:[ebp+8], eax
here only change temp stack's [ebp+8] location's value.
after invoke the function add1, the stack will be recovery, and the [ebp+8] location's value will has none meaning.
So the a still is not changed, it is 9.
1.2)
void cstart(int a,int b,int c)
{
}
call .**********(该函数的地址)
push ebp
mov ebp,esp
mov dword ptr ss:[ebp+0x8], 0x00000001
mov dword ptr ss:[ebp+0xc], 0x00000003
mov dword ptr ss:[ebp+0x10], 0x00000002
pop ebp
2 pointer to value.
a has changed.
int i = 9;
int *a = &i;
int add1(int *a,int b)
{
*a = *a + 1;
}
As it change the temp stack's [ebp+8] location's value(actually value address) """"ssss pointed value.
So this pointer is not change(in stack and exit stack it's the same).
alrough the pointer is same after exit invoking function,
But it's pointed value is followed to change as the temp stack's value's pointed NEW value.