        IF1                             ;
            %OUT    COMPONENT=DISKCOPY, INCLUDING DISKCOPY.EQU... ;
        ENDIF                           ;
;                   $SALUT (4,21,26,36)
;---------------------------------------------------------------------------;
;                                EQUATES                                    ;
;---------------------------------------------------------------------------;

;                          *** CONSTANTS ***

ZERO                EQU  0         ;
ONE                 EQU  1         ;
TWO                 EQU  2         ;
THREE               EQU  3         ;
FOUR                EQU  4         ;
TYPE_4              EQU  4         ;
FIVE                EQU  5         ;
SIX                 EQU  6         ;
SEVEN               EQU  7         ;
EIGHT               EQU  8         ;
NINE                EQU  9         ;
TEN                 EQU  0AH       ;
ON                  EQU  1         ;
OFF                 EQU  0         ;
TRUE                EQU  01        ;
FALSE               EQU  00        ;
GOOD                EQU  0         ;
BAD                 EQU  1         ;
FIRST               EQU  1         ;
SECOND              EQU  2         ;
NO_ERROR            EQU  0         ;
SOFT_ERROR          EQU  1         ;
HARD_ERROR          EQU  2         ;

BLANK               EQU  20H       ;BLANK IN ASCII (32 DEC)
CLEAR_SEGMENT       EQU  0E0H      ;USED TO CLEAR SEGMENT BITS (ROUND UP
                                   ;TO NEXT SECTOR)
