*        CREATED 1/3/72 KDR         GG VERSION
         SYSTEM   UTS
RDCK     EQU      0                 REMOVE READ CHECK CODE
WTCK     SET      1
         DEF      TSIO
TSIO     EQU      %
*
         REF      SWAP%PRI
*
         REF      ;
 M:CLBGN,;
 MH:CLEND,;
 M:HLTIC,;
 M:WCKBCL,;
 M:WCKECL,;
 MB:#RTRY,;
 MB:SFC,;
 MB:SDI,;
 M:SNSDA,;
 JBUPVP,;
 JCLE,;
 JCLPA,;
 JCMAP,;
 JJITVP,;
 S:BECL,;
 S:ISUN,;
 S:JCL,;
 SB:OSUL,;
 UX:JIT,;
 UH:FLG2,;
 X1FE00,;
 Y01,;
 RCVPSD
         REF      XFFFF
         REF      HIGH
         REF      M7,M16,M17,M19,M21,M24
         REF      Y4
         REF      DCT13
         REF      DCT12,DCT16
         REF      M:SWPEND
         REF      NEWQ
         REF      S:#SWAP%DEV
         REF      S:IOEA%ADR
         REF,1    S:SECTOR
         DEF      ;
 #SWAP%DEV
         DEF      T:SENSE
         DEF      T:SEXIT
         DEF      T:SIO
         DEF      T:SIOEA
         REF      DOWTCK
         REF      JXBUFVP,JAJITVP,JDCBLL,JDCBUL
         REF      SCLLIM
         REF      ERRLOG
         REF      TIME
         DO       RDCK
         REF      JHSWPCK
         REF      DORDCK,RDCKDSP1,RDCKDSP2,RDCKDSP3,RDCKDSP4
         FIN
*
#SWAP%DEV EQU     S:#SWAP%DEV
IOEA%ADR EQU      S:IOEA%ADR
SECTOR   EQU      S:SECTOR
         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
         PAGE
************************************************************************
*        SWAPPER I/O ERROR CODES                                       *
*        ***********************                                       *
*  INTERPRETATION OF                                                   *
*  BYTE IN REGISTER 15                                                 *
*                                                                      *
*         80          SENSE NOT = SEEK ON WRITE                        *
*         81          READ CHECK NOT SATISFIED                         *
*         82          WRT CK ERR - BAD ORDER ETC 7 = WHERE ERROR OCCURED
*         83          NOT DONE WITH CL ON WRITE BUT NO STATUS BITS SET *
*         90          DEV UNUSUAL END OR IOP HALT SET & NO OTHER BITS  *
*         91          WRT CHECK NOT IN SYSTEM BUT TRYING TO DO IT      *
*         92          IN LOGGING SECTOR, IOCD POINTS BAD               *
*                                                                      *
*  0 1 2 3 4 5 6 7                                                     *
*                                                                      *
*  1                  SWAPPER IO ERRER                                 *
*                                                                      *
*    0 0              BITS 3-7 NOT STATUS INDICATORS BUT RATHER AS ABOVE
*    0 1              WRITE FCN    BITS 3-7 STATUS ERRORS AS BELOW     *
*    1 0              READ  FCN     '    '    '      '    '    '       *
*    1 1              WRT CK FCN    '    '    '      '    '    '       *
*                                                                      *
*        1            TRANSMISSION DATA ERROR -|                       *
*          1                '      MEM    '    |   THESE ARE           *
*            1        MEMORY ADDRESS      '     >  STRAIGHT FROM       *
*              1      IOP MEMORY          '    |   STATUS BITS 9-13    *
*                1    IOP CONTROL         '   -|                       *
************************************************************************
         PAGE
*************************************
*        RECORD
*
*CODE 20 = WA(IOCD)
*     21 = ODD STATUS WD
*
*************************************
         PAGE
*                                   INTERRUPT COMES IN
#RETRIES EQU      5
         BOUND    8
SENSE%ORDR        ;
         EQU      %                 SNESE ORDER TO GET CURRENT SECTOR
         GEN,8,24 4,BA(SECTOR)        POSITION.
         GEN,8,24 30,4
         REF      LOW
