;***************************************************************
;
;
;       MAIN CONTROL ROUTINE FOR HARD DISK TEST
;
;
;***************************************************************
;
;
        EXT PBLK0,ERRLM,PASLM
        EXT TASKNM,MSG,IO,ABORT,EXIT
        EXT AANS,UNIT,ASK
;
;
;
; INITIALIZE PIAs
;
        LXI  B,11300    [B] = 44, [C] = 36
        XRA  A
        OUT  160
        OUT  162
        OUT  164
        OUT  166
        OUT  161
        OUT  165
        CMA
        OUT  163
        OUT  167
        MOV  A,B
        OUT  160
        OUT  164
        OUT  166
        MOV  A,C
        OUT  162
;
;
; SET UP PROGRAM NAME FOR DOS ABORT AND EXIT CALLS
;
        LXI  H,PNAME
        SHLD TASKNM
;
; GET ERROR AND PASS LIMITS
;
        CALL UPARS      GO GET ERROR AND PASS LIMITS INTO PBLK
;
;
TESTL:  LXI  H,PBLK0
        CALL UNIT
        JMP  TESTL
;
;
;
; SUBROUTINE TO GET ERROR LIMIT AND PASS LIMIT FOR A UNIT
; AND PUT THEM IN THE UNIT PARAMETER BLOCK
;
UPARS:  CALL ASK          OK - SEE HOW MANY ERRORS TO ALLOW
        DW   ALLERR
        XCHG
        CALL AANS         ...IN BINARY
        LXI  H,ERRLM    POINT TO ERROR LIMIT
        MOV  M,A        SAVE ERROR LIMIT
        CALL ASK        SEE HOW MANY PASSES TO DO
        DW   ALLPAS
        XCHG
        CALL AANS       ...IN BINARY
        LXI  H,PASLM    POINT TO PASS LIMIT
        MOV  M,A        SAVE PASS LIMIT
        LXI  H,PBLK0    RESET POINTER TO  UNIT NUMBER
        RET
;
; MESSAGES AND FILE NAMES
;
PNAME:  DC   " HARD DISK TEST (V 1.0)   "
ALLERR: DC   "ERROR LIMIT ?"
ALLPAS: DC   "PASS LIMIT ?"
;
;
;
        END
