Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > [Question]activities of stack pointer and frame pointer when function called

Reply
Thread Tools

[Question]activities of stack pointer and frame pointer when function called

 
 
anonymous
Guest
Posts: n/a
 
      01-12-2005
I'm new to programming c; and have few questions. hope could get
answers from here.
My question is ( I read some post) when a function called the frame
pointer would be pushed onto the stack and then the previously stack
pointer becomes the new frame pointer. I'm not very sure how? or you
can say i don't understand this activities at all. Therefore, I hope
someone, if possible, can give me more detail illustration (if please,
with pic is better; my english understanding is not very well; ) or
tell me where I am able to find the related resource.
I appreciate it, sincerely.
Jason
 
Reply With Quote
 
 
 
 
Raymond Martineau
Guest
Posts: n/a
 
      01-12-2005
On 11 Jan 2005 17:01:40 -0800, http://www.velocityreviews.com/forums/(E-Mail Removed) (anonymous) wrote:

>I'm new to programming c; and have few questions. hope could get
>answers from here.
>My question is ( I read some post) when a function called the frame
>pointer would be pushed onto the stack and then the previously stack
>pointer becomes the new frame pointer. I'm not very sure how? or you
>can say i don't understand this activities at all.


I'm not sure which posting you are referring to, but it certainly doesn't
look like the poster explained it correctly. It was also a case where the
poster was trying to describe assembly language on this newsgroup, which is
basically off-topic.

>Therefore, I hope
>someone, if possible, can give me more detail illustration (if please,
>with pic is better; my english understanding is not very well; ) or
>tell me where I am able to find the related resource.


You should take a look at the newsgroups referenced here:
http://www.ungerhu.com/jxh/clc.welcome.txt

 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      01-13-2005
(E-Mail Removed) (anonymous) wrote:

> My question is ( I read some post) when a function called the frame
> pointer would be pushed onto the stack and then the previously stack
> pointer becomes the new frame pointer.


That depends on the implementation. If you just want to program in C,
you typically don't need to know how your implementation handles
function calls, as long as the result is in accord with the Standard.

Richard
 
Reply With Quote
 
S.Tobias
Guest
Posts: n/a
 
      01-13-2005
Stack frames and things are about how a function call is implemented
by a specific compiler, not necessarily a C compiler, and as such is OT
in clc. However, I believe that understanding these practical aspects
of life often helps better understand (the design of) a language itself
(...and people both from clc and csc as well). I hope a general answer
to this question is not much inappropriate here.

anonymous <(E-Mail Removed)> wrote:
> I'm new to programming c; and have few questions. hope could get
> answers from here.
> My question is ( I read some post) when a function called the frame
> pointer would be pushed onto the stack and then the previously stack
> pointer becomes the new frame pointer. I'm not very sure how?


Your description doesn't make much sense.
Next time supply some pointers to the article you read, it'll be
easier to answer your query.

> or you
> can say i don't understand this activities at all.


I suspect you don't understand what as stack frame is.

First try to read:
http://en.wikipedia.org/wiki/Stack_frame
(this is not a particularly good description, but you have
to start somewhere).

Then try to google for web pages with these keywords:
stack frame function call convention

Then if you have more questions, come back here, and I'll prepare
a longer answer.

--
Stan Tobias
mailx `echo (E-Mail Removed)LID | sed s/[[:upper:]]//g`
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C/C++ compilers have one stack for local variables and return addresses and then another stack for array allocations on the stack. Casey Hawthorne C Programming 3 11-01-2009 08:23 PM
stack frame size on linux/solaris of a running application stack Surinder Singh C Programming 1 12-20-2007 01:16 PM
gdb error: Previous frame inner to this frame (corrupt stack?) Sven C++ 2 11-30-2007 08:16 PM
stack pointer and frame pointer code break C Programming 4 10-18-2006 07:35 PM
[Question]activities of stack pointer and frame pointer when function called anonymous C Programming 4 01-28-2005 03:54 PM



Advertisments