         SYSTEM   BPM
         SYSTEM   SIG7
FLAGS    DATA     0
FL:ALL   DATA     0
FL:DCBS  DATA     0
FL:MSI   DATA     0
FL:USER  DATA     0
FL:PRIV  DATA     0
FL:DFLT  DATA     0
PRTBUF   DATA     '    '
         DO1      24
         DATA     '    '
SAVEREG  RES      16
SAVER    RES      6
:USERS   RES      1
TEMPCTR  DATA     0
DISP     DATA     0
ADCBUF   DATA     '    '
         DO1      35
         DATA     '    '
AMRBUF   RES      512
AMRBFSZ  EQU      2048
NXTPTR   RES      1
PRTCTR   RES      1
DFLAG    DATA     0
VFLAG    DATA     0
FILEBUF  RES      8
FILBFCTR DATA     0
TEMPBUF  RES      25
PATCH    RES      50
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
         REF      J:JIT
         REF      M:LO
         REF      J:CCBUF
         REF      M:EI
         REF,1    JB:BCP
         REF      JB:PRIV
         REF      COCLN
         REF      M:UC
         REF      SV:LIM,SL:NAME,SL:BMX,SL:ODF
         REF      SV:RSIZ,SH:RNM,SB:RBMX,SB:RODF
         REF      SV:TYM,SH:SYMT,S:SYMDB,S:SYMDO
         REF      SL:EX,SL:MEX
BLANKS   TEXT     '    '
*
* HEADERS - THESE ARE MESSAGES PRINTED BY SHOW
* USED FOR FORMATING THE INFORMATION REQUESTED BY THE USER
*
HEADERS  EQU      %
AUTOHDR  TEXT     'AUTOCALL PROCESSOR='
RDALLHDR TEXT     'READ = ALL'
RDNONEHDR TEXT    'READ = NONE'
RECLHDR  TEXT     ';RECL='
TRIESHDR TEXT     ';TRIES='
PRVHDR1  TEXT     'PRIVILEGE:'
PRVHDR2  TEXT     'BATCH   ON-LINE'
MSLHDR   TEXT     'MAXIMUM SERVICE LIMITS:'
BOLHDR1  TEXT     '            BATCH     ON-LINE'
BOLHDR3  TEXT     '       BATCH  ON-LINE'
MRLHDR   TEXT     'MAXIMUM RESOURCE LIMITS:'
ACSPHDR  TEXT     'ACCUMULATED SPACE:RAD='
DFRHDR   TEXT     'DEFAULT FILE RETENTION='
HOURS    TEXT     ' HOURS  '
MFRHDR   TEXT     'MAXIMUM FILE RETENTION='
DISKHDR  TEXT     ',  DISK='
PERLMHDR TEXT     'PERIPHERAL DEVICE AUTHORIZATION:'
DCBHDR   TEXT     '    DCB ASSIGNMENTS'
CYLHDR   TEXT     ';CYLINDER'
NOSEPHDR TEXT     ';NOSEP'
CONSCHDR TEXT     ';CONSEC'
KEYDHDR  TEXT     ';KEYED'
RNDMHDR  TEXT     ';RANDOM'
SEQENHDR TEXT     ';SEQUEN'
DRCTHDR  TEXT     ';DIRECT'
INHDR    TEXT     ';IN'
OUTHDR   TEXT     ';OUT'
INOUTHDR TEXT     ';INOUT'
OUTINHDR TEXT     ';OUTIN'
RELHDR   TEXT     ';REL'
SAVEHDR  TEXT     ';SAVE'
RSTRHDR  TEXT     ';RSTORE='
EXPHDR   TEXT     ';EXPIRE='
TABHDR   TEXT     ';TAB'
SEQHDR   TEXT     ';SEQ='
DATAHDR  TEXT     ';DATA='
LINESHDR TEXT     ';LINES='
QCNTHDR  TEXT     ';COUNT='
SPCEHDR  TEXT     ';SPACE='
DRCHDR   TEXT     ';DRC'
NODRCHDR TEXT     ';NODRC'
BINHDR   TEXT     ';BIN'
BCDHDR   TEXT     ';BCD'
PACKHDR  TEXT     ';PACK'
UNPCKHDR TEXT     ';UNPACK'
FBCDHDR  TEXT     ';FBCD'
NFBCDHDR TEXT     ';NOFBCD'
VFCHDR   TEXT     ';VFC'
NOVFCHDR TEXT     ';NOVFC'
LHDR     TEXT     ';L'
NOLHDR   TEXT     ';NOL'
ABCHDR   TEXT     ';ABCERR'
SHRHDR   TEXT     ',SHARE'
EXCLHDR  TEXT     ',EXCL'
KEYMHDR  TEXT     ';KEYM='
VOLHDR   TEXT     ';VOL='
NEWXHDR  TEXT     ';NEWX='
SPAREHDR TEXT     ';SPARE='
D16HDR   TEXT     ';DEN=1600'
D8HDR    TEXT     ';DEN=800'
EBCHDR   TEXT     ';EBC'
ASCHDR   TEXT     ';ASC'
EXTACHDR TEXT     'EXTENDED ACCOUNTING INFORMATION:'
NASNHDR  TEXT     ' IS NOT ASSIGNED'
BDOPTHDR TEXT     ' IS NOT A VALID OPTION'
LNNUMHDR TEXT     'USER ID=       COC LINE=    '
2LONGHDR TEXT     'COMMAND LINE MUST NOT EX'
         TEXT     'CEED 50 CHARACTERS'
NODFHDR  TEXT     'CANT GIVE YOU SYSTEM DEFAULT VALUES'
INDEFHDR TEXT     'RETAINED INDEFINITELY'
*
*FPTS - PROVIDES THE FPTS NEEDED BY THE CALS IN SHOW
*
FPTS     EQU      %
RAMR     EQU      %
         GEN,8,7,17 X'2D',0,M:EI
         GEN,8,24   X'30',0
         DATA     AMRBUF
         DATA     AMRBFSZ
GETPAGE  DATA     X'08000001'
FREEPAGE DATA     X'09000001'
MAPCHNGE EQU      %
         DATA     X'87000007'
         DATA     X'80000009'
