         PCC      0                                                             
*                                                                               
* THIS MODULE DESIGNED AND WRITTEN BY:                                          
*                                                                               
*                 GENE MALLORY                                                  
*                 5656 BUFFALO AVE.                                             
*                 VAN NUYS, CALIF.                                              
*                 91401                                                         
*                                                                               
*                 213-988-3975                                                  
*                                                                               
         DEF      A:DISC                                                        
         DEF      DPAK                                                          
         DEF      DPAKCU                                                        
         DEF      DISCIO                                                        
         DEF      DISCCU                                                        
         SYSTEM   SIG5P                                                         
         SYSTEM   OPTIONS                                                       
         PSYS     0                                                             
OLAYFLAG EQU      'DISC'                                                        
         SYSTEM   CPRMON                                                        
         TITLE    '** DISC - ROTATING MEMORY I/O HANDLERS **'                   
         TITLE    '** DISC - FIXED HEAD DISC HANDLER **'                        
*                                                                               
* 7202   128 TRACKS, 16 SECTORS/TRACK,  360 BYTE SECTORS                        
* 7203   256 TRACKS, 16 SECTORS/TRACK,  360 BYTE SECTORS                        
* 7204   512 TRACKS, 16 SECTORS/TRACK,  360 BYTE SECTORS                        
* 7232   512 TRACKS, 12 SECTORS/TRACK, 1024 BYTE SECTORS                        
* 7212    64 TRACKS, 82 SECTORS/TRACK, 1024 BYTE SECTORS                        
* 7251/2 408 TRACKS, 16 SECTORS/TRACK,  360 BYTE SECTORS                        
* 3214   256 TRACKS, 40 SECTORS/TRACK, 1024 BYTE SECTORS                        
*                                                                               
         PAGE                                                                   
************************************                                            
* DISC PRE-HANDLER                 *                                            
************************************                                            
A:DISC   RES      0                                                             
         DO       #RAD                                                          
DISCIO   RES      0                                                             
         LI,R10   DOTDC             GET DOT TABLE POINTER                       
         LB,R7    IOQ5,R3           CHECK FUNCTION VALIDITY                     
         CI,R7    FC11                                                          
         BG       EXITINC           TOO BIG                                     
         B        COMEXIT           AND BUILD I/O COMMAND LIST                  
*                                                                               
*****************                                                               
* CLIST USAGE   *                                                               
*****************                                                               
*                                                                               
*        WORD 0/1 RESERVED FOR CDW BUILDING                                     
*                                                                               
*        WORD 2/3 RESERVED FOR CDW BUILDING                                     
*                                                                               
*        WORD 4/5 RESERVED FOR 16 BYTES OF SENSE DATA FOR LOGGING               
*        WORD 6/7                                                               
*                                                                               
*                                                                               
*        LENGTH   8 WORDS FOR ALL SYSTEMS                                       
*                                                                               
         PAGE                                                                   
************************************                                            
* DISC POST-HANDLER                *                                            
************************************                                            
DISCCU   RES      0                                                             
         BAL,R9   NEWIOCK           IS THERE A NEED TO ANALYZE ERRORS           
         B        DISCERR           YES                                         
DISCOK   LI,R12   TYCOK                                                         
         LB,R7    IOQ5,R3           GET CURRENT FUNCTION STEP                   
         CI,R7    FC11              IS FC OK                                    
         BG       EXITINC           NO, ABORT                                   
         LH,R7    DCBT,R7                                                       
         B        DISCCU,R7         GO TO PROPER EXIT ROUTINE                   
         PAGE                                                                   
*************************************************************                   
* RAD ERROR ANALYSIS                                                            
*                                                                               
* R5     TDV STATUS HW RIGHT JUSTIFIED                                          
* R8     TIO STATUS HW RIGHT JUSTIFIED                                          
*                                                                               
DISCERR  RES      0                                                             
         DO       #DC3214                                                       
         LW,R0    DCTMOD,R1         GET MODEL NUMBER                            
         CW,R0    MDL3214           IS IT A 3214                                
         BE       TYPE3214          YES                                         
         FIN      #DC3214                                                       
         CI,R8    (BIT5+BIT6)**-16  IS CONTROLER READY                          
         BANZ     EXITHIOR          NO, HIO AND RETRY                           
*                                   YES                                         
         CI,R8    (BIT1+BIT2)**-16  IS DEVICE READY                             
         BAZ      DISCERR5          YES                                         
*                                   NO                                          
         CI,R8    BIT1**-16         IS IT NOT OPERATIONAL                       
         BAZ      EXITNO            YES                                         
         B        EXITHIOR          NO, HIO AND RETRY                           
         PAGE                                                                   
DISCERR5 RES      0                                                             
         CI,R5    (BIT10+BIT11+BIT12+BIT13)**-16 IOP ERROR                      
         BANZ     EXITHIOR          YES, HIO AND RETRY                          
*                                   NO                                          
         CI,R5    (BIT2)**-16       SECTOR UNAVAILABLE                          
         BANZ     EXITSNSR          YES, SENSE THEN INC STATUS                  
*                                   NO                                          
         CI,R5    (BIT3)**-16       WRITE PROTECT VIOLATION                     
         BANZ     EXITWP            YES, WRITE PROTECT MESSAGE                  
*                                   NO                                          
         CI,R8    BIT4**-16         UNUSUAL END                                 
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         LCF      DCT20,R1          ARE TDV CC = 00XX                           
         BCS,12   EXITHIOR          NO                                          
*                                   YES                                         
         CI,R5    BIT8**-16         INCORRECT LENGTH                            
         BANZ     DISCOK            YES, THIS IS NOT AN ERROR                   
         B        EXITHIOR          NO, INCONSISTANT STATUS                     
         PAGE                                                                   
         DO       #DC3214                                                       
*                                                                               
* DISC 3214 ERROR ANALYSIS                                                      
*                                                                               
* R5     TDV STATUS RIGHT JUSTIFIED                                             
* R8     TIO STATUS RIGHT JUSTIFIED                                             
*                                                                               
TYPE3214 RES      0                 DISC 3214 ERROR ANALYSIS                    
         LB,R0    DCT20,R1          GET TDV CC                                  
         SLS,R0   -6                SHIFT RIGHT TO GET CC1 AND CC1              
         CI,R0    1                 IS IT TEST MODE                             
         BE       EXITTM                                                        
         CI,R0    2                 IS IT BUSY                                  
         BE       EXITHIOR          YES, HIO AND RETRY                          
*                                   NO                                          
         LW,R9    R8                                                            
         SLS,R9   -9                POSITION CONTROLER STATE                    
         AND,R9   M2                AND MASK                                    
         CI,R9    3                 IS IT BUSY                                  
         BE       EXITHIOR          YES,HIO AND RETRY                           
*                                   NO                                          
         CI,R9    0                 IS IT OK                                    
         BNE      EXITNO            NO, NOT OPERATIONAL                         
*                                   YES,OK                                      
         LW,R9    R8                                                            
         SLS,R9   -13               POSITION DEVICE STATE                       
         AND,R9   M2                AND MASK                                    
         CI,R9    3                 IS IT BUSY                                  
         BE       EXITHIOR          YES, HIO AND RETRY                          
*                                   NO                                          
         CI,R9    0                 IS IT OK                                    
         BNE      EXITNO            NO, NOT OPERATIONAL                         
*                                   YES, OK                                     
         CI,R5    (BIT10+BIT11+BIT12+BIT13+BIT4+BIT5)**-16                      
         BANZ     EXITHIOR          VARIOUS ERRORS, HIO AND RETRY               
*                                   OK                                          
         CI,R5    BIT2**-16         PROGRAMMING ERROR                           
         BANZ     EXITSNSR          SENSE, THEN INC STATUS                      
*                                   OK                                          
         CI,R5    BIT3**-16         WRITE PROTECT                               
         BANZ     EXITWP            EXIT WRITE PROTECT VIOLATION                
*                                   NO                                          
         CI,R5    (BIT6+BIT7+BIT9)**-16 SEEK OR TDE PROBLEM                     
         BANZ     EXITHIOR          YES, HIO AND RETRY                          
*                                   NO                                          
         CI,R5    BIT8**-16         INCORRECT LENGTH                            
         BANZ     DISCOK            YES, NO ERROR                               
         B        EXITHIOR          NO, HIO AND RETRY                           
MDL3214  TEXT     '3214'                                                        
         FIN      #DC3214                                                       
         PAGE                                                                   
*                                                                               
* RADQ - RAD QUEUE OPTIMIZATION                                                 
*                                                                               
* R1-R3 AND R12-R15 ARE PRESERVED, R10-R11 CLEARED                              
*                                                                               
         DO       #RADQING                                                      
RADQ     RES      0                                                             
         MTB,0    DCT15,R1          IS STOP ALL COUNT POSITIVE                  
         BNEZ     EXITOK            YES, DONT TRY TO OPTIMIZE                   
*                                   NO                                          
         MTB,0    DCT14,R1          IS THERE A STOP BKG COUNT                   
         BNEZ     EXITOK            YES, DONT OPTIMIZE                          
*                                   NO                                          
         BAL,R0   RE:ENT            CHECK IF REENTERED AND RETRY IF SO          
         ENABLE                                                                 
         LB,R4    DCTDISCI,R1       GET DISC DEVICE INDEX                       
         PAGE                                                                   
*                                                                               
* R4 IS NOW RAD TYPE INDEX                                                      
*                                                                               
RADQ05   LI,R8    0                 BEST IOQ INDEX                              
         LI,R9    1000              DUMMY TRANSFER START TO BEAT                
*                                                                               
         LI,R11   -1                                                            
         LB,R6    DISCTSFT,R4       TRACK SHIFT                                 
         SLS,R11  0,R6              LEFT SHIFT MASK                             
         EOR,R11  M32               MASK INVERT                                 
         AND,R11  IOQ12,R3          GET SECTOR NUMBER                           
*                                                                               
         LB,R6    DISCSSFT,R4       GET SECTOR SHIFT                            
         LCW,R6   R6                MAKE IT NEGATIVE                            
         SLS,R11  0,R6              SHIFT BACK RIGHT JUSTIFIED                  
         PAGE                                                                   
*                                                                               
* R11 IS NOW START POSITION FOR CURRENT TRANSFER                                
* R8 IS THE BEST IOQ FOUND SO FAR (INITIALLY ZERO)                              
* R9 IS THE BEST START POSITION SO FAR (INITIALLY LARGE)                        
*                                                                               
         LH,R7    IOQ9,R3           GET BYTE COUNT                              
         AND,R7   M16                                                           
         BNEZ     %+2                                                           
         LI,R7    BIT15                                                         
         DO       #MAP                                                          
         LW,R6    IOQ8,R3           GET BUFFER PTR                              
         CW,R6    XBIT0             IS IT A DATA CHAIN REQUEST                  
         BAZ      %+2               NO, SKIP                                    
         BAL,R0   RADQ90            YES, COUNT UP DATA CHAIN                    
         FIN      #MAP                                                          
         LH,R0    DISCNWPS,R4       GET NUMBER OF WORDS/SECTOR                  
         SLS,R0   16+2              GET NUMBER OF BYTES/SECTOR IN LEFT HW       
