Mail Archives: djgpp/1997/09/17/13:50:43
"Gurunandan R. Bhat" <grbhat AT unigoa DOT ernet DOT in> wrote:
> In what precise way does %ebp "characterise" a stack frame? Does it point
> to the first address on the current stack frame?
Is a copy of ESP at the entry point of the function. You can access to the
local variables, parameters and return address using EBP as base (you can use
ESP too, but not if you modify it).
> If so shouldn't each
> nested procedure call redefine %ebp to set up a new stack frame for its
> use?
Each function sets EBP to your own "stack-frame".
> I have looked at some .s files produced by gcc and all they do is push and
> pop %ebp at each procedure call. Where is it initialised if at all? I
> suspect that this is done in crt0.s but would be grateful for the range
> of line numbers in the relevant file where this is accomplished
Naa..., take a better look to the code, gcc uses:
pushl %ebp
movl %esp,%ebp
.
.
leave
ret
So the thing that is made at start-up is the definition of ss:esp.
Greetings, SET
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013
- Raw text -