************************************************************************
*                                                                     *
*                                                                     *
*     SHOW - IS A PROCESSOR THAT CAN BE CALLED EITHER ON-LINE OR      *
*     BATCH TO DISPLAY CERTAIN INFORMATION ABOUT THE USER FROM       *
*     HIS *:USERS RECORD AND HIS DCB ASSIGNMENTS FROM THE ASSIGN      *
*     MERGE RECORD.                                                   *
*                                                                     *
*     ON-LINE - SHOW IS CALLED BY THE SHOW COMMAND AT THE TEL LEVEL   *
*     THE SHOW COMMAND LINE CANNOT EXCEDE FIFTY CHARACTERS AND HAS    *
*     THE FORM:  SHOW[.:SYS] [OPTION,OPTION,....].                    *
*           THE VALID OPTIONS ARE:                                    *
*                   ALL - DISPLAYS EVERYTHING                         *
*                   USER - DISPLAYS:                                  *
*                           ACCOUNT,NAME                              *
*                           AUTOCALL PROCESSOR=                       *
*                           USER ID=    , COC LINE=                   *
*                   PRIV - DISPLAYS:                                  *
*                           ACCUMULATED SPACE:RAD=    ,DISK=          *
*                           DEFAULT FILE RETENTION=                   *
*                           MAXIMUM FILE RETENTION=                   *
*                           EXTENDED ACCOUNTING INFORMATION:          *
*                           PRIVELEGE:                                *
*                               BATCH    ON-LINE                      *
*                           MAXIMUM SERVICE LIMITS:                   *
*                               BATCH    ON-LINE                      *
*                           MAXIMUM RESOURCE LIMITS:                  *
*                               BATCH    ON-LINE                      *
*                           PERIPHERAL DEVICE AUTHORIZATION:          *
*                               BATCH    ON-LINE                      *
*                   DCBS - DISPLAYS ALL DCBS THAT THE USER HAS        *
*                          SET IN SET COMMAND FORMAT                  *
*                   M:?? 0R F:?? - DISPLAYS THE INDIVIDUAL DCB        *
*                          SPECIFIED IN SET COMMAND FORMAT            *
*                  IF NO OPTIONS ARE SPECIFIED THE ALL OPTION         *
*                  IS ASSUMED.                                        *
*                                                                     *
*                                                                     *
*                                                                     *
*     BATCH - IF THE SHOW COMMAND IS GIVEN IN BATCH THE OPTION        *
*     FIELD IS IGNORED AND THE ALL OPTION IS ASSUMED EXCEPT THAT      *
*     NO DCB ASSIGNMENTS ARE SHOWN. SO IN BATCH THE USER ALLWAYS      *
*     SEEMS TO HAVE SPECIFIED THE USER AND PRIV OPTIONS.              *
*                                                                     *
*                                                                     *
***********************************************************************
SHOW     EQU      %
DEFAULTS EQU      %
         LB,R1    JB:PRIV
         CI,R1    X'80'
         BGE      GETDFLTS
NODFLTS  MTW,1    FL:DFLT
         LCI      9
         LM,R1    NODFHDR
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         B        GT:USERS
GETDFLTS EQU      %
         LI,R3    S:SYMDB
         BAL,R8   PAGEDISP
         STW,R3   SYMDB
         CAL1,8   GETPAGE
         CI,R8    1
         BNE      NODFLTS
         CAL1,8   FREEPAGE
         CAL1,8   MAPCHNGE
         LW,R10   R9
         LI,R3    S:SYMDO
         SW,R3    R7
         STW,R3   SYMDO
         CI,R3    X'200'
         BL       %+2
         BAL,R1   MAPCALS
         AWM,R10  SYMDB
         AWM,R10  SYMDO
         LW,R2    *SYMDB
         STW,R2   SYMDB
         LW,R2    *SYMDO
         STW,R2   SYMDO
         LI,R3    SH:SYMT
         BAL,R8   PAGEDISP
         STW,R3   SYMTADR
         AI,R9    X'200'
         CAL1,8   MAPCHNGE
         LW,R10   R9
         LI,R4    6
ADRLOOP  LW,R3    NAMTAB,R4
         SW,R3    R7
         STW,R3   ADRTAB,R4
         CI,R3    X'200'
         BL       %+2
         BAL,R1   MAPCALS
         BDR,R4   ADRLOOP
         B        ENDADRLP
NAMTAB   EQU      %-1
         DATA     SL:ODF
         DATA     SL:BMX
         DATA     SL:NAME
         DATA     SB:RODF
         DATA     SB:RBMX
         DATA     SH:RNM
ADRTAB   EQU      %-1
ODFADR   RES      1
BDFADR   RES      1
NAMEADR  RES      1
RODFADR  RES      1
RBDFADR  RES      1
RNMADR   RES      1
SYMTADR  RES      1                 NOT PART OF ADRTAB
SYMDB    RES      1
SYMDO    RES      1
ENDADRLP EQU      %
         LI,R4    7
         AWM,R10  ADRTAB,R4
         BDR,R4   %-1
         B        GT:USERS
MAPCALS  EQU      %
         AI,R7    X'200'
         AI,R9    X'200'
         CAL1,8   MAPCHNGE
         B        *R1
PAGEDISP EQU      %
         LI,R7    0
         CW,R7    R3
         BG       TOOBIG
         AI,R7    X'200'
         B        %-3
TOOBIG   AI,R7    -X'200'
         SW,R3    R7
         B        *R8
*
* GT:USERS - WILL GET THE ADRESS OF THE COMMON PAGE THAT TEL HAS
* READ THE :USERS RECORD INTO FRON JB:BCP - SHIFT IT TO GET THE
* WORD ADDRESS - LOAD THAT ADDRESS INTO :USERS SO THAT IT CAN
* BE USED TO INDIRECTLY ADRESS THE :USERS RECORD
*
GT:USERS EQU      %
         LI,R1    JB:BCP
         LB,R2    0,R1
         AI,R2    1
         SLS,R2   9
         STW,R2   :USERS
*
* BTCHTST - WILL TEST FOR BATCH JOBS AND IF IT IS BATCH
*THE PRIV AND USER OPTIONS WILL BE ASSUMED
*
BTCHTST  MTW,0    J:JIT
         BLZ      OPT
         MTW,1    FL:USER
         MTW,1    FL:PRIV
         B        EVALOPT
TOOLONG  LCI      11
         LM,R0    2LONGHDR
         STM,R0   PRTBUF
         BAL,R8   PRINTER
         B        THEEND
OPT      LI,R7    0
         LI,R1    0
OPT1     LB,R2    J:CCBUF,R1
         STB,R2   R8,R7
         LI,R6    TERMSIZ
         CB,R2    TERMTBL,R6
         BE       OPTPROC
         BDR,R6   %-2
         AI,R7    1
         CI,R1    49
         BGE      TOOLONG
         AI,R1    1
         B        OPT1
OPTPROC  CI,R6    3
         BGE      PROC1
         CI,R7    0
         BNE      PROC2
         SLS,R8   8
         CW,R8    =X'C8D6E600'
         BNE      EVALOPT
         MTW,1    FL:ALL
         B        EVALOPT
PROC2    CW,R8    ='SHOW'
         BNE      PROC3
         CI,R6    3
         BGE      RET1
         MTW,1    FL:ALL
         B        EVALOPT
PROC3    CW,R8    ='USER'
         BNE      PROC4
         MTW,1    FL:USER
         B        RETURN
PROC4    CW,R8    ='PRIV'
         BNE      PROC5
         MTW,1    FL:PRIV
         B        RETURN
PROC5    CW,R8    ='DCBS'
         BNE      PROC6
         MTW,1    FL:DCBS
         B        RETURN
PROC6    LW,R5    R8
         SLS,R5   -8
         CW,R5    =X'00C1D3D3'
         BNE      DCBHUNT
         MTW,1    FL:ALL
RETURN   CI,R6    3
         BL       EVALOPT
RET1     LI,R7    0
         AI,R1    1
         B        OPT1
PROC1    CI,R7    0
         BNE      PROC2
         AI,R1    1
         B        OPT1
DCBHUNT  SLS,R5   -8
         CI,R5    'M:'
         BE       GOTDCB
         CI,R5    'F:'
         BNE      BADOPT
GOTDCB   CW,R8    ='M:SI'
         BNE      NOTSI
         MTW,1    FL:MSI
         B        RETURN
NOTSI    LI,R5    BA(ADCBUF)
         LW,R4    DISP
         AW,R5    R4
         LI,R4    X'20'             BA(R8)
         STB,R7   R5
         MBS,R4   0
         LI,R4    12
         AWM,R4   DISP
         B        RETURN