*                                                                               
         AH,R7    R0                ROUND UP                                    
         AI,R7    -1                                                            
         DH,R7    R0                                                            
*                                                                               
         LB,R0    DISCNSPT,R4                                                   
         AI,R0    10                                                            
         SLS,R0   -4                SLOP FOR PROCESS TIME                       
         AW,R7    R0                                                            
         LW,R11   R7                PUT IN R11                                  
         PAGE                                                                   
*                                                                               
* R11 IS NOW FIRST POSITION THAT A NEW TRANSFER CAN START                       
*                                                                               
         LB,R5    CIT1,R2           GET CHAN Q START                            
         B        %+2                                                           
RADQ10   LB,R5    IOQ2,R5                                                       
         LI,R7    X'1FFFF'          MASK FOR CS                                 
         LW,R6    R5                                                            
         BEZ      RADQCHND          END OF CHAIN WHEN ZERO                      
         CS,R6    R3                IS THIS THE SAME Q ENTRY                    
         BE       RADQ10            YES, IGNORE THIS ONE                        
         LB,R6    IOQ7,R6           GET DCT INDEX                               
         CS,R6    R1                IS THIS THE SAME DEVICE                     
         BNE      RADQCHND          NO, STOP SEARCH HERE                        
         LW,R6    IOQ8,R5           GET BUFFER PTR                              
         CW,R6    XBIT1             IS IT AN IOEX ENTRY                         
         BANZ     EXITOK            YES, ABORT OPTIMIZER FOR IOEX               
         PAGE                                                                   
*                                                                               
* R5 IS NOW THE IOQ INDEX OF A NEW RAD TRANSFER                                 
*                                                                               
         LH,R7    IOQ9,R5           GET BYTE COUNT                              
         AND,R7   M16                                                           
         BNEZ     %+2                                                           
         LI,R7    BIT15                                                         
         DO       #MAP                                                          
         CW,R6    XBIT0             IS IT A DATA CHAIN REQUEST                  
         BAZ      %+2               NO, SKIP                                    
         BAL,R0   RADQ90            YES, ADD UP BYTE COUNTS                     
         FIN      #MAP                                                          
         LH,R0    DISCNWPS,R4       GET NUMBER OF WORDS/SECTOR                  
         SLS,R0   16+2              GET NUMBER OF BYTES/SECTOR IN LEFT HW       
*                                                                               
         AH,R7    R0                ROUND UP                                    
         AI,R7    -1                                                            
         DH,R7    R0                                                            
*                                                                               
         LB,R0    DISCNSPT,R4                                                   
         AI,R0    10                                                            
         SLS,R0   -4                SLOP FOR PROCESS TIME                       
         AW,R7    R0                                                            
         PAGE                                                                   
* R7 IS NOW LENGTH OF NEW TRANSFER                                              
         LI,R0    -1                                                            
         LB,R6    DISCTSFT,R4       TRACK SHIFT                                 
         SLS,R0   0,R6              LEFT SHIFT MASK                             
         EOR,R0   M32               MASK INVERT                                 
         AND,R0   IOQ12,R5          GET SECTOR NUMBER                           
*                                                                               
         LB,R6    DISCSSFT,R4       GET SECTOR SHIFT                            
         LCW,R6   R6                MAKE IT NEGATIVE                            
         SLS,R0   0,R6              SHIFT BACK RIGHT JUSTIFIED                  
         PAGE                                                                   
*                                                                               
* R6 IS NOW START POSITION                                                      
*                                                                               
RADQ40   RES      0                                                             
         CW,R6    R11               IS IT LESS THAN MINIMUM START               
         BGE      RADQ50            NO                                          
         LB,R0    DISCNSPT,R4       GET MODULO                                  
         AW,R6    R0                ADD IT IN                                   
         B        RADQ40            AND CHECK AGAIN                             
*                                                                               
RADQ50   RES      0                                                             
* R6 IS NOW ADJUSTED START POSITION                                             
*                                                                               
         AW,R7    R6                GET ADJUSTED END                            
         CW,R7    R9                IS IT UNDER OLD BEST                        
         BGE      RADQ10            NO, GET NEXT Q ENTRY                        
         LW,R8    R5                YES, SET NEW IOQ PTR                        
         LW,R9    R6                AND NEW START TO BEAT                       
         B        RADQ10            AND LOOK SOME MORE                          
****************************************************************                
RADQCHND CI,R8    0                 DID I FIND ANY                              
         BEZ      EXITOK            NO, EXIT                                    
         BAL,R0   RE:ENT            YES, INHIBIT                                
         STB,R8   DCT6,R1           SET IOQ PTR FOR INTER-OP                    
         AI,R12   FLGINTER          SET INTER-OP FLAG                           
         B        EXITCU                                                        
         PAGE                                                                   
****************************************************************                
*                                                                               
* THIS COMPUTES THE TRUE BYTE COUNT IN A DATA CHAIN REQUEST                     
*                                                                               
* R0 IS THE LINK                                                                
* R6 IS THE IOQ8 CONTENT                                                        
* R7 IS THE BYTE COUNT RETURNED                                                 
*                                                                               
         DO       #MAP                                                          
RADQ90   RES      0                                                             
         LI,R7    0                                                             
         SLS,R6   1                 MAKE CDW A WORD ADDR                        
         AI,R6    -1                FUDGE FOR FIRST PASS                        
RADQ95   AI,R6    2                 GO TO NEXT CDW                              
         AW,R7    *R6               ADD UP BYTE COUNT                           
         AND,R7   M24               MASK OFF BYTE COUNT ONLY                    
         LCF      *R6               GET FLAGS                                   
         BCS,8    RADQ95            LOOP IF ANY DATA CHAINING                   
         B        *R0               RETURN                                      
****************************************************************                
         FIN      #MAP                                                          
         FIN      #RADQING                                                      
         ELSE                                                                   
DISCIO   RES      0                                                             
DISCCU   B        EXITINC                                                       
         FIN      #RAD                                                          
         TITLE    '** DISC - MOVALBLE HEAD DISC PACK HANDLERS **'               
*                                                                               
* 7242/6 200 CYLINDERS, 20 TRACKS/CYL,  6 SECTORS/TRACK                         
* 7261   200 CYLINDERS, 20 TRACKS/CYL, 11 SECTORS/TRACK (DISC A)                
* 7266   400 CYLINDERS, 20 TRACKS/CYL, 11 SECTORS/TRACK (DISC B)                
* 7270   400 CYLINDERS, 20 TRACKS/CYL,  6 SECTORS/TRACK (DISC A BACKUP)         
* 7275   400 CYLINDERS, 19 TRACKS/CYL, 11 SECTORS/TRACK (DISC B BACKUP)         
* 3242/3 400 CYLINDERS, 2 TRACKS/CYL, 7 SECTORS/TRACK   DIABLO PACK             
* 3277   400 CYLINDERS, 19 TRACKS/CYL, 12 SECTORS/TRACK 3330 DISC               
* 3283   800 CYLINDERS, 19 TRACKS/CYL, 12 SECTORS/TRACK 6660 DISC               
************************************                                            
* DISC PACK PRE-HANDLER            *                                            
************************************                                            
         DO       #DISKPAK                                                      
DPAK     RES      0                                                             
         LI,R10   DOTDP                                                         
         LB,R7    IOQ5,R3           CHECK FUNCTION VALIDITY                     
         CI,R7    F48                                                           
         BG       EXITINC           TOO BIG                                     
         DO       #TBT=0                                                        
         B        COMEXIT                                                       
         ELSE                                                                   
         LB,R7    IOQ4,R3                                                       
         CB,R7    IOQ5,R3           IS THIS THE INITIAL FUNCTION                
         BNE      COMEXIT           NO                                          
*                                                                               
         LW,R7    IOQ12,R3          SEEK ADDRESS                                
         LH,R6    IOQ9,R3           BYTE COUNT OR CDW COUNT                     
         AND,R6   M16               MASK                                        
         BNEZ     %+2               IS BYTE COUNT MAX                           
         LI,R6    X'10000'          YES, FIX UP                                 
*                                                                               
         LH,R5    DCT7,R1           CLIST DW ADDRESS                            
*                                                                               
         BAL,R0   RE:ENT            CHECK FOR RE-ENTRANCE                       
         STD,R6   10,R5             STORE IN 6TH DW IN CLIST                    
         ENABLE                                                                 
*                                                                               
         LB,R5    IOQ4,R3           GET INITIAL FUNCTION CODE                   
         CI,R5    F07               IS IT INITIAL                               
         BLE      COMEXIT           YES, DONT TBT                               
*                                   NO, DO TBT                                  
         PAGE                                                                   
         AND,R7   M4                MASK OFF SECTORS                            
         BAL,R0   RE:ENT            CHECK IF RE-ENTERED & RETRY IF SO           
         ENABLE                                                                 
         LB,R5    DCTDISCI,R1       GET DISC DEVICE INDEX                       
         LB,R0    DISCNSPT,R5       AND GET SECTORS PER TRACK FOR IT            
         PAGE                                                                   
*                                                                               
* R0 IS THE SECTORS/TRACK                                                       
*                                                                               
         SW,R7    R0                                                            
         LCW,R7   R7                # OF SECTORS TO TRACK END                   
         SLS,R7   10                BYTE COUNT TO TRACK END                     
*                                                                               
         DO       #MAP                                                          
         LW,R5    IOQ8,R3                                                       
         CW,R5    Y8                IS THIS A DATA CHAINING REQUEST             
         BANZ     DCHAIN            YES                                         
*                                   NO                                          
         FIN      #MAP                                                          
         CW,R7    R6                WILL TRANSFER CROSS TRACK END               
         BGE      COMEXIT           NO                                          
*                                   YES                                         
         BAL,R0   RE:ENT            CHECK FOR RE-ENTRANCE                       
         STH,R7   IOQ9,R3           CHANGE BYTE COUNT                           
         PAGE                                                                   
TOVES    RES      0                                                             
         LB,R7    IOQ4,R3           GET FUNCTION CODE                           
         CI,R7    F15               IS IT TOO BIG                               
         BG       EXITINC           YES                                         
*                                   OK                                          
         LB,R7    TRACKFUN,R7       GET MODIFIES FUNCTION CODE                  
         STB,R7   IOQ5,R3           AND PUT IT IN                               
*                                                                               
         LB,R7    DCT5,R1           GET SWITCHES                                
         OR,R7    XBIT26            SET INTER-OP SO NOT TO LOSE DEVICE          
         STB,R7   DCT5,R1                                                       
         STB,R3   DCT6,R1           AND SET IOQ INDEX FOR INTER-OP              
         B        COMEXIT                                                       
         DO       #MAP                                                          
DCHAIN   RES      0                                                             
         LD,R8    0,R5              PICK UP CDW FROM DATA CHAIN                 
         AND,R9   M16               MASK OUT BYTE COUNT                         
         SW,R7    R9                AND SUBTRACT FROM TRACK COUNT               
         BLEZ     2TRACK            IF NEGATIVE, MULTI-TRACK                    
*                                   ELSE                                        
         AI,R5    1                 BUMP POINTER AND DECREMENT COUNT            
         BDR,R6   DCHAIN            LOOP IF NOT CHAIN END                       
         B        COMEXIT           OTHERWISE EXIT                              
         PAGE                                                                   
