+23      SFP 10-07-77 S29903-S29904 DISC-R                              LIO
         DEF      C:WDR                                                 LIO
         DEF      C:RDR                                                 LIO
+33      SFP 10-10-77 S29903-S29904 DISC-R                              LIO
IO43SW   DATA     0                 IF 1 AN IO 43 OCCURED               LIO
KEYFPT   DATA     0                 HOLD KEY FOR DISC-R   I/O           LIO
         DATA     0                 HOLD KEY FOR LAST PART              LIO
KEYFPTZ  DATA     0                 HOLD JUST DEVELOPED KEY             LIO
         DATA     0                 FOR NEXT I/O                        LIO
DISCRSW  DATA     0                 IF 1 WE ARE A DISC-R FILE           LIO
RELDISP  DATA     0                 HOLD DISP INTO RELATIVE BUFFER      LIO
RANDIO$U DATA     DCB                                                   LIO
         DATA     X'F8000040'       ONEWKEY OPTION                      LIO
         DATA     C:ERA,C:ABA                                           LIO
         GEN,1,31 1,RECD                                                LIO
         GEN,1,31 1,SIZE                                                LIO
         GEN,32   KEYFPT                                                LIO
+64      SFP 11-03-77 S29903-S29904 DISC-R                              LIO
BADDSCRR EQU      X'8A'             TRYING TO READ AN OUTPUT DISC-R     LIO
BADDSCRW EQU      X'8B'             TRYING TO WRITE AN INPUT DISC-R     LIO
+248,248 SFP 11-07-77 S29903-S29904 DISC-R                              LIO
                  (X'43',INV$KEYX),(X'0A',WAS$56),;                     LIO
+274     SFP 11-07-77 S29903-S29904 DISC-R                              LIO
         LW,15    14                GET THE OPTION                      LIO
         CI,15    X'0801'           DISC-R                              LIO
         BL       C:OPN1            NOT A DISC-R                        LIO
         CI,15    X'0805'           DISC-R                              LIO
         BG       C:OPN1            NOT A DISC-R                        LIO
         LI,1     3                 INDEX TO LAST BYTE                  LIO
         CI,15    X'0802'           CREATE                              LIO
         BNE      $+3               SKIP OPTION OUTIN                   LIO
         LI,15    8                 OUTIN OPTION FOR CREATE 8002        LIO
         B        $+2               SKIP CHANGE TO OPTION               LIO
         LI,15    4                 INOUT MODE FOR  801-4-5             LIO
         STB,15   OPN$MODE,1        STORE OPTION IN FPT                 LIO
         B        C:OPN2                                                LIO
C:OPN1   RES      0                 ENTRY FOR NON DISC-R OPTIONS        LIO
+276     SFP 11-07-77 S29903-S29904 DISC-R                              LIO
C:OPN2   RES      0                                                     LIO
+388,391 SFP S29903-S29904 10-17-77 DISC-R                              LIO
         CI,ODD   3                 ASN = 3                             LIO
         BNE      SNGL              SINGLE BUFFERING                    LIO
         LI,ODD   X'3F00'           TYPE MASK                           LIO
         AND,ODD  1,DCB             TYPE FIELD WORD 1                   LIO
         CI,ODD   X'1000'           TYPE 10 = UC DEVICE NO BUFF         LIO
         BE       *LINK             GET OUT                             LIO
+399,399 SFP S29903-S29904 10-17-77 DISC-R                              LIO
+431      SFP S29903-S29904 DISC-R 11-07-77                             LIO
         AND,14   =X'F0F'           OPTION ONLY                         LIO
         CI,14    X'0801'                                               LIO
         BL       CHKBUF1           DONT SET FLAG IF NOT DISC-R         LIO
         CI,14    X'0805'                                               LIO
         BG       CHKBUF1           DONT SET FLAG IF NOT DISC-R         LIO
         LI,7     X'0C'             INDEX INTO I: AREA                  LIO
         MTB,1    *FIST,7           SET THE BYTE FLAG ON FOR 1ST TIME   LIO
CHKBUF1  RES      0                                                     LIO
+534,534   S28713 C.W. F01 12-10-76                                     LIO
         MTB,2    FIST              SET CLOSE FLAG                      LIO
