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

Discussion in 'C Programming' started by anonymous, Jan 12, 2005.

  1. anonymous

    anonymous Guest

    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
     
    anonymous, Jan 12, 2005
    #1
    1. Advertising

  2. On 11 Jan 2005 17:01:40 -0800, (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
     
    Raymond Martineau, Jan 12, 2005
    #2
    1. Advertising

  3. anonymous

    Richard Bos Guest

    (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
     
    Richard Bos, Jan 13, 2005
    #3
  4. anonymous

    S.Tobias Guest

    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 <> 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 LID | sed s/[[:upper:]]//g`
     
    S.Tobias, Jan 13, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sebastian Jekutsch

    Survey on refactoring activities using IDEs

    Sebastian Jekutsch, Jun 8, 2004, in forum: Java
    Replies:
    5
    Views:
    487
  2. Jeff Rush
    Replies:
    0
    Views:
    260
    Jeff Rush
    Feb 18, 2007
  3. anonymous
    Replies:
    4
    Views:
    764
    S.Tobias
    Jan 28, 2005
  4. code break

    stack pointer and frame pointer

    code break, Oct 18, 2006, in forum: C Programming
    Replies:
    4
    Views:
    639
    Walter Roberson
    Oct 18, 2006
  5. Surinder Singh
    Replies:
    1
    Views:
    1,249
    Richard Bos
    Dec 20, 2007
Loading...

Share This Page