FCNSUBR  EQU      %-2
         DATA     ;
 RETRY,;          WRITE ERROR-RETRY
 WTCK0,;          WRITE OK-DO WRT CHK
 RETRY,;          READ ERROR-RETRY
 END,;            READ OK-DONE
 WRTAGN,;         WRT CHK ERROR-REWRITE
 WTCK1,;          WRT CHK OK-CONTINUE WRT CHK
 RETRY,;          READ USER,ERROR-RETRY
 RDCK0,;          READ USER,OK-READ CHK(SOFTWARE)
 RETRY,;          READ USER,ERR REREADING-RETRY
 RDCK1            READ USER,OK-CONTINUE REREADING
*
         PAGE
************************************************************************
*                                                                      *
*        START I/O ON SWAP RAD                                         *
*        R15 = LINK = ADDRESS TO RETURN TO WHEN I/O                    *
*        R6 = COMMAND LIST ADDRESS                                     *
*                                                                      *
************************************************************************
T:SIO    EQU      %                                                    *
         NOP
         LW,R4    R14               SWAP DEVICE TABLE INDEX
         STW,R6   M:CLBGN,R4        SAVE  BEGINING OF  CL ADDRESS
         STB,R7   MB:SFC,R4         SAVE   SWAP I/O FUNCTION CODE
*  IF WRT FCN, SET UP LASTDA & NWTCKINT FOR WRT CK
         CI,7     01
         BNE      TSI001
         LW,R5    M:HLTIC,R4        TIC TO HALT COMMAND
         AND,R5   XFFFF
         SLS,R5   1                 COUNTERACT NEXT INSTRUCTION
TSI001   EQU      %
         SLS,5    -1
         STH,R5   MH:CLEND,R4        SAVE  COMMAND LIST END ADDRESS
         SLS,5    1
         RD,0     0
         BCR,1    T3                SKIP IF SW 4 RESET
         PUSH     6,R14
         LW,2     6
        LB,15    *5
         AI,5     1
        CI,15    X'1E'
        BE       T4
** E **
         CW,5     2
         BNE      T4
         SCREECH  X'E'              SCREECH .E
T4       LI,3     8
** A **
         LB,3    *2,3
         BNEZ     T4C
SCR0A    SCREECH  X'A'              SCREECH .A
T4C      CI,3     2
         BG       SCR0A
         AI,5     -1
T1       LB,1     *2                CHECK FOR SEEK
** B **
T2       EQU      %
         CI,1     4
         BE       DONE
         CI,1     3
         BE       T2C
         SCREECH  X'B'              SCREECH .B
T2C      EQU      %
T33      LI,8     4
T35      EQU      %
         AI,2     2
         LW,1     0,2               CHECK BUFFER
         AND,1    M24
         SLS,1    -11
** C **
         CW,1     LOW
        REF      NPMC
         BGE      T35C
        CI,1     NPMC
         BE       T35B
         LW,R15   0,2
         LB,R15   R15               GET F.C.
         CI,R15   8                 IS IT A TIC
         BE       T35C              YES--NO S/C 'C'
SCR0C    SCREECH  X'C'              SCREECH .C
T35B     CI,3     2
         BE       SCR0C
T35C     CW,1     HIGH
         BG       SCR0C
         LB,1     *2
** A **
         CW,1     3                 ALL READ OR ALL WRITE
         BE       T35G
         SCREECH  X'A'              SCREECH .A
T35G     EQU      %
         AI,2     1
         LB,1     *2
         AI,2     -1
         CI,1     X'4C'             CHECK FOR NO CC
         BE       DON1
         AI,2     2
T20      EQU      %
         LB,1     *2                CHECK FOR TIC
         CI,1     8
         BE       T22
         MTW,-1   8
         BLEZ     T2
         CI,1     3
         BE       T2
         B        T35+1
T22      EQU      %
         LW,2     0,2
         AND,2     M21
         SLS,2    1
         B        T1
** D **
DONE     EQU      %
         LW,0     1,2
         LB,0     0
         CI,0     X'1E'
         BE       DON1
         SCREECH  X'D'              SCREECH .D
DON1     EQU      %
         LB,R2    MB:SFC,R4         I/O FUNCTION CODE
         BGZ      DON1C
SCR0F    SCREECH  X'F'              SCREECH .F
DON1C    CI,2     5
         BG       SCR0F
         PULL     6,R14