BADOPT   LI,R4    X'20'             BA(R8)
         LI,R5    BA(PRTBUF)
         STB,R7   R5
         MBS,R4   0
         LI,R4    BA(BDOPTHDR)
         LI,R3    24
         STB,R3   R5
         MBS,R4   0
         BAL,R8   PRINTER
         B        RETURN
TERMTBL  DATA     X'00150D6B'
         DATA     X'40000000'
TERMSIZ  EQU      4
*
* EVALOPT WILL TEST TO SEE WHICH FLAGS ARE SET AND WILL GET
* THE NECESSARY INFORMATION FROM THE *:USERS FILE FOR THE
* ALL, USER AND PRIV OPTIONS. IT FORMATS THE INFORMATION
* USING THE HEADERS AND BALS TO THE PRINTER VIA R8.
*
EVALOPT  EQU      %
         MTW,0    FL:ALL
         BNEZ     USER
         MTW,0    FL:USER
         BNEZ     USER
         B        ACSPAC1
USER     LI,R2    0
         LI,R1    0
         LI,R4    8
USER1    LB,R3    *:USERS,R1
         CI,R3    X'40'
         BE       USER2
         STB,3    PRTBUF,R2
         AI,R2    1
         CW,R2    R4
         BGE      USER2
         AI,R1    1
         B        USER1
USER2    CI,R4    8
         BNE      USER3
         LI,R4    20
         LI,R1    X'6B'
         STB,R1   PRTBUF,R2
         AI,R2    1
         LI,R1    8
         B        USER1
USER3    BAL,R8   PRINTER
         LI,R2    5
         LW,R1    *:USERS,R2
         BLZ      NONE
         LCI      3
         LM,R0    RDALLHDR
         STM,R0   PRTBUF
         B        NONE1
NONE     LCI      3
         LM,0     RDNONEHDR
         STM,R0   PRTBUF
NONE1    BAL,R8   PRINTER
AUTOCALL EQU      %                 GET AUTOCALL PROC. NAME
         LI,R3    12
         MTW,0    *:USERS,R3        SEE IF AUTOCALL EXISTS
         BEZ      LINENUM
         LW,R2    :USERS
         AI,R2    12
         LB,R1    *R2
         SLS,R2   2                 BYTE ADRESS FOR MBS
         AI,R2    1                 SKIP COUNT
         LI,R3    BA(PRTBUF+5)
         STB,R1   R3                PUT COUNT IN R3
         MBS,R2   0                 MOVE IT
         LCI      5
         LM,R1    AUTOHDR           GET HEADER
         STM,R1   PRTBUF            STORE HEADER IN PRTBUF
         BAL,R8   PRINTER           GO PRINT IT
*
* LINENUM - WILL GET AND PRINT THE USER ID (SYSID) & COC LINE #
*
LINENUM  EQU      %
         MTW,0    J:JIT
         BLZ      %+2
         B        ACSPAC1
         LCI      7
         LM,R2    LNNUMHDR
         STM,R2   PRTBUF
         LI,R2    X'FF'
         AND,R2   M:UC+COCLN
         BAL,R8   BIN2HEX
         STW,R4   PRTBUF+6
         LI,R2    X'FFFF'
         AND,R2   J:JIT
         BAL,R8   BIN2HEX
         LW,R7    R4
         BAL,R8   BIN2HEX
         STH,R4   R7
         STW,R7   PRTBUF+2
         BAL,R8   PRINTER
*
* ACSPACE - GETS AND PRINTS THE ACCUMULATED SPACE ( BOTH RAD
* AND DISK ) THAT THE USER HAS AMMASSED.
*
ACSPAC1  MTW,0    FL:ALL
         BNEZ     ACSPACE
         MTW,0    FL:PRIV
         BNEZ     ACSPACE
         B        DCBINFO           ALL OR PRIV NOT SPECIFIED
ACSPACE  EQU      %
         LCI      6
         LM,R2    ACSPHDR           LOAD HEADER
         STM,R2   PRTBUF
         LI,R3    18
         LW,R3    *:USERS,R3
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         CW,R6    ='    '
         BNE      %+4
         STW,R7   PRTBUF+6
         LI,R2    PRTBUF+7
         B        %+4
         LI,R2    PRTBUF+8
         LCI      2
         STM,R6   PRTBUF+6
         LCI      2
         LM,R4    DISKHDR
         STM,R4   *R2
         LI,R3    22
         LW,R3    *:USERS,R3
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         AW,R2    =2
         CW,R6    ='    '
         BNE      %+3
         STW,R7   *R2
         B        %+3
         LCI      2
         STM,R6   *R2
         BAL,R8   PRINTER           GO PRINT IT
*
* DEFILRET - GETS AND PRINTS THE DEFAULT FILE RETENTION PERIOD
*
DEFILRET EQU      %
         LCI      6
         LM,R1    DFRHDR            LOAD HEADER
         STM,R1   PRTBUF
         LW,R2    :USERS
         AI,R2    20
         LH,R3    *R2
         AND,R3   =X'FFFF'
         LI,R1    MXFILRET
         LI,R4    SL:EX
FILRET1  CI,R3    0
         BNE      %+2
         LW,R3    R4
         CI,R3    X'FFFF'
         BNE      %+2
         B        INDEF
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         CW,R6    ='    '
         BNE      %+3
         STW,R7   PRTBUF+6
         LCI      2
         LM,R6    HOURS
         STM,R6   PRTBUF+7
         B        %+5
         LCI      2
         STM,R6   PRTBUF+6
         LM,R6    HOURS
         STM,R6   PRTBUF+8
         BAL,R8   PRINTER           GO PRINT IT
         B        *R1
*
* MXFILRET - GETS AND PRINTS THE MAXIMUM FILE RETENTION PERIOD
*
MXFILRET EQU      %
         LCI      6
         LM,R3    MFRHDR
         STM,R3   PRTBUF
         LI,R7    1
         LI,R3    1
         LH,R3    *R2,R3
         AND,R3   =X'FFFF'
         LI,R4    SL:MEX
         LI,R1    EXACINFO
         B        FILRET1
*
* INDEF - PRINTS 'RETAINED INDEFINITELY' IF FILE RETENTION IS X'FFFF'
*
INDEF    EQU      %
         LCI      6
         LM,R3    INDEFHDR
         STM,R3   PRTBUF+6
         BAL,R8   PRINTER
         B        *R1
*
* EXACINFO - GETS AND PRINTS THE EXTENDED ACCOUNTING INFORMATION
*
EXACINFO EQU      %
         LW,R0    :USERS
         AI,R0    24
         LW,R1    *R0
         CI,R1    0
         BE       PRIV
         LCI      8
         LM,R1    EXTACHDR
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LCI      6
         LM,R1    *R0
         STM,R1   PRTBUF+2
         BAL,R8   PRINTER           GO PRINT IT
PRIV     EQU      %
         MTW,0    J:JIT
         BGEZ     MSL
         LCI      3
         LM,R1    PRVHDR1
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LCI      4
         LM,R1    PRVHDR2
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LW,R1    :USERS
         AI,R1    16
         LB,R2    *R1
         BAL,R8   BIN2HEX
         STW,R4   PRTBUF
         LI,R2    1
         LB,R2    *R1,R2
         BAL,R8   BIN2HEX
         STW,R4   PRTBUF+2
         BAL,R8   PRINTER
MSL      EQU      %
         LCI      6
         LM,R1    MSLHDR
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LCI      8
         LM,R1    BOLHDR1
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LW,R0    :USERS
         AI,R0    30
         MTW,0    FL:DFLT
         BNEZ     MSL0
         LI,R4    SV:LIM
