[comp.sys.sun] Porting Questions

larus@spool.cs.wisc.edu (02/01/90)

I am trying to port a piece of software to a Sun 4 and have two questions
that I cannot answer from the documentation.  If anyone knows the answer
(or has a reference to the documentation), could you send me a note since
I don't normally read this news group.

1.  Are any of the global registers (%g1 -- %g7) available to programs?
Or, a better question, what are these registers used for?

2.  Is there any trick to doing an unaligned load/store of a word (4 byte
quantity)?  I can do it with a sequence of load-byte/store-byte's and
shifts, but I find it hard to believe that this is really the best
technique.

Thanks,
larus@cs.wisc.edu

dan@uunet.uu.net (Dan Mick) (02/08/90)

In article <4635@brazos.Rice.edu> larus@spool.cs.wisc.edu writes:
>X-Sun-Spots-Digest: Volume 9, Issue 21, message 9 of 13
>
>1.  Are any of the global registers (%g1 -- %g7) available to programs?
>Or, a better question, what are these registers used for?

Some of them are off-limits to the compilers, but some are used as part of
the normal register-allocation scheme.  I haven't been able to figure out
if any are available outside the compilers, and those that are may well be
used by the kernel...I've not seen any documentation on that either.

>2.  Is there any trick to doing an unaligned load/store of a word (4 byte
>quantity)?  I can do it with a sequence of load-byte/store-byte's and
>shifts, but I find it hard to believe that this is really the best
>technique.

Nope...that's all you get.  The CPU simply doesn't have the bus mux/demux
that CISC chips, in particular Moto chips, provide.