T3       EQU      %
         LI,R0    #RETRIES
         STB,R0   MB:#RTRY,R4        SAVE  # OF   RETRIES
         LW,0     6                 ADDRESS OF COMMAND LIST TO R0      *
         SLS,0    -1                FORM DOUBLEWORD ADR
         STW,15   IOEA%ADR          SAVE LINK AS END ACTION ADDRESS
DO%IO    EQU      %
         LW,14    4                 PUT RADX IN 14
         BAL,R15  SET%REG           SET REGS FOR NEWQ
         BAL,R11  NEWQ              QUEUE UP SWAP I/O REQUEST
         NOP                        RETURN IS +2
T:SEXIT  EQU      %
         PULL     R11               GET LINK
         B        *R11              RETURN TO IOQ CLEANUP
         PAGE
************************************************************************
*                                                                      *
*        SENSE CURRENT SECTOR POSITION OF SWAP RAD ROUTINE             *
*        LINK     R15                                                  *
*        TEMP     R5                                                   *
*        OUTPUT:
*                 R10 = CURRENT SECTOR POSITION                        *
*                                                                      *
************************************************************************
T:SENSE  EQU      %
         LI,0     DA(SENSE%ORDR)    DA OF COMMAND LIST FOR SENSE
         LW,R1    R15             SAVE LINK IN END ACTION REGISTER
         BAL,R15  SET%REG           SET UP REGISTERS FOR NEWQ
         LI,R0    T:SENSE%EA        SENSE END ACTION ADDRESS
         BAL,R11  NEWQ              CALL NEWQ
         NOP
         B        T:SEXIT           RETURN TO WHEREVER
*
T:SENSE%EA EQU    %
         PUSH     R11               SAVE CLEANUP LINK
         LI,R5    2                 BYTE OFFSET
         LB,10    SECTOR,5          GET CURRNENT SECTOR POSITION
         B        *R14              (R14)=END ACTION INFO FROM ABOVE
         PAGE
*
*        LOAD ARGUMENTS FOR NEWQ CALL
*
SET%REG  EQU      %
         LW,R2    R14               GET SWAP RAD SPECIAL TABLE INDEX
         STB,R2   R1                INCLUDE SWP TBL NDX IN END INFO
         LB,R12   MB:SDI,R2         GET SWAP RAD DCT INDEX
         LI,13    SWAP%PRI
         STH,13   12
         LW,R13   R0                COMMAND LIST ADDRESS
         OR,R13   Y4                FLAG TO IGNORE DISC PRE-HANDLER
         LI,R14   1                 ONE 5 SEC TIME OUT INCREMENT
         LI,R0    T:SIOEA           MOST PROBABLE END ACTION ADDRESS
         B        *R15              RETURN
         PAGE
************************************************************************
*                                                                      *
*        SWAP RAD I/O END ACTION ROUTINE                               *
*                                                                      *
************************************************************************
T:SIOEA  EQU      %                                                    *
         PUSH     R11               SAVE LINK
         LB,R4    R14                SWAP  DEVICE TABLE  INDEX
RDCK%RTRY EQU     %
         LB,R12   R12               I/O  TYPE  OF  COMPLETION
         CI,R12   1                  1 = NORMAL
         BE       ERCONT
*
         LD,2     DCT13,7           TDV STATUS
         LW,8     DCT12,7           IO ADDRESS.
         LI,3     X'1603'           ERROR LOG ENTRY CODE/COUNT.
         STH,3    8
         LW,9     TIME              TIME OF DAY
         INT,0    M:HLTIC,4
         LW,0     1                 ADDRESS OF SNSDA
         PUSH     14
         LB,14    14                DEVICE TABLE INDEX
         PUSH     10,11
         LW,12    M:SWPEND,4
         STW,12   M:SNSDA,4
         BAL,15   SET%REG
         LI,0     0
         MTH,-1   12
         BAL,11   NEWQ              SENSE
         NOP
         PULL     10,11
         BDR,0    %
         LW,10    M:SNSDA,4         SENSE INFORMATION.
         CW,10    M:SWPEND,4
         BL       %+2
         LI,10    -1                IF NOT A SWAPPER SEEK ADDRESS.
         LI,6     8
         BAL,5    ERRLOG
         LI,12    0
         PULL     14
ERCONT   EQU      %
         LW,8     2                 DCT13 STATUS
         LB,2     MB:SFC,4          FUNCTION CODE
         SLS,2    1
         AW,2     12
         LW,2     FCNSUBR,2
         B        *2