SERVLOOP LW,R5    *NAMEADR,R4
         LI,R1    15
TSTLOOP1 CW,R5    *R0,R1
         BE       NOTDFSRV
         BDR,R1   TSTLOOP1
         BAL,R2   DFLTSERV
NOTDFSRV BDR,R4   SERVLOOP
MSL0     LW,R4    :USERS
         AI,R4    46
         LW,R5    :USERS
         AI,R5    62
         LI,R1    15
MSL1     LW,R2    *R0,R1
         CW,R2    ='    '
         BE       MSL2
         CI,R2    0
         BE       MSL2
         STW,R2   PRTBUF
         LW,R3    *R4,R1
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         LCI      2
         STM,R6   PRTBUF+2
         LW,R3    *R5,R1
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         LCI      2
         STM,R6   PRTBUF+5
         BAL,R8   PRINTER
MSL2     BDR,R1   MSL1
MRL      EQU      %
         LCI      6
         LM,R1    MRLHDR
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LCI      8
         LM,R1    BOLHDR1
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LW,R0    :USERS
         AI,R0    94
         MTW,0    FL:DFLT
         BNEZ     MRL0
         LI,R4    SV:RSIZ
RESLOOP  LH,R5    *RNMADR,R4
         LI,R1    15
TSTLOOP2 CH,R5    *R0,R1
         BE       NOTDFRES
         BDR,R1   TSTLOOP2
         BAL,R2   DFLTRES
NOTDFRES BDR,R4   RESLOOP
MRL0     LW,R4    :USERS
         AI,R4    102
         LW,R5    :USERS
         AI,R5    106
         LI,R1    15
MRL1     LH,R2    *R0,R1
         CH,R2    =X'4040'
         BE       MRL2
         CH,R2    =X'00'
         BE       MRL2
         STH,R2   PRTBUF
         LB,R3    *R4,R1
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         LCI      2
         STM,R6   PRTBUF+2
         LB,R3    *R5,R1
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         LCI      2
         STM,R6   PRTBUF+5
         BAL,R8   PRINTER
MRL2     BDR,R1   MRL1
PERLIM   EQU      %
         LCI      8
         LM,R1    PERLMHDR
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LCI      6
         LM,R1    BOLHDR3
         STM,R1   PRTBUF
         BAL,R8   PRINTER
         LW,R0    :USERS
         AI,R0    114
         MTW,0    FL:DFLT
         BNEZ     PERLIM0
         LI,R4    SV:TYM
PERLOOP  LH,R5    *SYMTADR,R4
         LI,R1    15
TSTLOOP3 CH,R5    *R0,R1
         BE       NOTDFPER
         BDR,R1   TSTLOOP3
         BAL,R2   DFLTPER
NOTDFPER BDR,R4   PERLOOP
PERLIM0  LW,R3    :USERS
         AI,R3    122
         LI,R1    15
PERLIM1  LH,R2    *R0,R1
         CH,R2    =X'4040'
         BE       PERLIM6
         CH,R2    =X'00'
         BE       PERLIM6
         STH,R2   PRTBUF
         LB,R4    *R3,R1
         LI,R5    X'80'
         LI,R6    X'FF'
         CS,R4    R6
         BNE      PERLIM2
         LW,R7    ='YES '
         STW,R7   PRTBUF+2
         B        PERLIM3
PERLIM2  LW,R7    ='NO  '
         STW,R7   PRTBUF+2
PERLIM3  LI,R5    X'40'
         CS,R4    R6
         BNE      PERLIM4
         LW,R7    ='YES '
         STW,R7   PRTBUF+4
         B        PERLIM5
PERLIM4  LW,R7    ='NO  '
         STW,R7   PRTBUF+4
PERLIM5  BAL,R8   PRINTER
PERLIM6  BDR,R1   PERLIM1
         B        DCBINFO
DFLTSERV EQU      %
         STW,R5   PRTBUF
         LW,R3    *BDFADR,R4
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         LCI      2
         STM,R6   PRTBUF+2
         LW,R3    *ODFADR,R4
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         LCI      2
         STM,R6   PRTBUF+5
         BAL,R8   PRINTER
         B        *R2
DFLTRES  EQU      %
         STH,R5   PRTBUF
         LB,R3    *RBDFADR,R4
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         STW,R7   PRTBUF+3
         LB,R3    *RODFADR,R4
         BAL,R8   BIN2BCD
         BAL,R8   LZE
         STW,R7   PRTBUF+6
         BAL,R8   PRINTER
         B        *R2
DFLTPER  EQU      %
         STH,R5   PRTBUF
         LW,R3    =X'80000000'
         LW,R5    R4
         SLS,R3   -1
         BDR,R5   %-1
         CS,R3    SYMDB
         BNE      DFLTPER1
         LW,R7    ='YES '
         B        %+2
DFLTPER1 LW,R7    ='NO  '
         STW,R7   PRTBUF+2
         CS,R3    SYMDO
         BNE      DFLTPER3
         LW,R7    ='YES '
         B        %+2
DFLTPER3 LM,R7    ='NO  '
         STW,R7   PRTBUF+4
         BAL,R8   PRINTER
         B        *R2
*
* THIS COMPLETES THE INFORMATION FROM THE *:USERS FILE.
* BRANCH TO DCBINFO TO PICKUP INFORMATION FROM ASSIGN-MERGE
*
*
* PRINTER - WILL TAKE THE CONTENTS OF PRTBUF, DELETES
* TRAILING BLANKS, OUTPUTS A LINE OF PRINT AND RETURNS
* TO THE CALLING ROUTINE. COMMUNICATION IS VIA REGISTER 8.
*
PRINTER  EQU      %
         LCI      0
         STM,R0   SAVEREG           SAVE ALL REGISTERS
         LI,R1    99                SET CHARACTER POINTER
STEP1    LB,R2    PRTBUF,R1         GET CHARACTER
         CI,R2    ' '               TEST FOR BLANK
         BE       STEP2             IF BLANK GO TO STEP2
         B        STEP3             IF NOT GO TO STEP3
STEP2    AI,R1    -1                DECREMENT REGISTER 1
         BNEZ     STEP1
STEP3    MTW,0    J:JIT
         BGZ      STEP4             IF BATCH DONT NEED LINEFEED
         AI,R1    1
         LI,R3    X'15'             ADD LINE FEED
         STB,R3   PRTBUF,R1
STEP4    AI,R1    1
         M:WRITE  M:LO,(BUF,PRTBUF),(SIZE,*R1),(WAIT),(BTD,0)
         LW,R2    BLANKS            BLANK FILL PRTBUF
J        DO       25
         STW,R2   PRTBUF+J-1
         FIN
         LCI      0
         LM,R0    SAVEREG           RESTORE REGISTERS
         B        *R8               RETURN
*
* LZE - WILL SUBSTITUTE LEAD BLANKS FOR LEAD ZEROS
*
LZE      EQU      %
         LCI      6
         STM,R0   SAVEREG
         LI,R5    X'40'
         LW,R0    R6
         LW,R1    R7
         LI,R2    0
AGAIN    LB,R3    R0,R2
         CI,R3    X'F0'
         BNE      ENDLZE
         STB,R5   R6,R2
         AI,R2    1
         CI,R2    7
         BL       AGAIN
ENDLZE   LCI      6
         LM,R0    SAVEREG
         B        *R8