2TRACK   RES      0                                                             
         LD,R8    0,R5              CDW ON TRACK BOUNDRY                        
         AW,R9    R7                ADJUST BYTE COUNT                           
*                                                                               
         LH,R12   IOQ9,R3           INITIAL CDW COUNT                           
         LCW,R7   R7                MAKE EXCESS COUNT POSITIVE                  
         STH,R7   R12               AND PUT IN TOP OF R12                       
         LW,R13   IOQ12,R3          COMPLETE DW FOR STORE                       
*                                                                               
         LH,R7    DCT7,R1           CLIST POINTER                               
*                                                                               
         BAL,R0   RE:ENT            CHECK FOR RE-ENTRANCE                       
         STD,R12  10,R7                                                         
*                                                                               
         LD,R12   2,R5              GET NEXT CDW                                
         STD,R12  12,R7             AND SAVE IT                                 
*                                                                               
         ENABLE                     ALLOW INTERRUPTS                            
         BAL,R0   RE:ENT            AND CHECK RE-ENTRANCE AGAIN                 
*                                                                               
         STD,R8   0,R5              MODIFY DATA CHAIN                           
*                                                                               
         SW,R5    IOQ8,R3                                                       
         AI,R5    1                                                             
         STH,R5   IOQ9,R3           NEW CDW COUNT                               
*                                                                               
         B        TOVES                                                         
         FIN      #MAP                                                          
         FIN      #TBT                                                          
         FIN      #DISKPAK                                                      
         PAGE                                                                   
*                                                                               
* SENSE FOR LOG CDW BUILDER                                                     
*                                                                               
SENSELOG RES      0                                                             
         LH,R0    DCT7,R1           GET CLIST ADDR                              
         AI,R0    2                 POINT TO 3ED DW                             
         SLS,R0   3                 MAKE BYTE ADDR                              
         OR,R8    R0                OR IT IN                                    
         B        USECOM            AND STORE IT                                
         DO       #DISKPAK                                                      
*                                                                               
* HEADER READ CDW BUILDER                                                       
*                                                                               
HEADER   RES      0                                                             
         LH,R0    DCT7,R1           GET CLIST ADDR                              
         AI,R0    4                 POINT TO 5TH DW                             
         SLS,R0   3                 MAKE IT A BYTE ADDR                         
         OR,R8    R0                OR IT IN                                    
         B        USECOM            AND STORE IT                                
*                                                                               
* SEEK CDW BUILDER                                                              
*                                                                               
SEEK     RES      0                                                             
         AI,R9    X'100'            MAKE IT AN IOQ12 FORM                       
         OR,R4    Y8                SET FLAG FOR NOT BUSING CONTROLER           
         B        REPCOM            GO BACK THRU COMLIST                        
*                                                                               
         PAGE                                                                   
* CLIST USAGE   *                                                               
*****************                                                               
*                                                                               
*        WORD 0/1 RESERVED FOR CDW BUILDING                                     
*                                                                               
*        WORD 2/3 RESERVED FOR CDW BUILDING                                     
*                                                                               
*        WORD 4/5 RESERVED FOR 16 BYTES OF SENSE DATA FOR LOGGING               
*        WORD 6/7                                                               
*        WORD 8/9 RESERVED FOR HEADER READ DATA AREA                            
*                                                                               
*                                                                               
*        WORD A/B RESERVED FOR OLD BYTE COUNT AND SEEK ADDRESS                  
*                 FOR TRACK BY TRACK STEPPING                                   
*                                                                               
*        WORD C/D RESERVED FOR BROKEN DATA CHAIN DW IN TRACK BY                 
*                 TRACK STEPPING IN A MAPPED SYSTEM                             
*                                                                               
*        LENGTH   10 WORDS IF NO TRACK BY TRACK                                 
*                 12 WORDS IF TRACK BY TRACK, UNMAPPED                          
*                 14 WORDS IF TRACK BY TRACK, MAPPED                            
*                                                                               
*                                                                               
         PAGE                                                                   
************************************                                            
* DISC PACK POST HANDLER           *                                            
************************************                                            
DPAKCU   RES      0                                                             
         BAL,R9   NEWIOCK                                                       
         B        DPAKERR                                                       
