Path: utzoo!utgpu!watmath!clyde!att!alberta!ubc-cs!uw-beaver!mit-eddie!ll-xn!ames!pasteur!ucbvax!hplabs!hp-sdd!ncr-sd!crash!mwilson From: mwilson@crash.cts.com (Marc Wilson) Newsgroups: comp.os.cpm Subject: Re: Zcpr & High Level Languages Keywords: ZCPR3 Z33 ENV HLL Message-ID: <3649@crash.cts.com> Date: 26 Dec 88 04:53:26 GMT References: <12879@cup.portal.com> Reply-To: mwilson@crash.CTS.COM (Marc Wilson) Organization: Mesa College, San Diego, Ca. Lines: 37 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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~