+536      SFP 10-31-77 S29903-S29904 DISC-R                             LIO
         LW,4     1,FIST            SEE THE OPTION IF IT IS DISC-R      LIO
         AND,4    =X'F0F'           JUST THE OPTION                     LIO
         CI,4     X'0801'           IF LOWER THAN 0801 NO DISC-R        LIO
         BL       C:CLS1            YES GET OUT                         LIO
         CI,4     X'0806'           IF LESS THAN 0806 (0801-0805)       LIO
         BL       C:CLS2            YES BRANCH IT IS A DISC-R           LIO
C:CLS1   RES      0                 HERE IF NOT A DISC-R                LIO
+540     SFP 10-31-77 S29903-S29904 DISC-R                              LIO
C:CLS2   RES      0                                                     LIO
+626     SFP 10-07-77 S29903-S29904 DISC-R                              LIO
C:WDR    EQU      $                 ENTRY FOR DISC-R WRITE              LIO
         AND,3    =X'F0F'           OPTION ONLY                         LIO
         CI,3     X'0801'           TRYING TO READ IN OUTPUT MODE       LIO
         BNE      C:WDR1            NO EVERYTHING OK                    LIO
         LI,ERROR BADDSCRR          PICK UP 8A FOR ABORT                LIO
         B        ERRCOM+1          GO ABORT                            LIO
C:WDR1   RES      0                                                     LIO
         CI,3     X'0804'           I/O DISC-R                          LIO
         BL       C:RDR2            NO WAS OUTPUT  802                  LIO
         LI,3     X'0804'           RESET I/O DISC-R WRITE TO 8004      LIO
         SLS,6    1                 FIST TO HALFWORD INDEX              LIO
         MTW,1    6                 TO SECOND HALF                      LIO
         STH,3    1,FIST            SAVE FOR WRITE RELATIVE             LIO
         SLS,6    -1                BACK TO WORD INDEX LOSE THE BIT     LIO
         B        C:RDR2            SKIP READ CHECKING                  LIO
C:RDR    EQU      $                 ENTRY FOR DISC-R READ               LIO
         LW,3     1,FIST            SEE THE OPTION                      LIO
         AND,3    =X'F0F'           OPTION ONLY                         LIO
         CI,3     X'0802'           TRYING TO WRITE AN INPUT FILE       LIO
         BNE      C:RDR1            NO EVERYTHING OK                    LIO
         LI,ERROR BADDSCRW          PICK UP 8B FOR ABORT                LIO
         B        ERRCOM+1          GO ABORT                            LIO
C:RDR1   RES      0                                                     LIO
         CI,3     X'0804'           IS IT I/O OR JUST READ              LIO
         BL       C:RDR2            YES READ  801 SKIP PROCESSING       LIO
         LI,3     X'0805'            805 FOR I/O DISC-R READ            LIO
         SLS,6    1                 FIST TO HALFWORD INDEX              LIO
         MTW,1    6                 TO SECOND HALF OF WORD              LIO
         STH,3    1,FIST            SAVE FOR READ RELATIVE ROUTINE      LIO
         SLS,6    -1                BACK TO WORD INDEX LOSE THE BIT     LIO
C:RDR2   RES      0                                                     LIO
         STW,15   KEYSV             SAVE KEY DISC-R                     LIO
         MTW,1    DISCRSW           SET ON FOR LATER TEST               LIO
+638     SFP 10-07-77 S29903-S29904 DISC-R                              LIO
         MTW,0    DISCRSW           IS THIS A DISC-R I/O ?              LIO
         BNEZ     UNBLKREL          YES GO TO UNBLOCKED RELATIVE        LIO
+686,687 SFP 10-07-77 S29903-S29904 DISC-R                              LIO
         MTW,0    DISCRSW           IS THIS A DISC-R I/O ?              LIO
         BNEZ     RELATIVE          YES GO PROCESS BLOCKED RELATIVE     LIO
+981     SFP 10-07-77 S29903-S29904 DISC-R                              LIO
UNBLKREL RES      0                 ENTRY FOR UNBLOCKED RELATIVE        LIO
         LI,ODD   0                 CLEAR SW                            LIO
         STW,ODD  DISCRSW                                               LIO
         STW,15   LAST$BLK,FIST     SAVE INDEX VAL                      LIO
         LI,ODD   X'91'             WRITE OP CODE                       LIO
         STB,ODD  RANDIO$U          STORE IN FPT                        LIO
         LW,SIZE  MAX$SIZE,FIST     GET RECORD SIZE                     LIO
         SLS,SIZE -17               SET UP                              LIO
         MTW,0    15                IS THIS A ZERO RELATIVE KEY         LIO
         LI,14    X'04'             KEY LENGTH                          LIO
         SLD,14   +24               FORMAT KEY 04KKKKKK KK000000        LIO
         STW,14   KEYFPT            SET UP                              LIO
         STW,15   KEYFPT+1          SET UP                              LIO
         LW,RECD  REC$ADR,FIST      GET BUFFER ADDR                     LIO
         CI,FIST  OUTPUT            X'20000'                            LIO
         BANZ     UNBLK$1           YES IT IS OUTPUT                    LIO
         MTB,-1   RANDIO$U          SET FPT OP CODE TO '90' READ        LIO