*
* BIN2BCD - WILL CONVERT A BINARY VALUE TO ITS PTINTABLE BCD VALUE
*
BIN2BCD  EQU      %
         LCI      6
         STM,R0   SAVER
         LI,R1    7
BINA     LI,R2    0
         DW,R2    =10
         AI,R2    X'F0'
         STB,R2   R6,R1
         AI,R1    -1
         BGEZ     BINA
         LCI      6
         LM,R0    SAVER
         B        *R8
*
* BIN2HEX - WILL CONVERT A BINARY BYTE TO ITS PRINTABLE
*HEXADECIMAL EQUIVALENT. R2 CONTAINS THE BINARY BYTE TO BE
*CONVERTED AND R4 CONTAINS THE CONVERTED HEX VALUE.
*
BIN2HEX  EQU      %
         LI,R5    3
         LW,R4    =X'40404040'      SET POINTER AND BLANK R4
GO       SLD,R2   -4                POSITION BYTE
         SLS,R3   -28
         CW,R3    =X'09'
         BG       BIG9              >9 GO TO BIG9
         OR,R3    =X'F0'
         B        OVER              CONVERT AND GO TO OVER
BIG9     SW,R3    =X'09'            SUBTRACT X'09'
         OR,R3    =X'C0'            CONVERT
OVER     STB,R3   R4,R5             STORE CONVERTED VALUE
         AI,R5    -1                DECREMENT POINTER
         CI,R5    1                 DONE?
         BG       GO                NOPE - RETURN
         B        *R8               YUP- RETURN TO CALLING ROUTINE
*
* LOADER - WILL TAKE THE INFORMATION SUPLIED IN THE BUFFERS
* SET TO HEADER AND COUNT AND MOVE IT TO TEMPBUF.
*
LOADER   EQU      %
         LW,R6    R13
         LI,R7    BA(TEMPBUF)
         AW,R7    TEMPCTR           SET UP SOURCE AND DEST.
         STB,R14  R7
         MBS,R6   0
         AW,R14   TEMPCTR
         STW,R14  TEMPCTR
         B        *R8
*
* DCBINFO - WILL READ THE ASSIGN - MERGE RECORD INTO A BUFFER
* AMRBUF AND WILL TEST TO SEE IF THE INFORMATION FOR EACH  DCB
* IN THE RECORD HAS BEEN REQUESTED EITHER BY THE ALL,DCBS OR
* INDIVIDUAL DCB OPTIONS. IF IT HAS IT BRANCHES TO START.
*
DCBINFO  EQU      %
         MTW,0    FL:ALL
         BNEZ     INFO1
         MTW,0    FL:DCBS
         BNEZ     INFO1
         LW,R7    ADCBUF
         CW,R7    BLANKS
         BNE      INFO1
         MTW,0    FL:MSI
         BNEZ     INFO1
         B        THEEND
INFO1    LCI      5
         LM,R3    DCBHDR
         STM,R3   PRTBUF
         BAL,R8   PRINTER
         CAL1,1   RAMR              READ ASSIGN-MERGE RECORD
MSI      MTW,0    FL:MSI            TEST FOR M:SI REQUESTED
         BNEZ     INFO2
         MTW,0    FL:DCBS           TEST FOR ALL DCBS REQUESTED
         BNEZ     INFO2
         B        NXTDCB1
INFO2    LW,R7    AMRBUF+2
         CI,R7    0
         BE       NXTDCB1
         LI,R1    0
         STW,R1   FL:MSI
         LW,R1    AMRBUF+1          PUT FIRST LINK OF
         STW,R1   NXTPTR            DCB CHAIN IN NXTPTR
         LI,R1    AMRBUF
         AW,R1    R7
         AI,R1    1
         LB,R3    *R1               DCBNAME TEXTC COUNT
         LW,R0    R1
         SLS,R0   2
         AI,R0    1                 BYTE ADDRESS OF DCBNAME
         B        START1
NXTDCB1  LW,R7    AMRBUF+1
NXTDCB   LI,R1    AMRBUF
         AW,R1    R7
         LW,R7    *R1               GET POINTER TO NEXT ENTRY
         STW,R7   NXTPTR            STORE IT
         AI,R1    1                 ADVANCE TO DCB NAME
         LB,R3    *R1               GET TEXTC COUNT OF DCBNAME
         LW,R0    R1
         SLS,R0   2
         AI,R0    1
         LI,R6    0
NXTADCB  LW,R4    R0
         LI,R5    BA(ADCBUF)
         AW,R5    R6
         STB,R3   R5
         CBS,R4   0
         BE       PRESTART
         AI,R6    12
         CI,R6    144
         BGE      TESTS
         B        NXTADCB
TESTS    MTW,0    FL:ALL
         BNEZ     START
         MTW,0    FL:DCBS
         BNEZ     START
         CI,R7    0                 TEST FOR LAST ENTRY
         BE       ENDER
         B        NXTDCB
*
* START - START WILL PUT THE WORD 'SET' AND THE DCB NAME IN
* PRTBUF, THEN IT WILL FIND THE FPT, TEST FOR THE CYLINDER
* AND NOSEP OPTIONS, SET FLAGS FOR THE V (VLP) AND D (DEVICE
* FPT) OPTINNS, AND SEARCH ALL THE PARAMETER PRESENCE
* BITS AND BRANCH TO THE PROPER ROUTINE IF THEY ARE SET.
*
PRESTART EQU      %
         SW,R5    R3                RESET TO CONDITION BEFORE CBS
         SLS,R5   -2
         LW,R4    BLANKS
         STW,R4   *R5
START1   LW,R4    R0
START    EQU      %
         LW,R0    ='SET '
         STW,R0   PRTBUF
         LI,R5    BA(PRTBUF)+4
         STB,R3   R5
         MBS,R4   0
         AI,R3    1
         STW,R3   PRTCTR            ESTABLISH PRTCOUNTER
         MTW,4    PRTCTR
         LI,R3    1
FPTSRCH  LW,R4    *R1,R3
         LB,R4    R4
         CI,R4    X'14'
         BE       ENDSRCH
         AI,R3    1
         B        FPTSRCH
ENDSRCH  LW,R4    *R1,R3
         SLS,R4   10
         BEV      NOSEP             IF EVEN CYL BIT NOT SET
         LI,R13   BA(CYLHDR)
         LI,R14   9
         BAL,R8   LOADER
NOSEP    SLS,R4   1                 TEST NOSEP BIT
         BEV      ABCERR
         LI,R13   BA(NOSEPHDR)
         LI,R14   6
         BAL,R8   LOADER
ABCERR   SLS,R4   1
         BEV      DVWORD
         LI,R13   ABCHDR
         LI,R14   7
         BAL,R8   LOADER
DVWORD   AI,R3    1                 GET SECOND WORD OF FPT
         LW,R4    *R1,R3
         SLS,R4   18
         BOD      DTST              IF ODD V BIT NOT SET
         MTW,1    VFLAG
DTST     SLS,R4   2
         BOD      PWORD
         MTW,1    DFLAG
PWORD    AI,R3    1                 GET THIRD WORD OF FPT
         LW,R4    *R1,R3
         SLS,R4   3                 SKIP FIRST THREE BITS
         LI,R5    0
NXTBIT   AI,R5    1
         CI,R5    23                CHECK POINTER FOR DONE
         BE       VLPS
         SLS,R4   1                 TEST NEXT BIT
         BEV      NXTBIT
         AI,R3    1
         LW,R6    BTBL,R5
         LCI      0
         STM,R0   SAVEREG
         B        *R6