DPAKOK   LB,R7    IOQ5,R3           GET CURRENT FUNCTION                        
         CI,R7    F48                                                           
         BG       EXITINC                                                       
         LB,R7    DPBT,R7                                                       
         DO       (#DP3277+#DP3283)>0                                           
         CI,R6    BIT7**-16         IS THERE A CORRECTED DEVICE ERROR           
         BAZ      DPJUMP,R7         NO, GO TO PROPER EXIT                       
*                                   YES                                         
         CI,R6    BIT5**-16         IS THERE A LOT OF CORRECTED ERRORS          
         BAZ      DPJUMP,R7         NO, FORGET ABOUT IT                         
*                                   YES                                         
         MTB,0    IOQ11,R3          ARE THERE ANY RETRIES LEFT                  
         BEZ      DPJUMP,R7         NO, GET IT NEXT TIME                        
         B        EXITHIOR          YES, TREAT AS AN ERROR TO GET LOGGED        
         ELSE                       NOT NS DISCS                                
         B        DPJUMP,R7         GO TO PROPER EXIT                           
         FIN                        NOT NS DISCS                                
         PAGE                                                                   
************************************                                            
* DISC PACK ERROR ANALYSIS         *                                            
*                                                                               
* R5     TDV STATUS HW RIGHT JUSTIFIED                                          
* R6     AIO STATUS HW RIGHT JUSTIFIED                                          
* R8     TIO STATUS HW RIGHT JUSTIFIED                                          
*                                                                               
DPAKERR  RES      0                 ANALYZE DISC PACK ERRORS                    
         CI,R6    BIT6**-16         IS IT A SEEK TIME-OUT (SEEK ONLY)           
         BANZ     EXITHIOR          YES, RETRY                                  
*                                   NO                                          
         CI,R6    BIT4**-16         IS IT AN ON-SECTOR INTERRUPT                
         BANZ     DPAKOK            YES                                         
*                                   NO                                          
         LB,R0    DCT20,R1          GET TDV CC                                  
         SLS,R0   -6                SHIFT RIGHT TO GET CC1 AND CC1              
         CI,R0    1                 IS IT TEST MODE                             
         BE       EXITTM                                                        
         CI,R0    2                 IS IT BUSY                                  
         BE       EXITHIOR          YES, HIO AND RETRY                          
*                                   NO                                          
         LW,R9    R8                                                            
         SLS,R9   -9                POSITION CONTROLER STATE                    
         AND,R9   M2                AND MASK                                    
         CI,R9    3                 IS IT BUSY                                  
         BE       EXITHIOR          YES,HIO AND RETRY                           
*                                   NO                                          
         CI,R9    0                 IS IT OK                                    
         BNE      EXITNO            NO, NOT OPERATIONAL                         
*                                   YES,OK                                      
         LW,R9    R8                                                            
         SLS,R9   -13               POSITION DEVICE STATE                       
         AND,R9   M2                AND MASK                                    
         CI,R9    3                 IS IT BUSY                                  
         BE       JUSTBUSY          BUSY IS OK FOR 3277/3283                    
*                                   NO                                          
         CI,R9    0                 IS IT OK                                    
         BNE      EXITNO            NO, NOT OPERATIONAL                         
*                                   YES, OK                                     
JUSTBUSY RES      0                                                             
         CI,R5    (BIT10+BIT11+BIT12+BIT13)**-16  IOP OK                        
         BANZ     EXITHIOR          NO                                          
*                                   YES                                         
         CI,R5    BIT2**-16         IS IT SECTOR UNAVAILABLE                    
         BANZ     SECTORUN          YES, ERROR                                  
*                                   NO                                          
         LB,R0    DCT4,R1           GET DEVICE TYPE                             
         DO       (#DP7246+#DP7270)>0                                           
         CI,R0    12                IS IT A 7240 TYPE                           
         BE       TYPE7240          YES                                         
*                                   NO                                          
         FIN                                                                    
         DO       (#DP7261+#DP7266+#DP7275+;                                    
                  #DP3242+#DP3243+#DP3277+#DP3283)>0                            
         CI,R0    14                IS IT A 7260 TYPE                           
         BE       TYPE7260          YES                                         
*                                   NO                                          
         FIN                                                                    
         B        EXITINC                                                       
         PAGE                                                                   
* 7240 CONTROLER DEPENDENT ERROR ANALYSIS                                       
         DO       (#DP7246+#DP7270)>0                                           
TYPE7240 RES      0                 ERROR ANALYSIS FOR 7440 CONTROLER           
         CI,R5    (BIT4+BIT6+BIT7)**-16  ANY SEEK PROBLEM                       
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         CI,R5    BIT1**-16         FLAWED TRACK                                
         BANZ     EXITFXXK          MAYBE                                       
         CI,R5    BIT9**-16         TRANSMISSION DATA ERROR                     
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         CI,R8    BIT4**-16         UNUSUAL END                                 
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         CI,R5    BIT8**-16         INCORRECT LENGTH                            
         BANZ     DPAKOK            YES, THIS IS NOT AN ERROR                   
         B        EXITHIOR          INCONSISTANT STATUS                         
*********                                                                       
EXITFXXK RES      0                                                             
         LH,R5    DCT7,R1           GET CLIST PTR                               
         SLS,R5   3                 MAKE A BYTE ADDR                            
         LB,R5    0,R5              GET ORDER                                   
         CI,R5    4                 IS A SENSE ORDER                            
         BE       DPAKOK            YES,IGNORE                                  
         B        EXITFLAW          NO, ITS A REAL FLAWED TRACK                 
         FIN      7240 CONTROLER                                                
         PAGE                                                                   
         DO       (#DP7261+#DP7266+#DP7275+;                                    
                  #DP3242+#DP3243+#DP3277+#DP3283)>0                            
* 7260 CONTROLER DEPENDENT ERROR ANALYSIS                                       
TYPE7260 RES      0                 ERROR ANALYSIS FOR 7460 CONTROLER           
         CI,R5    (BIT4+BIT5)**-16  SEEK PROBLEM                                
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         CI,R5    BIT3**-16         WRITE PROTECT VIOLATION                     
         BANZ     EXITWP            YES                                         
*                                   NO                                          
         CI,R5    (BIT6+BIT7)**-16  HEADER PROBLEM                              
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         CI,R5    BIT1**-16         FLAWED TRACK                                
         BANZ     EXITFLAW          YES                                         
         CI,R5    BIT9**-16         TRANSMISSION DATA ERROR                     
         BANZ     EXITHIOR          YES                                         
*                                   NO                                          
         CI,R5    BIT8**-16         INCORRECT LENGTH                            
         BANZ     DPAKOK            YES, THIS IS NOT AN ERROR                   
         B        EXITHIOR          NO, INCONSISTANT STATUS                     
         FIN                                                                    
         PAGE                                                                   
* FLAWED TRACK EXIT                                                             
EXITFLAW RES      0                                                             
         LB,R5    IOQ4,R3           GET INITIAL FUNCTION                        
         DO       #TBT                                                          
         CI,R5    F07               IS IT A TBT FUNCTION                        
         BLE      TRYTBT            NO, GO TRY ONE                              
*                                   YES, TRY TO DO FLAWED TRACK                 
         FIN      #TBT                                                          
         CI,R5    F23               IS IT TOO BIG                               
         BG       EXITINC           YES                                         
*                                   OK                                          
         LB,R5    FLAWFUN,R5        GET FLAWED FUNCTION RECOVERY                
         B        EXITFI5           FOLLOW-ON, INTER-OP TO R5                   
         PAGE                                                                   
* NEXT TRACK EXIT                                                               
         DO       #TBT                                                          
EXITNEXT RES      0                                                             
         DO       #MAP                                                          
         LW,R5    IOQ8,R3                                                       
         CW,R5    Y8                IS THIS A DATA CHAIN REQUEST                
         BAZ      NOCHAIN           NO                                          
*                                   YES                                         
         AH,R5    IOQ9,R3           DW PTR TO LAST TIC IN CHAIN                 
         LD,R10   -2,R5             GET PREVIOUS CDW                            
*                                                                               
         SCS,R11  16                PUT BYTE COUNT IN TOP HALF                  
         AH,R10   R11               AND ADD IT TO THE ADDRESS                   
*                                                                               
         SCS,R6   16                PUT REMAINING BYTE COUNT IN LOW HAL         
         STH,R6   R11               AND USE IT AS NEW BYTE COUNT                
         SCS,R11  -16               RESTORE CDW FORMAT                          
         SLS,R6   -16               MASK OFF CDW COUNT                          
*                                                                               
         BAL,R0   RE:ENT            CHECK FOR RE-ENTRANCE                       
*                                                                               
         STD,R10  -2,R5             PUT MODIFIED CDW BACK IN CHAIN              
         STD,R8   0,R5              AND RESTORE CDW CLOBBERED BY TIC            
*                                                                               
         CI,R11   X'FFFF'           IS RBC ZERO                                 
         BAZ      NOCHAIN           YES                                         
*                                   NO                                          
         AI,R6    1                 BUMP CDW COUNT                              
         BAL,R0   RE:ENT                                                        
         MTW,-1   IOQ8,R3           TO DECREMENT DATA CHAIN PTR                 
         PAGE                                                                   
NOCHAIN  RES      0                                                             
         FIN      #MAP                                                          
         LH,R5    IOQ9,R3           BYTE COUNT                                  
         AND,R5   M16               REMOVE SIGN BITS                            
         SW,R6    R5                NEW IOQ9 VALUE                              
         BAL,R11  NEXTTRK           COMPUTE NEXT TRACK ADDR                     
         BAL,R0   RE:ENT            CHECK REENTRANCE                            
*                                                                               
         AWM,R5   IOQ8,R3           ADJUST BYTE ADDRESS                         
         STW,R7   IOQ12,R3          SEEK ADDRESS                                
         STH,R6   IOQ9,R3           BYTE COUNT                                  
*                                                                               
         LB,R6    IOQ10,R3          INITIAL RETRY COUNT                         
         STB,R6   IOQ11,R3          BACK TO CURRENT COUNT                       
* FOLLOW-ON TO INITIAL FUNCTION AND EXIT                                        
         LB,R5    IOQ4,R3           GET INITIAL FUNCTION                        
         B        EXITF5                                                        
         FIN      #TBT                                                          
         PAGE                                                                   
* SECTOR UNAVAILABLE (CYLINDER OVERFLOW OR BAD SEEK ADDR)                       
SECTORUN RES      0                 SECTOR UNAVAILABLE                          
         DO       #TBT                                                          
         LB,R5    IOQ4,R3           GET INITIAL FUNCTION CODE                   
         CI,R5    F07               IS IT INITIAL                               
         BG       EXITSNSD          NO, SENSE THEN INC STATUS                   
         DO       #FASTCYL                                                      
         LB,R4    DCTDISCI,R1       GET DISC INDEX                              
*                                                                               
         LI,R5    -1                                                            
         LB,R7    DISCCSFT,R4       CYLINDER SHIFT VALUE                        
         SLS,R5   0,R7              SHIFT MASK OVER                             
         EOR,R5   M32               INVERT MASK                                 
         AND,R5   IOQ12,R3          GET TRACK NUMBER                            
         LB,R7    DISCTSFT,R4       GET TRACK SHIFT VALUE                       
         LCW,R7   R7                NEGATE                                      
         SLS,R5   0,R7              GET TRACK NUMBER RIGHT JUSTIFIED            
* R5 IN NOW THE START TRACK NUMBER                                              
         LCW,R5   R5                NEGATE                                      
         AH,R5    DISCNTPC,R4       ADD # OF TRACKS/CYL                         
* R5 IS NOW THE REMAINING TRACKS IN THIS CYLINDER                               
         LB,R7    DISCNSPT,R4       # OF SECTORS/TRACK                          
         MW,R5    R7                TO GET # OF SECTORS TO CYL END              
* R5 IS THE NUMBER OF SECTORS IN THOSE TRACKS                                   
         LI,R6    -1                                                            
         LB,R7    DISCTSFT,R4       TRACK SHIFT VALUE                           
         SLS,R6   0,R7              POSITION MASK                               
         EOR,R6   M32               INVERT                                      
         AND,R6   IOQ12,R3          GET SECTOR NUMBER                           
         LB,R7    DISCSSFT,R4       GET SECTOR SHIFT                            
         LCW,R7   R7                NEGATE                                      
         SLS,R6   0,R7              AND POSITION SECTOR #                       
* R6 IS THE STARTING SECTOR NUMBER                                              
         SW,R5    R6                # OF SECTORS TO CYLINDER END                
         LH,R7    DISCNWPS,R4       # OF WORDS/SECTOR                           
         SLS,R7   2                 # OF BYTES/SECTOR                           
         MW,R5    R7                                                            
* R5 IS NOW THE NUMBER OF BYTES TO END OF CYLINDER                              
         LW,R8    IOQ8,R3           IS IT A DATA CHAIN                          
         DO1      #MAP                                                          
         BLZ      DCCYLEND          YES  (BIT0 INDICATES DATA CHAIN)            
*                                   NO                                          
         LH,R9    IOQ9,R3           GET BYTE COUNT                              
         AND,R9   M16               REMOVE SIGN BITS                            
         BNEZ     %+2               ZERO                                        
         LI,R9    X'10000'          MAX BYTE COUNT IF ZERO                      
*                                                                               
         SW,R9    R5                GET NEW BYTE COUNT                          
         BLEZ     EXITSNSD          MAJOR ERROR, IM LOST                        
*                                                                               
         BAL,R0   RE:ENT            INHIBIT                                     
         STH,R9   IOQ9,R3           NEW BYTE COUNT                              
*                                                                               
         AW,R8    R5                FORM NEW BYTE ADDRESS                       
         STW,R8   IOQ8,R3           AND SAVE IT                                 
NEXTCYL  RES      0                                                             
         LW,R8    IOQ12,R3          GET OLD SEEK ADDRESS                        
         LB,R7    DISCCSFT,R4       GET CYLINDER SHIFT                          
         LCW,R7   R7                COMPLIMENT FOR A RIGHT SHIFT                
         SLS,R8   0,R7              ALIGN CYLINDERS                             
         AI,R8    1                 BUMP CYLINDER NUMBER                        
         LCW,R7   R7                COMPLIMENT FOR LEFT SHIFT                   
         SLS,R8   0,R7              RE-POSITION CYLINDERS                       
         STW,R8   IOQ12,R3          AND SAVE IT                                 
*                                                                               
         LB,R5    IOQ4,R3           GET INITIAL FUNCTION                        
         B        EXITF5            AND FOLLOW ON TO IT AGAIN                   
         PAGE                                                                   
         DO       #MAP                                                          
* R5 IS THE # OF BYTES TO CYLINDER END                                          
DCCYLEND RES      0                 DATA CHAIN CASE                             
         LW,R7    IOQ8,R3           CDW DW PTR                                  
         LH,R6    IOQ9,R3           CDW COUNT                                   
*                                                                               
DCCYLOOP RES      0                                                             
         LD,R8    0,R7              GET A CDW                                   
         LI,R0    X'FFFF'           BYTE COUNT MASK                             
         AND,R0   R9                GET BYTE COUNT                              
         BNEZ     %+2               SKIP IF NON-ZERO                            
         LI,R0    X'10000'          ZERO IS MAX BYTE COUNT                      
*                                                                               
         CW,R0    R5                COMPARE TO AMOUNT TRANSFERED                
         BG       THISCDW           BRANCH IF IT IS THIS CDW                    
*                                   NOT THIS ONE                                
         SW,R5    R0                REMAINING BYTE COUNT                        
         AI,R7    1                 BUMP CDW PTR                                
         BDR,R6   DCCYLOOP          GO ON DOWN DC CHAIN                         
         B        EXITSNSD          MAJOR ERROR IF RUN OFF END                  
********                                                                        
THISCDW  RES      0                                                             
         SW,R9    R5                                                            
         AW,R8    R5                ADJUST CDW                                  
*                                                                               
         BAL,R0   RE:ENT            INHIBIT                                     
*                                                                               
         STD,R8   0,R7              RESTORE CDW                                 
         STW,R7   IOQ8,R3           RESTORE CDW PTR                             
         STH,R6   IOQ9,R3           RESTORE COUNT                               
         B        NEXTCYL           AND BUMP CYLINDER                           
         FIN      #MAP                                                          
         FIN      #FASTCYL                                                      
         PAGE                                                                   
* TRY TRACK BY TRACK IF FLAW OR CYLINDER OVERFLOW                               
TRYTBT   RES      0                 TRY TRACK BY TRACK                          
         LB,R5    TRACKFUN,R5       GET INITIAL TBT FUNCTION                    
         BAL,R0   RE:ENT                                                        
         STB,R5   IOQ4,R3           CHANGE INITIAL FUNCTION                     
         B        EXITF5            AND GO TO IT                                
         ELSE                                                                   
         B        EXITSNSD          SENSE THEN INC STATUS                       
         FIN      #TBT                                                          
         PAGE                                                                   
DPJUMP   RES      0                 BASE FOR JUMP TABLE                         
ALTER    RES      0                                                             
         LH,R7    DCT7,R1                                                       
         LD,R8    8,R7              GET HEADER                                  
*                                                                               
         LB,R8    R8                GET FLAW BYTE                               
         CI,R8    X'80'             IS A FLAW BYTE FOR SURE                     
         BAZ      EXITHIOR          NO, SOME STRANGE ERROR CASE                 
*                                   YES                                         
         DO       (#DP3242+#DP3243)>0 CARTRAGE DISC                             
         LW,R0    DCTMOD,R1         GET MODEL #                                 
         SLS,R0   4                                                             
         SLS,R0   -(8+4)                                                        
         CI,R0    X'3F2F4'          IS IT A 324X DEVICE                         
         BNE      NOT324X           NO                                          
*                                   YES                                         
         BAL,R0   RE:ENT                                                        
         STW,R9   IOQ12,R3          R9 IS THE ALTERNATE SEEK ADDRESS            
         B        EXITF             GO RE-SEEK                                  
         PAGE                                                                   
NOT324X  RES      0                                                             
         FIN                        END OF CARTRAGE DISC                        
         AND,R9   FFFF00                                                        
         DO       (#DP7261+#DP7266+#DP7270+#DP7275)>0                           
         CI,R9    BIT16             IS THERE A HIGH ORDER CYLINDER BIT          
         BAZ      NOHIBIT           NO                                          
*                                   YES                                         
         OR,R9    XBIT7             MOVE BIT                                    
         EOR,R9   XBIT16                                                        
         FIN                                                                    
*                                                                               
NOHIBIT  LI,R8    X'FF'                                                         
         AND,R8   IOQ12,R3          GET SECTOR                                  
*                                                                               
         OR,R8    R9                FORM NEW SEEK ADDRESS                       
         BAL,R0   RE:ENT                                                        
         STW,R8   IOQ12,R3          PUT IT IN IOQ12                             
*                                                                               
         B        EXITF                                                         
*                                                                               
FFFF00   DATA     X'FFFF00'                                                     
*                                                                               
         PAGE                                                                   
* TRACK DONE                                                                    
         DO       #TBT                                                          
EXITTD   RES      0                                                             
         LB,R5    IOQ4,R3           GET INITIAL FUNCTION CODE                   
         CI,R5    F07               IS IT A TRACK FUNCTION                      
         BLE      EXITDONE          NO, DONE                                    
*                                   YES, CHECK FOR MORE                         
         LH,R5    DCT7,R1           CLIST POINTER                               
         LD,R6    10,R5             GET SAVED BYTE COUNT AND SEEK               
         DO1      #MAP                                                          
         LD,R8    12,R5             PICK UP SAVED CDW                           
*                                                                               
         LH,R0    IOQ9,R3           GET BYTE COUNT                              
         AND,R0   M16               REMOVE SIGN BITS                            
         CW,R6    R0                IS THERE MORE TO DO                         
         BNE      EXITNEXT          MORE TO DO                                  
*                                   DONE                                        
EXITDONE LI,R12   TYCOK             SET FLAG TO COMPLETION OK                   
         BAL,R0   RE:ENT            CHECK FOR RE-ENTRANCE                       
         B        DISQ              AND DO DISC QUEUING                         
         FIN      #TBT                                                          
*                                                                               
         PAGE                                                                   
*                                                                               
* DISQ - DISC QUEUE OPTIMIZATION                                                
*                                                                               
* R1-R3 AND R11-R15 ARE PRESERVED                                               
*                                                                               
         DO       #DISQING                                                      
         DO1      #TBT=0                                                        
EXITTD   RES      0                                                             
DISQ     RES      0                                                             
         DO       #DP3243                                                       
         LW,R0    DCTMOD,R1         GET MODEL #                                 
         CW,R0    MDL3243           IS IT A 3243                                
         BE       EXITOK            YES, DONT TRY TO ARM QUEUE                  
*                                   NO                                          
         FIN      #DP3243                                                       
         MTB,0    DCT15,R1          IS STOP ALL COUNT POSITIVE                  
         BNEZ     EXITOK            YES, DONT TRY TO OPTIMIZE                   
*                                   NO                                          
         MTB,0    DCT14,R1          IS THERE A STOP BKG COUNT                   
         BNEZ     EXITOK            YES, DONT OPTIMIZE                          
*                                   NO                                          
         LI,R8    0                 BEST IOQ INDEX                              
         LW,R9    XBIT1             DUMMY BEST START TO BEAT                    
         LW,R7    IOQ12,R3          GET SEEK ADDR                               
         BAL,R11  NEXTTRK           COMPUTE NEXT TRACK                          
         LW,R11   R7                AND PUT IT IN R11                           
         PAGE                                                                   
*                                                                               
* R11 IS NOW MINIMUM START POSITION FOR NEXT TRANSFER                           
* R8 IS THE BEST IOQ FOUND SO FAR (INITIALLY ZERO)                              
* R9 IS THE BEST START POSITION SO FAR (INITIALLY LARGE)                        
*                                                                               
         LB,R5    CIT1,R2           GET CHAN Q START                            
         B        %+2                                                           
DISQ10   LB,R5    IOQ2,R5                                                       
         LI,R7    X'1FFFF'          MASK FOR CS                                 
         LW,R6    R5                                                            
         BEZ      DISQCHND          END OF CHAIN WHEN ZERO                      
         CS,R6    R3                IS THIS THE SAME Q ENTRY                    
         BE       DISQ10            YES, IGNORE THIS ONE                        
**********************************************************                      
* INSERT THIS CODE TO PREVENT OUT-OF-PRIORITY ARM QUEUING                       
**********************************************************                      
         DO       0                                                             
         LW,R6    R8                GET PREVIOUS IOQ INDEX                      
         BEZ      DISQ15            FORGET IT IF ZERO                           
         LB,R6    IOQ14,R6          GET PRIORITY OF PREVIOUS ENTRY              
         CB,R6    IOQ14,R5          IS IT THE SAME OF THIS ONE                  
         BNE      DISQCHND          NO, STOP OPTIMIZER                          
DISQ15   RES      0                                                             
         FIN                                                                    
*                                                                               
         LB,R6    IOQ7,R6           GET DCT INDEX                               
         CS,R6    R1                IS THIS THE SAME DEVICE                     
         BNE      DISQ10            NO, IGNORE                                  
         LW,R6    IOQ8,R5           GET BUFFER PTR                              
         CW,R6    XBIT1             IS IT AN IOEX ENTRY                         
         BANZ     EXITHIO           YES, ABORT OPTIMIZER FOR IOEX               
         PAGE                                                                   
*                                                                               
* R5 IS NOW THE IOQ INDEX OF A NEW DISC TRANSFER                                
*                                                                               
         LW,R6    IOQ12,R5          GET SEEK ADDR                               
         SW,R6    R11               SUBTRACT MINIMUM START                      
         BEZ      DISQSTRT          GOOD ENOUGH TO START HERE                   
         BGZ      %+2               OK IF POS                                   
         AW,R6    XBIT2             IF NEG, MAKE POSITIVE                       
*                                                                               
* R6 IS NOW ADJUSTED START ADDR OF NEW TRANSFER                                 
*                                                                               
         CW,R6    R9                IS IT UNDER OLD BEST                        
         BGE      DISQ10            NO, GET NEXT Q ENTRY                        
         LW,R8    R5                YES, SET NEW IOQ PTR                        
         LW,R9    R6                AND NEW START TO BEAT                       
         B        DISQ10            AND LOOK SOME MORE                          
****************************************************************                
DISQSTRT LW,R8    R5                FUDGE NEW IOQ PTR                           
DISQCHND CI,R8    0                 DID I FIND ANY                              
         BEZ      EXITHIO           NO, EXIT                                    
         BAL,R0   RE:ENT            YES, INHIBIT                                
         STB,R8   DCT6,R1           SET IOQ PTR FOR INTER-OP                    
         AI,R12   FLGINTER          SET INTER-OP FLAG                           
         B        EXITHIO           AND CLEANUP                                 
****************************************************************                
MDL3243  TEXT     '3243'                                                        
         FIN      #DISQING                                                      
         PAGE                                                                   
         DO       (#TBT+#DISQING)>0                                             
*                                                                               
* INCREMENT A DISK SEEK ADDRESS TO NEXT TRACK, SECTOR 0                         
*                                                                               
* R4     WORKING                                                                
* R7     SEEK ADDR                                                              
* R10    WORKING                                                                
* R11    LINK                                                                   
* OTHERS SAVED                                                                  
*                                                                               
NEXTTRK  RES      0                                                             
         LB,R4    DCTDISCI,R1       GET DISC DEVICE INDEX                       
         LCH,R10  DISCNTPC,R4       GET  -(TRACKS PER CYLINDER)                 
*                                                                               
* R10 IS THE NUMBER OF TRACKS/CYLINDER                                          
*                                                                               
         SLS,R10  8                                                             
         AI,R10   X'10100'                                                      
         AND,R7   YFFFFFF           MASK OFF SECTORS                            
         AW,R7    R10               ADD A TRACK                                 
         CI,R7    X'FF00'           WAS THERE A CARRY                           
         BAZ      *R11              YES, DONE                                   
         LCW,R10  R10               NO                                          
         AI,R10   X'100'                                                        
         AW,R7    R10               SUBTRACT OFF NOISE BITS                     
         B        *R11                                                          
         FIN      NEXTTRK                                                       
         ELSE                                                                   
DPAK     RES      0                                                             
DPAKCU   B        EXITINC                                                       
         FIN      #DISKPAK                                                      
         TITLE    '** DISC - POST HANDLER STANDARD EXITS **'                    
* FOLLOW ON ONLY                                                                
EXITF    RES      0                                                             
         LI,R12   FLGFOLOW                                                      
         B        EXITCU                                                        
* FOLLOW ON WITH INTER OP SET                                                   
EXITFI   RES      0                                                             
         LI,R12   FLGFOLOW+FLGINTER                                             
         B        EXITCU                                                        
* FOLLOW ON TO FUNCTION IN R5                                                   
EXITF5   RES      0                                                             
         LI,R12   FLGFOLOW                                                      
         B        EXIT5F                                                        
* FOLLOW ON WITH INTER OP TO FUNCTION IN R5                                     
EXITFI5  RES      0                                                             
         LI,R12   FLGFOLOW+FLGINTER                                             
EXIT5F   BAL,R0   RE:ENT                                                        
         STH,R5   DCT17,R1                                                      
         B        EXITCU                                                        
* I/O INCONSISTANCY                                                             
EXITINC  RES      0                                                             
         LI,R13   MSG2                                                          
         LI,R12   TYCINCST+FLGMSG                                               
         B        EXITHIO                                                       
         PAGE                                                                   
* LOG SENSE DATA AND FOLLOW ON EXIT                                             
EXITLSF  RES      0                                                             
         DO       #ERRORLOG                                                     
         MTW,0    LOGFLAG           IS ERROR LOGGING ON                         
         BEZ      EXITLSFX          BRANCH IF NO LOGGONG                        
*                                                                               
         BAL,R0   RE:ENT                                                        
         LW,R7    IOQERROR,R3       IS THERE A LOG BUFFER                       
         BEZ      EXITLSFX          NO                                          
*                                   YES                                         
         LI,R6    LOGSENSE                                                      
         LH,R5    DCT7,R1           GET CLIST DW ADDR                           
         SLS,R5   1                 MAKE IT A WORD ADDR                         
*                                                                               
         LCI      4                                                             
         LM,R8    4,R5              LOAD SENSE DATA                             
         STM,R8   *R7,R6            AND SAVE IT IN ERROR LOG ENTRY              
         LM,R8    ZEROS                                                         
         STM,R8   4,R5              CLEAR SENSE DATA                            
         FIN      #ERRORLOG                                                     
EXITLSFX RES      0                                                             
         LB,R0    IOQ5,R3           GET CURRENT FUNCTION                        
         DO       #RAD                                                          
         CI,R0    FC11              IS IT A FINAL SENSE                         
         BE       EXITINC           YES, END WITH INC STATUS                    
         FIN      #RAD                                                          
         DO       #DISKPAK                                                      
         CI,R0    F48               IS IT A FINAL SENSE                         
         BE       EXITINC           YES                                         
         FIN      #DISKPAK                                                      
         B        EXITF             NO, FOLLOW ON                               
         PAGE                                                                   
*                                                                               
* EXIT TO SENSE AND THEN EXIT WITH INCONSISTENT STATUS                          
*                                                                               
         DO       #RAD                                                          
EXITSNSR RES      0                                                             
         LB,R0    IOQ5,R3           CURRENT FUNCTION                            
         CI,R0    FC11              IS IT THE FINAL SENSE                       
         BE       EXITLSF           YES, LOG ANYWAY                             
*                                   NO                                          
         LI,R5    FC11**8                                                       
         B        EXITSNS                                                       
         FIN      #RAD                                                          
***                                                                             
         DO       #DISKPAK                                                      
EXITSNSD RES      0                                                             
         LB,R0    IOQ5,R3           CURRENT FUNCTION                            
         CI,R0    F48               IS IT FINAL SENSE                           
         BE       EXITLSF           YES, LOG ANYWAY                             
*                                   NO                                          
         LI,R5    F48**8                                                        
         FIN      #DISKPAK                                                      
*                                                                               
EXITSNS  RES      0                                                             
         BAL,R0   RE:ENT                                                        
         MTB,1    IOQ11,R3          BUMP RETRY COUNT FOR FINAL SENSE            
         STH,R5   DCT17,R1          SET FINAL SENSE CODE                        
         LI,R12   FLGRETRY+FLGINTER                                             
         B        IOSCU                                                         
         PAGE                                                                   
* TEST MODE MESSAGE EXIT                                                        
EXITTM   RES      0                                                             
         LB,R0    IOQ11,R3          GET CURRENT RETRY COUUNT                    
         BNEZ     EXITHIOR          IF NOT OUT OF RETRIES, RETRY                
*                                   ELSE ASK FOR HELP                           
*                                   YES, REPORT NOT-OP                          
         LI,R13   MSG9                                                          
         LI,R12   FLGKEYNC                                                      
         B        EXITELOG          GO LOG ERROR BEFORE KEYIN                   
* NOT OPERATIONAL MESSAGE EXIT                                                  
EXITNO   RES      0                                                             
         LB,R0    IOQ11,R3          GET CURRENT RETRY COUUNT                    
         BNEZ     EXITHIOR          IF NOT OUT OF RETRIES, RETRY                
*                                   ELSE ASK FOR HELP                           
*                                   YES, REPORT NOT-OP                          
         LI,R13   MSG4A                                                         
         LI,R12   FLGKEYNC                                                      
EXITELOG RES      0                                                             
         DO       (#ERRORLOG*#XRBM)>0                                           
         BAL,R0   RE:ENT                                                        
         BAL,R0   IOERROR           RECORD STATUS                               
         FIN      ERRORLOG AND XRBM                                             
         B        EXITHIO                                                       
* WRITE PROTECT VIOLATION EXIT                                                  
EXITWP   RES      0                                                             
         LI,R13   MSG5                                                          
         LI,R12   FLGKEYNC                                                      
         B        EXITHIO                                                       
* EXIT TO HIO AND RETRY                                                         
EXITHIOR RES      0                                                             
         LI,R12   FLGRETRY+FLGHOLD                                              
         B        EXITHIO                                                       
         PAGE                                                                   
         DO1      (#TBT+#DISQING)=0                                             
EXITTD   RES      0                                                             
         DO1      #DISQING=0                                                    
DISQ     RES      0                                                             
         DO1      #RADQING=0                                                    
RADQ     RES      0                                                             
* OPERATION SUCCESSFUL EXIT                                                     
EXITOK   RES      0                                                             
         LI,R12   TYCOK                                                         
* HIO DEVICE EXIT                                                               
EXITHIO  RES      0                                                             
         BAL,R0   RE:ENT                                                        
         LH,R0    DCT1,R1           GET ADDR                                    
         HIO,R0   *R0               HIO DEVICE FOR RELEASE                      
* CLEAR REMAINING BYTE COUNT                                                    
EXITCU   LI,R10   0                                                             
         LI,R11   0                                                             
         B        IOSCU                                                         
         SPACE    4                                                             
*                                                                               
* PRE-HANDLER EXIT FROM MODULE                                                  
*                                                                               
COMEXIT  RES      0                                                             
         OR,R4    Y2                FLAG TO CAUSE CHANNEL HOLD                  
         B        COMLIST                                                       
         TITLE    '** DISC - DOT TABLES **'                                     
         DO       #RAD                                                          
**********************************************************                      
* DOT TABLE FOR 72O2/7203/7204/7212/7232/7251/7252 DISCS *                      
*               3214 AND 3215 DISCS ALSO                                        
**********************************************************                      
DOTDC    EQU      %                                                             
DOT      SET      %                                                             
*                                                                               
FC00     :DOT     DCRD,1,FC06,FC11  READ                                        
FC01     :DOT     DCWR,1,FC07,FC11  WRITE                                       
FC02     :DOT     DCSN,1,FC02,FC11  SENSE                                       
FC03     :DOT     DCCW,1,FC08,FC11  CHECKWRITE                                  
FC04     :DOT     DCWR,1,FC09,FC03  WRITE/CHECKWRITE                            
FC05     :DOT     DCRD,1,FC10,FC03  READ/CHECKWRITE                             
FC06     :DOT     DCLS,1,FC06,FC00  SENSE FOR LOG                               
FC07     :DOT     DCLS,1,FC07,FC01  SENSE FOR LOG                               
FC08     :DOT     DCLS,1,FC08,FC03  SENSE FOR LOG                               
FC09     :DOT     DCLS,1,FC09,FC04  SENSE FOR LOG                               
FC10     :DOT     DCLS,1,FC10,FC05  SENSE FOR LOG                               
FC11     :DOT     DCSN,1,FC11,FC11  SENSE, THEN INCON STATUS                    
         BOUND    4                                                             
         PAGE                                                                   
*****************                                                               
* CLIST TABLE   *                                                               
*****************                                                               
DCRD     :CLIST   SEEKC                                                         
         :CLIST   RDNC                                                          
*                                                                               
DCWR     :CLIST   SEEKC                                                         
         :CLIST   WRNC                                                          
*                                                                               
DCCW     :CLIST   SEEKC                                                         
         :CLIST   CKNC                                                          
*                                                                               
DCSN     :CLIST   SENSE1                                                        
*                                                                               
DCLS     :CLIST   SENSE2                                                        
         BOUND    4                                                             
         FIN      #RAD                                                          
         PAGE                                                                   
         DO       #DISKPAK                                                      
         DO       #TBT                                                          
*                                                                               
* TABLE TO GET TRACK FUNCTION CODES INDEXED BY IOQ4                             
*                                                                               
TRACKFUN DATA,1   F08,F09,F10,F11,F12,F13,F14,F15                               
         DATA,1   F16,F17,F18,F19,F20,F21,F22,F23                               
*                                                                               
         FIN      #TBT                                                          
         BOUND    4                                                             
*                                                                               
* TABLE TO GET FLAWED TRACK RECOVERY INDEXED BY IOQ4                            
FLAWFUN  RES      0                                                             
         DO       #TBT                                                          
         DATA,1   F48,F48,F48,F48,F48,F48,F48,F48                               
         DATA,1   F43,F44,F48,F45,F46,F47,F48,F48                               
         FIN      #TBT                                                          
         DATA,1   F43,F44,F48,F45,F46,F47,F48,F48                               
         BOUND    4                                                             
         PAGE                                                                   
************************************                                            
* DOT TABLE FOR DISC PACK          *                                            
************************************                                            
DOTDP    RES      0                                                             
DOT      SET      %                                                             
*                                                                               
         DO       #TBT                                                          
F00      :DOT     DPSK,1,F33,F24    READ          INITIAL FUNCTIONS             
F01      :DOT     DPSK,1,F34,F25    WRITE         INITIAL FUNCTIONS             
F02      :DOT     DPSN,1,F18,F48    SENSE         INITIAL FUNCTIONS             
F03      :DOT     DPSK,1,F35,F26    CHECKWRITE    INITIAL FUNCTIONS             
F04      :DOT     DPSK,1,F36,F27    WRITE/CKWR    INITIAL FUNCTIONS             
F05      :DOT     DPSK,1,F37,F28    READ/CKWR     INITIAL FUNCTIONS             
F06      :DOT     DPXX,0,F48,F48    SPARE         INITIAL FUNCTIONS             
F07      :DOT     DPXX,0,F48,F48    SPARE         INITIAL FUNCTIONS             
F08      :DOT     DPSK,1,F33,F24    READ          START TBT                     
F09      :DOT     DPSK,1,F34,F25    WRITE         START TBT                     
F10      :DOT     DPSN,1,F18,F48    SENSE         START TBT                     
F11      :DOT     DPSK,1,F35,F26    CHECKWRITE    START TBT                     
F12      :DOT     DPSK,1,F36,F27    WRITE/CKWR    START TBT                     
F13      :DOT     DPSK,1,F37,F28    READ/CKWR     START TBT                     
F14      :DOT     DPXX,0,F48,F48    SPARE         START TBT                     
F15      :DOT     DPXX,0,F48,F48    SPARE         START TBT                     
         FIN      #TBT                                                          
F16      :DOT     DPSK,1,F33,F24    READ          TRACK FUNCTION STEP           
F17      :DOT     DPSK,1,F34,F25    WRITE         TRACK FUNCTION STEP           
F18      :DOT     DPSN,1,F18,F48    SENSE         TRACK FUNCTION STEP           
F19      :DOT     DPSK,1,F35,F26    CHECKWRITE    TRACK FUNCTION STEP           
F20      :DOT     DPSK,1,F36,F27    WRITE/CKWR    TRACK FUNCTION STEP           
F21      :DOT     DPSK,1,F37,F28    READ/CKWR     TRACK FUNCTION STEP           
F22      :DOT     DPXX,1,F48,F48    SPARE         TRACK FUNCTION STEP           
F23      :DOT     DPXX,1,F48,F48    SPARE         TRACK FUNCTION STEP           
F24      :DOT     DPRD,1,F33,F48    READ          DATA FUNCTION STEPS           
F25      :DOT     DPWR,1,F34,F48    WRITE         DATA FUNCTION STEPS           
F26      :DOT     DPCW,1,F35,F48    CHECKWRITE    DATA FUNCTION STEPS           
F27      :DOT     DPWR,1,F36,F29    WRITE/CKWR    DATA FUNCTION STEPS           
F28      :DOT     DPRD,1,F37,F30    READ/CKWR     DATA FUNCTION STEPS           
F29      :DOT     DPSK,1,F36,F31    WRITE/CKWR    CHECKWRITE FOLLOW-ONS         
F30      :DOT     DPSK,1,F37,F32    READ/CKWR     CHECKWRITE FOLLOW-ONS         
F31      :DOT     DPCW,1,F36,F48    WRITE/CKWR    CHECKWRITE FOLLOW-ONS         
F32      :DOT     DPCW,1,F37,F48    READ/CKWR     CHECKWRITE FOLLOW-ONS         
F33      :DOT     DPLS,1,F33,F38    READ          RECOVERY SENSE STEPS          
F34      :DOT     DPLS,1,F34,F39    WRITE         RECOVERY SENSE STEPS          
F35      :DOT     DPLS,1,F35,F40    CHECKWRITE    RECOVERY SENSE STEPS          
F36      :DOT     DPLS,1,F36,F41    WRITE/CKWR    RECOVERY SENSE STEPS          
F37      :DOT     DPLS,1,F37,F42    READ/CKWR     RECOVERY SENSE STEPS          
F38      :DOT     DPRS,1,F33,F16    READ          RECOVERY RESTORE STEPS        
F39      :DOT     DPRS,1,F34,F17    WRITE         RECOVERY RESTORE STEPS        
F40      :DOT     DPRS,1,F35,F19    CHECKWRITE    RECOVERY RESTORE STEPS        
F41      :DOT     DPRS,1,F36,F20    WRITE/CKWR    RECOVERY RESTORE STEPS        
F42      :DOT     DPRS,1,F37,F21    READ/CKWR     RECOVERY RESTORE STEPS        
F43      :DOT     DPRH,1,F33,F16    READ          FLAWED TRACK RECOVERY         
F44      :DOT     DPRH,1,F34,F17    WRITE         FLAWED TRACK RECOVERY         
F45      :DOT     DPRH,1,F35,F19    CHECKWRITE    FLAWED TRACK RECOVERY         
F46      :DOT     DPRH,1,F36,F20    WRITE/CKWR    FLAWED TRACK RECOVERY         
F47      :DOT     DPRH,1,F37,F21    READ/CKWR     FLAWED TRACK RECOVERY         
F48      :DOT     DPLS,1,F48,F48    SENSE, THEN INC STATUS RETURN               
         PAGE                                                                   
*****************                                                               
* DISC PACK     *                                                               
* CLIST TABLE   *                                                               
*****************                                                               
DPSK     :CLIST   SEEKNCI                                                       
*                                                                               
DPSN     :CLIST   SENSE1                                                        
*                                                                               
DPRD     :CLIST   RDNC                                                          
*                                                                               
DPWR     :CLIST   WRNC                                                          
*                                                                               
DPCW     :CLIST   CKNC                                                          
*                                                                               
DPLS     :CLIST   SENSE2                                                        
*                                                                               
DPRS     :CLIST   RSC                                                           
         :CLIST   RHNC                                                          
*                                                                               
DPRH     :CLIST   RHNC                                                          
*                                                                               
DPXX     :CLIST   CDWINC                                                        
         BOUND    4                                                             
         FIN      #DISKPAK                                                      
         TITLE    '** DISC - POST HANDLER BRANCH TABLES **'                     
************************************                                            
* DISC BRANCH TABLE                *                                            
************************************                                            
         DO       #RAD                                                          
DCBT     COM,16   AF(1)-DISCCU                                                  
*                                                                               
* INDEXED BY CURRENT FUNCTION CODE (IOQ5)                                       
* GIVES CORRECT NON-ERROR POST-HANDLER ENTRY                                    
*                                                                               
DCBT     DCBT     RADQ                                                          
         DCBT     RADQ                                                          
         DCBT     RADQ                                                          
         DCBT     RADQ                                                          
         DCBT     EXITF                                                         
         DCBT     EXITF                                                         
         DCBT     EXITLSF                                                       
         DCBT     EXITLSF                                                       
         DCBT     EXITLSF                                                       
         DCBT     EXITLSF                                                       
         DCBT     EXITLSF                                                       
         DCBT     EXITLSF                                                       
         BOUND    4                                                             
         FIN      #RAD                                                          
         PAGE                                                                   
************************************                                            
* DISC PACK BRANCH TABLE           *                                            
************************************                                            
         DO       #DISKPAK                                                      
DPBT     COM,8    AF(1)-DPJUMP                                                  
*                                                                               
* INDEXED BY CURRENT FUNCTION CODE (IOQ5)                                       
* GIVES CORRECT NON-ERROR POST-HANDLER ENTRY                                    
*                                                                               
DPBT     RES      0                                                             
         DO       #TBT                                                          
         DPBT     EXITFI            0                                           
         DPBT     EXITFI            1                                           
         DPBT     EXITTD            2                                           
         DPBT     EXITFI            3                                           
         DPBT     EXITFI            4                                           
         DPBT     EXITFI            5                                           
         DPBT     EXITINC           6                                           
         DPBT     EXITINC           7                                           
         DPBT     EXITFI            8                                           
         DPBT     EXITFI            9                                           
         DPBT     EXITTD            10                                          
         DPBT     EXITFI            11                                          
         DPBT     EXITFI            12                                          
         DPBT     EXITFI            13                                          
         DPBT     EXITINC           14                                          
         DPBT     EXITINC           15                                          
         FIN      #TBT                                                          
         DPBT     EXITFI            16                                          
         DPBT     EXITFI            17                                          
         DPBT     EXITTD            18                                          
         DPBT     EXITFI            19                                          
         DPBT     EXITFI            20                                          
         DPBT     EXITFI            21                                          
         DPBT     EXITINC           22                                          
         DPBT     EXITINC           23                                          
         DPBT     EXITTD            24                                          
         DPBT     EXITTD            25                                          
         DPBT     EXITTD            26                                          
         DPBT     EXITF             27                                          
         DPBT     EXITF             28                                          
         DPBT     EXITFI            29                                          
         DPBT     EXITFI            30                                          
         DPBT     EXITTD            31                                          
         DPBT     EXITTD            32                                          
         DPBT     EXITLSF           33                                          
         DPBT     EXITLSF           34                                          
         DPBT     EXITLSF           35                                          
         DPBT     EXITLSF           36                                          
         DPBT     EXITLSF           37                                          
         DPBT     EXITF             38                                          
         DPBT     EXITF             39                                          
         DPBT     EXITF             40                                          
         DPBT     EXITF             41                                          
         DPBT     EXITF             42                                          
         DPBT     ALTER             43                                          
         DPBT     ALTER             44                                          
         DPBT     ALTER             45                                          
         DPBT     ALTER             46                                          
         DPBT     ALTER             47                                          
         DPBT     EXITLSF                                                       
         BOUND    4                                                             
         FIN      #DISKPAK                                                      
         TITLE    '** DISC - CDW FORMS **'                                      
         DO1      #RAD                                                          
SEEKC    :CDW     3,0,CC,1,2        SEEK                                        
*                                                                               
RDNC     :CDW     2,0,NCC,2         READ                                        
*                                                                               
WRNC     :CDW     1,0,NCC,2         WRITE                                       
*                                                                               
CKNC     :CDW     5,0,NCC,2         CHECK WRITE                                 
*                                                                               
SENSE1   :CDW     4,0,NCC,2         SENSE FOR CALLER                            
*                                                                               
SENSE2   :CDW     4,SENSELOG,NCC,4,16   SENSE FOR LOG                           
*                                                                               
         DO       #DISKPAK                                                      
SEEKNCI  :CDW     X'83',SEEK,X'C',4,4 SEPERATED SEEK ORDER                      
*                                                                               
RHNC     :CDW     X'0A',HEADER,NCC,4,8                                          
*                                                                               
RSC      :CDW     X'33',0,CC,0,0                                                
         FIN      #DISKPAK                                                      
*                                                                               
CDWINC   :CDW     0,EXITINC,0,4,0   ABORT                                       
         TITLE    '** DISC - FLOPLOT SOURCE **'                                 
*;         VERSION  D00                                                         
*;         TITLE    COMBINED DISC HANDLER                                       
*;         HEADING  DISC(RAD) HANDLER                                           
*;         ENTRY    DISCIO;DISC PRE HANDLER                                     
*;         P        ;PICK UP DOT TABLE POINTER                                  
*;         EXIT     ;COMLIST                                                    
*;*                                                                             
*;         COLUMN   2                                                           
*;         ENTRY    DISCCU;DISC POST HANDLER                                    
*;         L,NEWIOCK ;ARE THERE ANY ERRORS                                      
*;         IF,YES   DISCERR                                                     
*;         IF,NO                                                                
*;DISCOK   P        GET CURRENT FUNCTION;ENABLE;JUMP ON FUNC CODE               
*;         IF,1-3   EXITOK                                                      
*;         IF,4-5   EXITF                                                       
*;         IF,6-A   EXITF                                                       
*;         IF,B     EXITINC                                                     
*;         IF,C-D   EXITF                                                       
*;         IF,OVER  EXITINC                                                     
*;         COLUMN   1                                                           
*;         SPACE    1                                                           
*;DISCERR  D        ARE DEVICE + CONTROLER OK                                   
*;         IF,NO    EXITNO                                                      
*;         IF,YES                                                               
*;         D        IS IOP OK                                                   
*;         IF,NO    EXITHIOR                                                    
*;         IF,YES                                                               
*;         D        IS IT SECTOR UNAVAILABLE                                    
*;         IF,YES   EXITERR                                                     
*;         IF,NO                                                                
*;         D        IS IT WRITE PROTECT VIOLATED                                
*;         IF,YES   EXITWP                                                      
*;         IF,NO                                                                
*;         D        IS TIO BIT 4 SET                                            
*;         IF,YES   EXITHIOR                                                    
*;         IF,NO                                                                
*;         D        ARE TDV CC = 00XX                                           
*;         IF,NO    EXITHIOR                                                    
*;         IF,YES                                                               
*;         D        IS TDV BIT 8 SET                                            
*;         IF,YES   DISCOK                                                      
*;         IF,NO    EXITHIOR                                                    
*;         PAGE                                                                 
*;         HEADING  DISC PACK PRE-PROCESSOR                                     
*;         ENTRY    DPAK;DISC PACK PRE PROCESSOR                                
*;         P        ;PICK UP :DOT POINTER                                       
*;         D        IS THIS ORIGINAL FUNCTION                                   
*;         IF,YES   &FIRST                                                      
*;         IF,NO                                                                
*;         EXIT     COMLIST;BUILD CDW LIST                                      
*;         COLUMN   1                                                           
*;         SPACE    2                                                           
*;&FIRST   P        GET IOQ8 AND IOQ9;RE:ENT;STORE IN 5TH DW;ENABLE             
*;         D        IS FUNCTION CODE <= F07                                     
*;         IF,NO    &X0                                                         
*;         IF,YES                                                               
*;         EXIT     COMLIST;BUILD CDW LIST                                      
*;         COLUMN   1                                                           
*;         SPACE    3                                                           
*;&X0      D        DATA CHAINING CASE?                                         
*;         IF,YES   DCHAIN                                                      
*;         IF,NO                                                                
*;         D        DOES TRANSFER CROSS TRACK                                   
*;         IF,NO    &X1                                                         
*;         IF,YES                                                               
*;         P        RE:ENT;CHANGE TO TRACK FUNC;SET INTEROP; ;.                 
*;                  CHANGE BYTE CNT                                             
*;&X1      EXIT     COMLIST;BUILD CDW LIST                                      
*;         COLUMN   1                                                           
*;         SPACE    3                                                           
*;DCHAIN   D        DOES TRANSFER CROSS TRACK                                   
*;         IF,NO    &X2                                                         
*;         IF,YES                                                               
*;         P        RE:ENT;SAVE CDW AT EDGE IN GTH DW;SET INTEROP; ;.           
*;                  FIX UP CDW                                                  
*;&X2      EXIT     COMLIST;BUILD CDW LIST                                      
*;         PAGE                                                                 
*;         HEADING  DISC PACK POST-PROCESSOR                                    
*;         COLUMN                                                               
*;         ENTRY    DPAKCU:DISC PACK POST PROCESSOR                             
*;         L,IOSERCK  CHECK COMMON ERRORS                                       
*;         D        ANY ERROR CONDITIONS                                        
*;         IF,YES   DPAKERR                                                     
*;         IF,NO                                                                
*;DPAKOK   P        RE:ENT;GET CURRENT FUNC;ENABLE                              
*;         IF,F0    EXITFI                                                      
*;         IF,F1    EXITFI                                                      
*;         IF,F2    EXITTD                                                      
*;         IF,F3    EXITFI                                                      
*;         IF,F4    EXITFI                                                      
*;         IF,F5    EXITFI                                                      
*;         IF,F6    EXITINC                                                     
*;         IF,F7    EXITINC                                                     
*;         IF,F8    EXITFI                                                      
*;         IF,F9    EXITFI                                                      
*;         IF,F10   EXITTD                                                      
*;         IF,F11   EXITFI                                                      
*;         IF,F12   EXITFI                                                      
*;         IF,F13   EXITFI                                                      
*;         IF,F14   EXITINC                                                     
*;         IF,F15   EXITINC                                                     
*;         IF,ELSE  &J1                                                         
*;         COLUMN   1                                                           
*;         SPACE    3                                                           
*;&J1      NOTE                                                                 
*;         IF,F16   EXITFI                                                      
*;         IF,F17   EXITFI                                                      
*;         IF,F18   EXITTD                                                      
*;         IF,F19   EXITFI                                                      
*;         IF,F20   EXITFI                                                      
*;         IF,F21   EXITFI                                                      
*;         IF,F22   EXITINC                                                     
*;         IF,F23   EXITINC                                                     
*;         IF,F24   EXITTD                                                      
*;         IF,F25   EXITTD                                                      
*;         IF,F26   EXITTD                                                      
*;         IF,F27   EXITF                                                       
*;         IF,F28   EXITF                                                       
*;         IF,F29   EXITFI                                                      
*;         IF,F30   EXITFI                                                      
*;         IF,ELSE  &J2                                                         
*;         COLUMN   1                                                           
*;         SPACE    3                                                           
*;&J2      NOTE                                                                 
*;         IF,F31   EXITTD                                                      
*;         IF,F32   EXITTD                                                      
*;         IF,F33   EXITLSF                                                     
*;         IF,F34   EXITLSF                                                     
*;         IF,F35   EXITLSF                                                     
*;         IF,F36   EXITLSF                                                     
*;         IF,F37   EXITLSF                                                     
*;         IF,F38   EXITF                                                       
*;         IF,F39   EXITF                                                       
*;         IF,F40   EXITF                                                       
*;         IF,F41   EXITF                                                       
*;         IF,F42   EXITF                                                       
*;         IF,F43   ALTER                                                       
*;         IF,F44   ALTER                                                       
*;         IF,F45   ALTER                                                       
*;         IF,F46   ALTER                                                       
*;         IF,F47   ALTER                                                       
*;         IF,F48   EXITINC                                                     
*;         PAGE                                                                 
*;         HEADING  DPAK ERROR ANALYSIS                                         
*;         ENTRY    DPAKERR;ERROR ANALYSIS                                      
*;DPAKERR  D        DO TDV CC = 01XX                                            
*;         IF,YES   EXITTM                                                      
*;         IF,NO                                                                
*;         D        DO TDV CC = 10XX                                            
*;         IF,YES   EXITNO                                                      
*;         IF,NO                                                                
*;         D        ARE TIO 1,2,5,6 ALL ZERO                                    
*;         IF,NO    EXITNO                                                      
*;         IF,YES                                                               
*;         D        ARE TDV 10,11,12,13 ALL ZERO                                
*;         IF,NO    EXITHIOR                                                    
*;         IF,YES                                                               
*;         D        IS TDV BIT 2 SET                                            
*;         IF,YES   SECTORUN                                                    
*;         IF,NO                                                                
*;         D        MODEL # 7242 7246 7270                                      
*;         IF,NO    TYPE7260                                                    
*;         IF,YES   TYPE7242                                                    
*;         COLUMN   1                                                           
*;         ENTRY    TYPE;7240;ANALYSIS                                          
*;TYPE7242 D        ARE TDV 4,6,7   ALL ZERO                                    
*;         IF,NO    EXITHIOR                                                    
*;         IF,YES                                                               
*;         D        IS TDV 1 SET                                                
*;         IF,YES   EXITFLAW                                                    
*;         IF,NO                                                                
*;         D        IS TIO BIT 4 SET                                            
*;         IF,YES   EXITHIOR                                                    
*;         IF,NO                                                                
*;         D        IS TDV BIT 8 SET                                            
*;         IF,YES   DPAKOK                                                      
*;         IF,NO    EXITHIOR                                                    
*;         COLUMN   1                                                           
*;         ENTRY    TYPE;7260;ANALYSIS                                          
*;TYPE7260 D        ARE TDV 4,5   ALL ZERO                                      
*;         IF,NO    EXITHIOR                                                    
*;         IF,YES                                                               
*;         D        IS TDV 3 SET                                                
*;         IF,YES   EXITWP                                                      
*;         IF,NO                                                                
*;         D        ARE TDV 6,7 BOTH ZERO                                       
*;         IF,NO    EXITHIOR                                                    
*;         IF,YES                                                               
*;         D        IS TDV 1 SET                                                
*;         IF,YES   EXITFLAW                                                    
*;         IF,NO                                                                
*;         D        ISTDV BIT 9 SET                                             
*;         IF,YES   EXITHIOR                                                    
*;         IF,NO                                                                
*;         D        IS TDV BIT 8 SET                                            
*;         IF,YES   DPAKOK                                                      
*;         IF,NO    EXITHIOR                                                    
*;         PAGE                                                                 
*;EXITNEXT D        IS THIS A DATA CHAIN                                        
*;         IF,YES   &NEXT                                                       
*;         IF,NO                                                                
*;         P        RE:ENT;INCREMENT SEEK ADDR;CHANGE IOQ8 AND IOQ9             
*;         P        RESET RETRY COUNT;PUT INITIAL FUNCTION IN DCT17             
*;         COLUMN   1                                                           
*;&NEXT    P        RE:ENT;INCREMENT SEEK ADDRESS;CHANGE IOQ8 AND IOQ9          
*;         P        FIX UP SPLIT CDW;RESET RETRY COUNT                          
*;         P        PUT INITIAL FUNCTION IN DCT17;SET FOLLOW-ON FLAG            
*;         EXIT     ;EXITHIO                                                    
*;         COLUMN   1                                                           
*;         ENTRY    ALTER;SET UP ALTER TRACK                                    
*;ALTER    P        MAKE UP ALTERNATE SEEK ADDR;RE:ENT;CHANGE IOQ12             
*;         B        EXITF                                                       
*;         COLUMN   1                                                           
*;SECTORUN ENTRY    SECTOR UNAVAILABLE                                          
*;         D        IS FUNC CODE <=F07                                          
*;         IF,NO    EXITERR                                                     
*;         IF,YES                                                               
*;TRYTBT   ENTRY    TRY TRACK BY TRACK                                          
*;         P        GET TRACK FUNCTION CODE;RE:ENT;STORE IN IOQ4                
*;         P        SET FOLLOW-ON; STORE R5 INTO DCT17                          
*;         EXIT     ;EXITHIO                                                    
*;         PAGE                                                                 
*;         HEADING  POST HANDLER EXIT ROUTINES                                  
*;         ENTRY   ;EXITOK                                                      
*;EXITOK   P        ;SET R12 TO TYC OK (4)                                      
*;EXITHIO  P        RE:ENT;HIO DEVICE                                           
*;EXITCU   P        CLEAR R10,R11                                               
*;         EXIT     ;IOSCU                                                      
*;         COLUMN   1                                                           
*;         ENTRY   ;EXITERR                                                     
*;EXITERR  P        ;SET R12 TO TYC ERROR (8)                                   
*;         EXIT     ;EXITHIO                                                    
*;         SPACE    1                                                           
*;         ENTRY    EXITINC:CRASH EXIT                                          
*;EXITINC  P        CRASH;I/O INCONSISTANCY                                     
*;         FLOBREAK                                                             
*;         COLUMN   1                                                           
*;         ENTRY    ;EXITHIOR                                                   
*;EXITHIOR P        RE:ENT;HIO DEVICE;SET RETRY FLAG AND TYC ERROR              
*;         EXIT     ;EXITHIO                                                    
*;         SPACE    1                                                           
*;         ENTRY    ;EXITNO                                                     
*;EXITNO   P        ;SET NOT-OP MSG IN R43;SET KEYIN FLAG                       
*;         EXIT     ;EXITHIO                                                    
*;         COLUMN   1                                                           
*;         ENTRY    ;EXITWP                                                     
*;EXITWP   P        ;SET WRITE-PROT MSG IN R13;SET KEY-IN FLAG                  
*;         EXIT     ;EXITHIO                                                    
*;         SPACE    1                                                           
*;         ENTRY    EXITTM;TEST MODE                                            
*;EXITTM   P        SET KEY-IN (NO C) FLAG AND TEST MODE MESSAGE                
*;         EXIT     ;EXITHIO                                                    
*;         COLUMN   1                                                           
*;         ENTRY    ;EXITLSR                                                    
*;EXITLSF  L,LOGSENSE RE:ENT;LOG SECONDARY SENSE STATUS                         
*;         P        ;SET FOLLOW ON FLAG                                         
*;         EXIT     ;EXITHIO                                                    
*;         COLUMN   1                                                           
*;         ENTRY    EXITFLAW;FLAWED TRACK                                       
*;EXITFLAW D        IS FUNCTION CODE >= F07                                     
*;         IF,YES   TRYTBT                                                      
*;         IF,NO                                                                
*;         P        SELECT PROPER READ HEADER SEEK FUNCTION                     
*;         P        RE:ENT;STUFF DCT17;SET FOLLOW ON FLAG                       
*;         EXIT     ;EXITHIO                                                    
*;         COLUMN   1                                                           
*;         ENTRY    ;EXITF5                                                     
*;         P        RE:ENT;STORE R5 INTO DCT17 FOR FOLLOW ON                    
*;         ENTRY    EXITF;FOLLOW ON EXIT                                        
*;EXITF    P        SET FOLLOW-ON FLAG                                          
*;         EXIT     ;EXITHIO                                                    
*;         COLUMN   1                                                           
*;         ENTRY    EXITFI;FOLLOW ON /INTEROP EXIT                              
*;EXITFI   P        SET FOLLOW-ON FLAG;SET INTER-OP FLAG                        
*;         EXIT     ;EXITHIO                                                    
*;         PAGE                                                                 
*;         ENTRY    TD;TRACK DONE                                               
*;EXITTD   P        ;PICK UP SAVED IOQ8 AND IOQ9                                
*;         D        ARE THEY THE SAME                                           
*;         IF,NO  EXITNEXT                                                      
*;         IF,YES                                                               
*;         P        ;SET TYC TO OK;PUT TDV STATUS IN R10/R11                    
*;         EXIT     ;EXITHIO                                                    
*;         END                                                                  
*;                                                                              
         END                                                                    