UNBLK$1  RES      0                                                     LIO
         CAL1,1   RANDIO$U          DO IT, READ OR WRITE                LIO
         B        RESTOREM          BACK TO NEXT STATEMENT              LIO
UNBLK$2  RES      0                 ZERO KEY INVALID KEY                LIO
         MTW,1    LINK              UP RETURN ADDR                      LIO
         B        *LINK             TAKE INVALID KEY                    LIO
*                                                                       LIO
+982     SFP S29903-S29904 10-12-77 DISC-R                              LIO
         LI,WORK  0                 CLEAR SW                            LIO
         STW,WORK DISCRSW                                               LIO
+984,984 SFP 10-27-77               S29903-S29904 DISC-R                LIO
         LW,WORK  BLOCKSZ,FIST      NUM OF RECORDS PER BLOCK            LIO
+986     SFP S29903-S29904 10-19-77 DISC-R                              LIO
         MTW,0    KEYSV             0 FOR KEY VALUE                     LIO
         BNEZ     $+3               NO GO DIVIDE                        LIO
         B        *LINK             INVALID KEY FORCED EXIT             LIO
         MTW,-1   15                REDUCE REL REC # SO KEY 1 IS 1ST    LIO
* REC OF BLOCK AND IF BLOCKED 10 FOR EX, REC 10 IS LAST REC OF BLK 1    LIO
+988     SFP S29903-S29904 10-19-77 DISC-R                              LIO
         MTW,1    15                UP RESULT SO 1ST BLK HAS VALUE 1    LIO
* AS THERE IS NO BLOCK 0 CONCEPT 10/10-1=0 , 0+1=BLK 1                  LIO
         STW,14   RELDISP           SAVE REMAINDER FOR RECORD POSITION  LIO
         LI,INDX1 X'0C'             1ST BYTE WORD 3 I:AREA              LIO
         MTB,0    *FIST,INDX1       IF NON ZERO 1ST TIME THROUGH        LIO
         BEZ      $+2               NOT FIRST TIME                      LIO
         B        REL$CHNG          1ST TIME ALWAYS DO I/O              LIO
+1000,1000 SFP 10-27-77 S29903-S29904 DISC-R                            LIO
         LW,14    RELDISP           REMAINDER FROM DIVIDE               LIO
* POSITIONAL PLACEMENT WITHIN THE RELATIVE BLOCK                        LIO
         MH,14    SIZE              DEVELOP BYTE POSITION               LIO
+1002,1003 SFP 10-31-77 S29903/S29904 DISC-R                            LIO
         LW,1     1,FIST            SEE OPTION                          LIO
         AND,1    =X'F0F'           OPTION ONLY                         LIO
         CI,1     X'0801'           READ                                LIO
         BE       REL$01            YES                                 LIO
         CI,1     X'0805'           I/O READ 8005                       LIO
         BE       REL$01            YES                                 LIO
+1024,1026  SFP 10-31-77 S29903-S29904 DISC-R                           LIO
         LB,1     0,FROM            SEE THE RECORD 2ND BYTE FOR NULL    LIO
         MTW,-1   FROM              BACK TO ADDR BEGIN OF REC           LIO
         CI,1     0                 WAS 2ND BYTE A 00 NULL              LIO
         BNEZ     REL$011           OK NOT A FF00 NULL REC BUT A FF??   LIO
         LW,1     1,FIST            SEE OPTION                          LIO
         AND,1    =X'F0F'           OPTION ONLY                         LIO
         CI,1     X'0801'           READ                                LIO
         BE       ABN$EXIT          YES NO NULL RECORDS TO BE READ      LIO
         CI,1     X'0805'           READ I/O OPEN OPTION                LIO
         BE       ABN$EXIT          YES NO NULL RECORDS TO BE READ      LIO
         B        REL$011           YES HE CAN WRITE NULL RECORDS       LIO
+1031,1032 SFP S29903-S29904 DISC-R 10-27-77                            LIO
         LI,ODD   X'90'             SET READ OF THIS BLOCK              LIO
         STB,ODD  RANDIO$U          IN FPT                              LIO
