Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

[Question]activities of stack pointer and frame pointer when function called
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

Report this thread to moderator Post Follow-up to this message
Old Post
anonymous
01-12-05 08:55 AM


Re: [Question]activities of stack pointer and frame pointer when function called
On 11 Jan 2005 17:01:40 -0800, newbie_tw@yahoo.com.tw (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


Report this thread to moderator Post Follow-up to this message
Old Post
Raymond Martineau
01-12-05 08:55 AM


Re: [Question]activities of stack pointer and frame pointer when function called
newbie_tw@yahoo.com.tw (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

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Bos
01-13-05 08:56 PM


Re: [Question]activities of stack pointer and frame pointer when function called
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 <newbie_tw@yahoo.com.tw> 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 siXtY@FamOuS.BedBuG.pAlS.INVALID | sed s/[[:upper:]]//g`

Report this thread to moderator Post Follow-up to this message
Old Post
S.Tobias
01-14-05 01:56 AM


Re: [Question]activities of stack pointer and frame pointer when function called
newbie_tw@yahoo.com.tw (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

Report this thread to moderator Post Follow-up to this message
Old Post
Richard Bos
01-15-05 01:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

C archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:11 PM.

 

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.