*
RETRY    EQU    %
         LB,R3     MB:SFC,R4          FUNCTION CODE
         MTB,-1 MB:#RTRY,4
         BEZ      N%ERRORS
RETRY:1  EQU      %
         LW,0     15
         B        DO%IO
*
END      EQU      %
         MTW,-1   #SWAP%DEV         WAIT FOR END ACTION ON ALL DEVICES
         BNEZ     T:SEXIT           OTHERWISE RETURN IMMEDIATELY
         B        *IOEA%ADR
         PAGE
*************************************
*        SET UP WRITE CHECK         *
*************************************
*
WTCK0    EQU      %
         DO       WTCK
         MTW,0    DOWTCK
         BEZ      END
*  JUST COMPLETED WRT, IF WRT CK DESIRED, SET UP FOR IT
         LI,8     03                WRT CK FCN
         STB,R8   MB:SFC,R4
         LW,R8    M:CLBGN,R4
         STW,R8   M:WCKBCL,R4
         B        WTCK2
WTCK1    EQU      %
*  RESTORE FLGS IN SHELL CL
         LW,R7    M:HLTIC,R4        TIC TO HALT COMMAND
         AND,R7   XFFFF             ADDRESS ONLY
         SLS,R7   1                 WANT WA
         CW,R7    M:WCKBCL,R4       TEST IF DONE WITH WRITE CHECK
         BE       END
         LW,R5    M:WCKECL,R4
         LI,2     12
         LB,8     *5,2
         AI,8     X'E'
         STB,8    *5,2              RESTORED WHERE DESTROYED BY INTR FLG
WTCK2    EQU      %
*  SET UP FOR NEXT SECTION OF WRT CK
         LI,2     12                DISP OF HALT FLGS FROM BEG OF ENTRY
         LI,12    08                TIC
         LI,13    04                HALT ORDER FOR WRT = SENSE
         LI,14    03                SEEK
         LI,15    01                WRITE
         LI,8     05                WRT CK
         LW,R6    M:WCKBCL,R4
WTCK3    EQU      %
*  IF ORDER IS TIC, SET WTCK ORDER-IF NOT,FIND OUT IF JIT OR USER
         CB,14    *6                IS THIS A SEEK
         BE       WTCK45            IF SO, SKIP IT
         CB,12    *6                IS THIS TIC
         BNE      WTCK4             NO
*  TIC - SAVE PRESENT POINTER TO CL & GET NEW
         LW,5     6                 SAVE PRESENT
         LW,6     0,6
         AND,6    M21
         SLS,6    1                 WA(NEXT SECTION OF CL)
         B        WTCK5
WTCK4    EQU      %
*  CHANGE WRITE TO WRITE CK AFTER SOME ERROR TESTS
         STB,8    *6                STORE WRTCK ORDER
WTCK45   EQU      %
         AI,6     2                 NEXT CL DBLWRD
         B        WTCK3
WTCK5    EQU      %
*  WHAT IS 1ST ORDER AFTER TIC
         CB,14    *6                IS IT SEEK
         BNE      WTCK7             SKIP IF ALL DONE
WTCK6    EQU      %
*  AFTER TIC ORDER WAS SEEK,IS CL JIT OR USER
         CLM,6    SCLLIM            IS CL IN SCL AREA IE. IS IT JIT
         BCR,9    WTCK45            YES CONTINUE PROCESSING
*  USER CL ENCOUNTERED SO SET INTERRUPT FLGS IN PREV JIT CL
         AI,5     -4
         LB,14    *5,2
         AI,14    -X'E'
         STB,14   *5,2              RESTORE FLAGS
WTCK7    EQU      %
         STW,R5   M:WCKECL,R4
         XW,R6    M:WCKBCL,R4
*  GO TO DO IO
         SLS,6    -1
         LW,14    4
         LW,0     6
         B        DO%IO
         PAGE
*                                 *
*        WRT IF WRT CK FAILS      *
*                                 *
*        IF WRT CK XMISSION ERR, RE WRITE THEN WRT CK
WRTAGN   EQU      %
         LI,2     1                 WRT ORDER
         LB,3     MB:SFC,4
         MTB,-1   MB:#RTRY,4        COUNT RETRIES
         BEZ      N%ERRORS          ALL THROUGH RETRYING..
         B        WRT2
WRT1     EQU      %
         PUSH     R11               SAVE CLEANUP LINK
         LI,2     5                 WRT CK ORDER
