Date : Fri, 23 Dec 1988 18:32:09 GMT
From : portal!cup.portal.com!dgee@uunet.uu.net (David O Goodman)
Subject: Zcpr & High Level Languages
Does anyone have suggestions for a graceful way in which to pass the
address of a ZCPR 3.x environment descriptor to a program written in a
high level language, so that the program can make use of the various ZCPR
facilities? Specifically, rather than hard-wiring the environment
descriptor address into the program, thus making it non-portable, what
would be a good way for a utility written in bds-c to learn the
environment descriptor address?
Discussion:
As some of you know, an assembly language program using the zcpr
environment is written with a header which tells the command processor
that it is a 'Z3ENV' program. At run time, the command processor plugs
the environment descriptor address into a specific location in this
header; now the program contains the address needed to get information on
its environment.
Since the object code of a program compiled under bds-c starts with the
bds runtime package, there seems to be no way to create the required
header, other than (perhaps) relocating the runtime package and finding
some way to link in a header underneath the package. I have not yet
played with this approach, but it does not seem very fruitful, since 1)
the bds documentation indicates that all code must run directly above the
runtime package, and 2) even if it could be done, relocating the runtime
package would require a full reassembly and/or recompilation of the
libraries, making them completely non-standard.
A second mechanism for communicating the environment descriptor address
from the command processor to a transient program apparently exists.
Inspection of the source code for ZCPR 3.3 (I haven't checked other
versions, yet) reveals that when zcpr 'calls' the transient program,
register pair HL contains the desired address. However, upon entry into
the runtime package, this register is immediately clobbered.
Any ideas, suggestions, or further discussion would be appreciated. If I
receive mail on this subject, I will summarize to the net.
Thanks.
--
Dave Goodman
dgee@cup.portal.com
...sun!portal!cup.portal.com!dgee
End of INFO-CPM Digest
******************************