home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / asmutil / ovl301.zip / OVL.DOC < prev    next >
Text File  |  1989-02-05  |  87KB  |  2,296 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.                          ======================
  7.                          OVL 3.01 DOCUMENTATION
  8.                          ======================
  9.  
  10.  
  11.  
  12.      LICENSE AND WARRANTY
  13.      --------------------
  14.  
  15.      OVL copyright 1988, 1989 by Michael E. Devore.  All rights
  16.      reserved.
  17.  
  18.      The copyright holder licenses you to use, copy, and distribute
  19.      OVL files for yourself and others subject to the following four
  20.      restrictions:
  21.  
  22.  
  23.      1.  The OVL package must be copied and distributed only in its
  24.          original, unmodified form.  This includes the documentation,
  25.          executable, source, object, and all example files.
  26.  
  27.      2.  No fee or other compensation can be charged for copying or
  28.          distributing the program files.  The only exceptions are
  29.          user groups and incorporated public domain or shareware
  30.          software distributors who may charge a handling fee for its
  31.          distribution NOT TO EXCEED $8.00 PER COPY.  ONLY ONE COPY
  32.          PER COMPUTER DISK IS ALLOWED FOR SUCH DISTRIBUTION.
  33.  
  34.      3.  OVL files may NOT be distributed in combination with any
  35.          other products, software or hardware, without the express
  36.          written permission of Michael E. Devore.
  37.  
  38.      4.  OVL files are for your personal use only and may NOT be used
  39.          for commercial applications.  See the PROVL program
  40.          description in this documentation file if you need to use a
  41.          version of the OVL overlay manager package commercially or
  42.          need a custom version of OVL.
  43.  
  44.  
  45.      There is no warranty of any kind with OVL and the copyright
  46.      holder is not liable for any damages of any kind whatsoever,
  47.      directly or indirectly, that may occur due to use of, or
  48.      inability to use, this software.  By using or distributing OVL
  49.      you agree to these terms.  If you do not agree to these terms,
  50.      you may not use or distribute OVL.
  51.  
  52.      It is the copyright holder's intention to fix any errors in OVL
  53.      and to allow both its noncommercial use and distribution free of
  54.      charge.  The copyright holder, however, is NOT LEGALLY OBLIGATED
  55.      TO DO SO.
  56.  
  57.      This document copyright 1988, 1989 by Michael E. Devore.  All
  58.      rights reserved.
  59.  
  60.  
  61.  
  62.      License and Warranty                             page 1 of 1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.      OVL FILES
  69.      ---------
  70.  
  71.      Included in OVL301.ARC should be the following files:
  72.  
  73.      OVL.DOC        (OVL documentation file)
  74.      LINKOVL.OBJ    (linkable OVL program object file)
  75.      OVL.EXE        (OVL stand-alone executable)
  76.      QB4MOD.OBJ     (Object module for use with OVL.EXE)
  77.  
  78.      SPLIT.EXE      (Separate overlay files utility, executable)
  79.      SPLIT.C        (Turbo C source code for the SPLIT program)
  80.      MAPOVL.EXE     (Overlay mapping utility, executable)
  81.      MAPOVL.C       (Turbo C source code for the MAPOVL program)
  82.      PRONK.EXE      (Utility to allow use of Clipper or indirect
  83.                      calls to overlays with OVL)
  84.  
  85.      MASMTEST.ASM   (MASM example files)
  86.      MASMTEST.OBJ
  87.      OV1.ASM
  88.      OV1.OBJ
  89.      OV2.ASM
  90.      OV2.OBJ
  91.      OV3.ASM
  92.      OV3.OBJ
  93.  
  94.      COW.C          (Turbo C example files)
  95.      FARM.C
  96.      HORSE.C
  97.      PIG.C
  98.      PIGLET.C
  99.      SHEEP.C
  100.  
  101.      QBNEST.BAS     (QuickBASIC 4.x example files)
  102.      BNEST1.BAS
  103.      BNEST2.BAS
  104.      BNEST3.BAS
  105.      BNEST4.BAS
  106.  
  107.      PRTEST.ASM     (MASM example files for PRONK demonstration)
  108.      PRTEST.OBJ
  109.      PTEST2.ASM
  110.      PTEST2.OBJ
  111.      PTEST3.ASM
  112.      PTEST3.OBJ
  113.  
  114.      MULTEST.ASM    (MASM source code to multiple overlay area
  115.      MULTA.ASM       demonstration program)
  116.      MULTB.ASM
  117.      MULTC.ASM
  118.      MULTD.ASM
  119.  
  120.      MULTEST.EXE    (Demonstration use of multiple overlay areas)
  121.  
  122.  
  123.  
  124.      OVL files                                        page 1 of 1
  125.  
  126.  
  127.  
  128.  
  129.  
  130.      What is OVL?
  131.      ------------
  132.  
  133.      OVL is an overlay manager package containing two types of an
  134.      overlay manager, a linkable and a stand-alone version.  So what
  135.      is an overlay manager and what good are they?  To answer that
  136.      question we first need a little background on what overlays are
  137.      and why they are useful.
  138.  
  139.      Overlays are portions of program code which are loaded from disk
  140.      into memory on an as-needed basis.
  141.  
  142.      Use of overlays allows an extremely large (potentially equal to
  143.      hard disk capacity) program to run in a much smaller amount of
  144.      memory.  Code from the program's .EXE file is brought in from
  145.      disk (overlaid) only when the program needs it.  Since all
  146.      overlays share the same memory space, the memory requirements
  147.      can be much less than the total code size of the program.  Also,
  148.      there is no longer a need for the messy chaining, spawning, or
  149.      exec'ing to another program that some languages require.
  150.  
  151.      There is a tradeoff for these advantages.  The tradeoff is the
  152.      time and code overhead necessary to read overlays in from disk.
  153.      If you make the decision to use overlays with your program, any
  154.      timing critical code should not be divided between overlays.
  155.      For most applications, though, the relatively small amount of
  156.      time it takes to read in an overlay from disk is not important
  157.      if transfers to overlays are not overdone or poorly timed.
  158.      Constant shuttling between overlays is an exercise guaranteed to
  159.      give disappointing results.  A little bit of thought will go a
  160.      long way towards efficient overlay operation.
  161.  
  162.      LINK.EXE, Microsoft's Overlay Linker, included with MS-DOS and
  163.      Microsoft languages, versions 3.x and some 2.x versions, allow
  164.      creation of overlaid programs.  However, LINK only inserts
  165.      software interrupts and some overlay information in the program
  166.      for an overlay manager to use.  LINK doesn't provide the actual
  167.      code that loads the proper overlay from disk and passes control
  168.      to it.  That's a job for an overlay manager, and that's where
  169.      the OVL overlay managers come in.
  170.  
  171.      OVL "manages" overlays.  OVL loads overlays from disk at the
  172.      appropriate time and jumps program execution to the overlay
  173.      code.
  174.  
  175.      Beginning with OVL version 3.0, there are two different ways to
  176.      use the OVL package.
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.      What is OVL?                                     page 1 of 2
  187.  
  188.  
  189.  
  190.  
  191.  
  192.      OVL.EXE and LINKOVL.OBJ are separate versions of the overlay
  193.      manager in the OVL package and are not to be used together.
  194.      Each version takes a different approach to managing overlays.
  195.      OVL.EXE is a stand-alone overlay manager that loads an .EXE
  196.      program containing overlays.  LINKOVL.OBJ is a linkable overlay
  197.      manager that is linked in as an object module with the program
  198.      containing overlays.  Most users of the OVL package will
  199.      probably use the LINKOVL.OBJ overlay manager since it is cleaner
  200.      and more powerful.  OVL.EXE is included for backward
  201.      compatibility with previous versions of OVL and for
  202.      circumstances where OVL.EXE is more appropriate or works better
  203.      with a particular program.  LINKOVL.OBJ, for instance, will take
  204.      longer to execute a program during startup since it actually
  205.      loads an overlaid program twice -- once to get information and
  206.      allocate extra overlay areas if necessary, and once to begin
  207.      program execution.
  208.  
  209.      Beginning with version 2.2, OVL supports use of multiple overlay
  210.      areas.  The overlay areas are set up via command line switches
  211.      at runtime.  To see detailed examples of how to use this option
  212.      and why it is useful, read the 'USING OVL (Advanced Operation --
  213.      Multiple Overlay Areas)' section.
  214.  
  215.      Several other command line switches or options were added with
  216.      version 3.0 of OVL, including a overlay log file for debugging
  217.      purposes, support of separate overlay files, and a couple of
  218.      other options.  Examples and a description of these options are
  219.      covered in the 'USING OVL (Advanced Operation -- Command Line
  220.      Option //x)' and 'USING OVL (Advanced Operation -- Other Command
  221.      Line Options) sections.
  222.  
  223.      If you are or become completely overwhelmed at the size or
  224.      complexity of OVL, be sure to read the 'TOO LARGE!  DOESN'T WORK
  225.      WITH MY DEBUGGER!  TOO COMPLICATED!  PROVL TOO EXPENSIVE!'
  226.      section for an alternative to the OVL overlay managers.
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.      What is OVL?                                     page 2 of 2
  249.  
  250.  
  251.  
  252.  
  253.  
  254.      SYSTEM REQUIREMENTS
  255.      -------------------
  256.  
  257.      The OVL package requires an IBM PC or PS/2 microcomputer or
  258.      close compatible with MS-DOS or PC-DOS operating system version
  259.      2.1 or later.  Microsoft's Overlay Linker version 3.06 or later,
  260.      or some versions of Microsoft's Object Linker version 3.05 or
  261.      earlier, must be used to link together the object modules of the
  262.      overlaid program.
  263.  
  264.      In their standard configurations LINKOVL.OBJ requires 14K
  265.      (kilobytes) RAM and OVL.EXE requires 12K RAM, in addition to the
  266.      memory requirements of the overlaid program.  Use of multiple
  267.      overlay areas or increasing the relocation table buffer size
  268.      with OVL's /ZBn option will increase memory requirements above
  269.      the standard configurations.
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.      System requirements                              page 1 of 1
  311.  
  312.  
  313.  
  314.  
  315.  
  316.      LINKOVL SPECIFICATIONS AND REQUIREMENTS (Linkable OVL program)
  317.      --------------------------------------------------------------
  318.  
  319.      *  LINKOVL.OBJ has been tested with MASM 4.0 and 5.0; Turbo C
  320.         1.0, 1.5 and 2.0; QuickBASIC 4.0 and 4.5; Microsoft's BASCOM
  321.         6.0; and Clipper (PRONK.EXE, an included support utility,
  322.         must be used with Clipper programs).  Other languages that
  323.         compile to standard Microsoft Overlay LINKable object modules
  324.         MAY also work with LINKOVL.
  325.  
  326.      *  Use of LINKOVL with QuickBASIC 4.x and BASCOM 6.0 requires
  327.         compiling the program with the /O option of BC.EXE.  Use of
  328.         the file QB4MOD.OBJ is NOT required as it is for OVL.EXE.
  329.  
  330.      *  The object files created by versions of QuickBASIC earlier
  331.         than 4.0 abort with an error if a link is attempted with
  332.         overlays.  Therefore, LINKOVL will NOT work with versions of
  333.         QuickBASIC earlier than 4.0.  This is a limitation of the
  334.         earlier versions of QuickBASIC and not an error or
  335.         shortcoming in LINKOVL.
  336.  
  337.      *  The Microsoft LINK object module preprocessor utility
  338.         PRONK.EXE must be used if indirect calls to overlay code are
  339.         required.  Otherwise, calls to a function or procedure FROM
  340.         the root code TO overlay code, or from one overlay to another
  341.         (INTERoverlay calls) MUST be direct, that is, not indirectly
  342.         through a pointer.  This restriction is necessary because
  343.         Microsoft LINK can only set up an interrupt invoking the
  344.         overlay manager for direct calls to program code.  For
  345.         assembly language programs this means that interoverlay calls
  346.         to procedures must be coded as CALL ADDR, not CALL MEM/REG.
  347.         For 'C', interoverlay function calls should be directly
  348.         called, not called through a pointer to a function.  Calls
  349.         within an overlay (INTRAoverlay calls), within the root code,
  350.         or FROM an overlay TO the root can be made indirectly.
  351.         QuickBASIC and BASCOM programs should not be affected by this
  352.         restriction unless non-BASIC modules which use indirect calls
  353.         to overlays are also linked in.  Clipper programmers must use
  354.         PRONK whenever they use the LINKOVL.OBJ overlay manager.
  355.  
  356.      *  Microsoft's Overlay Linker requires the presence of at least
  357.         one overlay when linking LINKOVL.OBJ with a program's object
  358.         modules.  An attempt to link LINKOVL.OBJ with a program that
  359.         doesn't have at least one overlay will cause LINK to abort
  360.         with several "Unresolved external" errors.
  361.  
  362.      *  LINKOVL has a limit of eight overlays in a program.  More
  363.         than eight overlays will cause LINKOVL to abort with a "Too
  364.         many overlays." error upon startup.  LINKPRO, the enhanced
  365.         version of LINKOVL, has a limit of 63 overlays -- LINK's
  366.         current maximum.
  367.  
  368.  
  369.  
  370.  
  371.  
  372.      LINKOVL specifications and requirements          page 1 of 2
  373.  
  374.  
  375.  
  376.  
  377.  
  378.      *  LINKOVL supports calls from one overlay to another (nesting).
  379.         Overlays can be nested up to four levels.  An attempt to nest
  380.         deeper than four overlays will cause LINKOVL to abort with an
  381.         "Overlays nested deeper than 4 levels." error.  LINKPRO
  382.         supports a nesting depth of 32 levels.
  383.  
  384.      *  LINKOVL requires use of the Microsoft LINK default overlay
  385.         interrupt 63 (3fh).  Do not use the /OVERLAYINTERRUPT or /O
  386.         option of LINK to change the overlay manager interrupt.
  387.         LINKPRO supports changing the default overlay manager
  388.         interrupt via the /O option of LINK.
  389.  
  390.      *  LINKOVL WILL work with the /EXEPACK or /E option of LINK, if
  391.         the program containing overlays is suitable for using the
  392.         /EXEPACK option.  LINKOVL will work with the EXEPACK.EXE
  393.         utility as well.  Note that EXEPACKed files are NOT supported
  394.         with OVL.EXE.
  395.  
  396.      *  LINKOVL supports two overlay areas: the overlay area
  397.         allocated by Microsoft LINK during the linking process and
  398.         optionally one other overlay area.  If two overlay areas are
  399.         used, memory allocation for the second overlay area is made
  400.         in normal DOS memory.  As a result, the amount of memory
  401.         available to the loaded program decreases.  This decrease,
  402.         that is, the amount used by the second overlay area, is equal
  403.         to the largest overlay file that will load into that overlay
  404.         area rounded up to the next 512-byte block.  LINKPRO supports
  405.         up to nine overlay areas.
  406.  
  407.      *  LINKOVL uses the PATH environment variable when searching for
  408.         the program to execute or an overlay to load.  If LINKOVL
  409.         attempts to load an overlay and the program containing that
  410.         overlay is neither in the current directory nor in a
  411.         directory in the PATH variable, LINKOVL will abort with a
  412.         "File not found." error.
  413.  
  414.      *  LINKOVL uses a maximum of 24 bytes of the overlaid program's
  415.         stack during its operation.
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.      LINKOVL specifications and requirements          page 2 of 2
  435.  
  436.  
  437.  
  438.  
  439.  
  440.      OVL SPECIFICATIONS AND REQUIREMENTS (Stand-alone OVL program)
  441.      -------------------------------------------------------------
  442.  
  443.      *  OVL.EXE has been tested with MASM 4.0 and 5.0; Turbo C 1.0,
  444.         1.5, and 2.0; QuickBASIC 4.0 and 4.5; Microsoft's BASCOM 6.0;
  445.         and Clipper (PRONK.EXE, an included support utility, must be
  446.         used with Clipper programs).  Other languages that compile to
  447.         standard Microsoft Overlay LINKable object modules MAY also
  448.         work with OVL.
  449.  
  450.      *  Use of OVL with QuickBASIC 4.x and BASCOM 6.0 requires
  451.         linking in the object module QB4MOD.OBJ as the first object
  452.         file and compiling the program with the /O option of BC.EXE.
  453.         The object files created by versions of QuickBASIC earlier
  454.         than 4.0 abort with an error if a link is attempted with
  455.         overlays.  Therefore, OVL will NOT work with versions of
  456.         QuickBASIC earlier than 4.0.  This is a limitation of the
  457.         earlier versions of QuickBASIC and not an error or
  458.         shortcoming in OVL.
  459.  
  460.      *  Very recent versions of Microsoft LINK (3.69) require ALL
  461.         languages to link in QB4MOD.OBJ as the first object file when
  462.         using OVL.EXE.  Otherwise LINK will abort with a 'Microsoft
  463.         Overlay Manager module not found' error.
  464.  
  465.      *  The Microsoft LINK object module preprocessor utility
  466.         PRONK.EXE must be used if indirect calls to overlay code are
  467.         required.  Otherwise, calls to a function or procedure FROM
  468.         the root code TO overlay code, or from one overlay to another
  469.         (INTERoverlay calls) MUST be direct, that is, not indirectly
  470.         through a pointer.  This restriction is necessary because
  471.         Microsoft LINK can only set up an interrupt invoking the
  472.         overlay manager for direct calls in program code.  For
  473.         assembly language programs this means that interoverlay calls
  474.         to procedures must be coded as CALL ADDR, not CALL MEM/REG.
  475.         For 'C', interoverlay function calls should be directly
  476.         called, not called through a pointer to a function.  Calls
  477.         within an overlay (INTRAoverlay calls), within the root code,
  478.         or FROM an overlay TO the root can be made indirectly.
  479.         QuickBASIC and BASCOM programs should not be affected by this
  480.         restriction unless non-BASIC modules which use indirect calls
  481.         to overlays are also linked in.  Clipper programmers must use
  482.         PRONK whenever they use the OVL.EXE overlay manager.
  483.  
  484.      *  OVL requires the presence of at least one overlay in the
  485.         program it loads.  It will abort with an "Invalid overlay
  486.         information." error upon startup if none exist.
  487.  
  488.      *  OVL has a limit of eight overlays in a program.  More than
  489.         eight overlays will cause OVL to abort with a "Too many
  490.         overlays." error upon startup.  PROVL, the enhanced version
  491.         of OVL, has a limit of 63 overlays -- Microsoft LINK's
  492.         maximum.
  493.  
  494.  
  495.  
  496.      OVL specifications and requirements              page 1 of 2
  497.  
  498.  
  499.  
  500.  
  501.  
  502.      *  OVL supports calls from one overlay to another (nesting).
  503.         Overlays can be nested up to four levels.  An attempt to nest
  504.         deeper than four overlays will cause OVL to abort with an
  505.         "Overlays nested deeper than 4 levels." error.  PROVL
  506.         supports a nesting depth of 32 levels.
  507.  
  508.      *  OVL requires use of the Microsoft LINK default overlay
  509.         interrupt 63 (3fh).  Do not use the /OVERLAYINTERRUPT or /O
  510.         option of LINK to change the overlay manager interrupt.
  511.         PROVL supports changing the default overlay manager interrupt
  512.         via the /O option of LINK.
  513.  
  514.      *  Neither the /EXEPACK or /E option of Microsoft LINK nor the
  515.         EXEPACK.EXE utility will work with OVL.  Note that EXEPACKed
  516.         files ARE supported with LINKOVL.OBJ.
  517.  
  518.      *  OVL supports two overlay areas: the overlay area allocated by
  519.         Microsoft LINK during the linking process and optionally one
  520.         other overlay area.  If two overlay areas are used, memory
  521.         allocation for the second overlay area is made in normal DOS
  522.         memory.  As a result, the amount of memory available to the
  523.         loaded program decreases.  This decrease, that is, the amount
  524.         used by the second overlay area, is equal to the largest
  525.         overlay file that will load into that overlay area rounded up
  526.         to the next 512-byte block.  PROVL supports up to nine
  527.         overlay areas.
  528.  
  529.      *  OVL uses the PATH environment variable when searching for the
  530.         program to execute or an overlay to load.  If OVL attempts to
  531.         load an overlay and the program containing that overlay is
  532.         neither in the current directory nor in a directory in the
  533.         PATH variable, OVL will abort with a "File not found." error.
  534.  
  535.      *  OVL uses a maximum of 20 bytes of the overlaid program's
  536.         stack during its operation.
  537.  
  538.      *  OVL may operate improperly when executing memory resident
  539.         programs -- also called TSR (Terminate and Stay Resident)
  540.         programs.  When operating in such situations OVL may work
  541.         correctly none, some, or all of the time.  Intermittent
  542.         machine lockup or erratic program operation is possible
  543.         depending on how the code for the TSR program is written.
  544.  
  545.      *  OVL versions 2.21 and higher support overlay files larger
  546.         than 64K in size.
  547.  
  548.      *  OVL versions 3.0 and higher have no data declaration
  549.         restrictions for multiple overlay areas.
  550.  
  551.  
  552.  
  553.  
  554.  
  555.  
  556.  
  557.  
  558.      OVL specifications and requirements              page 2 of 2
  559.  
  560.  
  561.  
  562.  
  563.  
  564.      USING OVL (Basic Operation)
  565.      ---------------------------
  566.  
  567.      To demonstrate how to use LINK to set up overlays with OVL.EXE
  568.      and LINKOVL.OBJ there are three sets of sample programs included
  569.      in the OVL package that show use of the overlay managers' basic
  570.      operations.  One set is written using MASM 5.0, another using
  571.      Turbo C, and the third using QuickBASIC 4.x.
  572.  
  573.      As stated in the Microsoft LINK documentation, you MUST
  574.      compile using a large code model for for your programs to work
  575.      correctly with overlays.  For MASM 5.0, this means you must
  576.      compile using .MODEL MEDIUM (far-code, near-data), .MODEL LARGE
  577.      (far-code, far-data), or .MODEL HUGE (far-code, far-data).  If
  578.      you are using an earlier version of MASM you need to make sure
  579.      that PUBLIC procedures in overlays are declared FAR if they
  580.      called by the root code or another overlay.  For Turbo C
  581.      versions 1.x and 2.0, compile your files using the medium,
  582.      large, or huge model.  QuickBASIC and BASCOM users must compile
  583.      their program with BC.EXE using the /O option.  Microsoft's
  584.      runtime program for BASIC, BRUNxx.EXE, will not work with the
  585.      OVL package.  Clipper programmers should carefully read the
  586.      'USING PRONK.EXE' section before using OVL on their programs.
  587.  
  588.      The first example will use the assembly language .ASM files
  589.      MASMTEST, OV1, OV2, and OV3, written using Microsoft's MASM 5.0.
  590.      Although the .MODEL LARGE is used for these example files,
  591.      .MODEL MEDIUM and .MODEL HUGE should work in exactly the same
  592.      fashion for overlaying purposes.  Since MASM requires no
  593.      additional support .OBJ files, you can test the overlay managers
  594.      with the MASM .OBJ files even if you do not have access to an
  595.      assembler such as MASM.
  596.  
  597.      Link together the MASM .OBJ files, enclosing in parentheses the
  598.      modules you want to be overlays.  Make sure that you use at
  599.      create at least one overlay or the overlay managers will not
  600.      work with the file you create.  If you link the object files
  601.      together like this:
  602.  
  603.           link linkovl+masmtest+(ov1+ov2)+(ov3),masmtest;
  604.  
  605.      using LINKOVL.OBJ or
  606.  
  607.           link masmtest+(ov1+ov2)+(ov3),masmtest;
  608.  
  609.      using OVL.EXE,
  610.  
  611.      a standard .EXE file called MASMTEST.EXE will be created.
  612.      MASMTEST.EXE will include the root .EXE file MASMTEST comprised
  613.      of the code of the MASMTEST (and LINKOVL if it is used) object
  614.      module and will also include two overlay files appended to the
  615.      root .EXE file.  One overlay file will contain the code of the
  616.      OV1 and OV2 modules, the other will contain the code of the OV3
  617.      module.
  618.  
  619.  
  620.      OVL basic operation                              page 1 of 5
  621.  
  622.  
  623.  
  624.  
  625.  
  626.      When LINKOVL.OBJ is used in the previous example, typing
  627.      MASMTEST at the command line causes the program to begin
  628.      execution.  As program code is needed from an overlay, that
  629.      overlay is loaded from disk, if necessary, and program execution
  630.      continues.
  631.  
  632.      When OVL.EXE is used, the MASMTEST.EXE file created from the
  633.      linking process is executed by typing either OVL MASMTEST or OVL
  634.      MASMTEST.EXE -- typing the .EXE extension is optional.  OVL then
  635.      begins to run, controlling the loading and overlay management of
  636.      the MASMTEST program.
  637.  
  638.      IMPORTANT NOTE:  Throughout the rest of this document, both
  639.      overlay managers will be generically referred to as OVL.
  640.      Further examples in this manual will assume use of the
  641.      LINKOVL.OBJ overlay manager unless otherwise noted.
  642.  
  643.      The amount of memory required to load the example file
  644.      MASMTEST.EXE, or any file created by LINK using overlays, is
  645.      equal to the size of the root file PLUS the size of the largest
  646.      overlay file PLUS any program overhead and dynamic memory
  647.      allocations made by the program plus OVL's overhead.  This
  648.      brings up an important point.  There is no advantage to only
  649.      using one overlay in a program since memory must be allocated
  650.      for it during program execution anyway.  There is only the
  651.      disadvantage of the overlay overhead.  In other words, while the
  652.      link commands:
  653.  
  654.           link linkovl+masmtest+(ov1)+ov2+ov3,masmtest;
  655.  
  656.           link linkovl+masmtest+ov1+(ov2+ov3),masmtest;
  657.  
  658.           link linkovl+masmtest+(ov1+ov2+ov3),masmtest;
  659.  
  660.      are all valid, there is no useful purpose served by linking
  661.      overlays in this fashion.  Use two or more overlay files in the
  662.      link command.
  663.  
  664.      An example of linking with two overlays is:
  665.  
  666.           link linkovl+masmtest+(ov1)+(ov2)+ov3,masmtest;
  667.  
  668.      Here there will be two overlay files containing the code of,
  669.      respectively, OV1 and OV2 and a root file containing the
  670.      MASMTEST, OV3, and LINKOVL code.
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.      OVL basic operation                              page 2 of 5
  683.  
  684.  
  685.  
  686.  
  687.  
  688.      An example of linking with three overlay files is:
  689.  
  690.           link /exepack linkovl+masmtest+(ov1)+(ov2)+(ov3),masmtest;
  691.  
  692.      Three overlay files contain the code of OV1, OV2, and OV3.  The
  693.      root file contains the MASMTEST and LINKOVL code.  The /EXEPACK
  694.      or /E option of Microsoft's Overlay Linker shown in this example
  695.      may successfully be used with those programs suitable for the
  696.      option if LINKOVL.OBJ is used as the overlay manager.  OVL.EXE
  697.      does not support the /EXEPACK option of Microsoft LINK and the
  698.      '/exepack' command and 'linkovl' object module in the object
  699.      file list for this example should be deleted if it is used.
  700.  
  701.      Another example of linking with two overlays is:
  702.  
  703.           link linkovl+masmtest+(ov1+ov3)+(ov2),masmtest;
  704.  
  705.      Two overlay files contain the code of OV1 and OV3, and OV2.  The
  706.      root file contains the MASMTEST and LINKOVL code.
  707.  
  708.      The only overlay combination not allowed by OVL is one where the
  709.      the initial entry code object module(s) -- in this case the
  710.      MASMTEST.OBJ and LINKOVL.OBJ modules -- are linked as an
  711.      overlay.  Such startup code must be loaded in memory during the
  712.      beginning of the program's execution.
  713.  
  714.      LINKOVL.OBJ users with large root .EXE files, especially Clipper
  715.      programmers, should explore using EXEPACKed files.  Using the
  716.      /EXEPACK option of Microsoft LINK will almost always result in a
  717.      significantly smaller .EXE file with large files than if it is
  718.      not used.  Remember that the EXEPACKed files will not reduce the
  719.      memory requirements of a program and are not compatible with the
  720.      OVL.EXE version of the overlay managers.
  721.  
  722.      The second set of files are examples using Turbo C.  To use them
  723.      you need to have a C compiler compatible with the Turbo C source
  724.      files COW.C, FARM.C, HORSE.C, PIG.C, PIGLET.C, and SHEEP.C.  No
  725.      .OBJ files are included due to the many different versions of C
  726.      compilers available; object modules for C are usually compiler
  727.      version specific.  Compile the source files with your own
  728.      compiler.
  729.  
  730.      OVL is put a little more to the test here because the code is
  731.      larger, parameters are passed to the overlays, a value is
  732.      returned from a function, and a command line argument can be
  733.      passed.  Further, in one module, PIG.C, overlays can be nested
  734.      if the 'piglet' function that is called from it is located in a
  735.      different overlay file.
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.      OVL basic operation                              page 3 of 5
  745.  
  746.  
  747.  
  748.  
  749.  
  750.      To create FARM.EXE with an overlay file containing the code of
  751.      HORSE and PIGLET and an overlay file containing the code of
  752.      COW, PIG, and SHEEP and a root containing the code of
  753.      FARM and the start up code of C0M, you would link like this,
  754.      assuming that the code has been compiled using the medium model:
  755.  
  756.           link linkovl+c0m+farm+(horse+piglet)+(cow+pig+sheep),farm,
  757.           nul,emu+mathm+cm;
  758.  
  759.      After you link the program try running it by typing FARM and
  760.      FARM MACDONALD to see the command line parameter in use.  All of
  761.      the modules can be put in an overlay except for LINKOVL, C0M,
  762.      and FARM which contain startup code.  Remember, you must use
  763.      Microsoft's LINK when linking this or any other Turbo C program
  764.      for use with OVL.  The copy of TLINK included with Turbo C does
  765.      not support overlays.
  766.  
  767.      The final set of examples are QuickBASIC 4.x files.  Since
  768.      QuickBASIC programs need a QuickBASIC library to link correctly,
  769.      you must own or have access to QuickBASIC 4.x to try these
  770.      example files.  Again, no .OBJ files have been included.  These
  771.      QuickBASIC source files also demonstrate how to use COMMON to
  772.      share variables between more than one module if one module is in
  773.      an overlay.
  774.  
  775.      Using QuickBASIC 4.x and BASCOM 6.0 programs with OVL.EXE
  776.      involves an additional step not required by the other tested
  777.      languages.  An extra object module called QB4MOD.OBJ must be
  778.      linked in as the first object file during the link process.  For
  779.      example, to create a program called QBNEST.EXE with a root of
  780.      QB4MOD and QBNEST, an overlay containing BNEST1 and BNEST2, an
  781.      and overlay containing BNEST4 and BNEST3, you would link in this
  782.      fashion:
  783.  
  784.           link qb4mod+qbnest+(bnest1+bnest2)+(bnest4+bnest3),qbnest;
  785.  
  786.      Typing OVL QBNEST at the DOS prompt will run the program.
  787.      QB4MOD must be included in the root with the main program.  In
  788.      this example neither QB4MOD nor QBNEST can be in an overlay.
  789.      QB4MOD.OBJ is not required by the LINKOVL.OBJ overlay manager
  790.      and should not be used with it.
  791.  
  792.      To really stretch OVL to its limits, link each of the BNEST
  793.      modules in a separate overlay.  This forces OVL to nest overlays
  794.      to its four level maximum.
  795.  
  796.      To use your own QuickBASIC 4.x programs with overlays you should
  797.      compile the files using BC.EXE.  Overlays will not work with the
  798.      runtime file BRUNxx.EXE so the /O option must be used to compile
  799.      QuickBASIC 4.x programs.
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.      OVL basic operation                              page 4 of 5
  807.  
  808.  
  809.  
  810.  
  811.  
  812.      Feel free to try any permutation of overlays allowed by these
  813.      examples.  OVL should work with any of them as long as you stay
  814.      within the restrictions already outlined.  It is especially
  815.      important to remember not to put the initial entry code in an
  816.      overlay.  The start up code must be in memory when the program
  817.      is first loaded, i.e. in the root code.
  818.  
  819.      You may have noticed that these example files are all small
  820.      enough to fit into memory without overlays.  You may even be
  821.      asking yourself how you really know that OVL is bringing the
  822.      overlays in as needed instead of sneaking everything in at once?
  823.  
  824.      First, you can try running a file linked with overlays without
  825.      LINKPRO.OBJ or OVL.EXE.  If you do this your computer will
  826.      probably lock up and need to be turned off or reset before it
  827.      can be used again.  This is because your program is using
  828.      interrupt 63 which OVL hasn't initialized to point to code that
  829.      manages the overlays.  Your program tries to transfer control to
  830.      whatever random address happens to be at the memory location
  831.      that corresponds to the address at interrupt 63, leading to
  832.      unpredictable results.  This is also known as a "thin air"
  833.      transfer.
  834.  
  835.      The second test you can do is transfer the overlaid program (and
  836.      OVL.EXE if you are using it) to a floppy and disable any disk
  837.      caching.  Now run the program.  You should see the floppy disk
  838.      drive light come on during execution of the example program as
  839.      overlays are loaded from disk.  For maximum effect you may want
  840.      to link the example program using as many overlays as possible.
  841.  
  842.      It is important to understand how the use of overlays can affect
  843.      a program's performance.  Time critical code should not be
  844.      divided between two overlays.  Depending upon the speed of the
  845.      disk drive used and the size of the overlay file, the time to
  846.      load each overlay from disk can be several seconds.  Extremely
  847.      time critical code should also not be divided the root code and
  848.      an overlay.  The execution time overhead of the overlay manager
  849.      code can range from several microseconds up to a few
  850.      milliseconds depending upon the type of machine used to run the
  851.      overlaid program.
  852.  
  853.      There is NO time penalty involved in calling routines FROM a
  854.      loaded overlay TO the root code or from one code module to
  855.      another WITHIN the same overlay file.  There IS a time penalty
  856.      in calling routines FROM the root code TO an overlay file.  This
  857.      time penalty will range from several microseconds with an
  858.      already loaded overlay file on a fast computer to several
  859.      seconds with an overlay file that needs to be loaded on a
  860.      computer with a slow disk drive.
  861.  
  862.  
  863.  
  864.  
  865.  
  866.  
  867.  
  868.      OVL basic operation                              page 5 of 5
  869.  
  870.  
  871.  
  872.  
  873.  
  874.      USING OVL (Advanced Operation -- Multiple Overlay Areas)
  875.      --------------------------------------------------------
  876.  
  877.      OVL supports two overlay areas.  This allows you to have two
  878.      overlay files in memory at the same time, and for these overlay
  879.      files to be swapped in and out without the other being affected.
  880.      Why is this important?  Suppose you have two sections of
  881.      initialization code in your program that operate independently
  882.      of each other.  With only one overlay area, in order to reclaim
  883.      the dead space after initialization is completed, you have to
  884.      put both sections in one overlay file.  Even after one section
  885.      is complete the other may still be in use, so each section must
  886.      take up memory until both are finished.  With two overlay areas,
  887.      you could overlay one section as soon as it is complete,
  888.      allowing your program to run under smaller memory requirements.
  889.  
  890.      Such an example only scratches the surface of how two overlay
  891.      areas can be used.  Another example is using separate overlay
  892.      areas for code that runs two different peripherals.  For
  893.      instance, one overlay area could be overlaid with a
  894.      user-selected printer driver, and the other with a particular
  895.      video driver.  Other examples will probably come to mind once
  896.      you start thinking of ways to apply the idea.
  897.  
  898.      Information about which overlay file loads in which overlay area
  899.      is passed via the command line.  There are two switches or
  900.      options allowed, /A (or /a) and /B (or /b).  Do not intermix
  901.      these switches with command line switches or options used by an
  902.      overlaid program.
  903.  
  904.      When using the OVL.EXE overlay manager, a program's command line
  905.      switches come AFTER the program name.  OVL.EXE's switches come
  906.      BEFORE the program name.  When using LINKOVL.OBJ as the overlay
  907.      manager, both LINKOVL's and the program's command line switches
  908.      come AFTER the program name, with LINKOVL's switches coming
  909.      first.  To differentiate between LINKOVL.OBJ and a program's
  910.      command line switches you should use OVL's //x option described
  911.      in the 'COMMAND LINE OPTION //X' section.
  912.  
  913.      Each switch should be followed by one or more numbers separated
  914.      by a comma, or range of numbers separated by a dash.  These
  915.      numbers correspond to an overlay file.  Overlay files are
  916.      numbered starting at 1 in the order that they were linked.  The
  917.      /A and /B switches do not represent a particular overlay area,
  918.      but rather differentiate which overlay files are loaded in one
  919.      or the other overlay areas.  The specific overlay area used to
  920.      load an overlay file is transparent to the enduser of the
  921.      program.
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.      OVL multiple overlay areas                       page 1 of 4
  931.  
  932.  
  933.  
  934.  
  935.  
  936.      All files in the switch containing the largest overlay file will
  937.      load in the standard overlay area designated by Microsoft LINK
  938.      during the linking process.  All files listed in the other
  939.      switch load in the second overlay area.  Such switches may be
  940.      either explicitly or implicitly given.  Switches are explicit if
  941.      they are listed in the actual command line, e.g. /A1.  They are
  942.      implicit if an explicit switch does not list all of the overlay
  943.      files; the remaining overlay files are assigned to the unlisted
  944.      (implicit) switch by default.
  945.  
  946.      To demonstrate, if you linked the .OBJ files of the example
  947.      QBNEST files in this manner (OVL.EXE users should replace the
  948.      'linkovl' object module with 'qb4mod'):
  949.  
  950.           link linkovl+qbnest+(bnest1)+(bnest2)+(bnest4+bnest3),
  951.           qbnest;
  952.  
  953.      you would have three overlay files.  Code for BNEST1 would be in
  954.      overlay file number 1, BNEST2 would be overlay file number 2,
  955.      and code for BNEST3 and BNEST4 would be in overlay file number
  956.      3.  To run this program via OVL with the code from BNEST1,
  957.      BNEST3, and BNEST4 in one overlay area and BNEST2 in the other,
  958.      you would type:
  959.  
  960.           QBNEST /A1,3 /B2  [for LINKOVL.OBJ users]
  961.  
  962.      or
  963.  
  964.           OVL /A1,3 /B2 QBNEST  [for OVL.EXE users]
  965.  
  966.      In this example, overlay files 1 and 3 load in the standard
  967.      overlay area, since overlay file 3 is the largest, and overlay
  968.      file 2 loads in the second overlay area.  Because the overlay
  969.      switches do not correspond to an actual overlay area, the
  970.      following command line would give exactly the same results, if
  971.      you are using LINKOVL.OBJ as the overlay manager:
  972.  
  973.           QBNEST /B1,3 /A2
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.      OVL multiple overlay areas                       page 2 of 4
  993.  
  994.  
  995.  
  996.  
  997.  
  998.      Further, since any overlay files not listed with a switch are
  999.      assigned to the switch not used, this command line would work
  1000.      identically as well:
  1001.  
  1002.           QBNEST /A1,3
  1003.  
  1004.      The /B2 is implied by this command line.  This is why, if you
  1005.      use both the /A and /B switch of OVL, you MUST list all overlay
  1006.      files in the switches.  Otherwise, when OVL attempts to assign
  1007.      the overlay files not listed to an unused overlay area it finds
  1008.      both overlay areas used and returns an invalid overlay switch
  1009.      value error.  Using the same example:
  1010.  
  1011.           QBNEST /A1 /B2
  1012.  
  1013.      results in an invalid overlay switch value error because overlay
  1014.      file 3 is not listed and there are no unused overlay areas to
  1015.      assign it to.
  1016.  
  1017.      If all of the overlay files are listed with one switch the
  1018.      advanced option second overlay area is effectively defeated.  In
  1019.      other words, if you put all of your overlay files in one overlay
  1020.      area there isn't any reason to have the second overlay area.
  1021.      While this may sound trite, it is relatively easy to overlook if
  1022.      you are depending upon an implicit switch.  For instance, the
  1023.      command line:
  1024.  
  1025.           QBNEST /A1-3
  1026.  
  1027.      is identical to:
  1028.  
  1029.           QBNEST
  1030.  
  1031.      and the second overlay area is not used.  Remember that ranges
  1032.      can be represented by a dash, so that /A1-3 is the same as
  1033.      /A1,2,3 (and /A1,2-3 or /A1-2,3 as well).
  1034.  
  1035.      Included with the OVL files is an program called MULTEST.EXE,
  1036.      created from the MASM source files MULTEST.ASM, MULTA.ASM,
  1037.      MULTB.ASM, MULTC.ASM, and MULTD.ASM.  The MULTEST.EXE program
  1038.      can provide a graphic demonstration of the power of two overlay
  1039.      areas.  MULTEST.EXE has been padded with 160,000 extra bytes to
  1040.      increase load time to simulate operation under large file
  1041.      conditions.  The size of the resultant file also shows the
  1042.      overlay managers' ability to handle overlay files greater than
  1043.      64K.  MULTEST.EXE was created with two overlay files using the
  1044.      LINK command:
  1045.  
  1046.           link linkovl+multest+(multa+multb)+(multc+multd),multest;
  1047.  
  1048.      To best demonstrate the program, transfer a copy of MULTEST.EXE
  1049.      (and OVL.EXE if you are using it) to a floppy disk and disable
  1050.      any disk caching.
  1051.  
  1052.  
  1053.  
  1054.      OVL multiple overlay areas                       page 3 of 4
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.      First, try basic OVL operation, i.e. type MULTEST if using
  1061.      LINKOVL.OBJ, or OVL MULTEST if using OVL.EXE.  After the program
  1062.      loads and displays the prompt, when you press the A, B, C, or D
  1063.      keys the floppy disk drive light will come on as overlays are
  1064.      loaded.  For example, if you first press the 'A' key, overlay
  1065.      file 1 will load from disk into memory.  At that point neither
  1066.      an 'A' or 'B' keypress will required a disk access because the
  1067.      overlay containing the code for process 'A' and 'B' is in
  1068.      memory.  If you press 'C' or 'D', the disk drive will be
  1069.      accessed again to load in overlay file 2.  Then either 'C' or
  1070.      'D' can be pressed without accessing the drive, but an 'A' or
  1071.      'B' keypress will reload overlay file 1.
  1072.  
  1073.      In short, under this arrangement 'C' and 'D' keypresses will
  1074.      swap out the overlay file containing the code for processes 'A'
  1075.      and 'B', and 'A' and 'B' keypresses will swap out the overlay
  1076.      file containing the code for the 'C' and 'D' processes.
  1077.  
  1078.      Now try typing MULTEST /A1.  This will cause overlay file 1 to
  1079.      load in one overlay area when its code is needed and overlay
  1080.      file 2 to load in the other.  The disk drive will be accessed
  1081.      the first time you press 'A' or 'B' and the first time you press
  1082.      'C' or 'D', but once both overlay files are loaded there will be
  1083.      no more disk accesses -- no matter which of the four keys you
  1084.      press and no matter what the order.
  1085.  
  1086.      A nice feature of multiple overlay areas and other command line
  1087.      options is that their use is optionally under the control of the
  1088.      enduser.  The enduser may dynamically configure the program to
  1089.      best fit the memory and speed requirements of a specific
  1090.      environment without the need to relink the program, or access
  1091.      the object files.  In fact, when using multiple overlay areas --
  1092.      unlike when using one overlay area -- assigning only one overlay
  1093.      to a particular overlay area can be advantageous.  Endusers with
  1094.      large amounts of free memory will probably wish to use two
  1095.      overlay areas to keep as much code in memory as possible.  Those
  1096.      with less free memory may only be able to use one overlay area,
  1097.      paying for the lower memory requirement with more frequent disk
  1098.      accesses.  The identical version of a program can be used in
  1099.      both cases.  Only the command line arguments passed to it at
  1100.      runtime will differ.
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.      OVL multiple overlay areas                       page 4 of 4
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122.  
  1123.      USING OVL (Advanced Operation -- Command Line Option //x)
  1124.      ------------------------------------------------------------
  1125.  
  1126.      When using LINKOVL.OBJ, programs that use command line options
  1127.      that begin with a '/' need a way to distinguish between the
  1128.      LINKOVL options and the program options.  This is handled by
  1129.      OVL's //x option, where 'x' can be any printable character
  1130.      except for the DOS special characters for input and output
  1131.      redirection and command piping, i.e. <, >, and |.
  1132.  
  1133.      The //x option changes the character recognized by OVL as the
  1134.      beginning of an option to a different character.  OVL stops
  1135.      scanning for options as soon as it encounters a character which
  1136.      is not one of its options, passing any remaining command line
  1137.      options to the overlaid program.
  1138.  
  1139.      For example, if you need to pass the command line options or
  1140.      switches /DEBUG and /X to a program named RUNME.EXE and the
  1141.      command line options /A3 and /B1-2 to OVL, you would use this
  1142.      command:
  1143.  
  1144.           RUNME /A3 /B1-2 //$ /DEBUG /X
  1145.  
  1146.      The //$ part of the command line directs OVL to look for the '$'
  1147.      character for any further command line options.  When OVL
  1148.      encounters the next '/' character, it stops looking for options
  1149.      and passes the remaining command line, /DEBUG /X, to the
  1150.      overlaid program.  The '$' character can be replaced in this
  1151.      example by any other character that would serve the purpose of
  1152.      forcing LINKOVL to stop scanning when it reaches a program
  1153.      option.
  1154.  
  1155.      Even if you only need to pass command line options beginning
  1156.      with a '/' to a program and not LINKOVL, you must still use the
  1157.      //x option.  Otherwise, LINKOVL has no way of determining that a
  1158.      particular option is not meant for its interpretation.  If you
  1159.      have a program that needs the command line option /BELL, but you
  1160.      wish to pass no options to LINKOVL, you would use this command:
  1161.  
  1162.           RUNME //x /BELL
  1163.  
  1164.      Again, the 'x' character can be replaced by other characters if
  1165.      it is necessary or desireable.
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.      Command line option //x                          page 1 of 2
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.      The //x option can be used more than once on a particular
  1185.      command line, changing the character OVL scans for as a
  1186.      beginning to an option each time it is encountered.  For
  1187.      example, if you wish to pass the command line options
  1188.      /ZDLOGFILE, /A1,2, and /ZS to OVL and the command line options
  1189.      /NON, /QS, and /LO to an overlaid program called RUNME, you
  1190.      could do it in this fashion:
  1191.  
  1192.           RUNME //* *ZDLOGFILE **& &A1,2 &&/ /ZS //# /NON /QS /LO
  1193.  
  1194.      Of course this is more complicated than necessary.  A more
  1195.      mundane approach would be:
  1196.  
  1197.           RUNME /ZDLOGFILE /A1,2 /ZS //# /NON /QS /LO
  1198.  
  1199.      the //# switch or option forcing OVL to stop scanning with the
  1200.      next '/' character.
  1201.  
  1202.      Although the PROVL.EXE overlay manager supports the //x option
  1203.      for consistency, there is little or no need to use it with
  1204.      PROVL.EXE.
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212.  
  1213.  
  1214.  
  1215.  
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.      Command line option //x                          page 2 of 2
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.      USING OVL (Advanced Operation -- Other Command Line Options)
  1247.      ------------------------------------------------------------
  1248.  
  1249.      There are three other command line options that the OVL overlay
  1250.      managers can use.  The three options are /ZD<filename>, /ZBn,
  1251.      and /ZS.  Following is a description of each.
  1252.  
  1253.      (1)  The /ZD<filename> option allows a user to specify a debug
  1254.      file that will timestamp and log the loading, access, or swap of
  1255.      each overlay.
  1256.  
  1257.      For example, to log overlays for a program called MYPROG.EXE
  1258.      with two overlay areas into a file called MYPROG.LOG, you could
  1259.      type MYPROG /A1 /B2-4 /ZDMYPROG.LOG at the DOS prompt.  A
  1260.      typical debugging log file such a situation might look like
  1261.      this:
  1262.  
  1263.           09:15:06  Overlay 01  Loaded
  1264.           09:15:35  Overlay 02  Loaded
  1265.           09:16:07  Overlay 03  Swapped out Overlay 02
  1266.           09:17:12  Overlay 04  Swapped out Overlay 03
  1267.           09:20:14  Overlay 03  Swapped out Overlay 04
  1268.           09:24:00  Overlay 02  Swapped out Overlay 03
  1269.           09:33:53  Overlay 01  Accessed
  1270.           09:39:32  Overlay 02  Accessed
  1271.           09:54:17  Overlay 04  Swapped out Overlay 02
  1272.           09:55:40  Overlay 04  Accessed
  1273.  
  1274.      The timestamp comes first, then the overlay number being
  1275.      manipulated and the number of the overlay being swapped out, if
  1276.      any.   An overlay may either LOAD into an empty overlay area and
  1277.      be accessed, SWAP out another overlay in the overlay area it
  1278.      loads into and be accessed, or simply be ACCESSED, having been
  1279.      loaded during a previous call to the overlay.
  1280.  
  1281.      Devices such as LPT1 or CON are valid filenames for a log file.
  1282.      Preexisting log files will be appended to, rather than
  1283.      overwritten.
  1284.  
  1285.      There is no space between /ZD and the filename when using
  1286.      this option.
  1287.  
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.      Other command line options                       page 1 of 2
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.      (2)  The /ZBn option shrinks or increases the size of the buffer
  1309.      OVL allocates for reading the relocation table items in an .EXE
  1310.      file header.
  1311.  
  1312.      If the buffer allocation is too small, overlays will take
  1313.      somewhat longer to load because OVL will need to access the disk
  1314.      more than once to read in all of a relocation table.  If the
  1315.      buffer is too large, memory is wasted.  The 'n' following /ZB is
  1316.      the number of kilobytes allocated to the buffer and can be any
  1317.      number from 4 to 8.  The default buffer size is 4K (/ZB4).  This
  1318.      is a good compromise value and probably should not be changed
  1319.      unless you understand what the relocation table in a
  1320.      .EXE file is.  Overlay files with a very large relocation table
  1321.      may load somewhat faster if the buffer size is set to its
  1322.      maximum size of 8K, i.e. /ZB8.  PROVL expands the allowed 'n'
  1323.      from 1 to 32.
  1324.  
  1325.      If you wish to use the /ZB option, the MAPOVL.EXE utility
  1326.      described in the 'Using MAPOVL.EXE' section may be helpful in
  1327.      selecting an appropriate buffer size for your application.
  1328.  
  1329.      Do NOT insert a space between /ZB and the number when specifying
  1330.      this option.
  1331.  
  1332.  
  1333.      (3)  The /ZS option directs OVL to recognize and load overlays
  1334.      from separate files.
  1335.  
  1336.      You must use the SPLIT.EXE utility to generate individual
  1337.      overlay files from an overlaid program created by Microsoft
  1338.      LINK.  See the 'USING THE SPLIT.EXE UTILITY' section in this
  1339.      manual for more information on separate overlay files and the
  1340.      SPLIT utility.
  1341.  
  1342.      NOTE:  All command line options are case insensitive.
  1343.  
  1344.  
  1345.  
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352.  
  1353.  
  1354.  
  1355.  
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.      Other command line options                       page 2 of 2
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.      USING SPLIT.EXE -- A Utility to Allow Separate Overlay Files
  1371.      ------------------------------------------------------------
  1372.  
  1373.      SPLIT.EXE is a utility that splits off the overlay .EXE files
  1374.      normally appended to the root .EXE file by Microsoft LINK.
  1375.      These overlay files have the same name as the root .EXE file
  1376.      with an extension of '001', '002', and so on up to the number of
  1377.      overlay files in the program.  You must use the /ZS option of
  1378.      OVL if you split separate overlay files off of the main .EXE
  1379.      file.  Otherwise OVL will abort with a "Bad EXE file signature."
  1380.      error when it searches for an overlay at the end of the root
  1381.      .EXE file.
  1382.  
  1383.      To use the SPLIT utility, type SPLIT and press return.  SPLIT
  1384.      prompts you for name of the file to split, then splits up the
  1385.      files, and terminates with a message showing how many overlay
  1386.      files were created.  You may bypass the filename question by
  1387.      typing SPLIT <program name>, e.g. SPLIT MYPROG, if MYPROG.EXE is
  1388.      the overlaid program to split up.  Accidentally running SPLIT on
  1389.      an already split up .EXE file is harmless, SPLIT will find no
  1390.      overlay files to split off and simply terminate.
  1391.  
  1392.      Separate overlay files are most useful when you need to avoid
  1393.      one large program .EXE file, e.g. due to available storage space
  1394.      on floppy disk.  In addition, since OVL automatically searches
  1395.      the entire PATH environment string for an overlay file if it
  1396.      doesn't find the file in the current directory, it is also
  1397.      possible to run overlays off of a different disk drive when the
  1398.      /ZS option is used.
  1399.  
  1400.      Because of the small increase in development time involved in
  1401.      running SPLIT, it is recommended that you not bother with
  1402.      splitting your program into separate overlay files until it is
  1403.      ready for enduser operation.
  1404.  
  1405.      The source to SPLIT.EXE has been included in the OVL package for
  1406.      your study or amusement.  The source file is SPLIT.C.  SPLIT was
  1407.      written using version 2.0 of Borland's Turbo C.
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413.  
  1414.  
  1415.  
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.      Using SPLIT.EXE                                  page 1 of 1
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.      USING MAPOVL.EXE
  1433.      ----------------
  1434.  
  1435.      The utility MAPOVL serves two purposes.  It reports on the
  1436.      actual code size of overlay files without their .EXE header to
  1437.      allow you to see what the memory requirements for particular
  1438.      overlay file and overlay area configurations are.  MAPOVL also
  1439.      displays the number of relocation table items in each overlay
  1440.      file so that you can choose the best /ZBn option for your
  1441.      particular situation.
  1442.  
  1443.      To use the MAPOVL utility, type MAPOVL and press return.
  1444.      MAPOVL prompts you for the name of the overlaid file to
  1445.      report on.  As with SPLIT.EXE, you may bypass the filename
  1446.      question by typing MAPOVL <program name>.  Do not use
  1447.      MAPOVL on a program which has already been had SPLIT.EXE
  1448.      run on it.  MAPOVL searches for overlay files at the end of
  1449.      the root .EXE file.
  1450.  
  1451.      Following is sample output from MAPOVL for a file called
  1452.      TEST.EXE with three overlays:
  1453.  
  1454.  
  1455.      Report on file test.exe
  1456.      =======================
  1457.  
  1458.      Root file:  File size  87552 (15600 hex) bytes
  1459.          Relocation table    19 (13 hex) items,     76 (4c hex) bytes
  1460.          Unaffected by /ZBn option
  1461.  
  1462.      Overlay file  1:  File size  40448 (9e00 hex) bytes
  1463.          Relocation table  5803 (16ab hex) items,  23212 (5aac hex) bytes
  1464.          /ZBn option requires 'n' of 5 for no table reload
  1465.  
  1466.      Overlay file  2:  File size  80384 (13a00 hex) bytes
  1467.          Relocation table     6 (6 hex) items,     24 (18 hex) bytes
  1468.          /ZBn option requires 'n' of 1 for no table reload
  1469.  
  1470.      Overlay file  3:  File size  40448 (9e00 hex) bytes
  1471.          Relocation table 10003 (2713 hex) items,  40012 (9c4c hex) bytes
  1472.          /ZBn option requires 'n' of 40 for no table reload
  1473.  
  1474.      Overlay file 2 always loads into the standard overlay area.
  1475.  
  1476.      Report complete: 3 overlay files
  1477.  
  1478.  
  1479.      After printing the report header, MAPOVL reports on the
  1480.      root file.  This provides no information about overlays,
  1481.      but is handy for comparison of root to overlay file size.
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.      Using MAPOVL.EXE                                 page 1 of 2
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.      Following the root file report, MAPOVL displays information
  1495.      about each overlay file that it finds.  First it reports on
  1496.      the true file size of the overlay file rounded up to the
  1497.      next 512 byte page.  This is the amount of memory that an
  1498.      overlay file will take up when loaded into an overlay area.
  1499.      Each overlay area will be large enough to accomodate the
  1500.      largest overlay file that loads there.
  1501.  
  1502.      After the file size information, MAPOVL displays the number
  1503.      of relocation table items and the byte size of the
  1504.      relocation table.  The byte size will always be four times
  1505.      the count of items.  MAPOVL uses this information to
  1506.      calculate the minimum /ZBn size that OVL needs to avoid
  1507.      having to reload the relocation table, slowing down the
  1508.      speed at which an overlay loads from disk.  If you have the
  1509.      memory to spare, you should use the /ZBn listed for best
  1510.      program performance.  If the recommended /ZBn is higher or
  1511.      lower than the allowed range, use the highest or lowest
  1512.      value allowed.
  1513.  
  1514.      Unless an overlay file is very large or has an
  1515.      extraordinary number of relocation table items, you will
  1516.      generally find that the default /ZB4 is sufficient to avoid
  1517.      a table reload for most situations.  Even if a reload is
  1518.      necessary, the extra delay is usually less than a second and
  1519.      often not noticeable to the program operator.
  1520.  
  1521.      The largest overlay always loads into the standard overlay
  1522.      area allocated by LINK.  MAPOVL shows which overlay loads
  1523.      into the standard overlay area.  No additional memory
  1524.      allocations are needed for this overlay area, so the worst
  1525.      case memory allocation for the second overlay area will
  1526.      never be more than the size of the second largest overlay
  1527.      file, and then only if it loads in a different overlay area
  1528.      from the largest overlay file.
  1529.  
  1530.      The source to MAPOVL.EXE has also been included in the OVL
  1531.      package for those interested.  The source file is MAPOVL.C.
  1532.      MAPOVL was written using version 2.0 of Borland's Turbo C.
  1533.  
  1534.  
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.      Using MAPOVL.EXE                                 page 2 of 2
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.      USING PRONK.EXE
  1557.      ---------------
  1558.  
  1559.      PRONK is an object module preprocessor for Microsoft's Overlay
  1560.      Linker that allows LINK to properly set up indirect calls to
  1561.      overlay files.  Clipper programmers MUST use PRONK.EXE in
  1562.      conjunction with OVL and any overlaid program.  It is unknown
  1563.      whether PRONK.EXE works other overlay managers, such as the one
  1564.      that comes with Microsoft C.
  1565.  
  1566.      PRONK directly reads and writes to object modules, creating
  1567.      an object module called $$MD.OBJ that is linked in with the
  1568.      other object modules in the link command.  Pass the same
  1569.      command line to PRONK that you normally pass to Microsoft
  1570.      LINK.  After PRONK has altered and created the necessary
  1571.      object modules, it automatically invokes LINK with the same
  1572.      command line passed to it except for '+$$md' added to the
  1573.      object file list.  The '+$$md' will be inserted as the
  1574.      second file in the object file list.
  1575.  
  1576.      The example PRTEST.ASM, PTEST2.ASM, and PTEST3.ASM source files
  1577.      show a variety of indirect calls to procedures.  If there were
  1578.      no indirect calls to procedures and you wanted to put PTEST2.OBJ
  1579.      and PTEST3.OBJ in an overlay, you could link in this fashion:
  1580.  
  1581.           link linkovl+prtest+(ptest2)+(ptest3),prtest;
  1582.  
  1583.      However since the object modules in this example contain
  1584.      indirect calls to overlay procedures, linking in this manner
  1585.      with Microsoft's Overlay Linker will not work.  Running PRTEST
  1586.      after linking like this will cause improper behavior when an
  1587.      indirect call to an overlay is made, and possibly lock up the
  1588.      computer.
  1589.  
  1590.      PRONK may be used in such cases to allow proper program
  1591.      operation.  This command line should be used for the previous
  1592.      example:
  1593.  
  1594.           pronk linkovl+prtest+(ptest2)+(ptest3),prtest;
  1595.  
  1596.      While PRONK is running it displays the names of the object
  1597.      modules that it has modified.  Not all object modules may need
  1598.      to be modified by PRONK, often it is necessary to modify only
  1599.      one or two.  After PRONK has finished, it automatically loads
  1600.      and runs LINK, displaying the command line it passes to LINK.
  1601.      The command line in this example is:
  1602.  
  1603.           link linkovl+$$md+prtest+(ptest2)+(ptest3),prtest;
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612.      Using PRONK.EXE                                  page 1 of 3
  1613.  
  1614.  
  1615.  
  1616.  
  1617.  
  1618.      The PRTEST.EXE program created by PRONK should overlay
  1619.      correctly.  Notice that PRONK has created and added the file
  1620.      $$MD to the object file list passed to LINK.  This object file
  1621.      contains direct calls to publicly defined overlay procedures or
  1622.      functions, allowing LINK to properly set up the overlay manager
  1623.      interrupt.  Any preexisting object file called $$MD.OBJ in your
  1624.      current directory will be overwritten.
  1625.  
  1626.      PRONK also works correctly with response files or options in the
  1627.      LINK command line.  The following command is valid syntax for
  1628.      PRONK assuming that the PRRSP.LNK file exists and is in the
  1629.      current directory:
  1630.  
  1631.           pronk /exepack /nod linkovl+@prrsp.lnk;
  1632.  
  1633.      Note that if you use a response file that contains more than the
  1634.      object file list, i.e. a map file, program name, or library
  1635.      list, you MUST place at least one object module outside of the
  1636.      response file.  PRONK always tries to place $$md.obj second in
  1637.      the object file list and such an arrangement will not work
  1638.      correctly if the first entry in the list is a response file
  1639.      which completes the object file list.
  1640.  
  1641.      PRONK correctly handles output file redirection for Microsoft
  1642.      LINK, although PRONK's copyright message, object modules
  1643.      modified message, and the command line passed to MS LINK will
  1644.      appear first in the redirected file.  PRONK will return an
  1645.      errorlevel of 1 to a batch file if it aborts with an error.
  1646.  
  1647.      PRONK reads each object file into memory and then rewrites it if
  1648.      any changes are necessary.  If PRONK is interrupted in the
  1649.      middle of its operation or aborts with an error, the possibility
  1650.      exists that some object modules have been corrupted.  PRONK
  1651.      attempts to warn you of circumstances when object modules may
  1652.      have been corrupted, but such warning should not be depended
  1653.      upon as a surety.  If PRONK abnormally aborts, check the object
  1654.      modules modified list to see what files were modified and
  1655.      recompile those that were.  IF YOU HAVE ANY IRREPLACEABLE OBJECT
  1656.      MODULES, MAKE SURE THAT YOU HAVE ONE OR MORE BACKUP COPIES OF
  1657.      THOSE MODULES BESIDES THE COPY PRONK IS WORKING WITH.  This is
  1658.      EXTREMELY important.
  1659.  
  1660.      Do not rerun PRONK with the same program object modules that
  1661.      have been modified on a previous PRONK pass.  You may want to
  1662.      set up a batch file to automate a save and restore (to pre-PRONK
  1663.      state) of all PRONK-modified object modules that are not being
  1664.      recompiled IF you need to rerun PRONK with a recompiled object
  1665.      module that PRONK normally modifies.
  1666.  
  1667.  
  1668.  
  1669.  
  1670.  
  1671.  
  1672.  
  1673.  
  1674.      Using PRONK.EXE                                  page 2 of 3
  1675.  
  1676.  
  1677.  
  1678.  
  1679.  
  1680.      For example, assume that you have three object modules that
  1681.      PRONK modifies, AMOD.OBJ, BMOD.OBJ, and CMOD.OBJ.  Further
  1682.      assume that you have finished development of the AMOD and BMOD
  1683.      code, but are still working on the CMOD code.  To avoid having
  1684.      to recompile the AMOD and BMOD source files to return the .OBJ
  1685.      files to their original state, you can set a batch file that
  1686.      saves the original AMOD.OBJ and BMOD.OBJ object modules under
  1687.      the names AMOD.TMP and BMOD.TMP before running PRONK.  Later,
  1688.      when you need to rerun PRONK again with a newly recompiled CMOD
  1689.      module, another batch file can copy the AMOD.TMP and BMOD.TMP
  1690.      files back to AMOD.OBJ and BMOD.OBJ.
  1691.  
  1692.      You need not rerun PRONK if you change an object module
  1693.      unmodified by PRONK in a previous pass UNLESS the object module
  1694.      has been changed to call a procedure indirectly (always indirect
  1695.      with Clipper) in an overlay object module.  Be sure to link in
  1696.      the last created version of $$MD.OBJ, however.
  1697.  
  1698.      Be aware that PRONK changes code labels in modified object
  1699.      modules.  If PRONK or LINK aborts with an error, you may see
  1700.      error messages containing code labels or procedure names that
  1701.      were not used in the overlaid program's source code.  Avoid
  1702.      using the global labels or names '___AAA' through '___BMI' in
  1703.      your program.  Only the leading three underscores and letters
  1704.      are used by the changed labels.  Three underscore characters
  1705.      before numbers and other legal name characters can be safely
  1706.      used in a program's source code.
  1707.  
  1708.      The code overhead when using PRONK amounts to 6 bytes per public
  1709.      name in the overlay modules, with a maximum capability of
  1710.      handling 1023 public names.  At worst, this will add 6138 bytes
  1711.      to your root code size.
  1712.  
  1713.      The source code to PRONK is available for a fee.  PRONK was
  1714.      written in Turbo C, version 2.0.  To order the source code, send
  1715.      $20.00 to the address in the PROVL section immediately
  1716.      following.  The ordering instructions for the PROVL package and
  1717.      PRONK's source code are the same.  The PROVL commercial overlay
  1718.      manager package does not include the PRONK source code and the
  1719.      $5.00 discount can only be applied once, even if both are
  1720.      ordered.
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728.  
  1729.  
  1730.  
  1731.  
  1732.  
  1733.  
  1734.  
  1735.  
  1736.      Using PRONK.EXE                                  page 3 of 3
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742.      PROVL -- An Enhanced Version of OVL
  1743.      -----------------------------------
  1744.  
  1745.      If you wish to sell a program that uses OVL to operate, or if
  1746.      you just want a more powerful version of OVL, an enhanced
  1747.      version of OVL called PROVL can be purchased for $80.  You may
  1748.      reduce this amount by five dollars (to $75.00) if you send me
  1749.      the name and location of the bulletin board, software
  1750.      distributor, or place where you received your copy of OVL.  If
  1751.      someone else gave you the copy of OVL, ask him or her where they
  1752.      got it from.  The reason for the $5.00 discount is that this
  1753.      information is valuable to me in determining distribution
  1754.      strategies.
  1755.  
  1756.      PROVL has the following enhancements to OVL:
  1757.  
  1758.  
  1759.           1.  PROVL supports up to nine overlay areas.
  1760.  
  1761.           2.  PROVL allows up to the Microsoft Overlay Linker maximum
  1762.               of 63 overlays.
  1763.  
  1764.           3.  The depth that overlays can be nested to is increased
  1765.               to 32 levels with PROVL.
  1766.  
  1767.           4.  PROVL works with any overlay interrupt specified by the
  1768.               /O option of LINK.
  1769.  
  1770.           5.  PROVL expands the allowed buffer size of the /ZBn
  1771.               option to 1K through 32K.  For some overlay files this
  1772.               can reduce the overlay manager's overhead by up to 3K
  1773.               with no side effects.
  1774.  
  1775.  
  1776.      PROVL also dispenses with the runtime copyright notice.  This
  1777.      removal of the runtime copyright notice does not suggest, and
  1778.      should not be taken to suggest, that PROVL is not copyrighted.
  1779.      A potentially distracting message is simply not displayed.
  1780.  
  1781.      A bound manual containing an index and quick reference page is
  1782.      provided with PROVL.
  1783.  
  1784.      For those with particular needs, there are several customized or
  1785.      special versions of PROVL available.  One version of PROVL
  1786.      supports options passed via a configuration file instead of
  1787.      through command line options.  Another version allows a user to
  1788.      link in his or her own custom error-handler if a DOS error
  1789.      occurs inside of the overlay manager.  There is no extra charge
  1790.      for a customized change to the standard version of PROVL IF the
  1791.      change is deemed to have potential use for other PROVL users and
  1792.      is not too major.  Very specialized or large changes will cost
  1793.      more than the standard PROVL version.  Please contact me if you
  1794.      require a special version of PROVL.
  1795.  
  1796.  
  1797.  
  1798.      PROVL -- An enhanced version of OVL              page 1 of 2
  1799.  
  1800.  
  1801.  
  1802.  
  1803.  
  1804.      No royalties are charged for use of PROVL.  This means that you
  1805.      need only purchase a single version of PROVL for use with your
  1806.      program no matter how many copies of your program you
  1807.      distribute.  Purchase of PROVL entitles the purchaser to
  1808.      telephone support.  I reserve the right to require that all
  1809.      calls be at the purchaser's expense.
  1810.  
  1811.      Purchase of PROVL is MANDATORY if you wish to use a version of
  1812.      OVL for distribution with a commercial or potentially commercial
  1813.      application -- including programs distributed as shareware.
  1814.      PROVL is the only version of the overlay manager permitted
  1815.      for use with such applications and programs.
  1816.  
  1817.      To purchase PROVL, send $80.00 in US dollars -- $75.00 if you
  1818.      include a description of where you heard of PROVL -- by check or
  1819.      money order with your shipping address to:
  1820.  
  1821.          Michael E. Devore
  1822.          Devore Software & Consulting
  1823.          403 West Charles
  1824.          Champaign, IL  61820
  1825.  
  1826.      Please state your preference for either 360K 5 1/4 or 720K
  1827.      3 1/2 inch diskettes.  Thank you.
  1828.  
  1829.      All information contained herein, including the cost of PROVL,
  1830.      is subject to change without notice.
  1831.  
  1832.      PROVL copyright 1988, 1989 by Michael E. Devore
  1833.  
  1834.  
  1835.  
  1836.  
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844.  
  1845.  
  1846.  
  1847.  
  1848.  
  1849.  
  1850.  
  1851.  
  1852.  
  1853.  
  1854.  
  1855.  
  1856.  
  1857.  
  1858.  
  1859.  
  1860.      PROVL -- An enhanced version of OVL              page 2 of 2
  1861.  
  1862.  
  1863.  
  1864.  
  1865.  
  1866.      TOO LARGE!  DOESN'T WORK WITH MY DEBUGGER!
  1867.      TOO COMPLICATED!  PROVL TOO EXPENSIVE!
  1868.      ------------------------------------------
  1869.  
  1870.      There exists a cousin program to OVL, called LOVR, current
  1871.      version 1.14.  LOVR is strictly a linkable overlay manager with
  1872.      no command line options, e.g. it supports neither multiple
  1873.      overlay areas nor separate overlay files.  As a consequence,
  1874.      LOVR takes up less memory than LINKOVL, only 9K.
  1875.  
  1876.      LOVR uses less complicated techniques than the overlay managers
  1877.      in the OVL package.  For example, it simply integrates into the
  1878.      program's code without reloading the overlaid program as
  1879.      LINKOVL.OBJ does.  Such an approach may work better with the
  1880.      particular debugger you use on your programs.
  1881.  
  1882.      Since LOVR supports no extra options, it is most useful for
  1883.      those with more modest overlay manager needs who do not require
  1884.      the extra power of OVL.  After you decide on the way you wish to
  1885.      set up overlaid object modules, you can link in LOVR and never
  1886.      concern yourself with its operation again.
  1887.  
  1888.      If you wish a copy of LOVR and you have been unsuccessful in
  1889.      obtaining a copy, you may send $6.00 to cover shipping and
  1890.      handling for the latest version to the shipping address in the
  1891.      PROVL section.  No $5.00 discount applies.
  1892.  
  1893.      LOVR also has an enhanced commercial version, called PLOVR.
  1894.      PLOVR adds similar non-command line option enhancements to LOVR
  1895.      that PROVL does to OVL.  A small manual is provided with PLOVR
  1896.      as well.  Additionally, the PLOVR package includes a smaller
  1897.      copy of PLOVR.OBJ called SPLOVR.OBJ, which takes up 5K of
  1898.      program space in the root code, instead of 9K.  The trade-off
  1899.      for the decrease in space is an occasional increase in time to
  1900.      load an overlay from disk in some circumstances, but SPLOVR can
  1901.      be useful for those running close to the memory space limit even
  1902.      with overlays.  PLOVR costs $50, less a $5 discount if you
  1903.      include a description of where you heard of PLOVR (i.e. where
  1904.      you got this OVL package) when you order.  The ordering
  1905.      instructions for the PLOVR package and the PROVL package are the
  1906.      same and can be found in the PROVL section immediately
  1907.      preceding.
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.  
  1915.  
  1916.  
  1917.  
  1918.  
  1919.  
  1920.  
  1921.  
  1922.      Too large!  Too complicated!                     page 1 of 1
  1923.  
  1924.  
  1925.  
  1926.  
  1927.  
  1928.      TROUBLE-SHOOTING
  1929.      ----------------
  1930.  
  1931.      Check to make sure that you have compiled your program properly.
  1932.      Turbo C and MASM users must compile their source files using a
  1933.      large or far code memory model.  OVL will not work under a small
  1934.      or near code memory model.
  1935.  
  1936.      QuickBASIC 4.x, BASCOM, and Microsoft LINK 3.69 users using the
  1937.      OVL.EXE overlay manager should check to make sure that they are
  1938.      linking in QB4MOD.OBJ as the first object module.
  1939.  
  1940.      LINKOVL users should link LINKOVL.OBJ in as the first object
  1941.      module of Microsoft LINK's object file list.  Otherwise, memory
  1942.      requirements for the overlay manager will increase, possibly
  1943.      enough to exceed available memory.
  1944.  
  1945.      Use a recent version of LINK when linking overlays for OVL.  OVL
  1946.      was tested with LINK versions 3.05, 3.06, 3.60, 3.61, 3.64, and
  1947.      3.69.  2.x versions of LINK may not work properly.  For best
  1948.      results, the copyright notice of LINK.EXE should say Microsoft
  1949.      Overlay Linker, although some early versions that say Microsoft
  1950.      Object Linker will work as well.  TLINK, PLINK, or other
  1951.      proprietary linkers will not work with OVL; you must use
  1952.      Microsoft's linker.  In addition, if you experience problems,
  1953.      try linking with a different version of LINK.EXE -- at least one
  1954.      version has errors that causes improper operation when programs
  1955.      are linked with overlays.
  1956.  
  1957.      Check your link syntax, making sure that neither LINKOVL.OBJ nor
  1958.      the initial entry or main program module is in an overlay, and
  1959.      that you are not exceeding 8 overlay files or nesting overlays
  1960.      deeper than 4 levels.
  1961.  
  1962.      Carefully read the SPECIFICATIONS AND REQUIREMENTS sections to
  1963.      make sure that you are using the OVL programs in accordance with
  1964.      their operating requirements.  One possible mistake for those
  1965.      using OVL with 'C' or assembly language is to indirectly call a
  1966.      function or procedure in one overlay from another or from the
  1967.      root to an overlay without using PRONK on the object modules.
  1968.      Clipper users must always use PRONK, since all of Clipper's
  1969.      calls to overlay procedures are made indirectly.  Microsoft LINK
  1970.      requires direct calls to overlay procedures for it to correctly
  1971.      set up the overlay manager interrupts.
  1972.  
  1973.      Use of OVL's advanced options and support utilities brings with
  1974.      it more possibilities of operator error.  If you are using
  1975.      multiple overlay areas, it is important to understand that all
  1976.      overlay files not listed in an OVL command line switch are
  1977.      assigned to a different overlay area from the files listed in
  1978.      the switch.  Check that your switches and switch values match
  1979.      the rules outlined in the 'USING MULTIPLE OVERLAY AREAS' section
  1980.      of this manual.
  1981.  
  1982.  
  1983.  
  1984.      Trouble-shooting                                 page 1 of 3
  1985.  
  1986.  
  1987.  
  1988.  
  1989.  
  1990.      LINKOVL.OBJ users who wish to pass command line options to an
  1991.      overlaid program via the '/' character must use the '//x' option
  1992.      of OVL to avoid confusing LINKOVL into an attempt to take the
  1993.      overlaid program's command line options as its own.  All command
  1994.      line options for an overlaid program must come AFTER LINKOVL's
  1995.      own command line options.
  1996.  
  1997.      Since OVL will search all directories in the PATH environment
  1998.      variable when attempting to find a program containing an overlay
  1999.      file, it is important not to have another file with the same
  2000.      name as the overlay file in a directory earlier in the PATH
  2001.      variable, if the overlaid file is not in the current directory.
  2002.  
  2003.      If you use the utility SPLIT.EXE, remember to use the /ZS option
  2004.      of OVL.  Do not use the /ZS option if the most recent version of
  2005.      the overlaid program has not been run through SPLIT.  Old
  2006.      versions of separate overlay files will cause problems with a
  2007.      non-split program that inadvertently has the /ZS switch in the
  2008.      command line.
  2009.  
  2010.      PRONK users should pay careful attention to the manner of its
  2011.      operation.  Remember that PRONK can change some object modules
  2012.      on each pass and it should not be rerun on object modules
  2013.      changed by a previous pass of PRONK.
  2014.  
  2015.      If you are sure that you are compiling and linking properly and
  2016.      operating OVL within its specifications and requirements, but
  2017.      you still experience problems, make sure that the error is not
  2018.      in your program.  If memory size allows, compile your program
  2019.      without overlays and test it.  If the size of your program is
  2020.      too large for all of it to fit in memory, try to compile only
  2021.      the code that is giving you problems and see if it works
  2022.      correctly without overlays.
  2023.  
  2024.      If your program still fails after you have eliminated all
  2025.      suspects except for OVL, please contact me so I can fix the
  2026.      problem as soon as possible.  However, I will need to know the
  2027.      circumstances.  What error message, if any, does OVL display?
  2028.      What version and options of OVL were used?  What version and
  2029.      options of LINK were used?  What hardware and software
  2030.      configuration was your machine running under when the error
  2031.      occurred?  What language was the program written in?  If I deem
  2032.      it necessary to locate the error, I may request a copy of the
  2033.      program that causes OVL to operate incorrectly.  This copy will
  2034.      be held in the strictest confidence and either returned or
  2035.      destroyed after I am through testing.  You, of course, will have
  2036.      the option of refusing the request, although this will probably
  2037.      mean a delayed, or no, fix for the problem.
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.      Trouble-shooting                                 page 2 of 3
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.      If an error is in OVL and you are the first person to find the
  2053.      error, I will send you a free corrected version as soon as it is
  2054.      available.  The corrected version will either be sent by e-mail
  2055.      if possible, or regular USPS mail if not.  If you are not the
  2056.      first person to find the error and do not wish to wait for the
  2057.      corrected version to reach general distribution channels, you
  2058.      may send $6.00 to cover shipping and handling for the latest
  2059.      version to the address below.
  2060.  
  2061.      If you subscribe to either the CompuServe Information Service,
  2062.      the GEnie Information Service, or the Byte Information Exchange,
  2063.      you can send me electronic mail at the appropriate e-mail
  2064.      address below.  Barring vacation or unusual circumstances, I
  2065.      check in to the CIS and GEnie services at least once a week --
  2066.      usually more frequently -- and BIX at least twice a month.  Your
  2067.      e-mail will be acknowledged as soon as I receive it.
  2068.  
  2069.      If you do not subscribe to either CompuServe, GEnie, or BIX you
  2070.      should contact me through USPS mail at the address given at the
  2071.      end of this section.
  2072.  
  2073.      The realities of life and need for income being what they are,
  2074.      my billable work and support of my commercial software has
  2075.      priority over fixes to and questions concerning OVL or LOVR.  If
  2076.      I have a full work schedule, a fix or question may take more
  2077.      time to respond to than either you or I would prefer.  This is
  2078.      unfortunate, but unavoidable.
  2079.  
  2080.      MAILING ADDRESS:
  2081.           Michael E. Devore
  2082.           Devore Software & Consulting
  2083.           403 West Charles
  2084.           Champaign, IL  61820
  2085.  
  2086.      E-MAIL ADDRESSES:
  2087.           CompuServe      71540,62
  2088.           GEnie           MDEVORE
  2089.           BIX             mdevore
  2090.  
  2091.  
  2092.  
  2093.  
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.      Trouble-shooting                                 page 3 of 3
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.      OVERLAY TECHNICAL DOCUMENTATION
  2115.      -------------------------------
  2116.  
  2117.      It is not necessary to read or understand this part of the OVL
  2118.      documentation to use OVL.  This technical documentation is
  2119.      included for those who wish to know more information about how
  2120.      overlay calls are set up by Microsoft LINK.
  2121.  
  2122.      When you link a program with overlays, LINK sets up direct calls
  2123.      to code in the overlays in a special way.  All of these calls
  2124.      are replaced with an interrupt.  By LINK default the interrupt
  2125.      is 63 decimal or 3f hexadecimal, although the interrupt can be
  2126.      changed using the /O or /OVERLAYINTERRUPT LINK option.  This
  2127.      option is not supported by OVL, although PROVL does support it.
  2128.  
  2129.      Immediately following the interrupt inserted by LINK are three
  2130.      bytes of data.  The first byte is used by the overlay manager as
  2131.      an offset into an table found in the root .EXE code (usually
  2132.      located at the end of the root) that determines which overlay
  2133.      should be loaded into memory.  The second two bytes give the
  2134.      value that the Instruction Pointer (IP) should have when a jump
  2135.      to the overlay code is executed.  When the overlay manager is
  2136.      called by the interrupt, it needs to adjust the return address
  2137.      to point past these three bytes.
  2138.  
  2139.      The remaining information that the overlay manager needs can
  2140.      usually be found at the end of the root .EXE file.  Note that an
  2141.      overlaid .EXE program has overlay .EXE files appended to the
  2142.      root .EXE file.  Also, at least one non-default option of MS
  2143.      LINK, the /EXEPACK option places additional information at the
  2144.      end of the root .EXE file.  This is why the nonlinkable version
  2145.      of OVL, OVL.EXE, will not work with EXEPACK'ed files.  OVL.EXE
  2146.      cannot locate the information it needs in this situation.
  2147.  
  2148.      Each overlay file has its own header that follows the standard
  2149.      format of normal .EXE file headers, including items in a
  2150.      relocation table that need to have fixups performed on them.
  2151.  
  2152.      The overlay information in the root file corresponds to data in
  2153.      the OVERLAY_DATA segment created by MS LINK.  All of the data
  2154.      has a MS LINK internal variable name, although these names are
  2155.      documented nowhere by Microsoft to the best of my knowledge.
  2156.      The names are prefixed with a '$$' and can be seen if you look
  2157.      at a binary dump of LINK.EXE.  The information that the root
  2158.      .EXE has is as follows:
  2159.  
  2160.  
  2161.           1 word containing the count of all segments in overlay
  2162.           files plus one.
  2163.  
  2164.           1 word containing the total .EXE files in the main .EXE
  2165.           file.  This will equal the number of overlay files plus one
  2166.           for the root.
  2167.  
  2168.  
  2169.  
  2170.      Overlay Technical Documentation                  page 1 of 2
  2171.  
  2172.  
  2173.  
  2174.  
  2175.  
  2176.           1 zero word.  This word is fixed up to the program load
  2177.           segment when the program is loaded into memory.
  2178.  
  2179.           A table with entries for each overlay that, when added to
  2180.           the root program load segment, provide the value the Code
  2181.           Segment (CS) should have when a jump to the overlay code is
  2182.           executed.  MS LINK fixes up the values in this table as
  2183.           well.  If using LINK's internal '$$' variables during
  2184.           runtime, the need to add in the root program load segment
  2185.           value is negated.
  2186.  
  2187.           1 zero word.
  2188.  
  2189.           A table that uses the first byte following the interrupt in
  2190.           the calling code for an offset.  The entries in the table
  2191.           determine which overlay has the necessary code and should
  2192.           be loaded in memory, if it isn't loaded already.
  2193.  
  2194.           Variable number of zero bytes.
  2195.  
  2196.           The name of the main .EXE file that normally has all of the
  2197.           overlay files appended to it.  This will not be true if you
  2198.           have used the SPLIT.EXE program to create separate overlay
  2199.           files.
  2200.  
  2201.           Variable number of zero bytes.  These bytes have a
  2202.           corresponding MS LINK internal variable name, but their
  2203.           use, if any, is unknown to me.
  2204.  
  2205.           The number of the interrupt LINK inserts in the program
  2206.           code that is vectored to the overlay manager code.
  2207.  
  2208.  
  2209.      This information has remained stable for Microsoft LINK
  2210.      versions 3.05 through 3.69.  It may change for future versions
  2211.      of Microsoft LINK.
  2212.  
  2213.      The information presented here is solely for your interest and
  2214.      entertainment.  Michael E. Devore makes no claims or guarantees
  2215.      of the accuracy of this information.  Use of this information is
  2216.      at your own risk.
  2217.  
  2218.  
  2219.  
  2220.  
  2221.  
  2222.  
  2223.  
  2224.  
  2225.  
  2226.  
  2227.  
  2228.  
  2229.  
  2230.  
  2231.  
  2232.      Overlay Technical Documentation                  page 2 of 2
  2233.  
  2234.  
  2235.  
  2236.  
  2237.  
  2238.      COMMENTS and MISCELLANY
  2239.      -----------------------
  2240.  
  2241.      If you have an idea for an improvement to OVL, a comment or
  2242.      question about OVL, or even a complaint about OVL, please send
  2243.      it to either my USPS mailing address or one of the e-mail
  2244.      addresses below.  I am receptive to new ideas and constructive
  2245.      criticism.  Your comments DO make a difference.  Several
  2246.      enhancements to OVL have come about due to user requests so
  2247.      don't be shy about dropping me a postcard or sending
  2248.      e-mail.  I am also interested in what applications or other
  2249.      languages you use OVL with.
  2250.  
  2251.      OVL is written entirely in 8088, also known as 8086, assembly
  2252.      language.  I feel that this is necessary to achieve acceptable
  2253.      speed and size overhead, especially with older computers, while
  2254.      maintaining maximum compatibility.  While some optimizations to
  2255.      OVL's code can undoubtably be made, I am skeptical that a
  2256.      significant decrease in code size is possible while retaining
  2257.      all of its functionality.
  2258.  
  2259.      There has been some confusion over the type of software OVL is
  2260.      and who may use it.  OVL IS A FREE, COPYRIGHTED PROGRAM WITH
  2261.      SOME USE RESTRICTIONS, MOST NOTABLY THAT IT IS ONLY FOR
  2262.      NONCOMMERCIAL USE.  OVL should be powerful enough for most
  2263.      casual or part-time programmers needing a solution to the
  2264.      problem of program that has gotten too large to fit in available
  2265.      memory.  OVL is also for professional programmers who have the
  2266.      same problem with a personal application.  Those who need a more
  2267.      powerful solution or who wish to use this type of overlay
  2268.      manager for a commercial application should be able to afford
  2269.      the enhanced PROVL version.  Such an approach is in keeping with
  2270.      my philosophy of allowing those chronically short on cash to
  2271.      still have the benefits of some programming tools.  I have great
  2272.      sympathy for persons with little money, having been in that
  2273.      position myself on more than one occasion.  This philosophy
  2274.      should not be interpreted as support for piracy, nonpayment of
  2275.      shareware fees, or other unethical acts.  I just think it is
  2276.      pleasant that not all programs have a price tag attached.  OVL
  2277.      is one of many programs in this category.  Look around, despite
  2278.      what cynics (and purveyors of high-priced software) may say,
  2279.      programs don't have to be expensive to be good.
  2280.  
  2281.      OVL began as a grass-roots solution to the problem of a low-cost
  2282.      overlay manager.  I hope to maintain that attitude and never
  2283.      acquire the arrogant traits exhibited by some software
  2284.      developers and corporations.  With your help, I plan to keep OVL
  2285.      a viable, useful, low- or no-cost alternative to overpriced
  2286.      software.
  2287.  
  2288.           Michael E. Devore                |   CompuServe   71540,62
  2289.           Devore Software & Consulting     |   GEnie        MDEVORE
  2290.           403 West Charles                 |   BIX          mdevore
  2291.           Champaign, IL  61820             |
  2292.  
  2293.  
  2294.      Comments and Miscellany                          page 1 of 1
  2295.  
  2296.