+1035    SFP 10-27-77 S29903-S29904 DISC-R                              LIO
         LI,14    X'04'             KEY LENGTH                          LIO
         SLD,14   +24               FORMAT KEY 04KKKKKK KK000000        LIO
         STW,14   KEYFPTZ           SET UP KEY FOR I/O                  LIO
         STW,15   KEYFPTZ+1         SET UP SECOND PART OF KEY           LIO
+1037,1040        SFP S29903-S29904 DISC-R 10-27-77                     LIO
         LI,INDX1 X'0C'             POSITIONAL BYTE INDEX               LIO
         MTB,0    *FIST,INDX1       IS IT FIRST TIME THROUGH            LIO
         BEZ      REL$C$W           NO                                  LIO
         LW,EVEN  1,FIST            ARE WE WRITING (CREATE MODE)        LIO
         AND,12   =X'F0F'           OPTION ONLY                         LIO
         CI,12    X'0801'           READ                                LIO
         BNE      REL$WRTZ          DO  802, 804, 805                   LIO
         BAL,7    SETKEY            SET UP DISC-R KEY FOR I-O           LIO
         B        REL$C$00          YES READ DONT WRITE                 LIO
+1041,1044 SFP S29903-S29904 10-27-77 DISC-R                            LIO
REL$C$W  RES      0                                                     LIO
         LW,12    1,FIST            GET OPTION                          LIO
         AND,12   =X'F0F'           OPTION ONLY                         LIO
         CI,12    X'0801'           READ                                LIO
         BNE      REL$C$W0                                              LIO
         BAL,7    SETKEY            SET UP DISC-R KEY FOR I-O READ      LIO
         B        REL$C$00          GO DO THE READ FOR 8001 OPTION      LIO
REL$C$W0 RES      0                                                     LIO
         MTB,1    RANDIO$U          SET TO WRITE THE PRIOR BLOCK        LIO
         CAL1,1   RANDIO$U          DO I/O                              LIO
         BAL,7    SETKEY            SET UP DISC-R KEY FOR I-O           LIO
         MTB,-1   RANDIO$U          NOW SET TO READ                     LIO
+1045,1047        SFP 10-27-77 S29903-S29904 DISC-R                     LIO
REL$C$00 RES      0                                                     LIO
         LI,7     X'0C'             INDEX INTO I:AREA                   LIO
         MTB,0    *FIST,INDX1       IS THIS THE 1ST TIME THROUGH        LIO
         BEZ      REL$C$01          NO                                  LIO
         MTB,-1   *FIST,INDX1       SET OFF FLAG FOREVER                LIO
         CAL1,1   RANDIO$U          DO 801  READ OR 802,4,5,  READ      LIO
* PRIOR TO THE WRITE FOR 8002,4,5                                       LIO
         LB,1     10                WAS THERE AN ERROR FROM READ        LIO
         CI,1     X'43'             INVALID KEY NOT FOUND               LIO
         BNE      REL$OLD           WAS WRITTEN BEFORE DONT NULL IT     LIO
         B        REL$NEW           1ST TIME FOR THE BLOCK NULL IT      LIO
+1049     SFP S29903-S29904 DISC-R 10-31-77                             LIO
REL$WRTZ RES      0                                                     LIO
         MTB,-1   *FIST,INDX1       SET OFF FOREVER                     LIO
         BAL,7    SETKEY            SET UP DISC-R KEY FOR I-O           LIO
         CAL1,1   RANDIO$U          READ PRIME THE BUFFER               LIO
         LB,1     10                WAS THERE AN ERROR FROM READ        LIO
         CI,1     X'43'             43 INVALID KEY NOT FOUND            LIO
         BNE      REL$OLD           IT WAS THERE OLD BLOCK              LIO
* LET 8002,8004,8005 FALL THROUGH AND NULL THE BLOCK ITS NEW            LIO
+1053    SFP 10-27-77 S29903-S29904 DISC-R                              LIO
         LI,WORK  0                                                     LIO
+1060,1060 SFP 10-31-77 S29903-S29904 DISC-R                            LIO
         BLZ      REL$OLD           GO MOVE IN THE REAL RECORD          LIO
+1061    SFP 10-27-77 S29903-S29904 DISC-R                              LIO
         MTW,1    INDX1             UP INDEX FOR SECOND BYTE            LIO
         STB,WORK *RECD,INDX1       STORE IN THE 00 AFTER THE FF NULL   LIO
         MTW,-1   INDX1             GET INDEX BACK TO 1ST BYTE          LIO
