;
                               Z33-TM2.LBR                                    

             Size (recs) CRC   Version    Author/Latest Issue      Disk
              n/a  n/a   n/a   n/a        Steve Cohen 6/87         n/a   

  1- Instructions  2- Notes                                                   

   Z33-TM2 contains several tools  for interfacing  Turbo-Modula2  to  ZCPR33.
Besides the familiar program structure by which Z3 utilities communicate  with
their environment,  ZCPR33 also finds the ENV address and puts it in HL as the
new program is loaded.   This provides  an alternate method  by which programs
can get the ENV address,  which then makes possible all the advanced  features
of Z3.  Z33-TM2 includes the following to accomplish this for TM2:

Z33M2.Z80  - assembler code to grab the ENV addr at the start of the program.
Z33M2.DEF  - the interface for the above procedure to M2.
TZ33M2.MOD - test module which calls on Module InOut to print the ENV in HEX.
:1

Instructions:

   1. Assemble Z33M2.Z80 with M80, ZAS, or Z80ASM to a .REL file.
   2. Invoke M2. and (C)ompile Z33M2.DEF
   3. (R)un REL Z33M2 Z33M2  (This creates the file Z33M2.MCD)
   4. (C)ompile TZ33M2.MOD.
   5. (L)ink TZ33M2 TZ33M2.COM  (when asked to include all modules, say yes)
   6. (Q)uit M2.
   7. Using  ZPATCH on TZ33M2.COM make  a note of the address in the two bytes
      at  101h  and  102h.   Write these down.   Then search  for  the  string
      "Z33ENV".   This has been inserted  in the assembler code for just  this
      purpose.   ZPATCH will  report  an  address  where the  string is found.
      Exactly 10-11  bytes further  on there  is  an address which  should  be
      patched with the  address  you found  at  101-102h (e.g., if the address
      which  the  search found  is  2000h, at 200Ah patch  the  same  byte you
      found at 101h and at 200Bh patch the  byte you found at 102h).   Now  go
      back  to  101-102h  and  patch  here  the  address  at  which the search
      reported its  find plus six  (in this example it would be 2006h,  so  at
      101h we would patch the value 06 and at 102h, the value 20). 
:2 


Z33-TM2 Notes:

   a. This procedure simply redirects program execution from the code it would
      normally execute first  to a different routine which stores HL in memory
      before  it is destroyed.   It then jumps to where TM2 would have started
      execution.