9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Latchesar Ionkov <lucho@ionkov.net>
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
Date: Sat, 26 Jun 2004 08:35:00 -0400	[thread overview]
Message-ID: <20040626123500.GA22240@ionkov.net> (raw)
In-Reply-To: <1040626135604.ZM882@Sindy>

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".


  reply	other threads:[~2004-06-26 12:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-25 17:30 ron minnich
2004-06-25 17:53 ` rog
2004-06-26 11:56   ` Andrew Lynch
2004-06-26 12:35     ` Latchesar Ionkov [this message]
2004-06-26 12:35     ` Charles Forsyth
2004-06-26 14:27   ` Latchesar Ionkov
2004-06-26 17:31     ` Charles Forsyth
2004-07-03  7:17 ` [9fans] cpuserver: dhcp for authsrv, rio, users, ssh, factotum, pull Stephen Wynne
2004-07-03 16:37   ` [9fans] andrey mirtchovski
2004-07-05  4:06     ` [9fans] Stephen Wynne
2004-07-05 17:23       ` [9fans] andrey mirtchovski
2004-07-05 20:33       ` [9fans] Eric Grosse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040626123500.GA22240@ionkov.net \
    --to=lucho@ionkov.net \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).