[net.micro.16k] NS16000 a.out format and calling sequence

glenn@nsc.UUCP (06/15/83)

I would like to correct a misconception contained in Brian Thomson's
and David Galloway's article on NS16032 calling sequences.  They state
that "... National-sponsored C implementations are constrained to use
cxp...".  It is easy to draw this conclusion, since our current
calling sequence uses cxp/rxp for procedure call and return.  However,
there is no requirement that an implementation use this calling
sequence.

In fact, we are in the midst of designing a new a.out format and
associated calling sequence for our System V implementation, and we
are seriously considering supporting jsr/ret (or bsr/ret) for
procedure linkage.  We also want the new a.out format to support
linking by traditional relocation as well as our current scheme of
linking that uses the NS16000 architecture's modular software features.

Another important issue in the a.out format and calling sequence
design is how global data references (C extern storage class) should
be made.  The architecture defines two addressing modes that can be
used for such references: external and absolute.  The external
addressing mode is compatible with the architecture's modular software
features but is expensive in terms of memory references, whereas the
absolute addressing mode is more suited for the relocation regime.

We have discovered a trick for speeding up external references in the
modular software environment.  The idea is to load the link table
adjacent to the static base area so that the link table resides at
small negative offsets from the static base register.  With this
memory layout, external addressing mode references can be converted to
indirect sb-relative references, saving a memory access per external
reference.  We've done some very rough and preliminary performance
measurements on C code produced using this trick, and it looks like we
get about a 10% speed improvement from it.

Before we commit ourselves to any specific a.out format and calling
sequence, we would like comments and opinions from the 16k community.
We are particularly interested in whether people would prefer:
	relocation using jsr/ret
	relocation using cxp/rxp
	our current scheme (loading using link tables, calls with cxp/rxp)
	something else (what?)

If there is sufficient response, I will summarize for the net.

		-- Glenn Skinner
		National Semiconductor, Microprocessor Systems Division
		...!{menlo70,fortune}!nsc!glenn
		(408) 733-2600 x 335