         DEF      7TAP:
7TAP:    EQU      %
*
         SYSTEM   UTS
*
*
         DEF      7TAP,7TAPCU,7TAP20
*
*
         REF      7TDOT,COMLIST
         REF      IOQ5,IOQ8,RE:ENT,NEWERCK,VECT4,VECT5
         REF      MAGTAPE,NOTOPTST,DCT7,MTAPCU,IOQ4,IOQ11
         REF      FCRDPB1,FCOUT2,EXITRTY,EXTSTORE
*
         PAGE
*
*
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
*
*
*        TYC CODES
*
TYCOK    EQU      1                 SUCCESS
TYCBOT   EQU      3                 LOAD POINT
TYCEOT   EQU      5                 END OF TAPE
TYCTM    EQU      6                 TAPE MARK (END OF FILE)
TYCERR   EQU      8                 ERROR
*
*        FLAGS
*
FLGRETRY EQU      X'8000'
FLGFOLOW EQU      X'4000'
FLGINTER EQU      X'2000'
FLGKEYNC EQU      X'800'
FLGHOLD  EQU      X'400'
*
*        ORDER CODES
*
RDBCODE  EQU      12                READ BACKWARD
SRBCODE  EQU      75                SPACE RECORD BACKWARD
SFBCODE  EQU      91                SPACE FILE BACKWARD
SECODE   EQU      99                SET ERASE
RWONCODE EQU      19                REWIND ON-LINE
RWOFCODE EQU      35                REWIND OFF-LINE
*
         PAGE
************************************
*   7T TAPE PRE-PROCESSOR          *
************************************
7TAP     EQU      %
         LI,R10   7TDOT
         B        COMLIST
*
*
************************************
         PAGE
************************************
*   7T TAPE POST-PROCESSOR         *
************************************
7TAPCU   EQU      %
         LB,R4    IOQ5,R3           GET CURRENT FUNCTION
         BAL,R0   RE:ENT
         ENABLE
         BAL,R7   NEWERCK           GENERAL ERROR TESTS
         B        7TAP05            POSSIBLE ERRORS FOUND
         LB,R7    VECT4,R4          NO ERRORS; GET INDEX FOR
*                                    NO ERROR CLEANUP
         B        MAGTAPE,R7        GO TO N0-ERROR-CLEANUP
7TAP05   EQU      %
         BAL,R15  NOTOPTST          CHK FOR ERRORS, NOT
*                                    DEPENDENT ON FUNCTION
*        IF WE RETURN HERE, NO INDEPENDENT ERRORS WERE FOUND.
*        ANALYZE THE FUNCTION DEPENDENT ERRORS.
*
         OR,R5    NONCORR           MAKE ALL 7T READS NON-CORRECTABLE
         LB,R7    VECT5,R4          GET INDEX FOR FUNCTION
*                                    DEPENDENT ERROR ANALYSIS
         LW,R4    IOQ8,R3           IS IT A DATA CHAINED CLIST
         BLZ      %+2               YES, IOCD'S ARE IN MPOOL
         LH,R4    DCT7,R1           GET CLIST AREA ADR
         SLS,R4   1                 MAKE IT A WORD ADR
         LB,R4    *R4               GET I/O ORDER FROM IOCD
         B        MTAPCU,R7         GO TO ERROR ANALYSIS
         PAGE
*
*        SPECIAL CHECK FOR 7T READ REVERSE RECOVERY
*
7TAP20   EQU      %
         LB,R5    IOQ5,R3           IS IT 7T REV RD
         CI,R5    FCRDPB1
         BGE      7TAP21            IT'S A REV RD SEQUENCE
         CB,R5    IOQ4,R3
         BNE      EXITRTY           NOT REV RD RECOVERY
7TAP21   EQU      %
         LB,R8    IOQ11,R3          7T REV RD RECOVERY
         BNEZ     EXITRTY           RETRY COUNT NOT ZERO
         LI,R5    FCOUT2            NO MORE RETRIES
         B        EXTSTORE          FINAL SRB BEFORE REPORTING ERROR
*
*
*
NONCORR  DATA     X'800'
*
         END

