home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug144.arc / ACOPY30.LBR / ACOPY30.PYT / ACOPY30.PYT
Text File  |  1990-02-17  |  17KB  |  373 lines

  1. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  2. ; *                                                               *
  3. ; *                           A C O P Y                           *
  4. ; *                                                               *
  5. ; *                 An Enhanced ZCPR3-Compatible                  *
  6. ; *                       File Copy Utility                       *
  7. ; *                                                               *
  8. ; *                     Copyright (c) 1986-90                     *
  9. ; *                              by                               *
  10. ; *                          Terry Hazen                          *
  11. ; *                     21460 Bear Creek Road                     *
  12. ; *                      Los Gatos, CA 95030                      *
  13. ; *                                                               *
  14. ; *                Voice.......... (408) 354-7188                 *
  15. ; *                Saratoga RBBS.. (408) 354-5934                 *
  16. ; *                Zee-Machine.... (408) 245-1420                 *
  17. ; *                Ladera Znode... (213) 670-9465                 *
  18. ; *                                                               *
  19. ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  20. ;
  21. ;
  22. ; Latest Revision
  23. ; ---------------
  24. ;
  25. ; Version 3.0 - 02/16/90   Adds source and destination disk
  26. ;       directory caching in RAM for faster copying, two new
  27. ;       options Should now run under CP/M 3.0.  See ACOPY30.HIS
  28. ;       for revision history.
  29. ;
  30. ;================================================================
  31. ;
  32. ; Equates
  33. ;
  34. OFF     EQU     0
  35. ON      EQU     0FFh
  36.         ORG     010Bh   ; Start of patch area
  37.  
  38. ;================================================================
  39. ;
  40. ; ACOPY has several locations near the beginning of the program
  41. ; that can be patched using DDT, PATCH, ZPATCH, etc, to alter the
  42. ; operation of the program to suit the user.  The following
  43. ; tables list their locations and the distribution defaults.
  44. ;
  45. ; An alternate method is to rename this entire file as a source
  46. ; code file (for example, you might rename it to ACOPY30P.Z80),
  47. ; edit it to configure your copy of ACOPY30.COM just the way you
  48. ; want it, assemble it to a HEX file (for example, ACOPY30P.HEX)
  49. ; and then use MLOAD to overlay it on ACOPY30.COM, creating your
  50. ; new working file, COPY.COM:
  51. ;
  52. ;      A0>MLOAD COPY.COM=ACOPY30.COM,ACOPY30P.HEX
  53. ;
  54. ;================================================================
  55. ;
  56. ; DOS ID Byte
  57. ; -----------
  58. ;
  59. ; ACOPY checks which operating system it is operating under to
  60. ; determine how to tailor the copying process to the current DOS.
  61. ; Each DOS that ACOPY recognizes has an ID byte, consisting of
  62. ; flag bits that define the operating features that ACOPY checks
  63. ; during operation.
  64. ;
  65. ; ACOPY checks for adequate free space on the destination disk
  66. ; before copying, which requires each new destination disk to be
  67. ; relogged before doing the copying.  Under DOS systems that
  68. ; don't do automatic disk relogging, such as CP/M 2.2, this
  69. ; relogging must be done manually with a ^C each time the
  70. ; destination disk is changed.  Some DOS systems that do
  71. ; automatic disk relogging, such as Z80DOS and ZRDOS (used in
  72. ; stock NZCOM systems), don't do it until the first disk write.
  73. ; This means that while the new disk does get automatically
  74. ; relogged, it won't happen until after the free space
  75. ; calculation has already been made, resulting in a free space
  76. ; value that is actually for the previous destination disk and
  77. ; causing ACOPY to possibly give incorrect 'Disk too full' error
  78. ; messages and refuse to copy files that it thinks (incorrectly)
  79. ; won't fit on the destination disk.
  80. ;
  81. ; To avoid this problem, ACOPY checks bit 0 of the DOS ID byte
  82. ; before doing a copy.  If a DOS such as CP/M 2.2, Z80DOS or
  83. ; ZRDOS needs to always do a disk reset before copying, bit 0 of
  84. ; the ID byte for that DOS is set to 1.  Currently, ZSDOS and
  85. ; ZDDOS are the only DOS systems that do immediate automatic disk
  86. ; relogging and don't require ACOPY to do a disk reset before
  87. ; copying.  If you wish to take responsibility for doing your own
  88. ; disk relogging, you can reset bit 0 of your DOS ID byte to 0
  89. ; and save a little time with each copy.
  90. ;
  91. ; Some computers can read several disk formats in the same drive.
  92. ; AMPRO Z80 Little Boards, for example, can read the AMPRO 48tpi
  93. ; format in 96tpi drives, provided that a BIOS logon request is
  94. ; made first during the BIOS select disk operation, so that the
  95. ; BIOS will seek to the system track, read the format ID, and set
  96. ; the disk parameters in the BIOS accordingly.  Normally, if you
  97. ; try to read or write to a 48tpi disk in a 96tpi drive that has
  98. ; been logged with the 96tpi format, you will get a BDOS error,
  99. ; even when operating under ZSDOS.  If you operate under ZSDOS or
  100. ; ZDDOS and do a lot of format mixing, you can patch bit 0 of the
  101. ; ZSDOS ID byte to 1 to always do a disk reset before copying,
  102. ; which makes format relogging automatic.
  103. ;
  104. ; DOS ID byte definitions are:
  105. ;
  106. ;       +------> bit 5: Use CP/M 3.0 disk free space DOS call
  107. ;       |  +---> bit 2: Use Z80DOS datestamping calls
  108. ;       |  |+--> bit 1: Use ZSDOS-CP/M 3.0 datestamping calls
  109. ;       |  ||+-> bit 0: Do disk reset before copying
  110. ;       |  |||
  111. ; bit:76543210B Location  Purpose
  112. ;================================================================
  113. DB    00000001B ; 010Bh ; CP/M 2.2 ID - default DOS
  114. DB    00100011B ; 010Ch ; CP/M 3.0 ID
  115. DB    00000100B ; 010Dh ; Z80DOS ID
  116. DB    00000001B ; 010Eh ; ZRDOS ID
  117. DB    00000010B ; 010Fh ; ZSDOS/ZDDOS ID
  118.  
  119. ;
  120. ; Options
  121. ; -------
  122. ;
  123. ; The default option characters may be changed if you prefer
  124. ; other mnemonics.  The changed characters will automatically
  125. ; appear in the command line HELP message.
  126. ;
  127. ; The option settings are all OFF-ON toggles.  It is possible to
  128. ; change the default settings for any of the options from OFF
  129. ; (00h) to ON (0FFh) to allow, for example, always overwriting
  130. ; R/W destination files without having to use the /O option.
  131. ; Note that if you then use the /O option, it will turn OFF the
  132. ; automatic overwriting.  The current default settings will
  133. ; automatically be reflected in the command line HELP message.
  134. ;
  135. ; Since changing some of the default option settings may change
  136. ; the operation of ACOPY by removing some of the built-in safety
  137. ; factors that help prevent overwriting or deleting important
  138. ; existing files by accident, caution should be exercised in
  139. ; changing any of the default option settings.  You should be
  140. ; sure that you understand how ACOPY will operate with the new
  141. ; default settings by testing operation before making permanent
  142. ; changes.
  143. ;
  144. ; You may inactivate an option by patching ACOPY to set the high
  145. ; bit of the option character.  This is easily done by patching
  146. ; the option character to any hex value 80h or greater (FFh, for
  147. ; example), or by patching to add 80h to the hex value of the
  148. ; current character.  When ACOPY detects an option character with
  149. ; the high bit set, it will bypass the display for that option in
  150. ; the command line HELP message.  Since the command processor
  151. ; filters the high bits from characters passed through it, you
  152. ; can't send the new option character to ACOPY from the keyboard
  153. ; or through an ALIAS script, and the option is effectively
  154. ; eliminated.  You may, of course, reactivate the option at any
  155. ; time by patching the option character back to a normal
  156. ; character.
  157. ;
  158. ; If you want to eliminate ALL option choices following a given
  159. ; option, patch the first undesired option character to a 00h.
  160. ; All subsequent options will be effectively inactivated.
  161. ;
  162. ;
  163. ;     Default   Location  Purpose
  164. ;================================================================
  165. DB      '1'     ; 0110h ; Copy only files with F1 attribute set.
  166. DB      OFF     ; 0111h ; Default setting.  ON not recommended.
  167.  
  168. DB      '2'     ; 0112h ; Copy only files with F2 attribute set.
  169. DB      OFF     ; 0113h ; Default setting.  ON not recommended.
  170.  
  171. DB      '3'     ; 0114h ; Copy only files with F3 attribute set.
  172. DB      OFF     ; 0115h ; Default setting.  ON not recommended.
  173.  
  174. DB      '4'     ; 0116h ; Copy only files with F4 attribute set.
  175. DB      OFF     ; 0117h ; Default setting.  ON not recommended.
  176.  
  177. DB      '5'     ; 0118h ; Copy only files with F5 attribute set.
  178. DB      OFF     ; 0119h ; Default setting.  ON not recommended.
  179.  
  180. DB      '6'     ; 011Ah ; Copy only files with F6 attribute set.
  181. DB      OFF     ; 011Bh ; Default setting.  ON not recommended.
  182.  
  183. DB      '7'     ; 011Ch ; Copy only files with F7 attribute set.
  184. DB      OFF     ; 011Dh ; Default setting.  ON not recommended.
  185.  
  186. DB      'N'     ; 011Eh ; Copy only non-archived (changed) files.
  187. DB      OFF     ; 011Fh ; When OFF, ignore archive bit.
  188.                         ; When ON, copy only non-archived files.
  189.         ;
  190.         ; NOTE: This option is normally inactivated.  When it is
  191.         ;       inactivated, it should be set to ON so that both
  192.         ;       directory and system files may be copied.
  193. DB      'A'+80h ; 0120h ; Copy directory AND system files.
  194. DB      ON      ; 0121h ; When OFF, copy only directory files.
  195.                         ; When ON, copy directory AND system
  196.                         ;       files.
  197.  
  198. DB      'X'     ; 0122h ; Skip copying if destination files
  199. DB      OFF     ;       ; already exist.
  200.                 ; 0123h ; When OFF, ask before overwriting.
  201.                         ; When ON, skip copying if files exist.
  202.                         ; (Overridden by 'O' and 'R' options.)
  203.  
  204. DB      'O'     ; 0124h ; Overwrite existing R/W files.
  205. DB      OFF     ; 0125h ; When OFF, ask before overwriting.
  206.                         ; When ON, overwrite without asking.
  207.                         ; (Overrides 'X' option.)
  208.  
  209. DB      'R'     ; 0126h ; Overwrite existing R/O or R/W files.
  210. DB      OFF     ; 0127h ; When OFF, ask before overwriting.
  211.                         ; When ON, overwrite without asking.
  212.                         ; (Overrides 'X' option.)
  213.  
  214. DB      'M'     ; 0128h ; Move files, deleting source files after
  215.                         ; copying.
  216. DB      OFF     ; 0129h ; When OFF, don't delete source files.
  217.                         ; When ON, delete source files.
  218.  
  219. DB      'Y'     ; 012Ah ; Make destination files system files.
  220. DB      OFF     ; 012Bh ; When OFF, destination files are made
  221.                         ; directory files.
  222.                         ; When ON, destination files are made
  223.                         ; system files.
  224.  
  225. DB      'D'     ; 012Ch ; Archive destination files.
  226. DB      OFF     ; 012Dh ; When OFF, destination files are
  227.                         ; non-archived.
  228.                         ; When ON, destination files are
  229.                         ; archived.
  230.  
  231. DB      'S'     ; 012Eh ; Archive source files.
  232. DB      OFF     ; 012Fh ; When OFF, source files unchanged.
  233.                         ; When ON, source files are archived.
  234.  
  235. DB      'C'     ; 0130h ; Copy source file datestamps to
  236.                         ; destination files datestamps.
  237.                         ; (Only active when operating under
  238.                         ; Z80DOS, ZDDOS or ZSDOS.)
  239. DB      ON      ; 0131h ; When OFF, destination files are dated
  240.                         ; as newly created.
  241.                         ; When ON, destination files have the
  242.                         ; same datestamps as the source files.
  243.  
  244. DB      'V'     ; 0132h ; CRC verify copied files.
  245. DB      ON      ; 0133h ; When OFF, don't verify copied files.
  246.                         ; When ON, verify copied files.
  247.  
  248. DB      'Q'     ; 0134h ; Quiet.  Non-ZCPR3 default only.  ZCPR3
  249.                         ; default is ZCPR3 QUIET flag setting.
  250. DB      OFF     ; 0135h ; When OFF, display normal status
  251.                         ; messages.
  252.                         ; When ON, display only error messages.
  253. ;
  254. DB      0       ; 0136h ; Termination of option table.
  255.  
  256. ;
  257. ; Program Name
  258. ; ------------
  259. ;
  260. ; If you are operating in a ZCPR3 environment, the name by which
  261. ; ACOPY was invoked will automatically appear in the command line
  262. ; HELP message, and no patching need be done.
  263. ;
  264. ; If you are primarily operating in a non-ZCPR3 environment and
  265. ; rename ACOPY, the program name, 'ACOPY', may be patched to the
  266. ; new name, which will then automatically appear at the proper
  267. ; places in the command line HELP message when it is called.  A
  268. ; maximum of eight characters are available.  Fill the unused
  269. ; positions with space characters, as spaces in any of the eight
  270. ; locations will be ignored.  For example, to change the name of
  271. ; the program from ACOPY to COPY, you may simply patch the 'A' in
  272. ; 'ACOPY' to a space character (20H) and the HELP message will
  273. ; then display 'COPY' with no leading space.
  274. ;
  275. ;     Default   Location  Purpose
  276. ;================================================================
  277. DB   'ACOPY   ' ; 0137h ; Program name for use in command line
  278.                         ; help screen.  Used only in non-
  279.                         ; ZCPR3 environments.  8 characters
  280.                         ; maximum.
  281.  
  282. ;
  283. ; Option Flag Character
  284. ; ---------------------
  285. ;
  286. ; The option flag character may be changed if you prefer.  The
  287. ; changed character will automatically appear in the help
  288. ; message.
  289. ;
  290. ;     Default   Location  Purpose
  291. ;================================================================
  292. DB      '/'     ; 013Fh ; Option flag character.
  293.  
  294. ;
  295. ; Valid Drives and Users
  296. ; ----------------------
  297. ;
  298. ; The drive specifications accepted by ACOPY and the maximum user
  299. ; number accepted may be patched.  ACOPY checks specified drives
  300. ; against a valid drive vector (DRVEC), which is a 2 byte vector
  301. ; of available drives.  This method allows holes in the map of
  302. ; valid drives when the available drives are not contiguous.  One
  303. ; bit in the vector is set for each valid drive.  Drive A is the
  304. ; least significant bit and drive P is the most significant.  For
  305. ; example, the vector for valid drives A,B,C,D,and F would be
  306. ; 00000000 00101111b, or 002Fh.  This value would appear in the
  307. ; patching utility display with the hex digits in reverse order
  308. ; with the least significant digit appearing first (2F 00).
  309. ;
  310. ; In ZCPR3 systems with an extended environment, such as those
  311. ; created by NZCOM systems, the DRVEC bytes will be taken
  312. ; directly from the ZCPR3 environment.  For use in earlier ZCPR3
  313. ; systems that don't have the extended environment with a DRVEC
  314. ; specification, you may set the valid drive vector flag, below,
  315. ; if you wish ACOPY to use the internal DRVEC bytes instead of
  316. ; the ZCPR3 maximum allowable drive (MAXDRV) byte from the
  317. ; environment.  The default for these earlier systems is to take
  318. ; MAXDRV from the environment, translate it to a DRVEC vector and
  319. ; store it internally for use during program operation.  In non-
  320. ; ZCPR3 systems, ACOPY will always use the internal DRVEC bytes.
  321. ;
  322. ; Unless you have a binary/hex calculator such as HP.COM
  323. ; available to make the conversion from the binary to the hex
  324. ; word, it will probably be much easier to assemble this file
  325. ; into an overlay, or to use ZCNFG to make changes in the DRVEC
  326. ; vector then to patch the new value directly.
  327. ;
  328. ;     Default   Location  Purpose
  329. ;================================================================
  330. DW 1111111111111111b ; 0140 ; Valid drive vector
  331. ;  PONMLKJIHGFEDCBA<--Valid drives.
  332.                         ; Default:  FFFFh - all drives valid.
  333.  
  334. DB      OFF     ; 0142h ; When OFF, use the environmental MAXDRV
  335.                         ; maximum drive byte in non-extended
  336.                         ; ZCPR3 systems.
  337.                         ; When ON, use the internal valid drive
  338.                         ; vector in place of the environmental
  339.                         ; MAXDRV byte in non-extended ZCPR3
  340.                         ; systems.
  341.  
  342. DB      15      ; 0143h ; Maximum user number allowed (15d=0Fh).
  343.  
  344. ;
  345. ; Retrying After CRC Failure
  346. ; --------------------------
  347. ;
  348. ; The number of times ACOPY will retry if CRC verification fails
  349. ; may be changed.
  350. ;
  351. ;     Default   Location  Purpose
  352. ;================================================================
  353. DB      3       ; 0144h ; Number of times ACOPY will try to recopy
  354.                         ; after CRC verification fails.
  355.  
  356. ;
  357. ; Warm Boot Exit
  358. ; --------------
  359. ;
  360. ; Since ACOPY doesn't overwrite the CCP, it doesn't normally exit
  361. ; with a warm boot.  However, you may patch the following
  362. ; location to ON (0FFH) if you wish to always exit with a warm
  363. ; boot (except when displaying the command line help message.)
  364. ;
  365. ;     Default   Location  Purpose
  366. ;================================================================
  367. DB      OFF     ; 0145h ; When OFF, use normal exit to system.
  368.                         ; When ON, exit with warm boot.
  369.  
  370. ;================================================================
  371.         END     ; Patch overlay
  372.  
  373.