From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 26 Jun 2004 08:35:00 -0400 From: Latchesar Ionkov To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] which register is used as FP on the x86 Message-ID: <20040626123500.GA22240@ionkov.net> References: <90a3e63881750a184ef8b70e226c99ae@vitanuova.com> <1040626135604.ZM882@Sindy> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1040626135604.ZM882@Sindy> User-Agent: Mutt/1.4.1i Topicbox-Message-UUID: aef0ac06-eacd-11e9-9e20-41e7f4b1d025 The Plan9 calling convention doesn't use BP as frame pointer. Lucho PS. gcc -fomit-frame-pointer doesn't guarantee that no frame pointers will be generated. On Sat, Jun 26, 2004 at 01:56:04PM +0200, Andrew Lynch said: > On Jun 25, 6:53pm, rog@vitanuova.com wrote: > > no register is dedicated as a frame pointer. > > > > if you know the PC, you can find out the FP from the SP. > > Maybe not dedicated, in the sense that you can also use it for other stuff, but > the EBP register is intended to be used as FP: > > "3. Stack-Frame Base Pointer (EBP) Register: The EBP register typically is used > to access data structures passed on the stack. [...] If the stack pointer is > copied into the base pointer before anything is pushed on the stack, the base > pointer can be used to reference data structures with fixed offsets. [...] > Instructions, such as ENTER and LEAVE instructions, are provided which > automatically set up the EBP register for convenient access to variables." > > intel 386DX Microprocessor Programmer's Reference Manual 1990 > > Andrew. > > P.S. If you have a gcc targeted for x86 you can see for yourself by comparing > the output of "gcc -S" with "gcc -fomit-frame-pointer -S".