WRT2     EQU      %
         LB,14    14                RADX TO LO ORDR BYTE
         LW,R3    R15               COMMAND LIST ADR (RETURNED BY CLNUP)
         LW,R0    R15               SAVE FOR LATER
WRT3     EQU      %
         SLS,3    1
WRT4     EQU      %
         LB,1     *3
         CI,1     3                 IS IT SEEK
         BE       WRT5              YES
         CI,1     8                 IS IT TIC
         BNE      WRT7              NO WE MUST BE FINISHED
         LW,3     0,3               YES- GET DA OF NEXT PART OF CLIST
         AND,3    M21
         B        WRT3
WRT5     EQU      %
*        FOUND COMMAND TO CHANGE
         AI,3     2
         STB,2    *3                SET WRT OR WRT CK ORDER
         AI,3     1
         LC       *3                GET FLAGS
         BCR,2    WRT8              FINISHED IF NO CHAINING.
         AI,3     1                 YES DO MORE
         B        WRT4
WRT7     EQU      %
         CI,1     4                 IS IT A SENSE
         BNE      WRT5+1            NO, MUST BE WRITE.
*        FINISHED - SET LAST FLGS
         AI,3     1
WRT8     EQU      %
         LW,4     14                 GET RADX
         LD,8     DCT13,7           TDV STATUS W/CLIST ADR
         CI,2     5                 IS IT WRT CHK
         BE       RETRY:1
         BAL,R15  SET%REG           LOAD REGS FOR NEWQ
         LI,R0    WRT1              END ACTION ADDRESS FOR WRITE
         BAL,R11  NEWQ              Q I/O REQUEST
         NOP                        +2 RETURN FROM NEWQ
         B        T:SEXIT           ALL FOR NOW
         ELSE
         B        END
         FIN
*
         PAGE
*        READ CHECK USER            *
*
RDCK1    EQU      %
RDCK0    EQU      %
         LI,8     5
         STB,8    MB:SFC,4          SET FCN TO RD CK
         LI,8     #RETRIES
         STB,8    MB:#RTRY,4
*
         AND,7    M17
RDCK2 EQU      %
         LW,6     S:ISUN
         LI,2     0
         LOAD,5   UX:JIT,6
         SLS,5    9
         LW,13    JCLPA,5
         AW,13    JCLE,5            END OF CL
         DO       RDCK
         LW,6     5
         SLS,6    1
         AI,6     JHSWPCK
         LH,10    0,6
         AND,10   M16               GET INIT ID
         FIN
         LW,7     JCLPA,5
SICK1    EQU      %
         AI,7     2                 MEM ADR ENTRY OF CL
         LW,3     Y01
SICK2    EQU      %
         DO       RDCK
         LW,8     DORDCK
         BEZ      SICK6
*  LOOP, ONCE PER CL ENTRY IE PAGE
         CS,3     1,7               DON'T CHECK IF SKIP FLG SET
         BE       SICK6             YES, NO PHY PG ALLOC
         LW,5     0,7               GET BA OF MEM ADR
         SLS,5    -1
         AH,10    RDCKDSP1,5        COMPUTE CHECKSUM
         AH,10    RDCKDSP2,5
         AH,10    RDCKDSP3,5
         AH,10    RDCKDSP4,5
         FIN
SICK6    EQU      %
         STS,2    1,7               CLEAR NPMC FLG
SICK8    AI,7     2
         CW,7     13
         BGE      SICK7
         LB,8     *7
         CI,8     3
         BE       SICK8             SKIP SEEKS IN CLIST
         CI,8     8                 FINISHED IF TIC OR END CLIST
         BNE      SICK2
SICK7    EQU      %
         DO       RDCK
         LH,8     0,6
         AI,6     1                 NON-PURE  P FROM JIT
         AH,8     0,6
         CW,8     10                COMPARE WITH COMPUTED CKSUM
         BE       END               ALL RIGHT
         LB,7     MB:SDI,4
         STD,15   DCT13,7           SETUP CLIST ADDRESS
         B        RDCK%RTRY         AND RETRY.
         ELSE
         B        END
         FIN
         PAGE
*        FLAG ERRORED USER
*
N%ERRORS EQU      %
         AND,8    M16               TDV INFO FROM DCT13
         SLS,8    1
         CI,3     2
         BL       N%W0              WRITE ERR
         BE       N%R0              READ ERR
         CI,3     4
         BL       N%W0              WRT CHK ERR
         B        N%R0              READ ER
