Click to See Complete Forum and Search --> : Where is stack frame


sawer
April 24th, 2007, 03:05 AM
Hi
I am reading documents about stack frame. But i really confused about where the stack frame of func. is.
For example here
http://courses.ece.uiuc.edu/ece390/lecture/lockwood/l8.html
It doesnt include local variables to stack frame
But here
http://en.wikipedia.org/wiki/Call_stack
it includes.

So can anyone explain me which one is true?
What is the procedure for function call in c?

I am looking for your answers

Thanks.

Krishnaa
April 24th, 2007, 03:51 AM
Both are right, the first link talks in context of assembly language, which is little raw, but the wiki article is better to understand.

In C/C++, first the arguments are pushed, return address and then EBP. Once the function enters, it creates it's local variables on stack, thus moving the stack pointer further by size of it's variables.

Take a look at following article,

Playing with stack (http://www.codeproject.com/tips/stackdumper.asp)