home *** CD-ROM | disk | FTP | other *** search
- ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- ; * *
- ; * A C O P Y *
- ; * *
- ; * An Enhanced ZCPR3-Compatible *
- ; * File Copy Utility *
- ; * *
- ; * Copyright (c) 1986-90 *
- ; * by *
- ; * Terry Hazen *
- ; * 21460 Bear Creek Road *
- ; * Los Gatos, CA 95030 *
- ; * *
- ; * Voice.......... (408) 354-7188 *
- ; * Saratoga RBBS.. (408) 354-5934 *
- ; * Zee-Machine.... (408) 245-1420 *
- ; * Ladera Znode... (213) 670-9465 *
- ; * *
- ; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- ;
- ;
- ; Latest Revision
- ; ---------------
- ;
- ; Version 3.0 - 02/16/90 Adds source and destination disk
- ; directory caching in RAM for faster copying, two new
- ; options Should now run under CP/M 3.0. See ACOPY30.HIS
- ; for revision history.
- ;
- ;================================================================
- ;
- ; Equates
- ;
- OFF EQU 0
- ON EQU 0FFh
- ORG 010Bh ; Start of patch area
-
- ;================================================================
- ;
- ; ACOPY has several locations near the beginning of the program
- ; that can be patched using DDT, PATCH, ZPATCH, etc, to alter the
- ; operation of the program to suit the user. The following
- ; tables list their locations and the distribution defaults.
- ;
- ; An alternate method is to rename this entire file as a source
- ; code file (for example, you might rename it to ACOPY30P.Z80),
- ; edit it to configure your copy of ACOPY30.COM just the way you
- ; want it, assemble it to a HEX file (for example, ACOPY30P.HEX)
- ; and then use MLOAD to overlay it on ACOPY30.COM, creating your
- ; new working file, COPY.COM:
- ;
- ; A0>MLOAD COPY.COM=ACOPY30.COM,ACOPY30P.HEX
- ;
- ;================================================================
- ;
- ; DOS ID Byte
- ; -----------
- ;
- ; ACOPY checks which operating system it is operating under to
- ; determine how to tailor the copying process to the current DOS.
- ; Each DOS that ACOPY recognizes has an ID byte, consisting of
- ; flag bits that define the operating features that ACOPY checks
- ; during operation.
- ;
- ; ACOPY checks for adequate free space on the destination disk
- ; before copying, which requires each new destination disk to be
- ; relogged before doing the copying. Under DOS systems that
- ; don't do automatic disk relogging, such as CP/M 2.2, this
- ; relogging must be done manually with a ^C each time the
- ; destination disk is changed. Some DOS systems that do
- ; automatic disk relogging, such as Z80DOS and ZRDOS (used in
- ; stock NZCOM systems), don't do it until the first disk write.
- ; This means that while the new disk does get automatically
- ; relogged, it won't happen until after the free space
- ; calculation has already been made, resulting in a free space
- ; value that is actually for the previous destination disk and
- ; causing ACOPY to possibly give incorrect 'Disk too full' error
- ; messages and refuse to copy files that it thinks (incorrectly)
- ; won't fit on the destination disk.
- ;
- ; To avoid this problem, ACOPY checks bit 0 of the DOS ID byte
- ; before doing a copy. If a DOS such as CP/M 2.2, Z80DOS or
- ; ZRDOS needs to always do a disk reset before copying, bit 0 of
- ; the ID byte for that DOS is set to 1. Currently, ZSDOS and
- ; ZDDOS are the only DOS systems that do immediate automatic disk
- ; relogging and don't require ACOPY to do a disk reset before
- ; copying. If you wish to take responsibility for doing your own
- ; disk relogging, you can reset bit 0 of your DOS ID byte to 0
- ; and save a little time with each copy.
- ;
- ; Some computers can read several disk formats in the same drive.
- ; AMPRO Z80 Little Boards, for example, can read the AMPRO 48tpi
- ; format in 96tpi drives, provided that a BIOS logon request is
- ; made first during the BIOS select disk operation, so that the
- ; BIOS will seek to the system track, read the format ID, and set
- ; the disk parameters in the BIOS accordingly. Normally, if you
- ; try to read or write to a 48tpi disk in a 96tpi drive that has
- ; been logged with the 96tpi format, you will get a BDOS error,
- ; even when operating under ZSDOS. If you operate under ZSDOS or
- ; ZDDOS and do a lot of format mixing, you can patch bit 0 of the
- ; ZSDOS ID byte to 1 to always do a disk reset before copying,
- ; which makes format relogging automatic.
- ;
- ; DOS ID byte definitions are:
- ;
- ; +------> bit 5: Use CP/M 3.0 disk free space DOS call
- ; | +---> bit 2: Use Z80DOS datestamping calls
- ; | |+--> bit 1: Use ZSDOS-CP/M 3.0 datestamping calls
- ; | ||+-> bit 0: Do disk reset before copying
- ; | |||
- ; bit:76543210B Location Purpose
- ;================================================================
- DB 00000001B ; 010Bh ; CP/M 2.2 ID - default DOS
- DB 00100011B ; 010Ch ; CP/M 3.0 ID
- DB 00000100B ; 010Dh ; Z80DOS ID
- DB 00000001B ; 010Eh ; ZRDOS ID
- DB 00000010B ; 010Fh ; ZSDOS/ZDDOS ID
-
- ;
- ; Options
- ; -------
- ;
- ; The default option characters may be changed if you prefer
- ; other mnemonics. The changed characters will automatically
- ; appear in the command line HELP message.
- ;
- ; The option settings are all OFF-ON toggles. It is possible to
- ; change the default settings for any of the options from OFF
- ; (00h) to ON (0FFh) to allow, for example, always overwriting
- ; R/W destination files without having to use the /O option.
- ; Note that if you then use the /O option, it will turn OFF the
- ; automatic overwriting. The current default settings will
- ; automatically be reflected in the command line HELP message.
- ;
- ; Since changing some of the default option settings may change
- ; the operation of ACOPY by removing some of the built-in safety
- ; factors that help prevent overwriting or deleting important
- ; existing files by accident, caution should be exercised in
- ; changing any of the default option settings. You should be
- ; sure that you understand how ACOPY will operate with the new
- ; default settings by testing operation before making permanent
- ; changes.
- ;
- ; You may inactivate an option by patching ACOPY to set the high
- ; bit of the option character. This is easily done by patching
- ; the option character to any hex value 80h or greater (FFh, for
- ; example), or by patching to add 80h to the hex value of the
- ; current character. When ACOPY detects an option character with
- ; the high bit set, it will bypass the display for that option in
- ; the command line HELP message. Since the command processor
- ; filters the high bits from characters passed through it, you
- ; can't send the new option character to ACOPY from the keyboard
- ; or through an ALIAS script, and the option is effectively
- ; eliminated. You may, of course, reactivate the option at any
- ; time by patching the option character back to a normal
- ; character.
- ;
- ; If you want to eliminate ALL option choices following a given
- ; option, patch the first undesired option character to a 00h.
- ; All subsequent options will be effectively inactivated.
- ;
- ;
- ; Default Location Purpose
- ;================================================================
- DB '1' ; 0110h ; Copy only files with F1 attribute set.
- DB OFF ; 0111h ; Default setting. ON not recommended.
-
- DB '2' ; 0112h ; Copy only files with F2 attribute set.
- DB OFF ; 0113h ; Default setting. ON not recommended.
-
- DB '3' ; 0114h ; Copy only files with F3 attribute set.
- DB OFF ; 0115h ; Default setting. ON not recommended.
-
- DB '4' ; 0116h ; Copy only files with F4 attribute set.
- DB OFF ; 0117h ; Default setting. ON not recommended.
-
- DB '5' ; 0118h ; Copy only files with F5 attribute set.
- DB OFF ; 0119h ; Default setting. ON not recommended.
-
- DB '6' ; 011Ah ; Copy only files with F6 attribute set.
- DB OFF ; 011Bh ; Default setting. ON not recommended.
-
- DB '7' ; 011Ch ; Copy only files with F7 attribute set.
- DB OFF ; 011Dh ; Default setting. ON not recommended.
-
- DB 'N' ; 011Eh ; Copy only non-archived (changed) files.
- DB OFF ; 011Fh ; When OFF, ignore archive bit.
- ; When ON, copy only non-archived files.
- ;
- ; NOTE: This option is normally inactivated. When it is
- ; inactivated, it should be set to ON so that both
- ; directory and system files may be copied.
- DB 'A'+80h ; 0120h ; Copy directory AND system files.
- DB ON ; 0121h ; When OFF, copy only directory files.
- ; When ON, copy directory AND system
- ; files.
-
- DB 'X' ; 0122h ; Skip copying if destination files
- DB OFF ; ; already exist.
- ; 0123h ; When OFF, ask before overwriting.
- ; When ON, skip copying if files exist.
- ; (Overridden by 'O' and 'R' options.)
-
- DB 'O' ; 0124h ; Overwrite existing R/W files.
- DB OFF ; 0125h ; When OFF, ask before overwriting.
- ; When ON, overwrite without asking.
- ; (Overrides 'X' option.)
-
- DB 'R' ; 0126h ; Overwrite existing R/O or R/W files.
- DB OFF ; 0127h ; When OFF, ask before overwriting.
- ; When ON, overwrite without asking.
- ; (Overrides 'X' option.)
-
- DB 'M' ; 0128h ; Move files, deleting source files after
- ; copying.
- DB OFF ; 0129h ; When OFF, don't delete source files.
- ; When ON, delete source files.
-
- DB 'Y' ; 012Ah ; Make destination files system files.
- DB OFF ; 012Bh ; When OFF, destination files are made
- ; directory files.
- ; When ON, destination files are made
- ; system files.
-
- DB 'D' ; 012Ch ; Archive destination files.
- DB OFF ; 012Dh ; When OFF, destination files are
- ; non-archived.
- ; When ON, destination files are
- ; archived.
-
- DB 'S' ; 012Eh ; Archive source files.
- DB OFF ; 012Fh ; When OFF, source files unchanged.
- ; When ON, source files are archived.
-
- DB 'C' ; 0130h ; Copy source file datestamps to
- ; destination files datestamps.
- ; (Only active when operating under
- ; Z80DOS, ZDDOS or ZSDOS.)
- DB ON ; 0131h ; When OFF, destination files are dated
- ; as newly created.
- ; When ON, destination files have the
- ; same datestamps as the source files.
-
- DB 'V' ; 0132h ; CRC verify copied files.
- DB ON ; 0133h ; When OFF, don't verify copied files.
- ; When ON, verify copied files.
-
- DB 'Q' ; 0134h ; Quiet. Non-ZCPR3 default only. ZCPR3
- ; default is ZCPR3 QUIET flag setting.
- DB OFF ; 0135h ; When OFF, display normal status
- ; messages.
- ; When ON, display only error messages.
- ;
- DB 0 ; 0136h ; Termination of option table.
-
- ;
- ; Program Name
- ; ------------
- ;
- ; If you are operating in a ZCPR3 environment, the name by which
- ; ACOPY was invoked will automatically appear in the command line
- ; HELP message, and no patching need be done.
- ;
- ; If you are primarily operating in a non-ZCPR3 environment and
- ; rename ACOPY, the program name, 'ACOPY', may be patched to the
- ; new name, which will then automatically appear at the proper
- ; places in the command line HELP message when it is called. A
- ; maximum of eight characters are available. Fill the unused
- ; positions with space characters, as spaces in any of the eight
- ; locations will be ignored. For example, to change the name of
- ; the program from ACOPY to COPY, you may simply patch the 'A' in
- ; 'ACOPY' to a space character (20H) and the HELP message will
- ; then display 'COPY' with no leading space.
- ;
- ; Default Location Purpose
- ;================================================================
- DB 'ACOPY ' ; 0137h ; Program name for use in command line
- ; help screen. Used only in non-
- ; ZCPR3 environments. 8 characters
- ; maximum.
-
- ;
- ; Option Flag Character
- ; ---------------------
- ;
- ; The option flag character may be changed if you prefer. The
- ; changed character will automatically appear in the help
- ; message.
- ;
- ; Default Location Purpose
- ;================================================================
- DB '/' ; 013Fh ; Option flag character.
-
- ;
- ; Valid Drives and Users
- ; ----------------------
- ;
- ; The drive specifications accepted by ACOPY and the maximum user
- ; number accepted may be patched. ACOPY checks specified drives
- ; against a valid drive vector (DRVEC), which is a 2 byte vector
- ; of available drives. This method allows holes in the map of
- ; valid drives when the available drives are not contiguous. One
- ; bit in the vector is set for each valid drive. Drive A is the
- ; least significant bit and drive P is the most significant. For
- ; example, the vector for valid drives A,B,C,D,and F would be
- ; 00000000 00101111b, or 002Fh. This value would appear in the
- ; patching utility display with the hex digits in reverse order
- ; with the least significant digit appearing first (2F 00).
- ;
- ; In ZCPR3 systems with an extended environment, such as those
- ; created by NZCOM systems, the DRVEC bytes will be taken
- ; directly from the ZCPR3 environment. For use in earlier ZCPR3
- ; systems that don't have the extended environment with a DRVEC
- ; specification, you may set the valid drive vector flag, below,
- ; if you wish ACOPY to use the internal DRVEC bytes instead of
- ; the ZCPR3 maximum allowable drive (MAXDRV) byte from the
- ; environment. The default for these earlier systems is to take
- ; MAXDRV from the environment, translate it to a DRVEC vector and
- ; store it internally for use during program operation. In non-
- ; ZCPR3 systems, ACOPY will always use the internal DRVEC bytes.
- ;
- ; Unless you have a binary/hex calculator such as HP.COM
- ; available to make the conversion from the binary to the hex
- ; word, it will probably be much easier to assemble this file
- ; into an overlay, or to use ZCNFG to make changes in the DRVEC
- ; vector then to patch the new value directly.
- ;
- ; Default Location Purpose
- ;================================================================
- DW 1111111111111111b ; 0140 ; Valid drive vector
- ; PONMLKJIHGFEDCBA<--Valid drives.
- ; Default: FFFFh - all drives valid.
-
- DB OFF ; 0142h ; When OFF, use the environmental MAXDRV
- ; maximum drive byte in non-extended
- ; ZCPR3 systems.
- ; When ON, use the internal valid drive
- ; vector in place of the environmental
- ; MAXDRV byte in non-extended ZCPR3
- ; systems.
-
- DB 15 ; 0143h ; Maximum user number allowed (15d=0Fh).
-
- ;
- ; Retrying After CRC Failure
- ; --------------------------
- ;
- ; The number of times ACOPY will retry if CRC verification fails
- ; may be changed.
- ;
- ; Default Location Purpose
- ;================================================================
- DB 3 ; 0144h ; Number of times ACOPY will try to recopy
- ; after CRC verification fails.
-
- ;
- ; Warm Boot Exit
- ; --------------
- ;
- ; Since ACOPY doesn't overwrite the CCP, it doesn't normally exit
- ; with a warm boot. However, you may patch the following
- ; location to ON (0FFH) if you wish to always exit with a warm
- ; boot (except when displaying the command line help message.)
- ;
- ; Default Location Purpose
- ;================================================================
- DB OFF ; 0145h ; When OFF, use normal exit to system.
- ; When ON, exit with warm boot.
-
- ;================================================================
- END ; Patch overlay
-