*
N%R0     EQU      %
         LW,1     S:ISUN
*
N%R2     EQU    %
         LI,15    X'96'             ERR READING PROCR
         CLM,8    SCLLIM
         BOL      N%R2C
         SCREECH  X'96'             SCREECH .96
N%R2C    CI,8     S:JCL
         BGE      N%R2F
         SCREECH  X'95'             SCREECH .95
N%R2F    EQU      %
         CI,8     S:JCL+8
         BG       N%R5
*
*      ERROR READING JIT OR AJIT
         LH,9     UH:FLG2,1
         OR,9     X1                BAD JIT
         STH,9    UH:FLG2,1
         B        END
*
*        ERROR READING USER
N%R5     EQU      %
         LB,12    *8
         CI,12    2                 IS IT READ ORDER
         BE       N%R6+1            YES
         CI,12    3                 IS IT SEEK
         BE       N%R6
         SCREECH  X'A'              SCREECH .A
*
N%R6     EQU      %
         AI,8     2
         LW,12    *8
         AND,12   M16               PAGE NR.
         LOAD,9   UX:JIT,1
         SLS,9    9
         AI,9     JCMAP
         LI,10    2
         LI,2     JXBUFVP
         LI,13    JAJITVP+1
*
N%R7     EQU      %
         CB,12    *9,2              PP IN CONTEXT AREA
         BE       N%R8              YES
         AI,2     1
         CW,2     13
         BNE      N%R7
         CI,2     JAJITVP+1         END SPARES OR JITS
         BNE      N%R9              NO.. END DCBS...
         LI,2     JDCBUL
         LW,13    *9,2              UPPER LIMIT OF DCBS
         AI,13    1
         LI,2     JDCBLL            BEGIN SEARCHING FOR
         LW,2     *9,2              ERROR IN HIS DCBS.
         B        N%R7
N%R9     EQU      %
         LI,10    4
*
N%R8     EQU      %
         LH,12    UH:FLG2,1
         OR,12    10
         STH,12   UH:FLG2,1
         AI,8     1
         LB,12    *8
         CI,12    X'20'             IS THERE CHAINING
         BAZ      END               NO
         AI,8     -1
         LI,12    #RETRIES
         STB,12   MB:#RTRY,4
         B        N%W7
         PAGE
*
N%W0     EQU      %
         LW,9     X1FE00
         LB,1     SB:OSUL
*
N%W3     EQU      %
         LD,12    S:BECL,1
         CW,8     12
         BL       N%W5              ERR NOT IN S:SCL
         AI,12    7
         CW,8     12                IS IT BTWN BCL,BCL+7
         BLE      N%W6              YES
*
N%W4     EQU      %
         CLM,13   SCLLIM
         BCR,9    N%W5
         CS,8     13
         BE       N%W6
*
N%W5     EQU      %
         BDR,1    N%W3
         SCREECH  X'93'             SCREECH .93; CAN'T FIND ERRD AREA
*
N%W6     EQU      %
         LB,1     SB:OSUL,1
         LH,12    UH:FLG2,1
         OR,12    X4
         STH,12   UH:FLG2,1
         LI,12    #RETRIES
         STB,12   MB:#RTRY,4
         LW,12    M:HLTIC,4
         AND,12   XFFFF
         SLS,12   1
         CW,8     12                FINISHED YET
         BE       END
         LB,12    *8                ORDER CODE
         CI,12    3
         BL       N%W7              ITS READ OR WRITE
         CI,3     3
         BNE      N%W7
         LW,13    M:WCKECL,4
         CI,12    5
         BNE      %+2
         AI,13    -2                ERROR ON WRITE CHECK
         CW,8     13
         BE       WTCK1             LAST IOCD IN CHAIN...
*
N%W7     EQU      %
         LI,1     5
*
N%W8     EQU      %
         AI,8     2
         LB,13    *8
         CI,13    3
         BE       N%W10
         CI,13    8
         BE       N%W10
         BDR,1    N%W8
         SCREECH  X'94'             SCREECH .94
N%W10    EQU      %
         SLS,8    -1
         LW,0     8
         B        DO%IO
         PAGE
TSIOSZ   EQU      %-TSIO
         END

