home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / LANGUAGS / FORTRAN / CPMLIB.ARK / CPMLIB.MOD < prev    next >
Text File  |  1982-01-12  |  4KB  |  117 lines

  1.  
  2.  
  3.         CPMLIB.MOD
  4.  
  5.  
  6. This is a short guide to modifying the contents of CPMLIB.REL.
  7.  
  8. In the examples that follow, the "system disk" is assumed to be
  9. on drive A:. That drive is assumed to contain the Microsoft
  10. FORTRAN-80 package, including F80.COM, L80.COM, M80.COM and
  11. LIB.COM.  The CPMLIB files are assumed to be on drive B:.
  12.  
  13.  
  14. A)    CPMLIB structure
  15.  
  16.     CPMLIB.REL should be thought of as being divided into
  17.     three levels of subroutines.  The first are the
  18.     primary entry points from FORTRAN programs. These
  19.     routines are all at the beginning of the library.
  20.     Since there is no interdependence between them,
  21.     they have been placed in alphabetical order.
  22.  
  23.  
  24.     The second level contains various service routines
  25.     for the primary entry point routines.  These are
  26.     somewhat interdependent, and should be arranged so
  27.     that a single search through the library can resolve
  28.     all references.
  29.  
  30.     The last level contains the assembly language
  31.     routines that perform the CP/M function calls.
  32.     They should be last, since they can be called by
  33.     any of the higher-level routines.
  34.  
  35.     The first two levels are written in FORTRAN and are
  36.     contained in the file CPMINT.FOR which stands for
  37.     CP/M INTerface.
  38.  
  39.     The third level routines are written in assembly
  40.     and are contained in the files CPMFN.MAC and 
  41.     CPMFNA.MAC.  CPMFN.MAC contains the BDOS calls,
  42.     and CPMFNA.MAC contains the command line routine.
  43.     Both of the assembly language routines assume a
  44.     standard ORG 0000H version of CP/M.  If your CP/M
  45.     has a different origin, you will need to reassemble
  46.     these two routines.
  47.  
  48. B)    Adding or Changing Functions
  49.  
  50.     New functions can be added by writing the appropriate
  51.     FORTRAN interface routine. That routine, and any support
  52.     routines it needs, should be inserted into CPMINT.FOR.
  53.     Then, recompile the entire FORTRAN file.
  54.  
  55.         A>F80 =B:CPMINT.FOR
  56.  
  57.     If new BDOS function calls are required, set the 
  58.     appropriate equates in CPMFN.MAC and reassemble it.
  59.  
  60.         A>M80 =B:CPMFN.MAC
  61.  
  62.     Otherwise, you may need to write a new assembly language
  63.     routine.
  64.  
  65.     You will also need to reassemble to change the CP/M
  66.     origin if your version is not ORG 0000H.
  67.     In this case, all .MAC files will need to be edited
  68.     and reassembled.
  69.  
  70.     By convention, the high level routines are all written
  71.     with no interdependence. They are inserted at the 
  72.     beginning of the library in alphabetical order.
  73.  
  74.     The secondary FORTRAN routines all have names ending
  75.     with a dollar sign ($).  They must be arranged so that
  76.     a single search thru the library resolves all references.
  77.     The ERROR$ routine is placed last in the FORTRAN section,
  78.     since in the future any of the other routines may
  79.     issue a call to it.
  80.  
  81.     The assembly routines are all named with a prefix of
  82.     CPMF (for CP/M Function).  The BDOS functions are in
  83.     the file CPMFN.MAC / CPMFN.REL and the entry points
  84.     contain the BDOS function number -- CPMF19, for
  85.     example, is the entry for BDOS function number 19.
  86.     Additional routines are in files with alphabetic 
  87.     suffixes.  The first (and only) file in this category
  88.     is CPMFNA.MAC / CPMFNA.REL for command line processing.
  89.     The second would be CPMFNB, etc.
  90.  
  91.     While not essential, this convention does define an
  92.     orderly system for naming the routines in the library.
  93.  
  94. C)    Rebuilding the Library
  95.  
  96.     Once the new or modified routines are compiled and
  97.     assembled, use the LIB-80 program to construct your
  98.     new library.
  99.     LIB works on the currently-logged drive, so log in
  100.     to drive B: if that is where the CPMLIB files are.
  101.  
  102.         A>B:
  103.         B>A:LIB
  104.         *NEWLIB=CPMINT,CPMFN,CPMFNA
  105.         */E
  106.  
  107.     Test the new library.  If it is OK, then you can erase
  108.     the old library and rename the new one.
  109.  
  110.         B>ERA CPMLIB.REL
  111.         B>REN CPMLIB.REL=NEWLIB.REL
  112.  
  113.  
  114.  
  115.  
  116.  
  117.