I have a few questions about EBP, ESP and stack frame in following code.
Why did we subtract 28 from esp? We have two local variables x and y in main. So why didn't we subtract 8?
And don't we put values to stack from right (or top) to left (or bottom)? So why did we add 1 to [eax+8] instead of [eax+4]?
func(int a, int b, int c)
{
return a+b+c;
}
main()
{
int x, y=3;
x=func(y,2,1);
}