SECTOR8             EQU  8         ;
SECTOR9             EQU  9         ;
SECTOR14            EQU  14        ;
SECTOR15            EQU  15        ;
DRV_48TPI           EQU  0         ;48 TPI DRIVE
DRV_96TPI           EQU  1         ;96 TPI DRIVE
DRV_720             EQU  2         ;3.5", 720 KB DRIVE (FOR CASHEW OR P14)
DRV_OTHER           EQU  7         ;Other, could be 3.5" 1.44M drive       ;C02
FixedDisk           EQU  5         ;Drive type for a fixed disk            ;C05
NRLFUNC             EQU  5F02H     ;GET NETWORK-REDIRECTION-LIST FUNCTION
NRLMAX              EQU  1CH       ;(MAXIMUM # OF NAMES ON NRL) - 1
DOS20               EQU  2         ;DOS VERSION 2.0
                    PUBLIC FINE    ;AN000;PARSER NEEDS IT
FINE                EQU  -1        ;"FINE AND DANDY", USED FOR RETURN CODE
                                   ;(-1 WAS USED TO AVOID CONFUSION WITH ERROR
                                   ;OFFSET WHICH CAN BE ZERO)
LOCAL_DRV           EQU  -1        ;DEVICE NOT DIRECTED
REMOTE_DRV          EQU  1000H     ;REMOTE DRIVE TEST BITS
NO_OPTION           EQU  -1        ;NO OPTION "/1" SPECIFIED
OPTION_1            EQU  1         ;OPTION "/1" SPECIFIED
REMOVABLE           EQU  0000H     ;REMOVABLE FILE
INVAL_PARM          EQU  -9        ;INVALID PARAMETER ENTERED
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;                   *** COPY STATUS BYTE ***

FATAL               EQU  01H       ;FATAL COPY ERROR, ABORT
OK                  EQU  00H       ;OK, PROCEED
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;                   *** PROGRAM SEGMENT PREFIX ***

FCB1_DRV_ID         EQU  5CH       ;DRIVE NUMBER ADDR IN FILE CONTROL BLOCK 1
FCB1_FILENM         EQU  5DH       ;FILE NAME ADDR IN FILE CONTROL BLOCK 1
FCB2_DRV_ID         EQU  6CH       ;DRIVE NUMBER ADDR IN FILE CONTROL BLOCK 2
FCB2_FILENM         EQU  6DH       ;FILE NAME ADDR IN FILE CONTROL BLOCK 2
BEGIN_UNFORM_AREA   EQU  80H       ;BEGINNING @ OF THE UNFORMATTED AREA
END_UNFORM_AREA     EQU  100H      ;ENDING @ OF THE UNFORMATTED AREA
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;                       *** DOS FUNCTONS ***

KB_INPUT_FUNC       EQU  01H       ;DOS KEYBOARD INPUT FUNCTION
PRINT_FUNC          EQU  09H       ;DOS PRINT STRING FUNCTION
REDIRECTED_FUNC     EQU  09H       ;IOCTL SUB FUNCTION ****** TO BE CHECKED ****
CURRENTDRV_FUNC     EQU  19H       ;GET CURRENT DRIVE FUNCTION CALL
DOSVER_FUNC         EQU  30H       ;DOS VERSION FUNCTION CALL
IOCTL_FUNC          EQU  44H       ;IOCTL FUNCTION CALL
GET_DISKBASE_VECTOR EQU  351EH     ;
SET_DISKBASE_VECTOR EQU  251EH     ;
GET_CTL_BREAK_VECT  EQU  3523H     ;AN000;GET VECTOR FOR INT 23H (CTRL-BREAK)
SET_CTL_BREAK_VECT  EQU  2523H     ;AN000;SET VECTOR FOR INT 23H (CTRL-BREAK)
DRIVE_CHECK         EQU  4408H     ;DOS CHECK FOR REMOVABLE DRIVE IOCTL CALL
STD_ERROR           EQU  0002H     ;STANDARD ERROR FILE HANDLE
WRITE_FILE          EQU  40H       ;WRITE TO FILE OR DEVICE FUNCTION CALL
GET_ASSIGN_MODE     EQU  5F00H     ;SET ASSIGN MODE COMMAND
SET_ASSIGN_MODE     EQU  5F01H     ;SET ASSIGN MODE COMMAND
SERVER              EQU  2AH       ;NETWORK SERVER INTERUPT
SHARED              EQU  03H       ;DEVICE SHARED CHECK
EXTENDED_ERROR      EQU  59H       ;EXTENDED ERROR
GET_DATE            EQU  2AH       ;AN000;READ SYSTEM DATE
GET_TIME            EQU  2CH       ;AN000;READ SYSTEM TIME CLOCK
RET_CD_EXIT         EQU  4CH       ;AN000;EXIT TO DOS, PASSING RETURN CODE
GET_EXT_CNTRY_INFO  EQU  65H       ;AN000;GET EXTENDED COUNTRY INFORMATION
YESNO_CHECK         EQU  23H       ;AN000;REQUEST (Y/N) CHECK OF GET_EXT_CNTRY_INFO
NO                  EQU  0         ;AN006;(Y/N) RESPONSE IS "NO"
YES                 EQU  1         ;AN000;(Y/N) RESPONSE IS "YES"
BAD_YESNO           EQU  2         ;AN000;(Y/N) RESPONSE IS NEITHER "Y" NOR "N"
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;       *** IOCTL DISKETTE I/O FUNCTONS ***
GENERIC_IOCTL_CODE  EQU  0DH       ;GENERIC IOCTL REQUEST
MAJOR_CODE          EQU  08H       ;GENERIC IOCTL MAJOR CODE
READ_FUNC           EQU  61H       ;IOCTL DISKETTE READ FUNCTION
WRITE_FUNC          EQU  41H       ;IOCTL DISKETTE WRITE FUNCTION
VERIFY_FUNC         EQU  62H       ;IOCTL DISKETTE VERIFY FUNCTION
FORMAT_FUNC         EQU  42H       ;IOCTL DISKETTE FORMAT FUNCTION
GETDEVPARM          EQU  60H       ;IOCTL GET DEVICE PARAMETER
SETDEVPARM          EQU  40H       ;IOCTL SET DEVICE PARAMETER
SET_LOGIC_DRIVE     EQU  0FH       ;AN000;IOCTL SET LOGICAL DRIVE
SENSE_MEDIA_TYPE    EQU	 68H	   ;IOCTL MEDIA SENSING FUNCTION ;D01
IOCTL_QUERY_BLOCK   EQU	 11H	   ;IOCTL QUERY FUNCTION	 ;D01
;(deleted ;AN013) GSET_MEDIA_ID  EQU 69H  ;GET OR SET MEDIA ID                  ;AN009;
;(deleted ;AN013) GET_ID         EQU 0    ;AL=0;GET MEDIA ID                    ;AN009;
;(deleted ;AN013) SET_ID         EQU 1    ;AL=1;SET MEDIA ID                    ;AN009;

;special Functions
GET_SP_FUNC_DEF     EQU  00000000B ;GET DEVICE PARM. DEFAULT BPB
GET_SP_FUNC_MED     EQU  00000001B ;GET DEVICE PARM. BOOT BPB
SET_SP_FUNC_DEF     EQU  00000100B ;SET DEFAULT DEVICE PARM
SET_SP_FUNC_DOS     EQU  00000100B ;SET DEVICE PARM BEFORE RETURN TO DOS.
SET_SP_BF_FORM      EQU  00000101B ;SET DEV PARM BEFORE FORMAT
R_W_SP_FUNC         EQU  00000000B ;READ, WRITE
STATUS_CHK          EQU  00000001B ;USED IN FORMAT PACKET AND VALIDATE
                                   ;THE "SET DEVICE PARM" REQUEST.
FORMAT_SP_FUNC      EQU  00000000B ;FORMAT
.XLIST                             ;
;READ_DASD_FUNC    EQU     15H     ;BIOS READ DASD TYPE (DISKETTE DRIVE TYPE)
;SET_DASD_FUNC     EQU     17H     ;BIOS SET DASD TYPE
;COMPARE_FUNC      EQU     03H     ;BIOS COMPARE FUNC # FOR ERROR MSG PROC
.LIST                              ;
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;              *** BIOS DISKETTE I/O ERROR CODES ***

;NOT_READY         EQU     80H     ;DISKETTE I/O NOT READY ERROR
;CHANG_LINE        EQU     06H     ;CHANGE LINE ERROR
;BAD_CONTROLLER    EQU     20H     ;BAD DISKETTE/DISK CONTOROLLER
;WRITE_PROTECT     EQU     03H     ;DISKETTE I/O WRITE PROTECT ERROR
;BAD_ADDR_MARK     EQU     02H     ;DISKETTE I/O BAD ADDRESS MARK ERROR
;REC_NOT_FOUND     EQU     04H     ;DISETTTE I/O RECORD NOT FOUND ERROR
;BAD_CRC           EQU     10H     ;DISKETTE I/O BAD CRC ERROR
;HARD_WR_ERROR     EQU     03H     ;DISKETTE WRITE HARD ERROR COUNT
;HARD_FMT_ERROR    EQU     02H     ;DISKETTE FORMAT HARD ERROR COUNT
;SINGLE_SIDE_COPY  EQU     00H     ;WHEN READING TRACK 0 SIDE 1 IF HARD ERROR
                                   ;OCCURS, WE WILL ASSUME IT WILL BE SINGLE
                                   ;SIDED COPY AND AL WILL BE SET TO 0, SO THAT
                                   ;BUFFER_PTR WILL NOT BE ADVANCED AND
                                   ;IF THE TRACK HAPPENS TO FALL INTO DMA BOUNDRY
                                   ;IT WILL SKIP THE SECOND PART OF READ_TRACK
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;               SYSTEM MESSAGE HANDLER EQUATES
EXT_ERR_CLASS       EQU  01H       ;AN000;DOS Extended error class
PARSE_ERR_CLASS     EQU  02H       ;AN000;Parse error class
UTILITY_MSG_CLASS   EQU  0FFH      ;AN000;Utility message class
CLASS_A             EQU  UTILITY_MSG_CLASS ;AN000;IN MSG DESCRIPTOR
MAX_0               EQU  0         ;AN000;MAXIMUM WIDTH OF STRING FIELD (0=NO LIMIT)
PAD_BLK             EQU  " "       ;AN000;CHAR FOR PAD FIELD
STDOUT              EQU  0001H     ;AN000;Standard Output device handle
STDERR              EQU  0002H     ;AN000;Standard Error Output device handle

; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;               SELECT MULTIPLEXOR INTERFACE
SELECT_MPX          EQU  0ADC1H    ;AN006;THE SELECT MULTIPLEXOR ID
SELECT_PRESENT      EQU  0FFH      ;AN006;RESPONSE IN AL, IF SELECT IS PRESENT
MULTIPLEXOR         EQU  2FH       ;AN006;THE MULTIPLEXOR INTERRUPT NUMBER
;---------------------------------------------------------------------------;
;                          CONTROL BLOCKS (STRUCS)                          ;
;---------------------------------------------------------------------------;

MSG_DESC            STRUC          ;
MSG_NUM             DW   0         ;AN000;MESSAGE NUMBER (TO AX)
MSG_HANDLE          DW   STDOUT    ;AN000;HANDLE OF OUTPUT DEVICE (TO BX)
MSG_SUBLIST         DW   0         ;AN000;POINTER TO SUBLIST (TO SI)
MSG_COUNT           DW   0         ;AN000;SUBSTITUTION COUNT (TO CX)
MSG_CLASS           DW   CLASS_A SHL 8 ;AN000;MESSAGE CLASS (IN HIGH BYTE, TO DH)
                                   ; LOW BYTE HAS 0 (FUNCTION "NO INPUT", TO DL);AN000;
MSG_DESC            ENDS           ;AN000;
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
SUBLIST             STRUC          ;AN000;
SUB_SIZE            DB   11        ;AN000;SUBLIST SIZE (POINTER TO NEXT SUBLIST)
SUB_RES             DB   0         ;AN000;RESERVED
                                   ;NEXT FIELD IS TO BE USED AS A DOUBLE WORD
SUB_VALUE           DW   0         ;AN000;TIME, DATE, OR PTR TO DATA ITEM
SUB_VALUE_SEG       DW   0         ;AN000;SEG ID OF PTR
                                   ;(ABOVE FIELD MUST BE FILLED AT EXECUTION
                                   ; TIME, IF THIS IS A .COM FILE)
SUB_ID              DB   0         ;AN000;N OF %N
SUB_FLAGS           DB   0         ;AN000;DATA TYPE FLAGS
SUB_MAX_WIDTH       DB   MAX_0     ;AN000;MAXIMUM FIELD WIDTH (0=UNLIMITED)
SUB_MIN_WIDTH       DB   0         ;AN000;MINIMUM FIELD WIDTH
SUB_PAD_CHAR        DB   PAD_BLK   ;AN000;CHARACTER FOR PAD FIELD
                                   ; CAN BE " ", "0" OR ",".
                                   ; "," CAUSES INSERTION OF THE ACTIVE
                                   ; THOUSANDS SEPARATOR BETWEEN EVERY
                                   ; 3 DIGITS.
SUBLIST             ENDS           ;AN000;
; = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
;BUFFER AREA FOR COMMUNICATION WITH GET/SET MEDIA ID FUNCTION CALL
; (USED BY VOLSER PROC)

;(deleted ;AN013;) A_MEDIA_ID_INFO     STRUC          ;                         ;AN000;
;(deleted ;AN013;) MI_LEVEL            DW   0         ;INFO LEVEL               ;AN000;
;(deleted ;AN013;) MI_SERIAL           DD   0         ;SERIAL #                 ;AN000;
;(deleted ;AN013;) MI_LABEL            DB   11 DUP (' ') ;VOLUME LABEL          ;AN000;
;(deleted ;AN013;) MI_SYSTEM           DB   8 DUP (' ') ;FILE SYSTEM TYPE       ;AN000;
;(deleted ;AN013;) A_MEDIA_ID_INFO     ENDS           ;                         ;AN000;

;END OF DISKCOPY.EQU
