9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <forsyth@terzarima.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] bug in asm.ps
Date: Mon,  6 Mar 2006 16:56:10 +0000	[thread overview]
Message-ID: <4d2a523d8271df64fc8faaf5314d3263@terzarima.net> (raw)
In-Reply-To: <599f06db0603060833i2b1a994dr3f62c9dd18800cec@mail.gmail.com>

> For me the first is the first declared in C. First as in 1st.
> This is wrong taking all this assumptions.

there is no guarantee in C that variables outside structs
are allocated in order of declaration, and indeed, storage
might not be allocated at all if entirely contained in a register.
for instance, in the plan 9 implementation, external values are
allocated out of order by several ?l, allocating bigger things last,
to give smaller offsets from SB for other values (when SB is a real
register).  automatic variables might or might not be allocated a register.

asm.ms describes things from the point of view of the loader, or
object code, not a compiler, but what it doesn't say (i think) is what
the negative offsets mean (they index from the other end of the space
used for automatic variables, allowing for pushes and pops where those exist,
and a few other peculiar constructions).



  reply	other threads:[~2006-03-06 16:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-06 15:12 Gorka guardiola
2006-03-06 15:16 ` Brantley Coile
2006-03-06 15:31   ` Gorka guardiola
2006-03-06 15:36     ` Brantley Coile
2006-03-06 15:53       ` Russ Cox
2006-03-06 16:05         ` Brantley Coile
2006-03-06 16:17           ` Russ Cox
2006-03-06 16:22             ` Brantley Coile
2006-03-06 16:28               ` Russ Cox
2006-03-06 16:33                 ` Gorka guardiola
2006-03-06 16:56                   ` Charles Forsyth [this message]
2006-03-06 16:16         ` Gorka guardiola

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=4d2a523d8271df64fc8faaf5314d3263@terzarima.net \
    --to=forsyth@terzarima.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).