<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Mon, 26 Dec 1988 04:53:26 GMT
From   : hp-sdd!ncr-sd!crash!mwilson@hplabs.hp.com (Marc Wilson)
Subject: Zcpr & High Level Languages

In article <12879@cup.portal.com> dgee@cup.portal.com (David O Goodman) writes:
>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?

     The *easiest* way is to code a loop that begins at the top of memory
and scans downwards for the string "Z3ENV".  As long as you're between the
BIOS and the top of memory, the only place that that string should appear
is at address ENV+3.  That'll give you the environment address.

     Note that this technique is *extremely* dangerous on any system that
supports memory-mapped I/O ( i.e. Apple CP/M ), for obvious reasons.

     This technique is not new.  Several of the Z-System utilities include
a routine called FENV.  This is the _F_ind _ENV_ironment routine, originally
developed by Joe Wright.  The first program I saw use this technique was a
version of LX.

     Note that this method *should* work under NZ-COM, as long as you use
the address of the pseudo BIOS, rather than the real one.

>--
>
>Dave Goodman
>dgee@cup.portal.com
>...sun!portal!cup.portal.com!dgee


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Marc Wilson
     ARPA: ...!crash!mwilson@nosc.mil
           ...!crash!pnet01!pro-sol!mwilson@nosc.mil
     UUCP: [ cbosgd | hp-sdd!hplabs | sdcsvax | nosc ]!crash!mwilson
     INET: mwilson@crash.CTS.COM
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


End of INFO-CPM Digest
******************************
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>