home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 December / simtel1292_SIMTEL_1292_Walnut_Creek.iso / msdos / arc_lbr / xeq115.arc / XEQ.DOC < prev   
Text File  |  1987-05-30  |  12KB  |  260 lines

  1. comment *
  2.                    XEQ
  3.                -----
  4.        XEQ - COM File Library and Command Executor
  5.  
  6. This program allows COM files to be stored inside XEQ's code and executed
  7. by the command:
  8.     XEQ command
  9. For example, if BEEP.COM has been added to XEQ then:
  10.     XEQ BEEP
  11. will execute the BEEP program stored inside XEQ. The original BEEP.COM
  12. can be removed from the hard disk (onto a backup floppy!!!). If the
  13. specified command is not in XEQ it is passed to the DOS for execution as
  14. if directly typed at the DOS prompt.
  15.  
  16. PURPOSE
  17.     The purpose is to prevent wasted hard-disk space by those pesky
  18. little COM files we don't seem to be able to do without. When hard disks
  19. are formatted they are given an allocation size (called a cluster size)
  20. and this is typically 2048 or 4096 bytes. So when you save a 7 byte
  21. COM file like BEEP.COM, it takes up a full cluster. By combining these
  22. COM files into this program or LIBRARY, several COM files can be stored
  23. in one file (the XEQ program itself) and still be accessed without this waste
  24. in hard disk space.
  25.  
  26. In order to make the body of XEQ as small as possible, only a limited
  27. number of options are available. They are
  28.  
  29.     XEQ [/R]<command> Execute <command> if it is in the library
  30.                 or passes it to DOS for execution if not
  31.     XEQ /A(command>   Add <command>.COM to library if not existant
  32.     XEQ /D<command>   Delete command from library if existant
  33.     XEQ /E<command>   Extract command from library to .COM file if existant
  34.     XEQ /L        List the <commands> in the library
  35.  
  36. COMMAND DETAILS
  37.  
  38. /R - run a command
  39.  
  40. If no switch is given, the /R is assumed. If the given command name
  41. is in the library it is executed directly from there. XEQ internally
  42. relocates the stored file in memory so that the memory image is
  43. identical to the image if it had been loaded from the COM file on
  44. disk. This includes the way DOS loaded a COM file and the pretests
  45. for argument suitability and register set up. Thus ALL COM files
  46. should execute normally when run from within XEQ.
  47.  
  48. If the command is not found in XEQ then the string is passed to a DOS
  49. shell for execution. A second copy of COMMAND.COM is spawned with the
  50. command added after the /C switch. Therefore the command can be an
  51. internal, external, batch, EXE or COM file. (NOTE: SEE TSR LIMITATION
  52. BELOW.)
  53.  
  54. /A - add a command
  55.  
  56. Adds a COM file to the XEQ library. The filename given must either
  57. have no extension or .COM and the name part can contain standard DOS
  58. wildcards. A drive and/or path may be given to the target file.
  59. If the file is already in the library it will not be added. A warning
  60. message is given in this eventuality. Similarly if there is
  61. insufficient room to add a file, the addition of this file will be
  62. skipped with a warning. When wildcards exist, XEQ will attempt to add
  63. all files even if a given file cannot be found or is too big. Any attempt
  64. to add the current XEQ.COM file to itself (even if renamed under
  65. DOS3.x) will be prevented. (In DOS 2.x this safety feature can be
  66. thwarted by renaming XEQ.COM. A file called XEQ.COM is the only one
  67. excluded from being added.)
  68.  
  69. /D - delete a command
  70.  
  71. Removes the named command from the library. The filename given must either
  72. have no extension or .COM and the name part can contain standard DOS
  73. wildcards. A prompt asks for confirmation of the delete. 'Y' will
  74. delete the command, 'N' will skip deleting the command, 'G' will GO
  75. and delete this command and all further matching ones without asking
  76. again and 'A' will abort the entire delete process. Obviously 'G' is final
  77. and cannot be aborted once selected. Abort will cancel the effect of
  78. any 'Y' answers previously, AND NO COMMANDS WILL HAVE BEEN DELETED.
  79.  
  80. /E - extract a COM file
  81.  
  82. When the /E switch is used to extract a COM file, a full path for the
  83. resulting file may be specified. If the file already exists at that location,
  84. extraction does not occur. The filename given must either
  85. have no extension or .COM and the name part can contain standard DOS
  86. wildcards. The extracted file has the same date stamp as the COM file it was
  87. originally stored from. The file is NOT deleted from the library.
  88.  
  89. /L - list the library files
  90.  
  91. Displays a list of all files stored in XEQ. The original time and
  92. date stamp are displayed along with the file's byte size. At the end
  93. of the list the remaining space in XEQ is displayed, along with an
  94. indication of how much space has been saved by using XEQ (and
  95. deleting the original COM files). This computation is based upon
  96. the following:
  97.  
  98. DOS 2.x
  99. The value is the difference between the total clusters used by
  100. XEQ.COM on the default drive and the sum of all the clusters which
  101. would have been used on the default drive if each command was in its
  102. own COM file.
  103. The results can be misleading if say, you run XEQ/L while
  104. the drive default points to a floppy with a cluster size of 1024, but
  105. the DOS path executed XEQ.COM from the harddisk with a different
  106. cluster size. In this case the savings indicated are the bytes saved
  107. IF XEQ.COM WAS LOCATED ON THE DEFAULT DRIVE.
  108.  
  109. DOS 3.x
  110. The value is as above, but uses the cluster size of the drive it
  111. found XEQ.COM on and assumes that the COM files would have been on
  112. that drive if they were in seperate files.
  113. Under DOS 3.x the savings always relate to the drive the path found
  114. XEQ.COM on and is independent of the default drive cluster size.
  115.  
  116.  
  117. LIMITATIONS
  118.  
  119.     As a COM file can only be 64K long, COM files cannot
  120. be added to XEQ if this figure would be violated, as XEQ is a COM file
  121. itself. The /L command indicates the amount of space left and any
  122. attempt to add a file which would exceed the 64k limit is prevented. Any
  123. number of COM files can be added until this number is reached.
  124.         When a command is added or deleted from XEQ, a new copy of XEQ must
  125. be rewritten to disk. How it is written back depends on the version of DOS
  126. you are running.
  127.  
  128. DOS 2.x users
  129.  
  130. The revised library is always written to the current drive and directory as
  131. XEQ.COM, regardless of where the original copy of XEQ was found
  132. (it may have been loaded from elsewhere because of DOS's path
  133. capability). Therefore to update the original copy of XEQ, the /D or /A
  134. commands should be performed in the drive and directory of the
  135. original. If not, then the original copy of XEQ will still exist in its
  136. original location and the updated version in the current drive and
  137. directory. The new version of XEQ will always be called XEQ.COM, regardless
  138. of whether the original program was called XEQ.COM or not.
  139.  
  140. DOS3.x users
  141.  
  142. The revised library will be written over the original using the original's
  143. name. Thus doing a proper update of the original. The library can be given
  144. any name and this will be retained during the updating.
  145.  
  146. MULTIPLE LIBRARIES
  147.  
  148. For DOS 2.x user it is recommended that only one library XEQ.COM exist on the
  149. system. As adding or deleting from a renamed library file results in
  150. the new copy being called XEQ.COM on the current drive, care would
  151. have to be taken to prevent the overwriting of a legitimate XEQ.COM,
  152. and the new XEQ.COM would have to be renamed to the original name of
  153. the revised library.
  154.  
  155. For DOS 3.x users multiple libraries are more feasible as the updated library
  156. is always the original file no matter what it was called or where it
  157. was located. Thus maintaining multiple libraries is much simpler. CED
  158. (see below) can be used to avoid the need to remember which library
  159. contains a given command.
  160.  
  161. TERMINATE & STAY RESIDENT PROGRAMS
  162.  
  163. TSR programs can be stored inside XEQ and will install just like the
  164. original program. HOWEVER, NEVER RUN A TSR PROGRAM THROUGH XEQ WHICH
  165. IS NOT STORED IN XEQ. When XEQ cannot find a program it passes the name to
  166. DOS to run in a shell. If this program is a TSR it will freeze more
  167. memory than needed. XEQ has no way of knowing if a program it is
  168. about to execute externally is a TSR.
  169.  
  170. Beginning with version 1.10, XEQ will put the name of the file being
  171. run into the space between the end of the environment table and the
  172. start of the program. This is where DOS 3.x puts the running program
  173. name and XEQ will only duplicate this when running under DOS3.x. The
  174. purpose of this is to allow the running program to know its own name
  175. and to let TSR memory map programs like MAP.COM and MAPMEM.COM 
  176. show the real program name which is resident. A limitation exists for
  177. this however. The name stored is of the form d:/filename.COM. The
  178. space available to store this string cannot be increased and is set
  179. by the original running of XEQ. So if XEQ was in the root of C: the
  180. name would originally be C:\XEQ.COM. So only 3 letters of the program
  181. XEQ is running could be used, thus possibly truncating the name.
  182. Several possible solutions exist. First call XEQ a new name of 8
  183. letters, or run XEQ from a subdirectory such that the subdirectory
  184. name, separating backslashes and the current XEQ name (you may
  185. have renamed it to X, possibly) add up to more than 8 characters.
  186. Then there will always be room for the full name of the program XEQ
  187. is running.
  188.  
  189. USAGE TIP
  190.  
  191. The CED utility and its synonym feature can make the use of XEQ
  192. transparent in use. For example, if BEEP.COM is stored inside XEQ then a 
  193. synonym like
  194.     SYN BEEP XEQ BEEP
  195. will cause BEEP to be run out of the XEQ file just by entering BEEP.
  196.  
  197. DISCLAIMER
  198.  
  199.     Hardwood Software Associates guarantees XEQ.COM will do NOTHING
  200. useful at all. You use it at your own risk (make backups of the COM files
  201. stored within XEQ before deleting them from your hard disk). However, it
  202. seems to perform as described here and may be of use to you.
  203.  
  204.     Colin J. Stearman [71036,256]
  205.     Senior Associate
  206.     HS Associates
  207.     143 Ash Street
  208.     Hopkinton, MA 01748
  209.  
  210. ======================================================================
  211.             EDIT LOG
  212.     REV    DATE        NAME        DETAIL
  213.     1.01    14-MAR-87    C.STEARMAN    Fixed bug if COM file name
  214.                         is one character
  215.     1.02    27-MAR-87       C.STEARMAN    Aligned file size column
  216.                         Added disk bytes saved calc
  217.     1.03    1-APR-87        C.STEARMAN      Fixed bug if in list if file
  218.                         was longer than 9999 bytes.
  219.                         Fixed error in saved space
  220.                         computation
  221.     1.10    2-APR-87    C.STEARMAN    Under DOS 3.x updating writes
  222.                         to original file. Also updates
  223.                         command name in environment 
  224.                         for MAP, added wildcard,
  225.                         fixed yet another space
  226.                         computation bug, used local
  227.                         stack for external run only
  228.     1.11   13-APR-87        C.STEARMAN    Revised space saved compute,
  229.                         see note above
  230.     1.12   16-APR-87        C.STEARMAN      Fixed bug in load_run module
  231.                         which did not initialize stack
  232.                         correctly. Bug manifested it-
  233.                         self when MODE was run
  234.                         internally. Returned bad
  235.                         parameters message
  236.         1.13   22-APR-87       C.STEARMAN       Fixed wrong message of file
  237.                         not found in /A
  238.                         Improved construction of PSP
  239.                         when running internals. May
  240.                         clean up some compatability
  241.                         problems. Fixed drive validity
  242.                         test. If wild cards in argu-
  243.                         ments, did not set AX correct-
  244.                         ly per DOS loaded.
  245.     1.14  29-APR-87       C.STEARMAN        Fixed bug when executing ext-
  246.                         ernal commands. Local stack
  247.                         trashed passed command string.
  248.                         Also stack crash caused by
  249.                         allowing XEQ.COM to grow to
  250.                         large. Caused random crashes.
  251.                         Added confirm delete
  252.     1.15 30-MAY-87          C.STEARMAN    Cleaned up help screen and
  253.                         identified which library file
  254.                         was accessed. Fixed bug in
  255.                         extract where a 1 character
  256.                         filename did not have .COM
  257.                         added to it.
  258. ======================================================================
  259. *
  260.