NXTBIT1  LCI      0
         LM,R0    SAVEREG
         B        NXTBIT
NXTBIT2  MTW,1    SAVEREG+3
         B        NXTBIT1
*
*BTBL - IS A TABLE TELLING START WHERE TO GO DEPENDING
* ON THE VALUE OF THE INDEX REGISTER = R5.
*
BTBL     EQU      %-1
         DATA     P4
         DATA     P5
         DATA     P6
         DATA     P7
         DATA     P8
         DATA     0,P10
         DATA     NXTBIT
         DATA     NXTBIT2
         DATA     NXTBIT2
         DATA     P13
         DATA     P14
         DATA     NXTBIT2
         DATA     P16
         DATA     P17
         DATA     P18
         DATA     NXTBIT2
         DATA     P20
         DATA     P21
         DATA     P22
*
* P4 - RECL OPTION SPECIFIED
*
P4       LI,R13   BA(RECLHDR)
         LI,R14   6
         B        P20A
*
* P5 - TRIES OPTION WAS SPECIFIED
*
P5       LI,R13   BA(TRIESHDR)
         LI,R14   7
         B        P20A
*
* P6 - WILL BE CALLED IF THE ORG. PRESENCE BIT IS SET
*
P6       EQU      %
         LW,R4    *R1,R3
         SLS,R4   31
         BEV      CONSEC
         SLS,R4   1
         BEV      KEYED
         LI,R13   BA(RNDMHDR)
         LI,R14   7
P6A      BAL,R8   LOADER
         B        NXTBIT1
KEYED    LI,R13   BA(KEYDHDR)
         LI,R14   6
         B        P6A
CONSEC   LI,R13   BA(CONSCHDR)
         LI,R14   7
         B        P6A
*
* P7 - WILL BE CALLED IF THE ACCESS PRESENCE BIT IS SET
*
P7       EQU      %
         LW,R4    *R1,R3
        SLS,R4    30
        SLS,R4    1
        BEV       SEQUEN
        LI,R13    BA(DRCTHDR)
         LI,R14   7
         B        P6A
SEQUEN  LI,R13    BA(SEQENHDR)
         LI,R14   7
         B        P6A
*
* P8 - WILL BE CALLED WHEN THE MODE PRESENCE BIT IS SET
*
P8       EQU      %                 1=IN,2=OUT,4=INOUT,8=OUTIN
         LW,R4    *R1,R3
         CI,R4    8
         BAZ      INOUT
         LI,R13   BA(OUTINHDR)
         LI,R14   6
         B        P6A
INOUT    CI,R4    4
         BAZ      OUT
         LI,R13   BA(INOUTHDR)
         LI,R14   6
INOUT1   BAL,R8   LOADER
         CI,R4    X'200'
         BAZ      NXTBIT1
         CI,R4    X'100'
         BANZ     INSHARE
         LI,R13   BA(EXCLHDR)
         LI,R14   5
         B        P6A
INSHARE  LI,R13   BA(SHRHDR)
         LI,14    6
         B        P6A
OUT      CI,R4    2
         BAZ      IN
         LI,R13   BA(OUTHDR)
         LI,R14   4
         B        P6A
IN       LI,R13   BA(INHDR)
         LI,R14   3
         B        INOUT1
*
* P10 - WILL BE CALLED WHEN THE REL/SAVE PRESENCE BIT IS SET
*
P10      EQU      %                 1=REL,2=SAVE
         LW,R4    *R1,R3
         SLS,R4   31
         BEV      REL
         LI,R13   BA(SAVEHDR)
         LI,R14   5
         B        P6A
REL      LI,R13   BA(RELHDR)
         LI,R14   4
         B        P6A
*
* P13 - KEYM
P13      LI,R13   BA(KEYMHDR)
         LI,R14   6
         B        P20A
*
* P14 - WILL BE CALLED WHEN AN OPLABEL,TAPECODE, OR
* PACKCODE HAS BEEN SPECIFIED IN THE SET COMMAND
*
P14      EQU      %
         LW,R4    *R1,R3
         SCS,R4   -8
         LI,R5    PRTBUF
         LW,R2    PRTCTR
         STB,R4   *R5,R2
         AI,R2    1
         SCS,R4   8
         STB,R4   *R5,R2
         MTW,2    PRTCTR
         B        NXTBIT1
*
* P16 - VOLUME
*
P16      LI,R13   BA(VOLHDR)
         LI,R14   5
         B        P20A
*
*P17 - NEWX,SLIDES,CONSECUTIVE SLIDES
*
P17      LI,13    BA(NEWXHDR)
         LI,R14   6
         BAL,R8   LOADER
         LW,R0    *R1,R3
         SLS,R0   -17
         LB,R3    R0
         BAL,R9   P20B
         LI,R11   ','
         LI,R13   47
         LI,R14   1
         BAL,R8   LOADER
         LH,R3    R0
         LI,R9    NXTBIT1
         B        P20B
*
* P18 - SPARE=
*
P18      LI,R13   BA(SPAREHDR)
         LI,R14   6
         B        P20A
*
* P20 - WILL BE CALLED WHEN THE RSTORE OPTION IS SPECIFIED
*
P20      LI,R13   BA(RSTRHDR)
         LI,R14   8
P20A     LI,R9    NXTBIT1
         BAL,R8   LOADER
         LW,R3    *R1,R3
P20B     BAL,R8   BIN2BCD
         LW,R11   R7
         LI,R13   44                44=BA(R11)
         LI,R14   4
         BAL,R8   LOADER
         B        *R9
*
* P21 - DENSITY
*
P21      LW,R3    *R1,R3
         BNEZ     DEN800
         LI,R13   BA(D16HDR)
         LI,R14   9
         B        P6A
DEN800   LI,R13   BA(D8HDR)
         LI,R14   8
         B        P6A
*
* P22 - ANSCII OR EBCDIC
*
P22      LW,R3    *R1,R3
         BNEZ     ASCII
         LI,R13   BA(EBCHDR)
P22A     LI,R14   4
         B        P6A
ASCII    LI,R13   BA(ASCHDR)
         B        P22A
*
* VLPS - WILL LOOK AT THE CONTROL WORD OF THE VLP AND BAL
* TO THE PRORER ROUTINE. IT ALSO SKIPS TO THE NEXT WHEN FINISHED.
*
VLPS     EQU      %
         MTW,0    VFLAG
         BEZ      DFPT
         AI,R3    1
RESTART  LW,R4    *R1,R3
         LB,R4    R4
         LI,R5    5                 SET POINTER TO END OF TABLE
COMPARE  CB,R4    VTBL,R5
         BE       FOUND
         BDR,R5   COMPARE
         B        FOUND1
FOUND    LW,R5    VBTBL,R5
         LCI      0
         STM,R0   SAVEREG
         BAL,R9   *R5               GO TO PROPER SUBROUTINE
         LCI      0
         LM,R0    SAVEREG
FOUND1   LW,R4    *R1,R3            GET CONTROL WORD
         SLS,R4   8                 SHIFT TO LAST PARAMETER? BYTE
         LB,R5    R4
         AI,R3    1
         CI,R5    1                 TEST FOR LAST PARAMETER
         BE       DFPT
         SLS,R4   -8                SHIFT BACK
         AND,R4   =X'FF'            ZERO ALL BUT LENGTH BYTE
         AW,R3    R4                ADD TO WORD POINTER
         B        RESTART
