From: ivie@cc.usu.edu (Roger Ivie)
Subject: Re: loading data addresses on Alpha
Date: 1996/05/03 [thread overview]
Message-ID: <1996May3.094838.79529@cc.usu.edu> (raw)
In-Reply-To: Dqs8D7.7A3@world.std.com
In article <Dqs8D7.7A3@world.std.com>, craigp@world.std.com (Craig Partridge) writes:
Well, after my fiasco discussing MSCP and bad block replacement on port-vax,
I promised myself I wouldn't post about things I didn't know really well. I just
couldn't resist this one, though...
> How does one load addresses into registers on the Alpha?
>
> Having plowed through the manuals and various bits of code, it appears there
> are two choices:
>
> * I can laboriously load 16-bits of the address at a time using
> LDA and LDAH and one shift. This eats several instructions.
>
> * Various assemblers seem to offer a single instruction macro expansion of
> LDA, that loads a particular address using some offset from (I believe)
> the global pointer (GP). What I can't puzzle out is how this is done
> and how GP is initialized.
Your choices are basically load it using LDA and LDAH etc. or arrange to have
a location lying around somewhere convenient containing the valud you need
to load.
The address of a procedure on the Alpha is really the address of a record
containing a pair of addresses: the entry point of the procedure and the
value that should be loaded into one of the other registers so that
procedure can get to its constants (the "literal pool"). It's been a while
since I dorked with this stuff, but you should be able to see this happen
in MACRO32 if you compile with /list/show=machine. In the expansion of the
single-word LDA equivalent, you should see a reference through the pointer
into the literal pool to a word containing the value; i.e., the LDA expands
into an instruction and a data word.
--
-------------------------+---------------------------------------------
Roger Ivie | P v Q -> P
ivie@cc.usu.edu | -- Gordon B. Hinckley
http://cc.usu.edu/~ivie/ |
next prev parent reply other threads:[~1996-05-03 4:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-05-02 4:00 loading data addresses on Alpha Craig Partridge
1996-05-03 4:00 ` Roger Ivie [this message]
1996-05-07 4:00 ` Greg Lueck Development Environment
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox