;
                                   ANY4.Z80                                   

             Size (recs) CRC   Version    Author/Latest Issue      Disk
               5k (35)   C667  n/a        Bruce Morgen 7/88        Z3COM1

  1- Usage  2- Notes  3- Examples of Use                                      

   ANY4.Z80 is an enhancement of ANYWHERE.ASM as presented by Bridger Mitchell
in  The Computer Journal,  issue #33,  pp.11,14-15.   ANY4.Z80 is  a position-
independent  code linker/loader which  allows  a  PRL-format  program  to  run 
anywhere  in memory it  happens to be located.   Essentially,  ANY4 determines 
what its actual location is, then relocates itself to run at that address.  

   To use ANY4,  program code  must  be assembled  and linked into a PRL file, 
then overlayed with ANY4.
:1


   Usage:  1) Assemble ANY4.Z80 to a HEXfile:

              ZAS ANY4 H or Z80ASM ANY4/H
              (M80/L80 can't handle this correctly;
               use the M80 equate and the RELHEX 
               utility if you must use M80.)

           2) Overlay to PRL program file:

              MLOAD PROGNAME=PROGNAME.PRL,ANY4
              (MLOAD v2.1 or later required)
:2


ANY4 Notes:

   a. ANY4 includes  enhancements  suggested  by Bridger in  his TCJ  article:

      1) Code  is 'pulled' down  over  the Where-Am-I and  relocator  routines
         after relocation,  leaving just  the  relocated image  in  the buffer
         beginning at the anywhere address.

      2) All primary registers  except BC and IY can  be passed to the program
         by PUSHing  at ANYWHERE+3 and POPping at RDONE+3.   After the initial 
         relocate-&-move run, of course, any register can be passed.
:3


Examples of Use:

   a. An operating system could  be user-extensible  by providing  a buffer of
      adequate size and interface specifications to accomodate  a user-written
      driver for a new disk device,  real-time clock,  or other hardware.  The
      user needn't  know the location of the buffer to write  the driver,  and
      indeed, the operating system may not know until it loads the code.

   b. Programs  that  require  user-coded  configuration  or  hardware  driver
      routines could provide a configuration buffer 'anywhere'.  The hardware-
      specific code can  be assembled separately,  once,  and patched into any
      buffer location; the same  driver module could thus be used  in  several
      programs that require it, regardless of their buffer addresses. 