* UNIVERSAL SETKEY FOR FPT I-O DISC-R                                   LIO
SETKEY   RES      0                                                     LIO
         LW,14    KEYFPTZ           NEWLY DEVELOPED KEY                 LIO
         STW,14   KEYFPT            INTO I-O FPT                        LIO
         LW,14    KEYFPTZ+1         NEWLY DEVELOPED KEY                 LIO
         STW,14   KEYFPT+1          INTO I-O FPT                        LIO
         B        *7                RETURN                              LIO
+1063,1071 SFP S29903-S29904 DISC-R 10-31-77                            LIO
+1087    SFP 10-07-77 S29903-S29904 DISC-R                              LIO
         LI,1     0                 SET UP FOR CLEAR                    LIO
         STW,1    KEYSV             CLEAR FOR NEXT TIME THROUGH         LIO
+1094       SFP 10-31-77 S29903-S29904 DISC-R                           LIO
*      RLR 2-19-80 S32636 F04 MODIFY THIS DISC-R ROUTINE                LIO
         LW,5     1,FIST            SEE THE PRIOR OPTION                LIO
         AND,5    =X'F0F'           JUST GET OPTION                     LIO
         CI,5     X'0801'           WRITE DISC-R ONLY                   LIO
         BL       C:CIB0            NOT A DISC-R I/O                    LIO
         CI,5     X'0805'           I/O WRITE DISC-R ONLY               LIO
         BG       C:CIB0            NOT A DISC-R I/O                    LIO
         B        *LINK             YES NO MORE TO DO                   LIO
C:CIB0   RES      0                                                     LIO
+1098,1099 SFP 10-31-77 S29903-S29904 DISC-R                            LIO
+1110,1129  SFP S29903-S29904 DISC-R 10-31-77                           LIO
         BEZ      CHK$LCK3          READ/WRITE                          LIO
         CI,WORK  1                                                     LIO
         BE       *LNK2             OPEN STATEMENT                      LIO
         LI,WORK  X'40'             SEE IF FILE HAS BEEN OPEN $ CLOSED  LIO
         CH,WORK  *DCB                                                  LIO
         BAZ      *LNK2             NO OK TO CLOSE                      LIO
         LI,WORK  X'A'              ERROR '0A'                          LIO
         LW,SR3   0,FIST            DCB ADDR TO R10                     LIO
         B        CHK$LCK4          ISSUE ERROR                         LIO
CHK$LCK3 RES      0                                                     LIO
+1166             S28713 C.W. F01 12-10-76                              LIO
CHK$LCK4 RES      0                                                     LIO
+1310    SFP 10-07-77 S29903-S29904 DISC-R                              LIO
         LI,15    0                 SET UP FOR CLEAR                    LIO
         STW,15   KEYSV             CLEAR FOR NEXT TIME THROUGH         LIO
+1400    SFP 11-03-77 S29903-S29904 DISC-R                              LIO
         LW,1     2,FIST            IS IT BLOCKED                       LIO
         BEZ      INV$KEY1          NO                                  LIO
         LW,1     1,FIST            SEE WHAT TYPE OF BLOCKED            LIO
         AND,1    =X'F0F'           OPTION ONLY                         LIO
         CI,1     X'0802'           IF 8001 READ ITS AN ERROR           LIO
         BL       INV$KEY1          YES                                 LIO
         CI,1     X'0806'           IF NOT 802,804,805    ITS AN ERROR  LIO
         BGE      INV$KEY1                                              LIO
         MTW,0    IO43SW            WAS IT AN IO43                      LIO
         BEZ      *8                NO                                  LIO
         MTW,-1   IO43SW            SET OFF                             LIO
         B        *8                                                    LIO
INV$KEY1 RES      0                                                     LIO
         MTW,0    IO43SW            WAS IT AN IO 43                     LIO
         BEZ      INV$KEY2          NO                                  LIO
         MTW,-1   IO43SW            SET OFF                             LIO
         B        ABN$IF$IO         PROCESS NOT A DISC-R IO43           LIO
INV$KEY2 RES      0                                                     LIO
+1405    SFP S29903-S29904 11-07-77 DISC-R                              LIO
INV$KEYX RES      0                                                     LIO
         MTW,1    IO43SW            SET ON                              LIO
         B        INV$KEY           DO CHECKING                         LIO
+END                                                                    LIO
