Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: "Gurunandan R. Bhat" , djgpp AT delorie DOT com Date: Wed, 17 Sep 1997 15:12:06 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Asm Question Precedence: bulk "Gurunandan R. Bhat" 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