*
* VTBL - IS A BYTE TABLE OF PARAMETER TYPE CODES.
*
VTBL     EQU      %
         DATA     X'00010203'
         DATA     X'04070000'
*
* VBTBL - IS A WORD TABLE OF WHERE VLPS SHOULD BAL TO.
*
VBTBL    EQU      %-1
         DATA     FILENAME
         DATA     PASSACCT
         DATA     PASSACCT
         DATA     EXPDATE
         DATA     SN
*
* FILENAME - WILL GET THE FILENAME INTO FILEBUF AFTER A SLASH
*
FILENAME EQU      %
         AI,R3    1
         LI,R4    X'61'             SLASH
         STB,R4   FILEBUF
         MTW,1    FILBFCTR
         LW,R4    *R1,R3
         LB,R4    R4
         CI,R4    1
         BNE      %TEST
         LW,R7    *R1,R3
         SLS,R7   -16
         AND,R7   =X'FF'
         CI,R7    0
         BE       FINAL+12          M:GO IS SET TO DEFAULT
%TEST    CI,R4    3
         BNE      NOT%
         LW,R7    *R1,R3
         SLS,R7   -8                GIONG TO TEST FOR M:GO SET %
         AND,R7   =X'0000FFFF'
         OR,R7    =X'80000000'
         CW,R7    J:JIT             IS FULENAME THE SYSID?
         BNE      NOT%
         LI,R7    X'5B'             %
         LW,R6    PRTCTR
         AI,R6    1
         STB,R7   PRTBUF,R6
         BAL,R8   PRINTER
         B        FINAL1
NOT%     LW,R6    R1
         AW,R6    R3                SET UP SOURCE FOR MBS
         SLS,R6   2
         AI,R6    1
         LI,R7    BA(FILEBUF)+1     DESTINATION FOR MBS
         STB,R4   R7                COUNT FOR MBS
         MBS,R6   0
         AW,R4    FILBFCTR
         STW,R4   FILBFCTR
         B        *R9
*
* PASSACCT - WILL PUT BOTH THE ACCOUNT AND THE PASSWORD (IF
* THEY EXIST) INTO FILEBUF PRECEDED BY A PERIOD.
*
PASSACCT EQU      %
         LW,R2    *R1,R3            GET CONTROL WORD
         AND,R2   =X'FF'            GET LENGTH BYTE
         SLS,R2   2                 CONVERT FROM WORDS TO BYTES
         AI,R2    -1                SUTRACT ONE TO MAKE INDEX
         AI,R3    1                 GET FIRST WORD OF PASS-ACCT
         LW,R4    R1
         AW,R4    R3                SET UP BASE FOR INDEX & MBS
PATEST   LB,R5    *R4,R2
         CI,R5    X'40'             TEST FOR BLANK
         BNE      PAFILL            NOT BLANK - FOUND END OF P&A
         AI,R2    -1
         CI,R2    0                 TEST FOR NO P&A
         BL       *R9               RETURN IF NONE
         B        PATEST
PAFILL   LI,R6    X'4B'             PERIOD
         LI,R5    FILEBUF
         LW,R7    FILBFCTR
         STB,R6   *R5,R7
         MTW,1    FILBFCTR
         AI,R7    1
         AI,R2    1                 CONVERT INDEX TO COUNT
         LI,R5    BA(FILEBUF)
         AW,R5    R7
         STB,R2   R5
         SLS,R4   2
         MBS,R4   0
         AW,R2    FILBFCTR
         STW,R2   FILBFCTR
         B        *R9
*
* EXPDATE - WILL PUT THE EXPIRATION DATE, EITHER NEVER,DDD
* OR MM,DD,YY IN TEMPBUF AFTER THE HEADER ';EXPIRE='.
*
EXPDATE  AI,R3    1
         LI,R13   BA(EXPHDR)
         LI,R14   8
         BAL,R8   LOADER
         LCI      2
         LM,R10   *R1,R3
         LB,R4    R10
         CI,R4    'N'
         BE       NEVER
         CI,R4    ' '
         BE       DAYS
         SCD,R10  16
         SLS,R10  -8
         LI,R12   ','
         STB,R12  R10
         SCD,R10  -8
         STB,R12  R11
         SCD,R10  -8
         LI,R13   40                BA(R10)
         LI,R14   8
         BAL,R8   LOADER
         B        *R9
NEVER    LI,R14   5
         LI,R13   40
         BAL,R8   LOADER
         B        *R9
DAYS     LI,R14   3
         LI,R13   41
         BAL,R8   LOADER
         B        *R9
*
* SN - WILL PUT THE SERIAL NUMBER IN PRTBUF PRECEDED BY A '#'.
*
SN       EQU      %
         AI,R3    1
         LI,R2    X'7B'             '#'
         LI,R4    PRTBUF
         LW,R7    PRTCTR
         STB,R2   *R4,R7
         MTW,1    PRTCTR
         LW,R2    *R1,R3
         AI,R7    1
         LI,R6    8                 8=BA(R2)
         LI,R4    BA(PRTBUF)
         AW,R7    R4
         LI,R4    4
         STB,R4   R7
         MBS,R6   0
         MTW,4    PRTCTR
         B        *R9
*
* DFPT - WILL SEARCH THE Q PRESENCE BITS AND BRANCH TO THE
* PROPER SUBROUTINE IF SET.
*
DFPT     EQU      %
         MTW,0    DFLAG
         BEZ      FINAL
         AI,R3    1
         LW,R4    *R1,R3
         LI,R5    0
NXTQBIT  AI,R5    1
         CI,R5    9                 TEST POINTER FOR DONE
         BE       FINAL
         SLS,R4   1                 SHIFT ONE PRESENCE BIT OFF LEFT
         BEV      NXTQBIT           EVEN = 0 - NOT PRESENT
         LW,R6    QTBL,R5
         BAL,R9   *R6
         B        NXTQBIT           AFTER COMPLETION TRY NEXT BIT
*
* QTBL - IS THE TABLE THAT TELLS DFPT WHERE TO GO.
*
QTBL     EQU      %-1
         DATA     TABS
         DATA     SEQ
         DATA     DATA
         DATA     QCOUNT
         DATA     NXTQBIT           SHOULD NEVER BE SET
         DATA     LINES
         DATA     SPACE
         DATA     Q8
*
* TABS - SEARCHES THE FOUR WORDS OF POSSIBLE TAB POSITIONS,
* AND PUTS EACH ONE THAT EXISTS IN TEMPBUF AFTER 'TABS='.
*
TABS     EQU      %
         LCI      0
         STM,R0   SAVEREG
         LI,R13   BA(TABHDR)
         LI,R14   4
         BAL,R8   LOADER
         LW,R4    R1
         AW,R4    R3
         AI,R4    1
         LI,R5    -1
NXTTAB   AI,R5    1
         LB,R3    *R4,R5
         CI,R5    17                TEST FOR DONE
         BGE      ENDTABS
         CI,R3    0                 TEST FOR NO MORE TABS
         BE       ENDTABS
TABFILL  CI,R5    0                 FIRST TAB?
         BE       EQUSIN            YES - GET =
         LI,R10   X'6B'             NO - GET ,
         B        ENDSIN
EQUSIN   LI,R10   X'7E'
ENDSIN   BAL,R8   BIN2BCD           CONVERT TAB
         STB,R10  R7                PUT IN SEPERATOR
         LW,R11   R7
         LI,R13   44                44=BA(R11)
         LI,R14   4
         BAL,R8   LOADER
         B        NXTTAB
