Re: Difference Between Stack Pointer and Frame Pointer



On 4 Jul 2005 00:53:06 -0700, "toby" <toby@xxxxxxxxxxxxxxxxxxx> wrote:

>
>
>Dave Hansen wrote:
[...]
>> No. The stack pointer operates on the stack. The frame pointer
>> operates on the frame. Very often, the frame is located in the stack,
>> but it ain't necessarily so.
>
>Care to name a counterexample?

Most AVR compilers have a data stack separate from the hardware stack.
In this case it's on "a" stack, but not "the" stack.

Most 8051 compilers keep call frames completely separate from any
stack. However, functions that use this calling convention are not
reentrant.

I've heard rumors about (but have no experience with) architectures
like IBM's AS/400 that allocate call frames from the heap. The
reasons for this have to do with security, integrity, and
fault-tolerance.

I expect there are more.

Regards,

-=Dave
--
Change is inevitable, progress is not.
.



Relevant Pages

  • Re: [OT] [Question]activities of stack pointer and frame pointer when function called
    ... >>I suspect you don't understand what as stack frame is. ... A function stack frame is a method to keep track of function ... At the point of creation the caller is ... When the callee returns to its ...
    (comp.lang.c)
  • Re: [PATCH 2/2] function-graph: add stack frame test
    ... In case gcc does something funny with the stack frames, ... frame of the parent function, and will test that frame on exit. ... This modifies the parameters of one of the functions that the arch ... movl 0xc, %edx ...
    (Linux-Kernel)
  • Re: What is a stack frame?
    ... There is no need for a separate "this frame" pointer. ... In any case, the more general term, which covers what a C compiler ... hardware-provided stack to implement the stack-like data structure ... manner since the current stack frame is "deformed" by alloca. ...
    (comp.lang.c)
  • Re: [9fans] pointer to the last TOS
    ... the stack pointer is there. ... a positive offset from ... pointer to the virtual frame pointer to find the return address. ...
    (comp.os.plan9)
  • Re: LPC900/80C51 Compiler Toolchain
    ... Although the fixed-size frame optimization is orthogonal to removing ... storing stack arguments is less important in such cases. ... storing data at (SP + offset) takes exactly the same time ... up and uses up another 2 registers. ...
    (comp.arch.embedded)