ENDTABS  LCI      0
         LM,R0    SAVEREG
         AI,R3    4
         B        *R9
*
* SEQ - GETS THE SEQ HEADER AND VALUE INTO TEMPBUF
*
SEQ      EQU      %
         AI,R3    1
         LW,R11   *R1,R3
         LI,R13   BA(SEQHDR)
         LI,R14   5
         BAL,R8   LOADER
         LI,R13   44                44=BA(R11)
         LI,R14   4
         BAL,R8   LOADER
         B        *R9
*
* DATA - GETS THE DATA HEADER AND CONVERTED VALUE INTO TEMPBUF
*
DATA     EQU      %
         LI,R13   BA(DATAHDR)
         LI,R14   6
         BAL,R8   LOADER
VALUE    AI,R3    1
         LW,R15   R3
         LW,R3    *R1,R3
         BAL,R8   BIN2BCD
         LW,R11   R7
         LI,R13   44                44=BA(R11)
         LI,R14   4
         BAL,R8   LOADER
         LW,R3    R15
         B        *R9
*
* LINES - GETS THE LINES HEADER AND CONVERTED VALUE INTO TEMPBUF
*
LINES    EQU      %
         LI,R13   BA(LINESHDR)
         LI,R14   7
         BAL,R8   LOADER
         B        VALUE
*
*QCOUNT - GETS COUNT HEADER AND CONV. VALUE IN TEMPBUF
*
QCOUNT   EQU      %
         LI,R13   BA(QCNTHDR)
         LI,R14   7
         BAL,R8   LOADER
         B        VALUE
*
* SPACE - GETS SPACE HEADER AND CONVERTED VALUE INTO TEMPBUF
*
SPACE    EQU      %
         LI,R13   BA(SPCEHDR)
         LI,R14   7
         BAL,R8   LOADER
         B        VALUE
*
* Q8 - WILL GET THE TWO PARALLEL HALFWORDS OF BITS  FROM THE
* Q8 WORDS AND TEST THEM - PUTTING THE PROPER OPTION IN TEMPBUF
*
Q8       EQU      %
         AI,R3    1
         LW,R1    *R1,R3
         LH,R2    R1
         SLS,R1   25                SET UP THE PARALLEL
         SLS,R2   25                BIT TABLES
         SLS,R2   1
         BOD      DRC
         B        PBIN
DRC      SLS,R1   1
         BEV      NODRC
         LI,R13   BA(DRCHDR)
         LI,R14   4
         BAL,R8   LOADER
         B        PBIN+1
NODRC    EQU      %
         LI,R13   BA(NODRCHDR)
         LI,R14   6
         BAL,R8   LOADER
         B        PBIN+1
PBIN     SLS,R1   1
         SLS,R2   1
         BOD      BIN
         B        PPACK
BIN      SLS,R1   1
         BEV      BCD
         LI,R13   BA(BINHDR)
         LI,R14   4
         BAL,R8   LOADER
         B        PPACK+1
BCD      EQU      %
         LI,R13   BA(BCDHDR)
         LI,R14   4
         BAL,R8   LOADER
         B        PPACK+1
PPACK    SLS,R1   1
         SLS,R2   1
         BOD      PACK
         B        PFBCD
PACK     SLS,R1   1
         BEV      UNPACK
         LI,R13   BA(PACKHDR)
         LI,R14   5
         BAL,R8   LOADER
         B        PFBCD+1
UNPACK   EQU      %
         LI,R13   BA(UNPCKHDR)
         LI,R14   7
         BAL,R8   LOADER
         B        PFBCD+1
PFBCD    SLS,R1   1
         SLS,R1   1
         SLS,R2   1
         SLS,R2   1
         BOD      FBCD
         B        PVFC
FBCD     SLS,R1   1
         BEV      NOFBCD
         LI,R13   BA(FBCDHDR)
         LI,R14   5
         BAL,R8   LOADER
         B        PVFC+1
NOFBCD   EQU      %
         LI,R13   BA(NFBCDHDR)
         LI,R14   7
         BAL,R8   LOADER
         B        PVFC+1
PVFC     SLS,R1   1
         SLS,R2   1
         BOD      VFC
         B        PL
VFC      SLS,R1   1
         BEV      NOVFC
         LI,R13   BA(VFCHDR)
         LI,R14   4
         BAL,R8   LOADER
         B        PL+1
NOVFC    EQU      %
         LI,R13   BA(NOVFCHDR)
         LI,R14   6
         BAL,R8   LOADER
         B        PL+1
PL       SLS,R1   1
         SLS,R2   1
         BOD      QL
         B        FINAL
QL       SLS,R1   1
         BEV      NOL
         LI,R13   BA(LHDR)
         LI,R14   2
         BAL,R8   LOADER
         B        FINAL
NOL      EQU      %
         LI,R13   BA(NOLHDR)
         LI,R14   4
         BAL,R8   LOADER
         B        FINAL
*
* FINAL - ASSEMBLES FILEBUF AND TEMPBUF INTO PRTBUF, THEN
* PRINTS THE SET COMMAND, AND TEST FOR LAST DCB AND RETURNS.
*
FINAL    EQU      %
         LI,R4    BA(FILEBUF)
         LI,R5    BA(PRTBUF)
         AW,R5    PRTCTR
         LW,R6    FILBFCTR
         STB,R6   R5
         MBS,R4   0
         AW,R6    R5
         LI,R4    BA(TEMPBUF)
         LW,R6    TEMPCTR
         STB,R6   R5
         MBS,R4   0
         BAL,R8   PRINTER
FINAL1   LW,R2    BLANKS
Z        DO       8
         STW,R2   FILEBUF+Z-1
         FIN
Y        DO       25
         STW,R2   TEMPBUF+Y-1
         FIN
         LI,R1    0
         STW,R1   TEMPCTR
         STW,R1   FILBFCTR
         STW,R1   DFLAG
         STW,R1   VFLAG
         LW,R7    NXTPTR
         CI,R7    0
         BE       ENDER
         B        NXTDCB
*
* ENDER - WILL TRANSFER CONTROL BACK TO TEL
*
ENDER    EQU      %
         MTW,0    FL:MSI
         BEZ      ENDER1
         LW,8     ='M:SI'
         LI,1     4
         LI,6     8                 WA OF 'M:SI'
         LI,3     -1
         LI,4     -3
         B        PRTNASN
ENDER1   LI,R3    0
         LI,R4    0
CHKASGN  LI,R6    ADCBUF
         AW,R6    R4
         LW,R7    *R6
         CW,R7    ='    '
         BNE      NOTASGN
         AI,R4    3
         AI,R3    1
         CI,R3    12
         BGE      THEEND
         B        CHKASGN
NOTASGN  LI,R1    1
         LB,R2    *R6,R1
         CI,R2    X'40'
         BE       PRTNASN
         AI,R1    1
         B        NOTASGN+1
PRTNASN  SLS,R6   2
         LI,R7    BA(PRTBUF)
         STB,R1   R7
         MBS,R6   0
         LI,R6    BA(NASNHDR)
         LI,R1    16
         STB,R1   R7
         MBS,R6   0
         BAL,R8   PRINTER
         AI,R3    1
         AI,R4    3
         B        CHKASGN
THEEND   EQU      %
         M:EXIT
         END      SHOW

