*****************
*M* RECONFIG PERFORM PO TAPE BOOT-TIME RECONFIGURATION & PARTITIONING
*****************
         TITLE    'BOOT TIME RECONFIGURATION & PARTITIONING PROCESSOR'
*P***************
*P*      NAME:    RECONFIG
*P*      PURPOSE: TO PERFORM PO TAPE BOOT-TIME RECONFIGURATION
*P*               & PARTITIONING.
*P*      DESCRIPTION: THIS MODULE IS A PART OF THE CP-V MONITOR
*P*               ROOT WHEN IT IS BOOTED FROM A PO TAPE. IT IS
*P*               USED IN CONJUNCTION WITH BOOTSUBR & XDELTA
*P*               DURING THE PHASE WHICH PATCHES THE MONITORS
*P*               ROOT. IT IS ENTERED WHEN A COLON (:) COMMAND
*P*               IS ENCOUNTERED BY XDELTA & BOOTSUBR
*P*               DETERMINES THAT XDELTA IS STILL PATCHING
*P*               THE ROOT PORTION OF THE MONITOR, THAT IS, NO
*P*               NON-ROOT PATCHES HAVE BEEN ENCOUNTERED YET.
*P*               RECONFIG CONTAINS 3 ENTRIES:
*P*                 1. THE FIRST ENTRY IS FOR INITIALIZATION
*P*                    OF THE DEVICE ADDRESSES ACCORDING TO
*P*                    MACHINE TYPE, THAT IS, SIGMA VS 560.
*P*                 2. THE SECOND ENTRY IS FOR THE PROCESSING
*P*                    OF COLON (:) COMMANDS AS ENCOUNTERED
*P*                    BY XDELTA & BOOTSUBR.
*P*                 3. THE THIRD ENTRY IS USED BY BOOTSUBR
*P*                    WHEN NO ':END' COMMAND IS ENCOUNTERED
*P*                    PRIOR TO ENCOUNTERING A NON-ROOT PATCH
*P*                    OR THE ASTERISK (*) COMMAND IN THE PATCH
*P*                    DECK. THIS ENTRY ASSUMES A ':END'
*P*                    SITUATION & COMPLETES THE RECONFIGURATION
*P*                    & PARTITIONING PROCESS.
*P*               ALL OF RECONFIGS CODE CAN BE PATCHED BY XDELTA
*P*               PRIOR TO USING IT EXCEPT FOR THE CODE IN
*P*               THE FIRST ENTRY AREA. RECONFIG PATCHES MUST
*P*               PRECEED THE FIRST COLON (:) COMMAND.
*P*      REFERENCE:  SPECS.DWG.# 703198,703240.
*P***************
         PAGE
         CSECT    0
TEST     SET      0                 =0, NO TEST MODE CODE
*                                   =1, TEST MODE(ON-LINE DEBUGGING)
AUTO     SET      0                 =0 NO AUTO CNFG.,=1 AUTO CNFG.
         SYSTEM   UTS
         DO1      TEST=1
         SYSTEM   BPM
*****************
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
*****************
         PAGE
*****************
*  DEF'S
***
         DEF      RECNFG:0          1-ST ENTRY INTO RECONFIG
*,*                                 PERFORMS INITIALIZATION
         DEF      RECNFG:1          2-ND ENTRY INTO RECONFIG
*,*                                 PROCESSES COLON (:) COMMANDS
         DEF      RECNFG:2          3-RD ENTRY INTO RECONFIG
*,*                                 COMPLETES RECONFIGURATION &
*,*                                 PARTITIONING WHEN NO ':END'
*,*                                 COMMAND IS FOUND
         DO       TEST=1
         DEF      DUM:XDLT          ROUTINE
*,*                           USED DURING ON-LINE DEBUGGING ONLY.....
         FIN
*
         DEF      RECONFIG:         `PATCHING DEF
RECONFIG: RES
         PAGE
********
*  REF'S
***
         REF      DCT1              INPUT OUTPUT HALF WORD
*,*                           FIX DEV.ADDR.ACCORDING TO MACHINE TYPE
         REF      DCT1P             INPUT OUTPUT HALF WORD
*,*                           SET DEV.ADDR.FROM RECONFIGURATION INFO
*,*                             WHEN SINGLE ACCESS OR DUAL ACCESS
*,*                             & IS PRIMARY DEFINITION. SEARCH FOR
*,*                             DESIRED DEV.ADDR. FOR PARTITIONING.
         REF      DCT1A             INPUT OUTPUT HALF WORD
*,*                           SET DEV.ADDR.FROM RECONFIGURATION INFO
*,*                             WHEN DUAL ACCESS & IS ALTERNATE
*,*                             DEFINITION. SEARCH DESIRED DEV.
*,*                             ADDR. FOR PARTITIONING.
         REF      DCTSIZ            INPUT
*,*                           SIZE OF DCT TABLES
         REF      DCT2              INPUT BYTE
*,*                           OBTAIN CHANNEL INDEX & SEARCH FOR
*,*                             EQUIVALENT DCT ENTRIES
         REF      DCT3              INPUT OUTPUT BYTE BITS 2,5-7
*,*                           CHECK FOR POOLED DEV.IN INITIALIZATION.
*,*                             CHECK FOR DEV.PARTITIONED OR
*,*                             CONT.PARTITIONED & ALSO SET
*,*                             DEV. &/OR CONT.PARTITIONED FLAGS.
         REF      DCT4              INPUT BYTE
*,*                           OBTAIN DEV.TYPE INDEX & SEARCH FOR
*,*                             EQUIVALENT DEV.TYPES
         REF      DCT9              INPUT OUTPUT WORD BITS 3-6
*,*                           SAVE SC1/SC2 FLAGS FROM DCT3 BITS 6-7
*,*                           & PRIM./ALT.CONTROLLER PARTITIONED
*,*                           FLAGS
         REF      DCT16             INPUT OUTPUT DOUBLE WORD
*,*                           OBTAIN 'YYNDD' OR MODIFY 'YYNDD'
*,*                             AS DEFINED BY RECONFIGURATION
         REF      DCT24             INPUT OUTPUT BYTE BITS 0,2-4,6-7
*,*                           CHECK FOR DEV.NOT-PARTITIONABLE,
*,*                             DEV.RECONFIGURED OUT OF SYSTEM,
*,*                             CONT.PARTITIONED, CONT.
*,*                             RECONFIGURED OUT OF SYSTEM, CONT.
*,*                             NOT-PARTITIONABLE, OR SET DEV.
*,*                             RECONFIGURED OUT OF SYSTEM, CONT.
*,*                             PARTITIONED, CONT.RECONFIGURED
*,*                             OUT OF SYSTEM, & DEV.NOT-ALLOCATABLE.
         REF      CIT3              INPUT BYTE BIT 4
*,*                           CHECK CHANNEL IF DUAL ACCESS
         REF      SNDDX             INPUT OUTPUT BYTE
*,*                           SEARCH FOR DEV.BEING A SYMBIONT
*,*                             & SET ENTRY TO 0 IF SYMBIONT DEV.
*,*                             IS RECONFIGURED OUT OF SYSTEM
         REF      SSTAT             INPUT OUTPUT BYTE
*,*                           DETERMINE IF SYMBIONT IS
*,*                             AVAILABLE OR SET TO
*,*                             NOT AVAILABLE IF DEV. IS
*,*                             RECONFIGURED OUT OF SYSTEM OR IS
*,*                             PARTITIONED
         REF      SSIG              OUTPUT BYTE
*,*                           SET SIGNAL CHARACTER WHEN SYMBIONT
*,*                             IS RECONFIGURED OUT OF SYSTEM OR
*,*                             IS PARTITIONED
         REF      SYMX              INPUT BYTE BIT 6
*,*                           DETERMINE IF SYMBIONT IS INPUT OR
*,*                             OUTPUT
         REF      BATAPE            INPUT
*,*                           USED TO MODIFY DCT INDEX TO INDEX
*,*                             INTO AVRTBL TABLE
         REF      AVRTBLSIZ         INPUT
*,*                           # TAPE ENTRIES IN AVRTBL TABLE
         REF      AVRTBLNE          INPUT
*,*                           # ENTRIES IN AVRTBL TABLE
         REF      AVRTBL            INPUT OUTPUT DOUBLE WORD
*,*                                 BITS 32,40-47
*,*                           CHECK IF DISK PACK IS PUBLIC VS
*,*                             PRIVATE. SET NOU FIELD NON 0
*,*                             WHEN TAPE OR PACK IS RECONFIGURED
*,*                             OUT OF THE SYSTEM.
         REF      AVRNOU            OUTPUT HALF WORD
*,*                           SET NON 0 WHEN DISK PACK IS
*,*                             RECONFIGURED OUT OF THE SYSTEM
         REF      OH:NM             INPUT HALF WORD
*,*                           SEARCH FOR DEV.TYPE MNEMONIC
         REF      TYPMNSZ           INPUT
*,*                           SIZE OF OH:NM TABLES DEV.MNEMONICS
         REF      SB:RTY            INPUT BYTE
*,*                           SEARCH RESOURCE TABLES FOR DEV.TYPE
         REF      SH:RTOT           INPUT OUTPUT HALF WORD
*,*                           MODIFY RESOURCE TYPE COUNTS WHEN
*,*                             RECONFIGURING OR PARTITIONING
         REF      TB:FLGS           INPUT BYTE
*,*                           GET RESOURCE TYPE FLAGS TO CHECK
*,*                             FOR LEGITIMATE DEV.FOR PARTITIONING
         REF      SV:RSIZ           INPUT
*,*                           SIZE OF RESOURCE TABLES (SB:RTY,ETC.)
         REF      M:MODNUM          INPUT WORD
*,*                           OBTAIN # ENTRIES IN M:MODNUM TABLE
         REF      CNTMOD#           INPUT HALF WORD
*,*                           SEARCH FOR CONT.MODEL # IN THIS SYSGEN
         REF      DEVMOD#            INPUT HALF WORD
*,*                           SEARCH FOR DEV.MODEL # IN THIS SYSGEN
         REF      RBLIMS            INPUT DOUBLE WORD
*,*                           CHECK DCT INDEX IF REMOTE BATCH
         DO       TEST=0
         REF      C%CPU             INPUT WORD
*,*                           CHECK TARGET MACHINE = SYSGENED
         FIN
         REF      X560CUCL          INPUT BYTE
*,*                           TABLE CONTAINING XEROX 560
*,*                             VALUES FOR CONVERTING 'N'
*,*                             IN 'YYNDD'
         REF      OCNDD             INPUT WORD
*,*                           CONTAINS OC DEV.ADDR.AT BOOT-TIME
         DO       TEST=0
         REF      OCNDDFLG          INPUT WORD
*,*                           CONTAINS OC DEV.INDEX IF THE OC
*,*                             DEV.ADDR.AT BOOT-TIME WAS
*,*                             CHANGED FROM THAT WHICH IT WAS
*,*                             SYSGENED FOR, ELSE IT IS 0
         REF      :ENDFND           INPUT WORD
*,*                           FLAG INDICATING ':END' IS FOUND
         FIN
         REF      NAMSCAN           ROUTINE
*,*                           OBTAIN NEXT NAME FIELD FROM INPUT
*,*                             COMMAND
         REF      HEXSCAN           ROUTINE
*,*                           OBTAIN NEXT FIELD FROM INPUT COMMAND
*,*                             AND IT MUST BE HEXADECIMAL
         REF      RECNFGLL          ROUTINE
*,*                           DISPLAY INFO ON LL DEVICE
         REF      RECNFGOC          ROUTINE
*,*                           DISPLAY INFO ON OC DEVICE
         DO       TEST=0
         REF      CL2PA             ROUTINE
*,*                           CONVERTS 'YYNDD' ACCORDING TO
*,*                             MACHINE TYPE (SIGMA VS 560)
         REF      CANTRUN           ROUTINE
*,*                           DISPLAYS MESSAGE ON OC WHEN PO
*,*                             TAPE IS SYSGENED FOR A MACHINE
*,*                             & THE MACHINE WHERE IT IS BEING
*,*                             BOOTED IS NOT THAT MACHINE TYPE
         FIN
         REF      MB:SDI            INPUT BYTE
*,*                           OBTAIN DCT INDEX(S) OF SWAPPER(S)
         REF      LSWAP             INPUT
*,*                           # SWAPPER(S) IN SYSTEM
         REF      M:FREE#GRAN       OUTPUT WORD
*,*                           SET ENTRY TO 0 IF SWAPPER IS
*,*                             RECONFIGURED OUT OF SYSTEM
         REF      M16               CONSTANT X'FFFF'
         REF      M24               CONSTANT X'FFFFFF'
         REF      Y1                CONSTANT X'10000000'
         REF      Y2                CONSTANT X'20000000'
         REF      Y3                CONSTANT X'30000000'
         REF      Y4                CONSTANT X'40000000'
         REF      Y8                CONSTANT X'80000000'
         REF      Y01               CONSTANT X'01000000'
         REF      Y04               CONSTANT X'04000000'
         REF      Y08               CONSTANT X'08000000'
         REF      YC                CONSTANT X'C0000000'
         REF      M17               DATA OF X'0001FFFF'
         REF      BOOTFLG           BOOT TIME FLAG DELTA MAINTAINS
         DO       TEST=1
         REF      M:LO,M:SI
*,*                           USED ONLY IN TEST MODE
         FIN
         SREF     DCT26             INPUT BYTE
*,*                           IF > 0, FECP PRESENT
         SREF     FEH:ADR           OUTPUT HALF WORD
*,*                           CONTAINS FECP DEV.ADDR.FOR EACH FECP
         SREF     FEB:CDX           INPUT BYTE
*,*                           DCT INDEX OF FECP DEVICES
         SREF     FECP#             INPUT
*,*                           # OF FECP'S
         SREF     FECPD#            INPUT
*,*                           # ITEMS CONNECTED TO FECP
         SREF     FDB:DCT           INPUT BYTE
*,*                           DCT INDEX OF DEVICES
         SREF     C%PSZE            SIZE OF 560 POLLING TABLE
         SREF     C%PADDR           560 POLLING TABLE
         SREF     COC               INPUT
*,*                           VALUE IS 0 IF NON-COC SYSTEM
         SREF     LCOC              INPUT
*,*                           # COC'S IN SYSTEM
         SREF     COH:DN            INPUT OUTPUT HALF WORD
*,*                           CONTAINS COC DEV.ADDR.FOR EACH COC
         DO       AUTO=1
         SREF     IOPCNFG           ROUTINE
*,*                           AUTOMATIC CONFIGURATION ROUTINE
*,*                             TO DETERMINE IF DEV.ADDR.IS ON
*,*                             MACHINE, & THIS IS NOT IMPLEMENTED
         FIN
         SREF     RB:FLAG           OUTPUT WORD
*,*                           REMOTE BATCH STATION FLAG TABLE
*,*                             INDICATING PARTITIONED OR NOT
         SREF     OFFBIT            INPUT
*,*                           FLAG WHICH INDICATES IF REMOTE BATCH
*,*                             STATION IS PARTITIONED OR NOT
         SREF     CSEBRANCH         INPUT TABLE FOR SIGMA/560 MACHINES
*,*                           BRANCH TABLE FOR FAULT HANDLERS
         SREF     CSE%1:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%2:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%3:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%4:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%5:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%6:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%7:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%8:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%9:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%A:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%B:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%C:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%D:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%E:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%F:7           ROUTINE ENTRY SIGMA 7
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%1:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%2:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%3:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%4:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%5:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%6:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%7:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%8:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%9:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%A:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%B:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%C:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%D:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%E:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%F:9           ROUTINE ENTRY SIGMA 9
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%1:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%2:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%3:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%4:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%5:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%6:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%7:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%8:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%9:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%A:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%B:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%C:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%D:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%E:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
         SREF     CSE%F:560         ROUTINE ENTRY XEROX 560
*,*                           BRANCH ENTRY TO FAULT HANDLERS
********
         PAGE
*****************
*  SPECIAL PROCS
*****************
CLUNT    CNAME
         PROC
LF       GEN,8,2,3,3  AF(1),AF(2),AF(3),AF(4)
         PEND
*****************
         PAGE
*****************
*  RECONFIG ENTRY VECTOR - MUST BE COORDINATED WITH BOOTSUBR
********
*                             ** LOC **
RECNFG:0 B        INITL       <---0-INITIALIZE DCTS, ETC.        ENTRY#1
RECNFG:1 B        PROC:       <---1-PROCESS ':' COMMAND          ENTRY#2
RECNFG:2 B        :ENDFALT    <---2-ASSUME ':END' BY DEFAULT     ENTRY#3
*----------------
         DO       TEST=1
         PAGE
*****************
* CODE FOR DEBUGGING ONLY.....
****
****
* TO LOAD RECONFIG FOR DEBUGGING, LOAD AS FOLLOWS:
* !LOAD  (LMN,RECNFIG),(NOSYSLIB),(PERM),(NOTCB),(MAP),(SL,F),;
* !      (EF,(RECONFIG:BO),(LITERALS:BO),(GETFIELD:BO),;
* !      (M:MODNUM),(IOTABLE),(M:DCTMOD),(M:SDEV),;
* !      (SG:RNT),(SG:RTY),(SG:FLG),(SG:OPNM),(SG:RCT),;
* !      (SPECIAL:BO))
* !ASSIGN M:EI,(FILE,RECNFIG),(INOUT)
* !SYMCON
* BUILD (LIB)
* END
****
*        MODULE SPECIAL:BO MUST CONTAIN:
*                 REF         DUM:XDLT
*        START    B           DUM:XDLT
*                 END         START
*****************
OCNDDFLG DATA     0
C%CPU    DATA     X'20000020'       =X'80000080' IS SIGMA CPU
*                                   =Y20000020 XEROX 560
:ENDFND  DATA     0
BUFR     RES      21
********
         PAGE
********
*  'STOP'  COMMAND IS THE EQUIVALENT TO XDELTA IN REAL SYSTEM
*    READING AN '*' COMMAND OR MONITOR OVERLAY PATCH CARD.
****
DUM:XDLT EQU      %                 ENTRY WHEN IN DEBUG MODE
         M:DEVICE M:LO,(PAGE)
         BAL,R15  RECNFG:0          INITIALIZE DCT1,1P,1A
ENT:XDLT EQU      %
         LI,R1    21
         LW,R2    BLK
         STW,R2   BUFR-1,R1
         BDR,R1   %-1
         M:PC     '*'
         M:READ   M:SI,(BUF,BUFR),(SIZE,80),(BTD,0),(WAIT),;
                        (ABN,STOPIT),(ERR,STOPIT)
         LI,R12   3                 ASN MASK
         AND,R12  M:SI              GET INPUT DCB SOURCE MODE
         CI,R12   1                 INPUT COMING FROM A FILE
         BNE      %+2               NOPE
         M:WRITE  M:LO,(BUF,BUFR),(SIZE,80),(WAIT) ***ECHO INPUT IF SO
         LI,R12   BUFR
         LI,R14   AD:MSG
         LI,R15   ENT:XDLT
         LB,R1    BUFR
         CI,R1    ':'
         BE       RECNFG      ****
         LW,R1    BUFR
         CW,R1    L(C'STOP')
         BE       STOPIT
         B        ENT:XDLT
*-------
STOPIT   EQU      %
         B        SWAPINIT
*-------
AD:MSG   EQU      %
         B        *R10
*-------
         PAGE
********
RECNFG   EQU      %
         MTW,0    :ENDFND
         BEZ      RECNFG:1    ****
RECN:EXIT EQU     %
         M:EXIT   1
*-------
SWAPINIT EQU      %
         MTW,0    :ENDFND
         BNEZ     RECNFG      ****
         MTW,1    :ENDFND
         BAL,R15  RECNFG:2    ****
         B        ENT:XDLT
*-------
CANTRUN  EQU      %
         LI,R12   NORUNM
         BAL,R11  MSGLL
         M:EXIT   2
*-------
CL2PA    EQU      %
         LC       C%CPU
         BCS,2    CUCLCVT
         AI,R8    -'A'
         BLZ      BADL
         CI,R8    16
         BG       BADL
         CI,R8    8
         BLE      %+2
         AI,R8    -7
GOODL    EQU      %
         LCI      0
         B        *R15
*-------
BADL     EQU      %
         LCI      1
         B        *R15
*-------
CUCLCVT  EQU      %
         LI,R3    0
CUCLOOP  EQU      %
         CB,R8    CLUSUNT,R3
         BE       GOTN
         AI,R3    2
         CI,R2    #CLUNT*2
         BL       CUCLOOP
         B        BADL
*-------
GOTN     EQU      %
         AI,R3    1
         LB,R8    CLUSUNT,R3
         B        GOODL
*-------
NORUNM   EQU      %
         TEXTC    'CANNOT RUN'
*-------
         FIN
         PAGE
*****************
*DO*
*F*      NAME:    RECONFIG
*  R E C O N F I G  -  P R O C E S S O R
*
*        PURPOSE:
*    CONVERT ALL DCT1/DCT1A/DCT1P ENTRIES TO APPROPRIATE DEVICE ADDR., &
*    DETERMINE ALL EXISTING DEVICES ADDRESSES & CONTROLLER MODEL #'S &
*    USE INFO TO CHANGE CP-V MONITOR TABLES TO REPRESENT TARGET SYSTEMS
*    CONFIGURATION. ALSO, PARTITION DEVICES & CONTROLLERS PRIOR TO
*    MAKING SYSTEM AVAILABLE FOR USERS.
*FIN*
*DO*
*D*      NAME:    RECONFIG
*        DESCRIPTION:  INITIALIZE CONFIGURATION INFO.
*
*    ENTERED FROM BOOTSUBR
*
*    CALL:
*        R15 =    LINK              FROM BOOTSUBR OR XDELTA
*
*    EXIT BACK TO BOOTSUBR OR XDELTA
*
*    RECONFIG HAS 3 ENTRIES:
*        1. 1ST ENTRY CONVERTS DCT1/1A/1P ENTRIES
*        2. 2ND ENTRY PROCESSES A ':' COMMAND READ BY XDELTA, WHERE
*                 THE 1ST ':' COMMAND TRIGGERS AUTOMATIC RECONFIGURATOR
*        3. 3RD ENTRY IS FOR DEFAULT ':END' CARD WHEN NO ':' COMMANDS
*                 ARE ENCOUNTERED BY XDELTA
*
*        REGISTERS:  ALL SAVED
*                 WITHIN RECONFIG, BE CAREFUL WHEN USING R7,
*                 AS IT CONTAINS ADDRESS OF FPT USED WHEN
*                 USING CHARACTER SCAN ROUTINES.
*
*FIN*
*****************
         PAGE
*****************
*DO*
*F*      NAME:    INITL
*        PURPOSE:
*  INITL ROUTINE - INITIALIZE DCT1/1P/1A & CHECK MACHINE VS SYSTEM.
*FIN*
*DO*
*D*      NAME:    INITL
*        ENTRY:   XIT
*        DESCRIPTION:
*                 XIT - EXIT FROM RECONFIG.
*                 INITL -
*
*    IF FLAG OCNDDFLG >0, THEN TAKE VALUE IN OCNDD, FORMAT IT, & PUT
*    IT INTO DCT1/DCT1P, & DCT16. IF OCNDDFLG =0, NO FORMATTING NEEDED.
*    INIT THEN TAKES EACH DCT1/DCT1A ENTRY & CONVERTS THE DEVICE
*    ADDR. ACCORDING TO SIGMA OR 560 REQUIREMENTS.
*
*    INPUT:
*        OCNDDFLG = 0, NO FORMATTING OF OC ADDR.
*                 > 0, VALUE = DCT INDEX WHERE FORMATTED OC ADDR. GOES
*
*    CALL:
*        R15 =    LINK              FROM BOOTSUBR
*
*        INTERFACE:  CANTRUN.
*        REGISTERS:  ALL SAVED
*FIN*
*****************
         SPACE    3
INITL    EQU      %           <---  ENTER
         LCI      0                 SAVE
         PSM,R0   STK                 REGISTERS
         LW,R15   STK               PUT FLAG IN
         PSW,R15  STK                 STACK FOR RESTORATION
         LW,R6    OCNDDFLG          GET OC DCT INDEX IF OC CHANGED
         BEZ      OCSAME      NO--- DID OC CHANGE
         LD,R8    DCT16,R6    YES--
         LW,R10   OCNDD             GET OC DEVICE ADDR.
         LI,R1    2
         LB,R2    R10,R1            GET CHANNEL OR CLUSTER/UNIT BITS
         BIF,X560 XRX560      YES-- IS THIS XEROX 560
         AI,R2    'A'         NO--- SIGMA, MAKE CHANNEL LETTER
         B        XRXSIGMA
*----------------
XRX560   EQU      %
         LB,R2    X560CUCL,R2       XEROX 560, MAKE CLUSTER/UNIT LETTER
XRXSIGMA EQU      %
         STB,R2   R10,R1            REPLACE BINARY VALUE WITH EBCDIC
         STH,R10  DCT1,R6           PUT NDD (N=EBCDIC, & DD=HEX)
         STH,R10  DCT1P,R6            INTO DCT TABLES
         SLD,R10  -4
         SLS,R11  -4
         LB,R2    R11               GET 'D' (2)
         AI,R2    '0'               CONVERT HEX TO EBCDIC
         CI,R2    '9'
         BLE      %+2               0-9
         AI,R2    'A'-'9'+1         A-F
         STB,R2   R11
         SLD,R10  -4
         SLS,R11  -4
         LB,R2    R11               GET 'D' (1)
         AI,R2    '0'               CONVERT HEX TO EBCDIC
         CI,R2    '9'
         BLE      %+2               0-9
         AI,R2    'A'-'9'+1         A-F
         STB,R2   R11
         SLD,R10  -16               R11 = NDD IN EBCDIC
         LW,R10   M24
         XW,R10   R11
         STS,R10  R9                REPLACE OLD DCT16'S NDD WITH NEW
         STD,R8   DCT16,R6
OCSAME   EQU      %
*
*   WE NOW SET UP DCT1 WITH THE PROCESSOR ADDRESSES BY
*   LOOKING AT THE CHANNEL LETTER MNEUMONIC IN THE
*   HIGH ORDER BYTE
*
         LI,R1    DCTSIZ            SIZE OF DCT TABLES
DCTLOOP  LH,R8    DCT1,R1           PICK UP CHANNEL LETTER
         SLS,R8   16                CLEAR OUT SIGN
         SLD,R8   -24               ISOLATE CL, SAVE DEV ADDRESS IN R9
         BAL,R15  CL2PA             CONVERT CHANNEL LETTER TO PROC ADDR
         BCS,1    BAD:N
         SLD,R8   8                 GET DEVICE PART BACK
         STH,R8   DCT1,R1           PUT IT AWAY
         STH,R8   DCT1P,R1          JUST IN CASE DUAL
         LB,R9    DCT3,R1           PICK UP DUAL FLAGS
         CI,R9    3                 IS IT POOLED DEVICE
         BAZ      NONPOOL           B/ NOT
         LH,R8    DCT1A,R1          PICK UP ALT ADDR
         SLS,R8   16
         SLD,R8   -24
         BAL,R15  CL2PA
         BCS,1    BAD:N
         SLD,R8   8
NONPOOL  EQU      %
         STH,R8   DCT1A,R1          STORE AWAY AS ALT ADDRESS
         BDR,R1   DCTLOOP
*
*   SET UP CSEBRANCH TABLE IF NEEDED
*
         LW,R0    C%CPU
         CB,R0    C%CPU             COMPARE HIGH BYTE WITH LOW
         BAZ      CANTRUN           MEANS WE DONT HAVE THE RIGHT HANDLERS
         BEZ      ONLYONE           NOTHING TO DO
         BIF,S9X560 NOTSIG7         B/ IF SIGMA9, OR XEROX 560
         LI,R1    S7BRANCH-1        ADDRESS OF S7 BRANCH TABLE
         B        MOVEIT
NOTSIG7  BIF,X560  NOTSIG9          B/ IF X560
         LI,R1    S9BRANCH-1        ADDRESS OF SIGMA 9 BRANCH TABLE
         B        MOVEIT
NOTSIG9  LI,R1    X560BRANCH-1      MUST BE X560
MOVEIT   LI,R2    CSEBRANCH%SIZE    SIZE OF TABLE
MOVE2    LW,R3    *R1,R2            PICK UP BRANCH
         STW,R3   CSEBRANCH-1,R2    PUT IT INTO CSEBRANCH TABLE
         BDR,R2   MOVE2
ONLYONE  EQU      %
         MTW,1    M:TAURUS          SET TAURUS (560) FLAG
         BIF,X560 XIT         YES-- IS THIS XEROX 560 (TAURUS)
         MTW,-1   M:TAURUS    NO--- SET FLAG BACK TO SIGMA
XIT      EQU      %           <---  COMMON EXIT ROUTINE
RESTK    EQU      %
         PLW,R15  STK
         CW,R15   STK
         BNE      RESTK       NO--- FIND SPECIAL STACK FLAG
         LCI      0           YES-- RESTORE
         PLM,R0   STK                 REGISTERS
         B        *R15        --->  RETURN TO BOOTSUBR OR XDELTA
*----------------
BAD:N    EQU      %
         LD,R8    DCT16,R1
         LI,R0    X'7D15'           'NL
         STH,R0   R8
         SCD,R8   16
         LI,R0    ''''
         STB,R0   R8
         LCI      2
         STM,R8   VALX
         LI,R2    3
         LB,R12   R8,R2             GET 'N'
         LW,R11   L(X'407D007D')
         LI,R2    2
         STB,R12  R11,R2            PUT 'N' INTO MESSAGE
         STW,R11  VALN
         LI,R12   M:BAD:N
         BAL,R11  MSGOC       ****  MESG.TO OC
         B        %
         B        %-1
*----------------
         PAGE
*****************
*DO*
*F*      NAME:    PROC:
*        PURPOSE:
*  PROC: ROUTINE
*
*    PROCESS ':' COMMAND WHICH WAS READ BY XDELTA
*FIN*
*DO*
*D*      NAME:    PROC:
*        DESCRIPTION:
*                 PROCESS ':' COMMAND FOR RECONFIGURATION.
*
*    INPUT:
*        R12 =    WA(CARD IMAGE BUFFER)
*        R14 =    ROUTINE ADDRESS IN XDELTA TO ENTER WHEN ADDING
*                 MESSAGES TO PATCH FILE AS COMMENTS
*
*    CALL:
*        R15 =    LINK              FROM XDELTA VIA BOOTSUBR
*
*        INTERFACE:  AUTOCNFG,NAMSCAN,SYNTAX-ERROR-ROUTINES.
*        REGISTERS:  ALL SAVED
*FIN*
*****************
         SPACE    3
PROC:    EQU      %           <---  ENTER
         LCI      0                 SAVE
         PSM,R0   STK                 REGISTERS
         STW,R14  XDLTMSG           XDELTA S.R.ENTRY FOR MESSAGES
         LW,R15   STK               PUT FLAG IN
         PSW,R15  STK                 STACK FOR RESTORATION
         LW,R13   M24               PUT COMMAND BUFFER ADDR.
         STS,R12  SCNPLST+FLGS        INTO SCAN PLST
         MTW,0    1ST:FLG
         BNEZ     NOT1ST:     NO--- 1ST TIME IN
         MTW,1    1ST:FLG     YES--
         LI,R11   0                 INITIALIZE SIZE
         STW,R11  INT:BUF+V1          OF CONFIGURATION TABLES
         MTW,1    FND:CRD           SET ':' CARD FOUND FLAG
         DO1      AUTO=1
         BAL,R11  AUTOCNFG    ****  DO AUTOMATIC RECONFIGURATION
         PAGE
NOT1ST:  EQU      %
         SPACE    1
*****************
*DO*
*D*      NAME:    PROC: (CONTINUED)
*        DESCRIPTION: (CONTINUED)
*  PROCESS THE ':' COMMAND
*
*    THE COMMANDS ACCEPTED INCLUDE:
*        :GO
*                 ACCEPT PO TAPES HARDWARE ADRESSES AS IS
*                 ONLY :PART & :END COMMANDS ACCEPTED
*                 :TYPE/:REMOVE COMMANDS ARE IGNORED
*                 :SAVE COMMAND MEANINGLESS
*        :SAVE
*                 KEEP ALL DEV.ADDR.NOT CHANGED BY :TYPE
*                 OR AUTO.RECONFIGURATION. THAT IS, NO
*                 PERMANENT DOWN DEVICES.
*                 THIS COMMAND IS LIKE :GO EXCEPT :TYPE COMMANDS ARE OK.
*        :TYPE DEV.TYPE,DEV.ADDR.<,DEV.ADDR.,....>
*        :TYPE DEV.TYPE,(DEV.ADDR.1,DEV.ADDR.2)<,(....,....)>
*                 DEV.TYPE = 6-CHAR. FIELD:
*                     1ST 2 CHAR.= TYPE MNEMONIC(E.G., CR)
*                     LAST 4 CHAR.=DEV.MODEL # IN HEX
*                 DEV.ADDR.N = LIST OF 1 OR MORE ADDR.PAIRS(DUAL ACCESS)
*                     DEV.ADDR.1 = PRIMARY PATH
*                     DEV.ADDR.2 = ALTERNATE PATH
*                 DEV.ADDR.= LIST OF 1 OR MORE DEV.ADDR.(SINGLE ACCESS)
*                             SIGMA = NDD
*                             TAURUS= NDD OR VALUE
*                                   N = CHAN.OR CLUSTER/UNIT
*                                   DD= DEV.NUMBER
*                                   VALUE = 4-HEX.DIGITS,CLUST/UNT/DEV.#
*                 DEFINES DEVICE TYPE,MODEL #, & DEVICE ADDRESS
*                 AUGMENTS RECONFIGURATORS FINDINGS
*                 CHANGES RECONFIGURATORS FINDINGS
*        :PART <DEVICE ADDRESS     >
*              <CONT,DEVICE ADDRESS>
*                 DEVICE ADDRESS = RESOURCES HARDWARE ADDRESS
*                                   SIGMA = NDD
*                                   TAURUS= NDD OR VALUE
*                                     N = CHAN.OR CLUSTER/UNIT
*                                     DD= DEVICE NUMBER
*                                     VALUE = 4-HEX.DIG.,CLUST/UNT/DEV.#
*                 CONT = KEYWORD INDICATING PARTITION CONTROLLER
*        :REMOVE <DEVICE ADDRESS     >
*                <CONT,DEVICE ADDRESS>
*                 PARAMETERS SAME AS :PART
*        :END
*                 TERMINATE BOOT TIME RECONFIGURATOR
*
*FIN*
*****************
         PAGE
************************************************************************
*DO*
*D*      NAME:    PROC: (CONTINUED)
*        DESCRIPTION: (CONTINUED)
*  GENERAL TABLE STRUCTURE (INTERNAL TO RECONFIG, AT INT:BUF)
*
*                 *******************************************
*    TABLE WORD-0 |                         # WORDS IN TABLE|
*                 *******************************************
*
*    PARTITION ENTRY (:PART)
*
*                 *******************************************
*          WORD-0 |V|V|-|1|-|0|.|.|00000000|       DEV.ADDR.|
*                 *******************************************
*                  | |   |   |
*                  | |   |---|----- :PART ENTRY FLAGS
*                  | |
*                  |-|------------- = 01, DEVICE REQUEST
*                  |-|------------- = 10, CONTROLLER REQUEST
*
*FIN*
************************************************************************
         PAGE
************************************************************************
*DO*
*D*      NAME:    PROC: (CONTINUED)
*        DESCRIPTION: (CONTINUED)
*    REMOVE ENTRY (:REMOVE)
*
*                 *******************************************
*          WORD-0 |V|V|-|0|-|1|.|.|00000000|       DEV.ADDR.|
*                 *******************************************
*                  | |   |   |
*                  | |   |---|----- :REMOVE ENTRY FLAGS
*                  | |
*                  |-|------------- = 01, DEVICE REQUEST
*                  |-|------------- = 10, CONTROLLER REQUEST
*
*FIN*
************************************************************************
         PAGE
************************************************************************
*DO*
*D*      NAME:    PROC: (CONTINUED)
*        DESCRIPTION: (CONTINUED)
*    TYPE ENTRY (:TYPE)
*
*                 *******************************************
*          WORD-0 |V|V|V|0|V|0|.|.|TYP.INDX|      PRIM.ADDR.|
*                 *******************************************
*                  | | | | | |
*                  | | | |---|----- :TYPE ENTRY FLAGS
*                  | | |   |
*                  | | |   |------- = 0, NOT REORGANIZED DUE TO MUC
*                  | | |   |------- = 1, REORGANIZED DUE TO MUC
*                  | | |
*                  | | |----------- = 0, SINGLE ACCESS
*                  | | |----------- = 1, DUAL ACCESS
*                  | |
*                  | |------------- = 0, IN SYSTEM
*                  | |------------- = 1, NOT IN SYSTEM (CANNOT BE ADDED)
*                  |
*                  |--------------- = 0, AUTO RECONFIGURATION ENTRY
*                  |--------------- = 1, :TYPE COMMAND RECONFIGURATION
*
*                 ***********************************
*          WORD-1 |       DEV.MOD.#|      CONT.MOD.#|
*                 ***********************************
*
*                 ***********************************
*          WORD-2 |0000000000000000|       ALT.ADDR.|
*        IF DUAL  ***********************************
*
*FIN*
************************************************************************
         SPACE    3
         LI,R7    SCNPLST           CHAR.SCAN PLIST ADDR.
         LI,R8    1                 START SCAN
         STW,R8   SCNPLST+CCP         IN COLUMN 2
         LI,R0    STK               STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 INITIALIZE
         STW,R8   DUALFLG             DUAL FLAG FOR :TYPE
         STW,R8   SNGLFLG             SINGLE FLAG FOR :TYPE
         STB,R8   SCNPLST+FLGS        SCAN PLIST
         STW,R8   SCNPLST+CSL           VALUES
         BAL,R11  NAMSCAN     ****  GET COMMANDS ID
         BCS,8    NAMERR      EEEE  BAD NAME
         CI,R8    BADCONT
         BE       XIT         YES-- BAD CONTINUATION, EXIT
         LI,R12   0           NO---
         STW,R12  SUPRPART          INITIALIZE :REMOVE FLAG
         LW,R12   SCNPLST+CHSTRG    GET NAME
         LI,R5    #NAMES            # ID'S
NXTNAM   EQU      %
         CW,R12   NAMES-1,R5
         BE       NAMFND      YES-- FIND ID
         BDR,R5   NXTNAM      NO--- DONE SEARCH
         B        NAMERR      EEEE  UNKNOWN ID
*----------------
NAMFND   EQU      %
         EXU      CMNDVECT-1,R5 --> EXIT TO COMMAND PROCESSOR
*                                       :GO,:TYPE,:REMOVE,:PART,:END
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    :GO
*        DESCRIPTION:
*  :GO ROUTINE
*
*    PROCESS :GO COMMAND
*
*        INTERFACE:  MSGLL,XIT,SYNTAX-ERROR-ROUTINES.
*FIN*
*****************
         SPACE    3
:GO      EQU      %           <---  ENTER
         MTW,0    ENDFLG
         BNEZ     BADCMND EEE YES-- :END FOUND ALREADY
         MTW,0    GOFLG       NO---
         BNEZ     BADCMND EEE YES-- PREVIOUS :GO COMMAND
         MTW,1    GOFLG       NO--- SET :GO FLAG
         LI,R12   NO:TYPE           'ALL :TYPE/:REMOVE CMNDS.IGNORED'
         BAL,R11  MSGLL       ****  DISPLAY ON LL
         B        XIT         --->  EXIT
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    :SAVE
*        DESCRIPTION:
*  :SAVE ROUTINE
*
*    PROCESS :SAVE COMMAND
*
*        INTERFACE:  MSGLL,XIT,SYNTAX-ERROR-ROUTINES.
*FIN*
*****************
         SPACE    3
:SAVE    EQU      %           <---  ENTER
         MTW,0    ENDFLG
         BNEZ     BADCMND EEE YES-- :END FOUND ALREADY
         MTW,0    SAVEFLG     NO---
         BNEZ     BADCMND EEE YES-- :SAVE FOUND ALREADY
         MTW,1    SAVEFLG     NO--- SET TO FOUND
         LI,R12   KEEPDVAD          'KEEP DEV.ADDR.EVEN WITH :TYPE'
         BAL,R11  MSGLL       ****  DISPLAY ON LL
         B        XIT         --->  EXIT
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    :TYPE
*        DESCRIPTION:
*  :TYPE ROUTINE
*
*    PROCESS :TYPE COMMAND
*    DEFINE CONFIGURATION
*
*        INTERFACE:  NAMSCAN,HEXSCAN,CNVTMOD#,HEXEHEX,CHKNUM,
*                 XIT,SYNTAX-ERROR-ROUTINES.
*FIN*
*****************
         SPACE    3
:TYPE    EQU      %           <---  ENTER
         MTW,0    ENDFLG
         BNEZ     BADCMND EEE YES-- :END FOUND ALREADY
         MTW,0    GOFLG       NO---
         BNEZ     BADCMND EEE YES-- PREVIOUS :GO COMMAND
*                             NO---
         LI,R0    STK               STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 CLEAR CURRENT CHAR.FLAG FOR SCAN
         BAL,R11  NAMSCAN     ****  GET DEVICE TYPE & MODEL #
         BCS,8    NAMERR      EEEE  BAD VALUE
         CI,R8    BADCONT
         BE       XIT         YES-- BAD CONTINUATION, EXIT
         LCI      2           NO---
         LM,R2    SCNPLST+CHSTRG    DEV.TYPE & MODEL #
         LW,R1    SCNPLST+CSL       # CHAR.
         CI,R1    6
         BNE      NAMERR      EEEE  FIELD MUST BE 6 CHAR.LONG
         AI,R3    -' '+','          PUT IN ','
         LCI      2
         STM,R2   DEVTYP            SAVE DEV.TYPE & MODEL # IN MESSAGE
         LW,R4    SCNPLST+CCP
         STW,R4   RELCHAR           SAVE FOR POSSIBLE FUTURE USE
         LH,R4    R2                TYPE MNEMONIC
         LI,R5    TYPMNSZ           # DEVICE TYPES
NXTYP    EQU      %
         CH,R4    OH:NM,R5
         BE       CHK4MOD#    YES-- FIND MNEMONIC
         BDR,R5   NXTYP       NO--- DONE SEARCH
*                             YES--
         B        NAMERR      EEEE  UNKNOWN TYPE MNEMONIC
*----------------
CHK4MOD# EQU      %
*
* R2,R3= YYMM,MM--            YY=TYPE MNEMONIC, MMMM=DEV.MOD.#
*    R5= TYPE MNEMONIC INDEX
*
         SLD,R2   16                PUT MOD# INTO R2
         STW,R2   SCNPLST+CHSTRG      & INTO SCAN BUFFER
         LW,R3    Y2                SET SCAN BUFFER
         STS,R3   SCNPLST+FLGS        STILL FULL FLAG
         MTW,-2   SCNPLST+CSL       # CHAR.TO LOOK AT =4 (I.E.,6-2=4)
         BAL,R11  HEXSCAN     ****  CHECK MOD# FOR HEX
         BCS,8    NAMERR      EEEE  BAD VALUE
         LI,R14   0
         STW,R14  1STIME            SET TO 1ST TIME THRU
*
*DO*
*D*      NAME:    :TYPE (CONTINUED)
*        DESCRIPTION: (CONTINUED)
*  GIVEN A DEV.MOD#:
*        FIRST FIND DEV.MOD# & OBTAIN ITS CONT.MOD# FROM M:MODNUM.
*        IF NOT DESIRED PAIR, THEN FIND NEXT CONT.MOD# & OBTAIN ITS
*        DEV.MOD# & CONTINUE UNTIL EITHER A PAIR IS FOUND OR END
*        OF PAIRS IS ENCOUNTERED.
*    NO PAIRS FOUND, THEN FIND NEXT DEV.MOD# & OBTAIN ITS CONT.MOD#
*        & CONTINUE AS STATED ABOVE UNTIL A PAIR IS FOUND OR END OF
*        PAIRS IS ENCOUNTERED.
*    WHEN A PAIR IS FOUND, THE PAIR IS IN SYSGENED SYSTEM.
*FIN*
*
         LW,R14   Y8                SET FLAG, DEV.IN SYST.& :TYPE
2NDTIME  EQU      %
         LW,R6    M:MODNUM          SIZE OF M:MODNUM
         AW,R6    M:MODNUM          # WORDS IN TABLE
NXTMOD#D EQU      %                 SEARCH FOR DEV.MOD#
         CW,R2    M:MODNUM,R6
         BE       FNDMOD#D    YES-- FIND DEV.MOD# IN MASTER TABLE
2NXMOD#D EQU      %           NO---
         AI,R6    -1
         BDR,R6   NXTMOD#D    NO--- DONE SEARCH
         MTW,0    1STIME      YES--
         BNEZ     ALLDONE     YES-- COMPLETED ENTIRE CROSS CHECK
         MTW,1    1STIME      NO--- SET TO 2ND TIME THRU CROSS CHECK
         B        2NDTIME
*----------------
ALLDONE  EQU      %
         OR,R14   Y4                SET FLAG, CANNOT ADD DEV.TO SYSTEM
         B        CONTSCAN    EEEE  UNKNOWN NAME, BUT CONTINUE
*----------------
FNDMOD#D EQU      %
         AI,R6    1                 POINT TO CONTROLLER MODEL #
         LW,R3    M:MODNUM,R6       GET CONTROLLER MODEL #
*
*  R2 =  DEV.MOD#
*  R3 =  CONT.MOD#
*  R5 =  TYPE MNEMONIC INDEX
*  R6 =  CURRENT INDEX INTO M:MODNUM +1
*
         LI,R4    DCTSIZ            #DCT ENTRIES
NXTDCT4D EQU      %
         CB,R5    DCT4,R4
         BE       FNDEVTPD    YES-- FIND DEV.TYPE
FNDCT4D  EQU      %           NO---
         BDR,R4   NXTDCT4D    NO--- DONE SEARCH
         AI,R6    -1          YES-- POINT BACK TO DEV.MOD#
         MTW,0    1STIME
         BEZ      2NXMOD#D    NO--- DO COMPLETE CROSS CHECK YET
*                             YES--
         LCI      R6-R2+1
         PSM,R2   STK               SAVE OUTER LEVELS REGISTERS
         LW,R6    M:MODNUM          SIZE OF M:MODNUM
         AW,R6    M:MODNUM          # WORDS IN TABLE
         AI,R6    1
NXTMOD#C EQU      %                 SEARCH FOR CONT.MOD#
         CW,R3    M:MODNUM,R6
         BE       FNDMOD#C    YES-- FIND CONT.MOD# IN MASTER TABLE
2NXMOD#C EQU      %           NO---
         AI,R6    -1
         BDR,R6   NXTMOD#C    NO--- DONE SEARCH
*                             YES--
         LCI      R6-R2+1
         PLM,R2   STK               RESTORE OUTER LEVELS REGISTERS
         B        2NXMOD#D
*----------------
FNDMOD#C EQU      %
         AI,R6    -1                POINT TO DEVICE MOD#
         LW,R2    M:MODNUM,R6       GET DEV.MOD#
*
*  R2 =  DEV.MOD#
*  R3 =  CONT.MOD#
*  R5 =  TYPE MNEMONIC INDEX
*  R6 =  CURRENT INDEX INTO M:MODNUM -1
*
         LI,R4    DCTSIZ            #DCT ENTRIES
NXTDCT4C EQU      %
         CB,R5    DCT4,R4
         BE       FNDEVTPC    YES-- FIND DEV.TYPE
FNDCT4C  EQU      %           NO---
         BDR,R4   NXTDCT4C    NO--- DONE SEARCH
         AI,R6    1           YES-- POINT BACK TO CONT.MOD#
         B        2NXMOD#C
*----------------
FNDEVTPC EQU      %
*
*  R2 =  DEV.MOD# IN EBCDIC
*  R3 =  CONT.MOD# IN EBCDIC
*  R4 =  DCT INDEX
*
         BAL,R11  CNVTMOD#    ****  CONVERT MOD#'S TO HEX
*
*  R12 = DEV.MOD# IN HEX
*  R13 = CONT.MOD# IN HEX
*
         CH,R12   DEVMOD#,R4
         BNE      FNDCT4C     NO--- THIS DEV.= SYSGENED ONE
         CH,R13   CNTMOD#,R4  YES--
         BNE      FNDCT4C     NO--- THIS CONT.= SYSGENED ONE
         LI,R4    -(R6-R2+1)  YES--
         MSP,R4   STK               REMOVE OUTER LEVEL INFO
         B        CONTSCAN
*----------------
FNDEVTPD EQU      %
*
*  R2 =  DEV.MOD# IN EBCDIC
*  R3 =  CONT.MOD# IN EBCDIC
*  R4 =  DCT INDEX
*
         BAL,R11  CNVTMOD#    ****  CONVERT MOD#'S TO HEX
*
*  R12 = DEV.MOD# IN HEX
*  R13 = CONT.MOD# IN HEX
*
         CH,R12   DEVMOD#,R4
         BNE      FNDCT4D     NO--- THIS DEV.= SYSGENED ONE
         CH,R13   CNTMOD#,R4  YES--
         BNE      FNDCT4D     NO--- THIS CONT.= SYSGENED ONE
CONTSCAN EQU      %           YES--
*
* R5      = TYPE MNEMONIC INDEX
* R14(B1) = 0,    FOUND AN ENTRY IN SYSTEM FOR THIS DEVICE
* R14(B1) = 1,    DEVICE CANNOT BE ADDED TO SYSTEM
*
         CI,R8    ','
         BNE      TERMERR     EEEE  BAD TERMINATOR
         STW,R5   TYPINDX           SAVE DEV.TYPE MNEMONIC INDEX
         LW,R4    R14               SAVE FLAGS
SCNXTFLD EQU      %
         LCI      R4-R2+1
         PSM,R2   STK               SAVE MODEL # INFO
         LI,R0    STK               STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 CLEAR CURRENT CHAR.FLAG FOR SCAN
         STB,R8   SCNPLST+FLGS      SET SCAN FLAGS =0
         BAL,R11  NAMSCAN     ****  GET DEV.ADDR.
         BCS,8    CHKDUAL     YES-- POSSIBLE BAD VALUE OR DUAL ACCESS
FLDNUM   EQU      %           NO---
         CI,R8    BADCONT           SINGLE ACCESS
         BE       XIT         YES-- BAD CONTINUATION, EXIT
         MTW,0    DUALFLG     NO---
         BNEZ     DONTMIX EEE YES-- IN DUAL MODE
         MTW,1    SNGLFLG     NO--- SET SINGLE ACCESS FLAG
         LW,R5    SCNPLST+CSL       # CHAR.
         LW,R13   SCNPLST+CHSTRG    DEV.ADDR.
         STW,R13  DEVADDR           PUT INTO MESSAGE
         BAL,R10  HEXEHEX     ****  CONVERT 'NDD'/'VALUE' TO HEX
*
*  R14 = CONVERTED VALUE (DEV.ADDR.)
*
         LW,R0    R14               SAVE DEV.ADDR.
         LCI      R4-R2+1
         PLM,R2   STK               RESTORE MODEL # INFO
BILDENT  EQU      %
*
*  R2 =  DEV.MOD#
*  R3 =  CONT.MOD#
*  R4 =  :TYPE FLAG & DEV.IN SYSTEM FLAG (BIT-0 & BIT-1 RESPECTIVELY)
*                 BIT-1 = 1, CANNOT ADD TO SYSTEM
*        ALSO CONTAINS DUAL FLAG, BIT-2 = 1
*  R0 =  PRIM.DEV.ADDR.
*  R9 =  ALT.DEV.ADDR.(DUAL ACCESS MODE)
*
         LCI      R4-R2+1
         PSM,R2   STK               SAVE IN CASE OF ANOTHER FIELD LATER
         CW,R4    Y4
         BANZ     CANTADD     NO--- CAN DEV.BE ADDED TO SYSTEM
         LI,R5    4           YES--
         LW,R13   R2                DEV.MOD#
         MTW,1    SPECNVRT          MAKE CONVERSION OF 4 HEX DIGITS
         BAL,R10  HEXEHEX     ****  CONVERT DEV.MOD#
*
*  R14 = CONVERTED DEV.MOD#
*
         LW,R2    R14               SAVE DEV.MOD#
         LI,R5    4
         LW,R13   R3                CONT.MOD#
         BAL,R10  HEXEHEX     ****  CONVERT CONT.MOD#
*
*  R14 = CONVERTED CONT.MOD#
*
         MTW,-1   SPECNVRT          RESET CONVERT FLAG
         LW,R3    R14               SAVE CONT.MOD#
         SLS,R3   16
         SLD,R2   16                FORM DEV./CONT.MOD#'S IN R2
         LW,R3    R4                FLG1 FLAGS &
         AW,R3    R0                  PRIMARY DEV.ADDR.IN R3
         LW,R13   TYPINDX
         LI,R4    1
         STB,R13  R3,R4             PUT DEV.TYPE MNEMONIC INDEX IN ENTRY
         LW,R4    R9                ALTERNATE DEV.ADDR.IN R4
         LI,R13   2                 ENTRY SIZE (MINIMUM)
         LW,R12   Y2                MIN.SIZE ENTRY (CONDITION CODE SET)
         CW,R3    Y2
         BAZ      1ACSENT     YES-- SINGLE ACCESS ENTRY
         LI,R13   3           NO--- DUAL ACCESS, ENTRY SIZE (MAXIMUM)
         LW,R12   Y3                MAX.SIZE ENTRY (CONDITION CODE SET)
1ACSENT  EQU      %
         XW,R2    R3
         LW,R1    INT:BUF+V1        CURRENT TABLES SIZE
         AW,R1    R13               SIZE OF NEW ENTRY
         CI,R1    V2
         BG       NOAREA  EEE NO--- WILL NEW ENTRY FIT
         STW,R1   INT:BUF+V1  YES-- UPDATE SIZE
         SW,R1    R13
         LC       R12
         STM,R2   INT:BUF+V1+1,R1   PUT ENTRY INTO TABLE
         MTW,1    FND:TYPE          SET FOUND :TYPE COMMAND
         CI,R13   2
         BE       NXTFLD      YES-- SINGLE ACCESS ENTRY
         CI,R8    ')'         NO---
         BNE      TERMERR     EEEE  BAD TERMINATOR
         LI,R0    STK               SET STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 CLEAR CURRENT CHAR.FLAG FOR SCAN
         BAL,R11  NAMSCAN     ****  GET NEXT FIELD
         BCS,8    NXTFLD      YES-- TERMINATOR FOUND
         LW,R1    SCNPLST+CCP NO--- NO TERMINATOR, THEREFORE ERROR
         SW,R1    SCNPLST+CSL       PUT CHAR.POS.
         STW,R1   SCNPLST+CCP         BACK TO START OF FIELD
         B        TERMERR     EEEE  NO TERMINATOR
*----------------
NXTFLD   EQU      %
         LCI      R4-R2+1           RESTORE
         PLM,R2   STK                 DEV./CONT.MOD#'S & FLAGS
CHKTERM  EQU      %
         CI,R8    ','
         BE       SCNXTFLD    YES-- MORE FIELDS
         CI,R8    EOB
         BE       XIT         YES-- END OF BUFFER, EXIT
         CI,R8    NL          NO---
         BE       XIT         YES-- NEW LINE, EXIT
         CI,R8    PERIOD      NO---
         BE       XIT         YES-- PERIOD, EXIT
         CI,R8    CR          NO---
         BE       XIT         YES-- CARRIAGE RETURN, EXIT
         CI,R8    ' '         NO---
         BE       XIT         YES-- TRAILING BLANK TERMINATOR, EXIT
         B        TERMERR EEE NO--- BAD TERMINATOR
*----------------
CHKNUM1  EQU      %
         BAL,R10  CHKNUM      ****  CHECK & SCAN AS HEX IF TAURUS
*
*  NO RETURN IF TAURUS & NOT HEX VALUE 0R IF NOT TAURUS
*
         B        FLDNUM
*----------------
CHKNUM2  EQU      %
         BAL,R10  CHKNUM      ****  CHECK & SCAN AS HEX IF TAURUS
*
*  NO RETURN IF TAURUS & NOT HEX VALUE OR IF NOT TAURUS
*
         B        PRIMNUM
*----------------
CHKNUM3  EQU      %
         BAL,R10  CHKNUM      ****  CHECK & SCAN AS HEX IF TAURUS
*
*  NO RETURN IF TAURUS & NOT HEX VALUE OR IF NOT TAURUS
*
         B        ALTNUM
*----------------
CHKNUM4  EQU      %
         BAL,R10  CHKNUM      ****  CHECK & SCAN AS HEX IF TAURUS
*
*  NO RETURN IF TAURUS & NOT HEX VALUE OR IF NOT TAURUS
*
         B        PARTNUM
*----------------
CHKNUM5  EQU      %
         BAL,R10  CHKNUM      ****  CHECK & SCAN AS HEX IF TAURUS
*
*  NO RETURN IF TAURUS & NOT HEX VALUE OR IF NOT TAURUS
*
         B        CNTNUM
*----------------
CHKDUAL  EQU      %
         CI,R8    '('
         BNE      CHKNUM1     EEEE  MUST BE DUAL ACCESS OR IS IN ERROR
         MTW,0    SNGLFLG           DUAL ACCESS
         BNEZ     DONTMIX EEE YES-- IN SINGLE MODE
         MTW,1    DUALFLG     NO--- SET DUAL ACCESS FLAG
         LI,R0    STK               SET STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 CLEAR CURRENT CHAR.FLAG FOR SCAN
         STB,R8   SCNPLST+FLGS      SET FLAGS =0
         BAL,R11  NAMSCAN     ****  PRIMARY DEV.ADDR.
         BCS,8    CHKNUM2     EEEE  BAD VALUE
PRIMNUM  EQU      %
         CI,R8    BADCONT
         BE       XIT         YES-- BAD CONTINUATION, EXIT
         LW,R5    SCNPLST+CSL NO--- # CHAR.
         LW,R13   SCNPLST+CHSTRG    PRIM.DEV.ADDR.
         STW,R13  DEVADDR           PUT INTO MESSAGE
         AI,R13   -' '+','
         STW,R13  BAD:NDDS          PUT INTO MESSAGE
         LW,R13   DEVADDR
         BAL,R10  HEXEHEX     ****  CONVERT 'NDD'/'VALUE' TO HEX
*
*  R14 = CONVERTED VALUE (DEV.ADDR.)
*
         PSW,R14  STK               SAVE PRIM.DEV.ADDR.
         CI,R8    ','
         BNE      TERMERR     EEEE  BAD TERMINATOR
         LI,R0    STK               SET STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 CLEAR CURRENT CHAR.FLAG FOR SCAN
         BAL,R11  NAMSCAN     ****  ALTERNATE DEV.ADDR.
         BCS,8    CHKNUM3     EEEE  BAD VALUE
ALTNUM   EQU      %
         CI,R8    BADCONT
         BE       XIT         YES-- BAD CONTINUATION, EXIT
         LW,R5    SCNPLST+CSL NO--- # CHAR.
         LW,R13   SCNPLST+CHSTRG    ALT.DEV.ADDR.
         STW,R13  BAD:NDDS+1        PUT INTO MESSAGE
         BAL,R10  HEXEHEX     ****  CONVERT 'NDD'/'VALUE' TO HEX
*
*  R14 = CONVERTED VALUE (DEV.ADDR.)
*
         LW,R9    R14               SAVE ALT.DEV.ADDR.
         PLW,R0   STK               RESTORE PRIM.DEV.ADDR.
         LCI      R4-R2+1
         PLM,R2   STK               RESTORE MODEL # INFO
         OR,R4    Y2                SET DUAL FLAG
         LI,R11   MIOPCNTM          MIOP MASK
         LW,R10   R0                PRIM.DEV.ADDR.
         CS,R10   R9                PRIM.CONT.VS.ALT.CONT.
         BE       BADUAL  EEE YES-- SAME CONTROLLERS
         B        BILDENT     NO---
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    CHKNUM
*        DESCRIPTION:
*  CHKNUM ROUTINE
*
*    DETERMINE IF TAURUS MODE & THEN IF HEX VALUE
*    IF NOT TAURUS MODE, ERROR
*    IF TAURUS MODE & NOT HEX VALUE, ERROR
*    ELSE, RETURN
*
*    CALL:
*        R10 =    LINK
*
*        INTERFACE:  HEXSCAN,SYNTAX-ERROR-ROUTINES.
*        REGISTERS:  R11 USED, R10 SAVED
*FIN*
*****************
         SPACE    3
CHKNUM   EQU      %           <---  ENTER
         MTW,0    M:TAURUS
         BEZ      NAMERR      EEEE  NOT TAURUS, THUS ERROR
         BAL,R11  HEXSCAN     ****  CHECK IF HEX VALUE
         BCS,8    NAMERR      EEEE  NOT HEX, THUS ERROR
         B        *R10        --->  RETURN, HEX VALUE
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    :REMOVE
*        DESCRIPTION:
*  :REMOVE ROUTINE
*
*    PROCESS :REMOVE COMMAND
*    REMOVE RESOURCES FROM SYSTEM (OPPOSITE OF :TYPE)
*
*        INTERFACE:  :PART,SYNTAX-ERROR-ROUTINES.
*FIN*
*****************
         SPACE    3
:REMOVE  EQU      %           <---  ENTER
         MTW,0    GOFLG
         BNEZ     BADCMND EEE YES-- PREVIOUS :GO COMMAND
         LW,R8    Y14         NO---
         STW,R8   SUPRPART          SET PROCESS :REMOVE COMMAND FLAG
         B        :PART       --->  PROCESS :REMOVE AS :PART
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    :PART
*        DESCRIPTION:
*  :PART ROUTINE
*
*    PROCESS :PART COMMAND
*    PARTITION RESOURCES
*
*        INPUT:   SUPRPART = 0   :PART COMMAND
*                          = Y14 :REMOVE COMMAND
*
*        INTERFACE:  NAMSCAN,HEXEHEX,SYNTAX-ERROR-ROUTINES.
*FIN*
*****************
         SPACE    3
:PART    EQU      %           <---  ENTER
         MTW,0    ENDFLG
         BNEZ     BADCMND EEE YES-- :END FOUND ALREADY
MOREDEV  EQU      %
         LI,R8    0           NO--- CLEAR CURRENT CHAR.FLAG FOR SCAN
         LI,R0    STK               SET STACK POINTER FOR SCAN S.R.'S
         LW,R4    Y5                SET FLAG FOR :PART & DEV.TYPE
         BAL,R11  NAMSCAN     ****  GET FIELD ('CONT'/'NDD'/'VALUE')
         BCS,8    CHKTERM           MAYBE END OF BUFFER NOW..
PARTNUM  EQU      %
         CI,R8    BADCONT
         BE       XIT         YES-- BAD CONTINUATION, EXIT
         LW,R5    SCNPLST+CSL NO--- # CHAR.
         LW,R13   SCNPLST+CHSTRG    GET VALUE
         CI,R5    4
         BE       CHKCONT     YES-- 4 CHAR.= 'CONT'/'VALUE'
         CI,R5    3           NO---
         BNE      NAMERR  EEE NO--- 3 CHAR.= 'NDD', BAD VALUE
VAL:NDD  EQU      %           YES--
*
*  R4 =  FLAGS IDENTIFYING TYPE OF CONFIG.TABLE ENTRY
*
         BAL,R10  HEXEHEX     ****  CONVERT 'NDD'/'VALUE'
*
*  R14 = CONVERTED DEV.ADDR.(NDD/VALUE)
*
         OR,R4    R14               MERGE INDEV.ADDR.
         EOR,R4   SUPRPART          DOES NOTHING FOR :PART COMMAND
*                                   RESETS Y1 & SETS Y04 FOR :REMOVE
         LW,R1    INT:BUF+V1        SIZE OF CONFIG.TABLE
         AI,R1    1
         CI,R1    V2
         BG       NOAREA  EEE NO--- WILL NEW ENTRY FIT
         STW,R1   INT:BUF+V1  YES-- UPDATE SIZE
         AI,R1    -1
         STW,R4   INT:BUF+V1+1,R1   PUT ENTRY INTO TABLE
         MTW,0    SUPRPART
         BEZ      NOTREM      NO--- :REMOVE COMMAND
         MTW,1    FND:REMOVE  YES-- SET FOUND :REMOVE FLAG
         CI,R8    ','               LAST FIELD END ON COMMA...
         BE       MOREDEV           YES--> GET NEXT DEVICE ADDRESS
         B        CHKTERM           NOPE-> MAYBE QUIT NOW
*----------------
NOTREM   EQU      %
         MTW,1    FND:PART          SET FOUND :PART COMMAND
         B        MOREDEV           LOOP ON SAME CARD AGAIN...
*----------------
CHKCONT  EQU      %
         CW,R13   CONT
         BNE      VAL:NDD     NO--- VALUE = 'CONT', THEN = 'VALUE'
         CI,R8    ','         YES--
         BNE      TERMERR     EEEE  BAD TERMINATOR
         EOR,R4   YC                SET FLAG, CONTROLLER TYPE
         LI,R0    STK               SET STACK POINTER FOR SCAN S.R.'S
         LI,R8    0                 CLEAR CURRENT CHAR.FLAG FOR SCAN
         BAL,R11  NAMSCAN     ****  GET FIELD
         BCS,8    CHKNUM5     EEEE  BAD VALUE
CNTNUM   EQU      %
         CI,R8    BADCONT
         BE       XIT         YES-- BAD CONTINUATION
         LW,R5    SCNPLST+CSL NO--- # CHAR.
         LW,R13   SCNPLST+CHSTRG    GET VALUE
         CI,R5    4
         BE       VAL:NDD     YES-- 4 CHAR.= 'VALUE'
         CI,R5    3           NO---
         BNE      NAMERR  EEE NO--- 3 CHAR.= 'NDD', BAD VALUE
         B        VAL:NDD     YES--
*----------------
         PAGE
*****************
*DO*
*F*      NAME:    :ENDFALT
*        PURPOSE:
*  :ENDFALT ROUTINE
*
*    NO :END ENCOUNTERED, THEREFORE, :END BY DEFAULT
*FIN*
*DO*
*D*      NAME:    :ENDFALT
*        DESCRIPTION:
*                 COMPLETE PROCESSING AS IF :END WAS FOUND
*                 EVEN IF IT WASN'T ENCOUNTERED. THAT IS,
*                 :END BY DEFAULT.
*
*    INPUT:
*        R14 =    ROUTINE ADDRESS IN XDELTA TO ENTER WHEN ADDING
*                 MESSAGES TO PATCH FILE AS COMMENTS
*
*    CALL:
*        R15 =    LINK
*
*        INTERFACE:  ENDX.
*        REGISTERS:  ALL SAVED
*FIN*
*****************
         SPACE    3
:ENDFALT EQU      %           <---  ENTER
         LCI      0                 SAVE
         PSM,R0   STK                 REGISTERS
         STW,R14  XDLTMSG           XDELTA S.R.ENTRY FOR MESSAGES
         LW,R15   STK               PUT FLAG IN
         PSW,R15  STK                 STACK FOR RESTORATION
         B        :ENDX       --->  EXIT
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    :END
*        ENTRY:   :ENDX
*        DESCRIPTION:
*  :END ROUTINE
*  :ENDX ROUTINE
*
*    PROCESS :END COMMAND
*    FINISH BOOT TIME RECONFIGURATION PROCEDURE
*
*        INTERFACE:  MSGLL,DSPRESLL,DOPART,XIT,ORGANIZ,
*                 DORECNFG,DOREMOVE,SYNTAX-ERROR-ROUTINES.
*FIN*
*****************
         SPACE    3
:END     EQU      %           <---  ENTER
         MTW,0    ENDFLG
         BNEZ     BADCMND EEE YES-- :END FOUND ALREADY
         MTW,1    ENDFLG            JUST SET FLAG AND EXIT
         B        XIT
:ENDX    EQU      %           NO--- ENTER FROM :ENDFALT
         MTW,0    GOFLG
         BNEZ     GOEND       YES-- WAS :GO SPECIFIED
         MTW,0    FND:CRD     NO---
         BNEZ     RECNF       YES-- ANY ':' COMMANDS
GOEND    EQU      %           NO--- ASSUME :GO/:END BY DEFAULT
         LI,R12   0
         STW,R12  GOFLG             SET FLAG 2 DISP.SYSGEN CNFG.
         LI,R12   NORCNFG           'NO RECONFIGURATION PERFORMED'
         BAL,R11  MSGLL       ****  OUTPUT TO LL
CNTINU   EQU      %
         BAL,R11  DOPART      ****  PROCESS PARTITION INFO
         MTW,1    MSGFLG            SET FLAG 2 ENTER MSG.PATCH FILE
         LI,R1    RECNFGM           'FINAL CONFIGURATION' TITLE
         BAL,R11  DSPRESLL    ****  DISPLAY RESOURCES ON LL
         LI,R11   0
         STW,R11  MSGFLG            RESET FLAG 4 MSG.IN PATCH FILE
         LI,R12   TOP               TOP OF PAGE
         BAL,R11  MSGLL       ****  OUTPUT MESSAGE TO LL
         LI,R1    FECP#
         BEZ      NOFE        NO--- ANY FECP'S
FELOOP   EQU      %           YES--
         LB,R2    FEB:CDX,R1        GET FECP DCT INDEX
         LH,R12   DCT1,R2           GET FECP DEV.ADDR.
         STH,R12  FEH:ADR,R1          & PUT INTO FECP DEV.ADDR.TABLE
         LI,R12   FE:NDD
         STH,R12  DCT1,R2           SET DCT1/1P/1A
         STH,R12  DCT1P,R2            TO
         STH,R12  DCT1A,R2            X'001E' = 'A1E'
         BDR,R1   FELOOP      NO--- DONE
NOFE     EQU      %           YES--
         LI,R1    FECPD#
         BEZ      NOFD        NO--- ANY DEV.TO FECPS
FDLOOP   EQU      %           YES--
         LB,R2    FDB:DCT,R1        GET DEV.DCT INDEX
         STH,R12  DCT1,R2           SET DCT1/1P/1A
         STH,R12  DCT1P,R2            TO
         STH,R12  DCT1A,R2            X'001E' = 'A1E'
         BDR,R1   FDLOOP      NO--- DONE
NOFD     EQU      %           YES--
         LI,R1    COC
         BEZ      NOCOC             NO COC SYSTEM
         LI,R1    0
COCLOOP  EQU      %
         LH,R2    COH:DN,R1         GET COC DCT INDEX
         LH,R2    DCT1,R2           GET COC ADDRESS
         STH,R2   COH:DN,R1           AND PUT INTO COC ADDR.TABLE
         AI,R1    1                 TO NEXT COC
         CI,R1    LCOC
         BLE      COCLOOP     YES-- MORE COCS
*                             NO---
NOCOC    RES
         LW,13    BLK               IF ERRORS OCCURRED, TELL OC
         XW,13    ERCNT             ABOUT IT
         BEZ      XIT               NONE
         LI,1     3
         LI,3     '0'
         LI,12    0
         DW,12    =10
         STS,3    12
         STB,12   ERCNT,1
         BEZ      %+2
         BDR,1    %-5
         LI,12    ERCNTM
         BAL,11   MSGOC
         B        XIT         --->  EXIT
         PAGE
*
*        PROCESS RECONFIG COMMANDS
*
RECNF    EQU      %
         LW,R11   FND:TYPE          # :TYPE COMMANDS
         AW,R11   FND:REMOVE        # :REMOVE COMMANDS
         BEZ      NOXDLT      NO--- ANY :TYPE/:REMOVE COMMANDS
         MTW,1    MSGFLG      YES-- SET FLAG 2 ENTER MSG.PATCH FILE
         MTW,1    GOFLG             SET FLG 2 NOT DISP.SYSGEN CNFG.
         LI,R1    SYSGENM           'SYSGENED CONFIGURATION' TITLE
         DO       TEST=1
         M:PRINT  (MESS,MSG1)
         M:READ   M:SI,(BUF,BUFR),(SIZE,80),(WAIT)
         LH,R2    BUFR              GET FIRST TWO BYTES
         AND,R2   =X'FFFF'
         CI,R2    'NO'              SAYS NOT TOO SHOW IT
         BE       %+2               YUP-> JUMP
         FIN
         BAL,R11  DSPRESLL    ****  DISPLAY RESOURCES ON LL
         LI,R11   0
         STW,R11  MSGFLG            RESET FLAG 4 MSG.IN PATCH FILE
NOXDLT   EQU      %
         BAL,R11  ORGANIZ     ****  ORGANIZE DEV.ADDR.WITHIN CONT.SEQ.
         BAL,R11  DORECNFG    ****  PROCESS RECONFIGURATION INFO
         BAL,R11  DOREMOVE    ****  PROCESS REMOVE INFO
         B        CNTINU
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    DSPRESLL
*        DESCRIPTION:
*  DSPRESLL ROUTINE
*
*    DISPLAY SYSTEM HARDWARE RESOURCES ON LL
*
*    INPUT:
*        R1 =     ADDRESS OF SPECIAL TITLE LINE
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  MSGLL,HEXHEXE.
*        REGISTERS:  R1-R2,R4-R5,R10,R12-R15 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
DSPRESLL EQU      %           <---  ENTER
         PSW,R11  STK               SAVE RETURN
         LI,R12   TOP               TOP OF PAGE
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         LI,R12   ASTER             '****--**'
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         LW,R12   R1                SPECIAL TITLE LINE
         BAL,R11  MSGLL       ****  OUTPUT TITLE TO LL
         LI,R12   ASTER             '****--**'
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         LI,R12   TITL1             'DEVICE RESOURCE CONFIG.'
         BAL,R11  MSGLL       ****  OUTPUT TITLE TO LL
         LI,R12   TITL2             'DEV.TYPE : ----'
         BAL,R11  MSGLL       ****  OUTPUT HEADER TO LL
         LI,R12   DASH              '------'
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         LI,R12   BLANK             '    '
         BAL,R11  MSGLL       ****  OUTPUT BLANKS TO LL
         LI,R2    DCTSIZ            #DCT ENTRIES
         LI,R1    1                 CURRENT ENTRY #
NXTDCTAD EQU      %
         LB,R10   DCT24,R1          GET DEVICE FLAGS
         CI,R10   PERDWND
         BAZ      NOTDWN      NO--- DEV.PERM.DOWN
INCTONXT EQU      %           YES--
         AI,R1    1                 TO NEXT DCT ENTRY
         BDR,R2   NXTDCTAD    NO--- DONE
         LI,R12   BLANK       YES-- '    '
         BAL,R11  MSGLL       ****  OUTPUT BLANKS TO LL
         LI,R12   ASTER             '*****--**'
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
NOTDWN   EQU      %
         LW,R15   BLK
         LI,R5    IMGSZ-PBPRV+BA(IMG)+3
         SLS,R5   -2
         STW,R15  WA(PBPRV)-1,R5    BLANK OUT MESSAGE AREA
         BDR,R5   %-1
         LI,R5    1
         STH,R15  WA(N:AP:P),R5
         LB,R5    DCT3,R1           GET DEVICE SWITCHES
         AND,R5   =3                EXTRACT DUAL ACCESS SWITCHES
         EXU      IOALOAD,R5        GET DEV ADDRESS PER DUAL FLAGS
         STW,R13  TMPADDR           SAVE FOR DUAL CHECK
         LI,R5    4                 # CHAR.
         STH,R13  R13               LEFT JUSTIFY
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         SCD,R14  -24               PUT
         LCI      2                   DEV.ADDR.(PRIM.)
         STM,R14  WA(DVAD)            INTO MESSAGE
         LI,R5    2                 # CHAR.
         STB,R1   R13               LEFT JUSTIFY
         BAL,R10  HEXHEXE     ****  CONVERT DCT INDEX TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         STH,R14  WA(DCTI)          PUT DCT INDEX IN MESSAGE
         LB,R5    DCT2,R1
         STB,R5   R13
         LI,R5    2
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         STB,R14  WA(CITI)+1        PUT
         SLS,R14  -8                  QUEUING
         LI,R5    3                   INDEX
         STB,R14  WA(CITI),R5         INTO MESSAGE (CIT)
         LD,R14   DCT16,R1          GET YYNDD(R14=---Y,R15=YNDD)
         SLD,R14  16                PUT
         AI,R15   '  '                YYNDD
         LCI      2                   INTO
         STM,R14  WA(DVID)            MESSAGE
         LB,R4    DCT4,R1           GET TYPE MNEMONIC INDEX
         LH,R15   OH:NM,R4          GET TYPE MNEMONIC
         LI,R5    1                 DCT INDEX
GO2NXT   EQU      %
         CB,R4    DCT4,R5
         BE       CHK4EQU     YES-- FIND EQUIVALENT TYPE
FNDNXT   EQU      %           NO---
         AI,R5    1                 TO NEXT DCT
         CW,R5    R1
         BLE      GO2NXT      NO--- BACK TO WHERE WE STARTED
         B        %           YES-- THIS SHOULD NEVER HAPPEN
*----------------
CHK4EQU  EQU      %
         LB,R13   DCT24,R5
         CI,R13   PERDWND
         BANZ     FNDNXT      NO--- THIS DCT ENTRY AVAILABLE
*                             YES--
         CW,R5    R1
         BNE      NOTOT       NO--- 1ST TIME THIS TYPE FOUND
         STH,R15  WA(TP)      YES-- PUT DEV.TYPE IN MESG.
         LI,R5    SV:RSIZ+1         SIZE OF RESOURCE TABLES
NXTRTOT  EQU      %
         CB,R4    SB:RTY,R5
         BE       FNDRTOT     YES-- FIND RESOURCE TYPE
         BDR,R5   NXTRTOT     NO--- DONE
         B        NOTOT       YES--
*----------------
FNDRTOT  EQU      %
         LH,R13   SH:RTOT,R5        GET RESOURCE TOTAL COUNT
         STB,R13  R13               LEFT JUSTIFY
         LI,R5    2                 # CHAR.TO CONVERT
         BAL,R10  HEXHEXE     ****  CONVERT COUNT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         AND,R14  L(X'FFFF')
         STB,R14  WA(TOT)+1         PUT
         SLS,R14  -8                  COUNT
         OR,R14   BLK                 INTO
         STW,R14  WA(TOT)             MESSAGE
NOTOT    EQU      %
         LI,R5    4                 # CHAR.
         LH,R13   DEVMOD#,R1        GET DEV.MOD#
         STH,R13  R13               LEFT JUSTIFY
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         XW,R14   R15
         STB,R15  WA(DVTP)+2        PUT
         SCD,R14  -8                  DEV.TYPE MNEMONIC
         STW,R15  WA(DVTP)+1          AND
         LI,R5    3                   DEV.MODEL #
         STB,R14  WA(DVTP),R5         INTO MESSAGE
         LW,R15   BLK
         STW,R15  TEMP
         LI,R15   0                 RESET FLAG FOR LATER USE
         PSW,R1   STK               SAVE DCT INDEX
         AI,R1    -BATAPE
         BLZ      NO:PAC      NO--- DISK PACK
         CI,R1    AVRTBLSIZ   YES-- POSSIBLY
         BL       NO:PAC      NO--- DISK PACK
         CI,R1    AVRTBLNE    YES-- POSSIBLY
         BGE      NO:PAC      NO--- DISK PACK
         LW,R5    PRIV        YES-- 'PRIV'
         LD,R14   AVRTBL,R1         GET AVR INFO
         CI,R15   0
         BGEZ     %+2         YES-- PRIVATE PACK
         LW,R5    PUB         NO--- PUBLIC ('PUB')
         STW,R5   TEMP              SAVE FOR LATER
         STH,R5   WA(PBPRV)+1       PUT
         SLS,R5   -16                 PRIV/PUB
         LI,R1    1                   INTO
         STH,R5   WA(PBPRV),R1        MESSAGE
NO:PAC   EQU      %
         PLW,R1   STK               RESTORE DCT INDEX
         LI,R5    0
         CI,R15   0
         BLZ      NOT:PART    YES-- PUBLIC PACK
*                             NO---
         LB,R4    DCT4,R1           DEV.TYPE INDEX
         LB,R12   TB:FLGS,R4        DEV.TYPE FLAGS
         LI,R4    #DEVTYPS-1
TRY:NXT  EQU      %
         CH,R12   DEVTYPS,R4
         BE       NOT:PART    YES-- FIND NON-PART.TYPE
         BDR,R4   TRY:NXT     NO--- DONE
         LB,R12   DCT24,R1
         CI,R12   NOPARTC
         BANZ     NOT:PRTC    YES-- CONT.NON-PARTITIONABLE
         CI,R12   NOPARTD     NO---
         BANZ     NOT:PRTD    YES-- DEVICE NON-PARTITIONABLE
         LI,R12   0           NO--- SET FLAG
IS:SYMBT EQU      %
         LB,R4    SNDDX             SYMBIONT TABLE SIZE
TRY:SYMB EQU      %
         CB,R1    SNDDX,R4
         BE       IS:SYMB     YES-- SYMBIONT TYPE DEVICE
         BDR,R4   TRY:SYMB    NO--- DONE
         LI,R5    0           YES-- PRIM.PATH INDEX
         LI,R12   PERDWNCP
PRNTIMG  EQU      %
         CB,R12   DCT24,R1
         BAZ      W:PP        YES-- PRIM./ALT.PATH AVAILABLE
         LCI      3           NO---
         EXU      MESG,R5           GET APPROPRIATE MESSAGE
         LW,R14   R1                SAVE DCT INDEX
         LI,R1    N:AP:P+11
         LI,R5    11
NX:CH    EQU      %
         LB,R10   R11,R5
         STB,R10  0,R1                INTO DISPLAY
         AI,R1    -1
         BDR,R5   NX:CH       NO--- DONE
         LB,R10   R11         YES--
         STB,R10  0,R1
         LW,R1    R14               RESTORE DCT INDEX
W:PP     EQU      %
         LI,R12   IMG
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         LB,R5    DCT2,R1           GET CHAN.(QUEUING) INDEX
         LB,R5    CIT3,R5           GET CHAN.FLAGS
         CI,R5    DUALACS
         BAZ      INCTONXT    NO--- DUAL ACCESS
         LB,R5    DCT3,R1           GET DEVICE SWITCHES
         CI,R5    2                 GOT SCW PATH
         BAZ      INCTONXT          NO
         CI,R5    1                 YES-> GOT SC1 ALSO
         BAZ      INCTONXT          NO--> RESTIRCTED TO SC2 ONLY
         LW,R14   BLK         YES-- BLANKS
         STW,R14  WA(TP)            PUT BLANKS INTO MESSAGE OVER
         STW,R14  WA(TOT)             DEV.TYP.MNEMONIC, TYPE, &
         STW,R14  WA(TOT)+1           RESOURCE TOTAL
         STW,R14  WA(N:AP:P)+1
         STW,R14  WA(N:AP:P)+2
         STW,R14  WA(N:AP:P)+3
         LI,R5    3
         STB,R14  WA(N:AP:P),R5
         LW,R14   TEMP
         STH,R14  WA(PBPRV)+1       PUT PUB/PRIV/BLANK INTO DISPLAY
         SLS,R14  -16
         LI,R5    1
         STH,R14  WA(PBPRV),R5
         LD,R14   DUAL              PUT 'DUAL' INTO MESSAGE OVER
         LCI      2                   DEV.TYPE & DEV.MODEL #
         STM,R14  WA(DVTP)+1
         LW,R14   IMGX
         STW,R14  IMG
         LH,R13   DCT1A,R1          GET DEV.ADDR.(ALTERNATE)
         CW,R13   TMPADDR
         BE       INCTONXT    YES-- DEV.ADDR.= PRIM., SKIP THIS ADDR.
         STW,R13  TMPADDR     NO--- SAVE, USED AS FLAG TO EXIT FROM HERE
         LI,R5    4                 # CHAR.
         STH,R13  R13               LEFT JUSTIFY
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         LW,R15   BLK               PUT
         SCD,R14  -24                 DEV.ADDR.(ALT.)
         LCI      2                   INTO
         STM,R14  WA(DVAD)            MESSAGE
         LI,R5    1                 ALT.PATH INDEX
         LI,R12   PERDWNCA
         B        PRNTIMG
*----------------
NOT:PART EQU      %
         LD,R14   MV:NT:PT
         B        MV:IT:IN          MOVE TO MESG.
*----------------
NOT:PRTD EQU      %
         LD,R14   MV:NT:PD
FLGSYMB  EQU      %
         EXU      MV:IT:IN          MOVE TO MESSAGE
         LI,R12   -1                SET FLAG FOR SYMB.CHECK
         B        IS:SYMBT
*----------------
NOT:PRTC EQU      %
         LD,R14   MV:NT:PC
         B        FLGSYMB           MOVE TO MESG.
*----------------
IS:SYMB  EQU      %
         LD,R14   MV:IS:SM
         CI,R12   0
         BEZ      MV:IT:IN    NO--- SPECIAL SYMB.CHECK
         LW,R14   SYMBMX      YES--
         STW,R14  WA(:SYM)          ':SYM' TO MESSAGE
         B        SETR12
*----------------
MV:IT:IN EQU      %
         MBS,R14  0                 MOVE TO MESSAGE THE INFO
SETR12   EQU      %
         LI,R12   PERDWNCP
         B        PRNTIMG
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    DOREMOVE
*        DESCRIPTION:
*  DOREMOVE ROUTINE
*
*    PROCESS REMOVE REQUESTS FROM CONFIG.TABLE
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  DOREMV.
*        REGISTERS:  R3 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
DOREMOVE EQU      %           <---  ENTER
         MTW,0    FND:REMOVE
         BEZ      *R11        --->  RETURN, NO :REMOVE REQUESTS
         LW,R3    Y04
         STW,R3   REM:PART          LOOK FOR :REMOVE ENTRIES
         STW,R3   REMVFLG           SET REMOVE FLAG TO TRUE
         B        DOREMV      --->  GO DO REMOVE (LIKE PART.)
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    DOPART
*        ENTRY:   DOREMV
*        ENTRY:   NXT:PART
*        ENTRY:   CHKPRVDP
*        ENTRY:   BILDMSG
*        DESCRIPTION:
*  DOPART ROUTINE
*  DOREMV ROUTINE
*  NXT:PART ROUTINE (SUB-ENTRY TO GET NEXT PART/REMOVE ENTRY)
*  CHKPRVDP ROUTINE (SUB-ENTRY TO PART/REMOVE DEVICE IN CONT.)
*  BILDMSG ROUTINE (SUB-ENTRY TO BUILD & OUTPUT MESSAGE)
*
*    PROCESS PARTITIONING & REMOVE REQUESTS FROM CONFIG.TABLE
*
*    CALL:
*        R11 =    LINK
*
*        INPUT:   REMVFLG = 0   PART
*                         = Y04 REMOVE
*                 REM:PART = Y1  PART
*                          = Y04 REMOVE
*
*        INTERFACE:  FINDENT,MSGLL,MVTOMSG,PRIVPACK,MVNDD,
*                 TAPEPACK,CHK:REMV,NXDV:CNT,SETPERDN,CHKCNT.
*        REGISTERS:  R0-R6,R8-R10,R12-R15 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
DOPART   EQU      %           <---  ENTER
         LW,R3    Y1
         STW,R3   REM:PART          LOOK FOR :PART ENTRIES
         LI,R3    0
         STW,R3   REMVFLG           SET REMOVE FLAG TO FALSE
         MTW,0    FND:PART
         BEZ      CHKCITS     NO--- ANY :PART REQUESTS
*                             YES--
DOREMV   EQU      %                 PROCESS :PART/:REMOVE REQUESTS
         PSW,R11  STK               SAVE RETURN
         LI,R3    0                 ENTRY INDEX INTO CONFIG.TABLE
NXT:PART EQU      %
         LW,R8    REM:PART          FLAG FOR :PART/:REMOVE ENTRY SEARCH
         BAL,R11  FINDENT     ****  FIND AN ENTRY IN CONFIG.TABLE
*
*  R3 =  INDEX INTO CONFIG.TABLE OF PARTITION ENTRY
*  CC1=1 END OF CONFIG.TABLE FOUND
*
         BCR,8    PROCPART    NO--- END OF TABLE
*                             YES--
         MTW,0    REMVFLG
         BNEZ     CHK:REMV    YES-- REMOVE
         PLW,R11  STK         NO--- PART
CHKCITS  EQU      %
         PSW,R11  STK
         LI,R13   0
         STW,R13  TEMP              SPECIAL SYSGEN SUMMARY ONLY 1 TIME
         LI,R13   MIOPCNTM
         LI,R15   MIOPCNTM
         LI,R1    1
NX:DCT2  EQU      %
         LB,R8    DCT2,R1           GET QUEUING CHANNEL INDEX
         LH,R12   DCT1P,R1          PRIM.DEV.ADDR.
         LH,R14   DCT1A,R1          ALT.DEV.ADDR.
         CI,R12   -1
         BE       NX:ODEV     YES-- DEV.REMOVED
         CI,R14   -1          NO---
         BE       NX:ODEV     YES-- DEV.REMOVED
         CI,R12   MIOPMASK    NO---
         BANZ     M:U:C       YES-- MUC TYPE
         CI,R14   MIOPMASK    NO--- SUC
         BAZ      NX:ODEV     YES-- SUC TYPE DEVICE
M:U:C    EQU      %           NO--- MUC TYPE
         LI,R2    0
NEWDCT2  EQU      %
         AI,R2    1                 START SEARCH AT NEXT DCT
         CI,R2    DCTSIZ
         BG       NX:ODEV     YES-- DONE
         LB,R6    DCT3,R2     NO---
         LB,R5    DCT3,R1
         CI,R5    SC1+SC2
         BAZ      PRMPRM      YES-- USE ANY SUBCHANNEL IN SOURCE DCT
         CI,R5    SC1         NO---
         BAZ      ALTALT      YES-- SUBCHANNEL 2 ONLY
PRMPRM   EQU      %           NO--- SUBCHANNEL 1 ONLY, MAYBE SC2 ALSO
         CI,R6    SC1+SC2
         BAZ      PRMPRMCK    YES-- USE ANY SUBCHANNEL IN OTHER DCT
         CI,R6    SC1         NO---
         BAZ      ALTALT      YES-- SUBCHANNEL 2 ONLY
PRMPRMCK EQU      %           NO--- SUBCHANNEL 1 ONLY, MAYBE SC2 ALSO
         LH,R11   DCT1P,R2
         CS,R12   R11               CHECK PRIM.VS.PRIM.
         BNE      PRMALT      NO--- IOP/CONT,CLUST/UNIT EQUAL
CHK:DCT2 EQU      %           YES--
         CB,R8    DCT2,R2
         BE       NEWDCT2     YES-- SAME QUEUING CHANNEL
         LCI      0           NO---
         PSM,R0   STK               SAVE REGISTERS
         MTW,0    GOFLG
         BNEZ     NOSUMRY     NO--- NEED SYSGENED CNFG.SUMMARY
         MTW,0    TEMP        YES--
         BNEZ     NOSUMRY     YES-- ALREADY GIVE SPECIAL SUMMARY
         MTW,1    TEMP        NO--- SET FLAG TO ONLY 1 TIME
         MTW,1    MSGFLG            SET FLG.2 ENTER INTO MSG.PATCH FILE
         LI,R1    SYSGENM           'SYSGEN CONFIGURATION' TITLE
         BAL,R11  DSPRESLL    ****  DISPLAY CONFIGURATION
         LI,R11   0
         STW,R11  MSGFLG            RESET ENTER INTO PATCH FILE FLAG
         LI,R12   TOP               TOP OF FORM
         BAL,R11  MSGLL       ****  OUTPUT MESSAGE
NOSUMRY  EQU      %
         LCI      0
         PLM,R0   STK               RESTORE REGISTERS
         LB,R6    DCT2,R2
         LB,R11   CIT3,R6           QUEUE ENTRY TO BE CHANGED
         LB,R5    DCT2,R1
         LB,R4    CIT3,R5           CURRENT QUEUE ENTRY
         AND,R4   L(DUALACS)        CURRENT STATUS FOR DUAL FLAG
         LI,R5    DUALACS
         STS,R4   R11               CURRENT STATUS OF DUAL FLAG
         STB,R11  CIT3,R6             INTO QUEUE ENTRY TO BE CHANGED
         STB,R8   DCT2,R2           MAKE QUEUE INDEX SAME AS CURRENT
         LB,R11   DCT3,R2           GET SC1/SC2 TO BE CHANGED
         LB,R4    DCT3,R1           GET SC1/SC2 OF SOURCE
         LI,R5    SC1+SC2
         STS,R4   R11               MAKE SC1/SC2 SAME AS SOURCE
         STB,R11  DCT3,R2
         LCI      0
         PSM,R0   STK               SAVE REGISTERS
         LI,R5    2
         STB,R1   R13
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         STH,R14  WA(Q11)           CURRENT DCT INDEX
         LI,R5    1
         STH,R14  WA(Q22),R5
         LI,R5    2
         STB,R2   R13
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = EBCDIC VALUE
*
         STH,R14  WA(Q12)           CONFLICTIN DCT INDEX
         STH,R14  WA(Q21)
         LI,R12   Q:BAD1
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         LI,R12   Q:BAD2
         BAL,R11  MSGLL       ****  OUTPUT MESSAGE
         LCI      0
         PLM,R0   STK               RESTORE REGISTERS
         B        NEWDCT2
*----------------
NX:ODEV  EQU      %
         AI,R1    1
         CI,R1    DCTSIZ
         BLE      NX:DCT2     NO--- DONE X-CHECKING
*                             YES--
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
PRMALT   EQU      %
         CI,R6    SC2
         BAZ      ALTALT      YES-- SUBCHANNEL 1 ONLY
         LH,R11   DCT1A,R2
         CS,R12   R11               CHECK PRIM.VS.ALT.
         BE       CHK:DCT2    YES-- IOP/CONT,CLUST/UNIT EQUAL
ALTALT   EQU      %           NO---
         CI,R5    SC2
         BAZ      PRMALTX     YES-- SUBCHANNEL 1 ONLY
         CI,R6    SC1+SC2     NO---
         BAZ      ALTPRM      YES-- USE EITHER SC1 OR SC2
         CI,R6    SC2         NO---
         BAZ      ALTPRM      YES-- SUBCHANNEL 1 ONLY
         LH,R11   DCT1A,R2    NO---
         CS,R14   R11               ALT.VS.ALT.
         BE       CHK:DCT2    YES-- IOP/CONT,CLUST/UNIT EQUAL
         CI,R6    SC1
         BAZ      NEWDCT2     YES-- USE SUBCHANNEL 2 ONLY
ALTPRM   EQU      %           NO---
         LH,R11   DCT1P,R2
         CS,R14   R11               ALT.VS.PRIM.
         BE       CHK:DCT2    YES-- IOP/CONT,CLUST/UNIT EQUAL
         B        NEWDCT2     NO---
*----------------
PRMALTX  EQU      %
         CI,R6    SC2
         BAZ      NEWDCT2     YES-- USE SUBCHANNEL 1 ONLY
         LH,R11   DCT1A,R2
         CS,R12   R11               PRIM.VS.ALT.
         BE       CHK:DCT2    YES-- IOP/CONT,CLUST/UNIT EQUAL
         B        NEWDCT2     NO---
*----------------
         PAGE
*----------------
PROCPART EQU      %
         LI,R1    0
         STW,R1   SAMFLG            RESET FLAG 4 LOOKING 4 LIKE DEV.ADDR.
         LI,R1    DCTSIZ            # ENTRIES IN DCT
NXTDVAD  EQU      %
         LI,R2    1                 CONT.REQUEST FLAG
         LW,R13   E0,R3             GET ENTRY(FLAGS & DEV.ADDR.)
         BLZ      %+2         YES-- CONTROLLER REQUEST
         LI,R2    0           NO--- DEVICE, DEV.REQUEST FLAG
         AND,R13  M16               KEEP ONLY DEV.ADDR.
DOPARTCD EQU      %
         LI,R6    SC1               SUB-CHANNEL 1 (PRIM.) FLAG
         CH,R13   DCT1P,R1
         BE       CHKNOHER    YES-- FIND DEV.ADDR.(PRIM.)
         LI,R6    SC2         NO--- SUB-CHANNEL 2 (ALT.) FLAG
         CH,R13   DCT1A,R1
         BE       CHKNOHER    YES-- FIND DEV.ADDR.(ALT.)
NEXDCT   EQU      %           NO---
         BDR,R1   DOPARTCD    NO--- DONE SEARCH
         MTW,0    SAMFLG      YES--
         BNEZ     NXT:PART    YES-- LOOKING FOR LIKE DEV.ADDR.
NOPRESNT EQU      %           NO---
         LI,R6    PERMDWNM          'NOT PRESENT'
BILDMSG  EQU      %
         PSW,R3   STK               SAVE INDEX
         EXU      DVCNTMOV,R2       PARAM.ADDR. TO R8
         LD,R8    *R8               ', DEV.'  OR  ',CONT.'
         MBS,R8   0                   TO MESSAGE
         LI,R3    0
         MTW,0    REMVFLG
         BNEZ     %+2         YES-- REMOVE
         LI,R3    1           NO--- PART
         EXU      PARTREMV,R3       PARAM.ADDR. TO R8
         LD,R8    *R8               'PARTITION' OR 'REMOVE'
         MBS,R8   0                   TO MESSAGE
         BAL,R11  MVTOMSG     ****  SET UP MESSAGE
         LI,R12   CANTPART          'CANNOT XXXXXX, NDD---'
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         PLW,R3   STK               RESTORE INDEX
         B        NXT:PART
         PAGE
*
*        FOUND REQUEST DEVICE IN EITHER DCT1P OR DCT1A
*
*        INDEX IS IN R1
*
CHKNOHER EQU      %
*
*        R6=1 IF FOUND IN DCT1P
*        R6=2 IF FOUND IN DCT1A
*
         LI,R10   0                 FIRST LETS CLEAR THE 'NO-DECREMENT'
         STW,R10  NOCOUNTS          FLAG FOR RESOURCE COUNTING
         LB,R10   DCT3,R1           LOAD UP DEVICE FLAGS INTO R10
         CI,R6    SC1               WAS IT IN DCT1P (PRIM CHANNEL)
         BNE      NOTSC1            NOPE-->   DCT1A (ALT. CHANNEL)
         CH,R13   DCT1A,R1          YUP---> IS PRIM SAME AS ALT
         BE       NOTSC2            SC2 = SC1 GO AHEAD AND PARTITION.
*
*        THIS IS A DUAL ACCESS SYSTEM AND PRIM.NE.ALT CONTROLLER
*
         CI,R10   SC2               IS THERE AN ALTERNATE CHANNEL PATH
         BAZ      NO%PATH           NOPE--> JUMP
         MTW,7    NOCOUNTS          SET 'DONT DECREMENT RESOURCE COUNT'
         B        NOTSC2            MERGE
NOTSC1   EQU      %
         CH,R13   DCT1P,R1          IS ALT SAME AS PRIMARY
         BE       NOTSC2            YUP--> GO AHEAD AND PARTITION
         CI,R10   SC1               NO---> IS THERE A PRIMARY PATH LEFT
         BAZ      NO%PATH           NOPE--> WE'RE PARTITIONING THE
         MTW,7    NOCOUNTS          DONT DECREMENT RESOURCE COUNTS
*                                   WHOLE ENCHILADA.
*
NOTSC2   EQU      %
         STW,R6   ACCESS%PATH       REMEMBER PATH WE ARE TAKING DOWN
         CI,R2    0
         BEZ      ISPRMDWN    YES-- DEVICE REQUEST
         AW,R2    R6          NO--- CONTROLLER REQUESTED
ISPRMDWN EQU      %
         EXU      DCT:FLG1,R2       GET FLAGS IN R6
         EXU      PRMDWN,R2         CHECK PERM.DOWN (R6)
         BANZ     NOPRESNT    NO--- RESOURCE PRESENT
         MTW,0    REMVFLG     YES--
         BNEZ     CHKCNT      YES-- REMOVE TYPE
         EXU      NOPARTN,R2  NO--- CHECK NON-PARTITIONABLE (R6)
         BAZ      CHKDWN      YES-- RESOURCE PARTITIONABLE
NOTPART  EQU      %           NO---
         LI,R6    NOPARTM           'NON-PARTITIONABLE'
         B        BILDMSG
NO%PATH  EQU      %
         LI,R10   DCT1P             FIRST LETS CHECK
         CI,R10   DCT1A             AND SEE IF IT IS DUAL ACCESS MODE
         BNE      NOTSC2            NOPE--> GO AHEAD AND PARTITION IT
         BAL,R11  PRIVPACK          CHECK TO SEE IF PRIV PACK
         LI,R6    0                 IT PRIVATE
         B        NOTSC2            AND OKAY TO DROP
*----------------
CHKDWN   EQU      %
         EXU      DCT:FLG2,R2       GET FLAGS IN R6
         EXU      ALREDWN,R2        CHECK ALREADY DOWN (R6)
         BAZ      CHKCNT      NO--- ALREADY DOWN
*                             YES--
         LI,R6    ALREDPTM          'ALREADY PARTITIONED'
         B        BILDMSG
         PAGE
*
*
*
CHKPRVDP EQU      %
         MTW,0    REMVFLG
         BNEZ     REMOVEIT    YES-- REMOVE TYPE
*                             NO--- PART
         LCI      (PRTMSZ+3)**-2
         LM,R10   DEVALU            SET MESSAGE
         STM,R10  PARTM               TO 'DEV.'
         LI,R14   0                 FLAG TO DECREMENT RESOURCE COUNT
         CLM,R1   RBLIMS
         BCR,9    REMOTEP     YES-- REMOTE BATCH DEVICE
         LB,R4    SNDDX       NO--- SYMBIONT TABLE SIZE
NXTSNDX  EQU      %
         CB,R1    SNDDX,R4          CHECK DCT INDEX
         BE       FNDSYMB     YES-- SYMBIONT DEVICE
         BDR,R4   NXTSNDX     NO--- DONE SEARCH
         B        PART:IT     YES--
*----------------
FNDSYMB  EQU      %
         LI,R6    'Q'
         LB,R12   SYMX,R4           INPUT/OUTPUT FLAG
         CI,R12   OUTPUT
         BANZ     %+2         YES-- OUTPUT SYMBIONT
         LI,R6    'L'         NO--- INPUT
         STB,R6   SSIG,R4           SET SYMBIONT SIGNAL
         LI,R6    NOTAVAIL
         STB,R6   SSTAT,R4          SET STATUS = NOT AVAILABLE
         LI,R14   1                 FLAG TO NO DECREMENT RESOURCE COUNT
PART:IT  EQU      %
         MTW,0    CONTRFLG
         BNEZ     CHKPATH     YES-- CONTROLLER REQUEST
PARTITOK EQU      %           NO--- DEVICE REQUESTED
         PSW,R3   STK               SAVE PART.INDEX
         PSW,R14  STK               SAVE FLAG FOR LATER
         BAL,R11  MVNDD       ****  SET UP MESSAGE WITH 'NDD'
*
*  R6 =  EBCDIC 'NDD' LEFT JUSTIFIED BLANK FILLED
*
         STW,R6   PKTP3             'NDD'
         STW,R6   PKTP4             'NDD'
         STH,R6   NDDPARTM+1        PUT
         SLS,R6   -16                 'NDD'
         LI,R3    1                   INTO
         STH,R6   NDDPARTM,R3         MESSAGE
         LI,R12   PARTM             'NDD PART.' (DEV.)
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         PLW,R14  STK               RESTORE FLAG
         PLW,R3   STK               RESTORE PART.INDEX
         LB,R6    DCT3,R1           GET FLAGS (DEV.)
         MTW,0    CONTRFLG
         BEZ      NOCNT1      YES-- DEVICE REQUEST
         LW,R5    DCT9FLG     NO--- CONTROLLER
         LW,R4    DCT3FLG
         AND,R4   R6                GET ORIGINAL SC1/SC2
         STB,R4   R4
         SLS,R4   1
         STS,R4   DCT9,R1           SAVE ORIGINAL SC1/SC2 VALUE
NOCNT1   EQU      %
         LW,R12   R6
         AND,R6   =X'FC'            KEEP I/O FLAGS--CLEAR DUAL STUFF
         LW,R4    ACCESS%PATH       GET PATH REMAINING FLAG
         OR,R6    PATHS,R4          PLACE PROPER BIT IN DEVICE FLAGS
         MTW,0    CONTRFLG
         BEZ      NOCNT2      YES-- DEVICE REQUEST
         LB,R5    R5          NO--- CONTROLLER
         SLS,R5   -1
         LI,R4    0
         STS,R4   R6                SET ORIGINAL SC1/SC2 = 0
NOCNT2   EQU      %
         STB,R6   DCT3,R1
         LB,R6    DCT24,R1          GET FLAGS (CONT.)
         OR,R6    NOALLOC           SET NO ALLOCATE FLAG
         STB,R6   DCT24,R1
         LW,R5    CONTRFLG          IF CONTROLLER REQUEST,
         STS,R5   DCT9,R1             SET PRIM./ALT.PARTITIONED FLAG
         MTW,0    CONTRFLG
         BNEZ     NODEV1      YES-- CONT.REQUEST
         LW,R5    PART:DV     NO--- DEVICE
         STS,R5   DCT9,R1           SET DEV.PART.ALONE FLAG
NODEV1   EQU      %
         CI,R14   0
         BNEZ     DNTDECR     YES-- SYMBIONT DEVICE
         LB,R4    DCT4,R1     NO--- DEV.TYPE INDEX
         LI,R5    SV:RSIZ+1
NXTRSRCP EQU      %
         CB,R4    SB:RTY,R5
         BE       DECR        YES-- FIND DEV.RESOURCE
         BDR,R5   NXTRSRCP    NO--- DONE SEARCH
         B        DNTDECR     YES--
*----------------
DECR     EQU      %
         LW,R6    R12
         EXU      ALREDWN,R2        CHECK IF DEV.ALREADY ACCOUNTED 4(R6)
         BANZ     DNTDECR     YES-- ACCOUNTING DONE
         MTH,-1   SH:RTOT,R5  NO--- DECREMENT TOTAL COUNT
DNTDECR  EQU      %
         BAL,R11  TAPEPACK    ****  DISPLAY SPECIAL MESSAGE IF TAPE/PACK
NXTDEV   EQU      %
         MTW,0    CONTRFLG
         BNEZ     NXDV:CNT    --->  DEV.IN CONT.REQUEST, EXIT
         BDR,R1   MORESAME    YES-- POSSIBLY MORE DEV.ADDR.SAME
         B        NXT:PART    NO---
*----------------
MORESAME EQU      %
         MTW,1    SAMFLG            SET LOOKING FOR MORE DEV.ADDR.FLAG
         B        NXTDVAD           CONTINUE SEARCH
*----------------
         PAGE
*----------------
REMOVEIT EQU      %
         LI,R11   0
         LB,R2    DCT24,R1
         AND,R2   L(PERDWND+PERDWNC+DONTALLO)  SAVE PREV.FLAGS
         MTW,0    CONTRFLG
         BEZ      RMV:DEV     YES-- DEVICE REQUEST
         OR,R2    DCT24FLG    NO--- CONTROLLER
         LB,R6    DCT3,R1
         AND,R6   L(SC1+SC2)
         CI,R6    SC1+SC2
         BNE      RMV:PTH     YES-- SINGLE ACCESS PATH
         LI,R11   -1          NO--- DUAL
         B        RMV:PTH
*----------------
RMV:DEV  EQU      %
         CI,R11   -1
         BE       %+2         YES-- CONTROLLER REQUEST
*                             NO--- DEVICE
         OR,R2    L(PERDWND+DONTALLO)  DEV.PERM.DOWN FLAGS
         LW,R6    R1                DCT INDEX
         LI,R4    1                 # ENTRIES TO SET
         LI,R0    -1                - COUNT
         PSW,R1   STK               SAVE DCT INDEX
         BAL,R11  SETPERDN    ****  SET DEV.NOT AVAIL.
         PLW,R1   STK               RESTORE DCT INDEX
         B        NXTDEV
*----------------
CHKPATH  EQU      %
         LB,R11   DCT3,R1
         AND,R11  L(SC1+SC2)
         BEZ      PARTITOK    YES-- SINGLE ACCESS PATH
         CI,R11   SC1+SC2     NO--- BUT MAYBE
         BNE      PARTITOK    YES-- SINGLE ACCESS PATH
RMV:PTH  EQU      %           NO--- DUAL
         LW,R5    DCT9FLG
         LW,R4    DCT3FLG
         LB,R6    DCT3,R1
         AND,R4   R6                SAVE SC1 OR SC2 FLAG
         STB,R4   R4
         SLS,R4   1
         STS,R4   DCT9,R1           SAVE ORIGINAL SC1/SC2 FLAG
         LB,R5    R5
         SLS,R5   -1
         LI,R4    0
         STS,R4   R6                SET ORIGINAL SC1/SC2 = 0
         STB,R6   DCT3,R1
         MTW,0    REMVFLG
         BNEZ     RMV:DEV     YES-- REMOVE TYPE REQUEST
         LW,R5    CONTRFLG    NO--- PARTITION, IF CONTROLLER
         STS,R5   DCT9,R1             REQUEST, SET SC1/SC2 PART.
         B        NXTDEV
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    DEVINCNT
*        ENTRY:   NXDV:CNT
*        ENTRY:   CHKCNT
*        DESCRIPTION:
*  DEVINCNT ROUTINE (SUB-ENTRY TO PART ROUTINE)
*  NXDV:CNT ROUTINE (RETURN ENTRY WHEN PART/REMOVE DEV.IN CONT.)
*  CHKCNT ROUTINE (PROCESS DEVICE IN CONTROLLER INFO)
*
*    INPUT:
*        R1 =     DCT INDEX
*        R2 = 0   DEVICE REQUEST
*           = 1   CONTROLLER REQUEST
*        R13=     DEV.ADDR.
*        CONTRFLG=DOWNC FLAG
*
*        INTERFACE:  PRIVPACK,DEVINCNT,MVNDD,MSGLL,NXDV:CNT,
*                 CHKPRVDP.
*        REGISTERS:  R1-R2,R5-R13 USED, R3 SAVED
*FIN*
*****************
         SPACE    3
DEVINCNT EQU      %
         LB,R10   DCT24,R1          GET FLAGS
         CI,R10   PERDWND
*                             NO--- DEV.PRESENT
         BANZ     NXDV:CNT    --->  EXIT IF NOT
         B        CHKPRVDP          DO PARTITIONING
*----------------
         PAGE
*****************
CHKCNT   EQU      %
         LI,R10   0
         STW,R10  CONTRFLG          SET DEV.REQUESTED
         STW,R10  DCT3FLG
         STW,R10  DCT9FLG
         CI,R2    0
         BEZ      CHKPRVDP    YES-- DEV.REQUEST
         LB,R6    DCT2,R1     NO--- CONTROLLER
*
*  IF A PACK CONTROLLER:
*    LOOK AT ALL DEVICES WITHIN IT FOR PRIVATE & PARTITIONABLE
*    LOOK AT ALL DEVICES FOR PARTITIONABLE EVEN IF NOT PACK
*
         LI,R5    1                 DCT INDEX
         LI,R7    0                 1ST DCT(I) FOR DEVICE
CHK4CIT  EQU      %
         LB,R12   DCT2,R5
         CW,R12   R6
         BE       CITSAME     YES-- FIND DEV.IN CONT.
         CI,R7    0                 A`HAVE WE ALREADY FOUND THE 1ST DEV.
         BEZ      CKNXTCIT          NOPE--> KEEP SCANNING FOR IT
         BDR,R5   ENDCTCHK          YUP-->  ADJUST LAST CHANNEL INDEX
CKNXTCIT EQU      %           NO---
         AI,R5    1                 TO NEXT DCT
         CI,R5    DCTSIZ
         BG       ENDCTCHK    YES-- END OF DCT'S
         B        CHK4CIT     NO---
*----------------
CITSAME  EQU      %
         LI,R9    MIOPCNTM          MIOP MASK
         CI,R13   MIOPMASK          MASK TO CHK.4 MIOP
         BANZ     %+2         YES-- MIOP TYPE
         LI,R9    SIOPCNTM    NO--- SIOP, SIOP MASK
         EXU      GETDEVAD,R2       GET DEV.ADDR.
         CS,R8    R13
         BNE      CKNXTCIT    NO--- FIND DESIRED CONT.
         MTW,0    R7          YES--
         BNEZ     %+2         YES-- 1ST DCT(I) FOR DEV.FOUND
         STW,R5   R7          NO--- SAVE 1ST DCT(I) FOR DEVICE
         MTW,0    REMVFLG
         BNEZ     ENDCTCHK    YES-- REMOVE
         LB,R12   DCT3,R5     NO--- PART
         AND,R12  L(SC1+SC2)
         CI,R12   SC1+SC2
         BE       CKNXTCIT    YES-- DUAL ACCESSES TO DEVICE
*                             NO--- SINGLE
         STW,R1   R12               SAVE DCT INDEX
         LW,R1    R5                CURRENT DCT INDEX
         B        %+2               DISABLE PRIVATE PACK TEST
         BAL,R11  PRIVPACK    ****  CHECK IF PRIVATE PACK
*
*  NO RETURN IF PUBLIC PACK
*
         LW,R1    R12               RESTORE DCT INDEX
         LB,R12   DCT24,R5          CANNOT PARTITION CONTROLLER
         CI,R12   NOPARTD             IF A DEVICE WITHIN IT IS
         BANZ     NOTPART             NOT PARTITIONABLE
*                                   ALL'S OK
         B        CKNXTCIT
         PAGE
*
*        WE HAVE SCANNED ALL DEVICES ON THIS CHANNEL
*
ENDCTCHK EQU      %
*
*  R7 =  INDEX OF 1ST DEV. IN CONT.
*
         INT,R1   ALREDWN,R2
         LW,R10   0,R1              GET APPROPRIATE DOWN FLAG
         STW,R10  CONTRFLG            & SAVE (DOWND,CA,CP)
         LB,R10   ORIGFLG1,R2       GET APPROPRIATE SC1/SC2 FLAG
         STW,R10  DCT3FLG             & SAVE (ORIGINAL MASK)
         LW,R10   ORIGFLG2,R2       GET APPROPRIATE SC1/SC2 FLAG
         STW,R10  DCT9FLG             & SAVE (SAVING OF ORIGINAL)
         LW,R10   PRMDWN,R2         GET APPROPRIATE REMOVED FLAG
         STB,R10  R10
         LB,R10   R10
         STW,R10  DCT24FLG            & SAVE (PERDWND,CA,CP)
         PSW,R2   STK               SAVE INDEX FLAG
         LW,R8    R13               SAVE DEV.ADDR. (ORIGINAL)
PRT:CONT EQU      %
         PLW,R2   STK               RESTORE INDEX FLAG
         PSW,R2   STK               SAVE IT AGAIN
         LW,R1    R7
         EXU      GETDVAD,R2        GET DEVICE ADDRESS
         LI,R9    MIOPCNTM          MIOP TYPE MASK
         CI,R13   MIOPMASK          MASK TO CHK.4 MIOP
         BANZ     %+2         YES-- MIOP TYPE
         LI,R9    SIOPCNTM    NO--- SIOP, SIOP TYPE MASK
         CS,R8    R13
         BNE      XITCNT      YES-- END OF CONTROLLER
         LCI      R8-R7+1     NO--- SAVE DCT INDEX
         PSM,R7   STK                 & ORIGINAL DEV.ADDR.
         LI,R2    0                 DEV.PART.FLAG
         MTW,0    REMVFLG
         BNEZ     CHKPRVDP    YES-- REMOVE REQUEST
*                             NO---
         B        DEVINCNT    ****  PART.DEV.& CONT.
*
*  R E T U R N   TO   H E R E
*
NXDV:CNT EQU      %
         LCI      R8-R7+1           RESTORE DCT INDEX
         PLM,R7   STK                 & ORIGINAL DEV.ADDR.
         AI,R7    1
         LB,R13   DCT2,R7
         CB,R13   DCT2,R1
         BE       PRT:CONT    NO--- END OF DEV.IN CONT.
         PLW,R2   STK         YES-- RESTORE STACK
         MTW,0    REMVFLG
         BNEZ     NXT:PART    YES-- REMOVE
         LW,R13   R8          NO--- PART, ORIGINAL DEV.ADDR.
         LI,R2    1                 SET CONT.REQUEST FLAG
         LW,R10   DCT9,R1
         CW,R10   CONTRFLG
         BAZ      NOPRESNT    NO--- WAS CONT.PART.
         PSW,R2   STK         YES-- DUMMY TO STACK
XITCNT   EQU      %
         PLW,R2   STK               RESTORE STACK
         MTW,0    REMVFLG
         BNEZ     NXT:PART    YES-- REMOVE TYPE
*                             NO---
         LCI      (PRTMSZ+3)**-2
         LM,R10   CONTVALU          SET MESSAGE
         STM,R10  PARTM               TO 'CONT.'
         PSW,R3   STK               SAVE PART.INDEX
         LW,R13   R8
         BAL,R11  MVNDD       ****  SET UP MESSAGE WITH 'NDD'
*
*  R6 =  EBCDIC 'NDD' LEFT JUSTIFIED BLANK FILLED
*
         STH,R6   NDDPARTM+1        PUT
         SLS,R6   -16                 'NDD'
         LI,R3    1                   INTO
         STH,R6   NDDPARTM,R3         MESSAGE
         LI,R12   PARTM             'NDD PART.' (CONT.)
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         PLW,R3   STK               RESTORE PART.INDEX
         B        NXT:PART
*----------------
REMOTEP  EQU      %
         LI,R11   OFFBIT
         STS,R11  RB:FLAG,R1        SET REMOTE BATCH STATUS TO OFF
         B        PART:IT
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    TAPEPACK
*        DESCRIPTION:
*  TAPEPACK ROUTINE
*
*    CHECK IF TAPE/PACK & DISPLAY SPECIAL MESSAGE
*
*    INPUT:
*        R1 =     DCT INDEX
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  MSGLL.
*        REGISTERS:  R4-R5,R12 USED, R11 SAVED
*FIN*
*****************
         SPACE    2
TAPEPACK EQU      %           <---  ENTER
         LW,R4    R1                DCT INDEX
         AI,R4    -BATAPE
         BLZ      *R11        --->  RETURN, NOT TAPE OR PACK
         CI,R4    AVRTBLNE
         BGE      *R11        --->  RETURN, NOT TAPE OR PACK
         PSW,R11  STK               SAVE RETURN
         LW,R12   TAPE              'TAPE'
         CI,R4    AVRTBLSIZ
         BL       %+2               TAPE
         LW,R12   PACK              PACK, 'PACK'
         STW,R12  PKTP1             'PACK' / 'TAPE'
         LB,R5    DCT4,R1           TYPE MNEMONIC INDEX
         LH,R12   OH:NM,R5          TYPE MNEMONIC
         LI,R5    PKTP2
         STH,R12  0,R5              'YY'
         LI,R12   PKTP:PRT          'XXXX YYNDD PART.,DIAL #V NOT AVAIL.'
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    FINDENT
*        DESCRIPTION:
*  FINDENT ROUTINE
*
*    FIND AN ENTRY IN CONFIG.TABLE CORRESPONDING
*    TO A REQUESTED TYPE, (I.E., TYPE VS. PART)
*
*    INPUT:
*        R3 =     CURRENT INDEX INTO TABLE
*        R8 =     FLAG FOR TYPE OF ENTRY DESIRED (CRITERIA)
*                 = X'10000000' FOR :PART
*                 = X'00000000' FOR :TYPE
*                 = X'04000000' FOR :REMOVE
*
*    OUTPUT:
*        CC1 = 0  NOT END OF INFO
*          R3=    INDEX OF ENTRY IN TABLE
*        CC1 = 1  END OF INFO
*
*    CALL:
*        R11 =    LINK
*
*        REGISTERS:  R1,R3,R9 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
FINDENT  EQU      %           <---  ENTER
         CI,R3    0
         BEZ      2NXT        YES-- 1ST TIME IN
         LW,R1    Y14         NO--- MASK
         CW,R1    INT:BUF+V1,R3
         BANZ     2NXT        YES-- :PART/:REMOVE ENTRY
*                             NO--- :TYPE
         LW,R1    INT:BUF+V1,R3
         AI,R3    1
         CW,R1    Y2
         BAZ      2NXT        NO--- DUAL ACCESS ENTRY (:TYPE)
         AI,R3    1           YES-- BYPASS EXTRA WORD
2NXT     EQU      %
         AI,R3    1                 TO NEXT ENTRY
         CW,R3    INT:BUF+V1
         BLE      CHK:ENT     NO--- END OF INFO
         LCI      8           YES--
         B        *R11        --->  RETURN
*----------------
CHK:ENT  EQU      %
         LW,R9    Y14
         CS,R8    INT:BUF+V1,R3
         BNE      FINDENT     NO--- THIS A GOOD ENTRY
         LCI      0           YES--
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    CNVTMOD#
*        DESCRIPTION:
*  CNVTMOD# ROUTINE
*
*    CONVERT DEV/CONT MODEL #'S IN EBCDIC TO HEX
*
*    INPUT:
*        R2 =     DEV.MOD#
*        R3 =     CONT.MOD#
*
*    OUTPUT:
*        R12 =    DEV.MOD# (WITH SIGN EXT.)
*        R13 =    CONT.MOD#(WITH SIGN EXT.)
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  HEXEHEX.
*        REGISTERS:  R12-R13 USED, R0-R11,R14-R15 SAVED
*FIN*
*****************
         SPACE    3
CNVTMOD# EQU      %           <---  ENTER
         LCI      R15-R14+1+R11-R0+1
         PSM,R14  STK               SAVE REGISTERS
         MTW,1    SPECNVRT          SET SPECIAL CONVERT FLAG
         LI,R5    4                 # CHAR.
         LW,R13   R2                DEV.MOD#
         BAL,R10  HEXEHEX     ****  CONVERT TO HEX
*
*  R14 = CONVERTED VALUE
*
         STH,R14  R12
         LH,R12   R12               DEV.MOD# IN HEX (SIGN EXT.)
         LI,R5    4                 # CHAR.
         LW,R13   R3                CONT.MOD#
         BAL,R10  HEXEHEX     ****  CONVERT TO HEX
*
*  R14 = CONVERTED VALUE
*
         STH,R14  R13
         LH,R13   R13               CONT.MOD# IN HEX (SIGN EXT.)
         MTW,-1   SPECNVRT          RESET CONVERT FLAG
         LCI      R15-R14+1+R11-R0+1
         PLM,R14  STK               RESTORE REGISTERS
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    DORECNFG
*        DESCRIPTION:
*  DORECNFG ROUTINE
*
*    PROCESS CONFIGURATION REQUESTS FROM CONFIG.TABLE
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  SETPERDN,FINDENT,HEXHEXE,MSGLL,MVNDD.
*        REGISTERS:  ALL USED EXCEPT R11 SAVED
*FIN*
*****************
         SPACE    3
DORECNFG EQU      %           <---  ENTER
         MTW,0    FND:TYPE
         BEZ      RTOTSAVE    NO--- ANY :TYPE ENTRIES
*                             YES-- PROCESS THEM
         PSW,R11  STK               SAVE RETURN
         LI,R2    PERDWND+PERDWNC+DONTALLO
*                                   DEV./CONT.PERM.DOWN FLAGS
         LI,R3    0                 ENTRY INDEX INTO CONFIG.TABLE
         BAL,R11  SETPERDN    ****  SET ALL PERIPHERALS PERM.DOWN
NXT:TYPE EQU      %
         LI,R8    0                 FLAG FOR :TYPE ENTRY SEARCH
         BAL,R11  FINDENT     ****  FIND AN ENTRY IN CONFIG.TABLE
*
*  R3 =  INDEX INTO CONFIG.TABLE OF TYPE ENTRY
*  CC1=1 END OF CONFIG.TABLE FOUND
*
         BCR,8    PROCTYPE    NO--- END OF TABLE
*                             YES--
         LB,R1    MB:SDI            1-ST SWAPPER DCT INDEX
         LB,R1    DCT24,R1          1-ST SWAPPER FLAGS
         AND,R1   L(PERDWND+PERDWNC)
         STW,R1   SWAPFLG           SAVE DEV./CONT.DEFINED FLAGS
********
         PAGE
********
*DO*
*D*      NAME:    CHK:REMV
*        DESCRIPTION:
*
*  SUB-ENTRY INTO DORECNFG, USED BY DOPART WHEN REMOVE TYPE
*
*        INPUT:   REMVFLG = 0   PART
*                         = Y04 REMOVE
*
*        INTERFACE:  SAME AS DORECNFG
*        REGISTERS:  ALL USED EXCEPT R11 SAVED
*FIN*
********
         SPACE    3
CHK:REMV EQU      %           <---  ENTER
         LI,R1    1                 DCT INDEX
         LI,R2    DCTSIZ            # DCT ENTRIES
CHK:UP   EQU      %
         LB,R11   DCT24,R1
         CI,R11   PERDWND
         BAZ      2NXAVR      YES-- DEV.AVAILABLE
         MTW,0    REMVFLG     NO---
         BNEZ     DWNBYREM    YES-- REMOVE
         LW,R4    R1          NO---
         MTW,0    SAVEFLG
         BEZ      CHK4AVR     NO--- :SAVE COMMAND SPECIFIED
         LB,R11   DCT24,R1    YES--
         CI,R11   PERDWNC
         BAZ      2NXAVR      YES-- CONTROLLER UP
         LCI      2           NO---
         PSM,R1   STK               SAVE INDEXES
         LI,R2    0
TRY:SWAP EQU      %
         CB,R1    MB:SDI,R2
         BE       CHK4SWAP    YES-- THIS DCT(I) A SWAPPER
         AI,R2    1           NO--- TO NEXT SWAPPER
         CI,R2    LSWAP
         BLE      TRY:SWAP    NO--- END OF SWAPPERS
         B        DEV:UP      YES-- DCT(I) NOT A SWAPPER
*----------------
CHK4SWAP EQU      %
         MTW,0    SWAPFLG
         BNEZ     DEV:UP      NO--- 1ST SWAPPER DEFINED
         B        RESTINDX    YES-- DONT DEFINE THIS ONE THEN
*----------------
*                                   SO FAR CONTROLLER & DEVICE ARE
*                                   DOWN WITH SAVE REQUESTED.
*                                   CHECK IF DEVICE IS A SWAPPER.
*                                   IF NOT, THEN RETURN DEVICE &
*                                   CONTROLLER TO SYSTEM. IF IT
*                                   IS A SWAPPER, CHECK IF THE
*                                   FIRST SWAPPER DEVICE HAS
*                                   BEEN RETURNED TO THE SYSTEM,
*                                   BECAUSE IF THE SWAPPER HAS
*                                   ALREADY BEEN RETURNED, THEN
*                                   THE CURRENT SWAPPER DEVICE
*                                   IS NOT RETURNED. THIS IS
*                                   CAUSED WHEN A SYSTEM HAS
*                                   MORE THAN 1 SWAPPER & ONLY
*                                   1 TO N-1 (WHERE N=# SWAPPERS)
*                                   OF THE SWAPPER DEV.ADDR.
*                                   IS CHANGED BY BOOTSUBR
*                                   (PRIOR TO RECONFIGURATION)
*                                   & THE DEV.ADDR.IOP/CONT.
*                                   IS NOT THE SAME AS THAT FOR
*                                   THE OTHER DEVICES WHICH WERE
*                                   DEFINED IN BOOTSUBR AS 'SA'.
*                                   HOWEVER, IF THE FIRST SWAPPER
*                                   DEVICE HAS NOT BEEN RETURNED TO
*                                   THE SYSTEM, THEN ALL DEVICES
*                                   WILL BE RETURNED TO THE
*                                   SYSTEM.
DEV:UP   EQU      %                 RETURN SWAPPER
         LI,R2    0                 DEV.AVAILABLE FLAG
         BAL,R11  SETPERDN    ****  SET DEV.AVAILABLE & COUNTS
         LCI      2
         PLM,R1   STK               RESTORE REGISTERS
         LW,R6    R1                DCT INDEX
         BAL,R11  SETSC1:2    ****  SET DCT3 SC1/2 FROM DCT9
         B        2NXAVR
*----------------
RESTINDX EQU      %
         LCI      2
         PLM,R1   STK               RESTORE INDEXES
         B        2NXAVR
*----------------
CHK4AVR  EQU      %
         LI,R11   -1
         STH,R11  DCT1,R4
         STH,R11  DCT1P,R4          SET DCT1 ENTRY
         STH,R11  DCT1A,R4            TO X'FFFF'
         STD,R11  DCT16,R4          SET DCT16 ENTRY TO -1
         AI,R4    -BATAPE
         BLZ      2NXAVR:1    NO--- TAPE OR DISK PACK DEV.
         CI,R4    AVRTBLSIZ   YES-- POSSIBLY
         BL       SETNOU      YES-- TAPE DEV.
         CI,R4    AVRTBLNE    NO---
         BGE      2NXAVR:1    NO--- DISK PACK DEV.
         MTH,1    AVRNOU,R4   YES-- MAKE DISK PACK LOOK BUSY(I.E.,DOWN)
SETNOU   EQU      %
         LD,R8    AVRTBL,R4         MAKE
         AI,R9    NOU                 TAPE OR DISK PACK
         STD,R8   AVRTBL,R4           LOOK BUSY (I.E.,DOWN)
2NXAVR:1 EQU      %
         MTW,0    REMVFLG
         BNEZ     POSTAVR     YES-- REMOVE TYPE
*                             NO---
2NXAVR   EQU      %
         AI,R1    1
         BDR,R2   CHK:UP      NO--- DONE
         MTW,0    REMVFLG     YES--
         BNEZ     ISREMOV     YES-- PROCESSING :REMOVES
         MTW,0    FND:REMOVE  NO---
         BNEZ     YESREMOV    YES-- :REMOVE CMNDS.SPECIFIED
ISREMOV  EQU      %           NO--- PROCESS RTOT NOW
         LI,R1    SV:RSIZ+1         TABLE SIZE
NXT:RES  EQU      %
         LI,R11   0                 CURRENT COUNT
         STW,R11  TEMP              RESET FLAG INDICATING RES.CNT.CHANGE
         LI,R2    DCTSIZ
         LB,R4    SB:RTY,R1
#RES:CHK EQU      %
         CB,R4    DCT4,R2
         BE       RES:FWND    YES-- FIND RESOURCE TO BE COUNTED
NOT:HERE EQU      %           NO---
         BDR,R2   #RES:CHK    NO--- DONE RESOURCE COUNTING
         MTW,0    TEMP        YES--
         BEZ      NX:RESCT    NO--- RES.UPDATE COUNT AVAILABLE
         LH,R13   TSH:RTOT,R1 YES-- SYSGENED COUNT FOR THIS TYPE
         STH,R13  SH:RTOT,R1
         CH,R11   TSH:RTOT,R1
         BGE      %+2         YES-- # FOUND > SYSGENED
         STH,R11  SH:RTOT,R1  NO--- < SYSGENED, TAKE # FOUND
NX:RESCT EQU      %
         BDR,R1   NXT:RES     NO--- DONE WITH ALL RESOURCES
         B        YESREMOV    YES--
*----------------
RES:FWND EQU      %
         MTW,1    TEMP              SET FLAG INDICATING RES.CNT.AVAIL.
         LB,R13   DCT24,R2
         CI,R13   PERDWND
         BANZ     NOT:HERE    NO--- DEVICE EXIST
         PSW,R2   STK               SAVE DCT INDEX
         AI,R2    -BATAPE
         BLZ      IS:HERE     NO--- TAPE OR PACK
         CI,R2    AVRTBLSIZ   YES--
         BL       IS:HERE     YES-- TAPE
         CI,R2    AVRTBLNE    NO--- MAYBE PACK
         BGE      IS:HERE     NO--- PACK
         LD,R12   AVRTBL,R2   YES--
         CI,R13   0
         BLZ      DONTINC     YES-- PUBLIC PACK, DONT COUNT IT
IS:HERE  EQU      %           NO--- PRIVATE
         AI,R11   1                 INCREMENT RESOURCE COUNT
DONTINC  EQU      %
         PLW,R2   STK               RESTORE DCT INDEX
         B        NOT:HERE
*----------------
YESREMOV EQU      %           YES-- DONT PROCESS RTOT NOW
         LI,R11   0
         LI,R1    0                 SWAP TABLE INDEX
2NXTSWAP EQU      %
         LB,R2    MB:SDI,R1         SWAPPER DCT INDEX
         LB,R4    DCT24,R2
         CI,R4    PERDWND
         BAZ      %+2         NO--- DEVICE PERM.DOWN
*                             YES-- RESET FREE GRAN.TABLE ENTRY
         STW,R11  M:FREE#GRAN,R1      TO INDICATE DEV.NOT AVAIL.
         AI,R1    1                 TO NEXT SWAPPER
         CI,R1    LSWAP
         BLE      2NXTSWAP    NO--- DONE
*                             YES--
         LI,R1    DCTSIZ
NX:RMOTE EQU      %
         CLM,R1   RBLIMS
         BCR,9    CHKRMOTE    YES-- REMOTE BATCH STATION
RMOTEFIX EQU      %           NO---
         BDR,R1   NX:RMOTE    NO--- DONE
*                             YES--
         LB,R1    SNDDX             SIZE OF SYMBIONT TABLES
ZAPSNDDX EQU      %
         LB,R2    SSTAT,R1          GET STATUS
         CI,R2    NOTAVAIL
         BNE      %+2         YES-- SYMBIONT AVAILABLE
         STB,R11  SNDDX,R1    NO--- REMOVE COMPLETELY
         BDR,R1   ZAPSNDDX    NO--- DONE
         PLW,R11  STK         YES-- RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
CHKRMOTE EQU      %
         LB,R2    DCT24,R1          CHECK IF REMOTE BATCH
         CI,R2    PERDWND             STATION NEEDS 'OFFBIT'
*                                     SET IN RB:FLAG TABLE
         BAZ      RMOTEFIX    NO--- DEVICE PERM.DOWN
         LI,R13   OFFBIT      YES-- SET 'OFFBIT'
         STS,R13  RB:FLAG,R1          IN RB:FLAG TABLE
         B        RMOTEFIX
*----------------
         PAGE
*----------------
DWNBYREM EQU      %
         LH,R10   DCT1P,R1          ORIGINAL DEV.ADDR.
         CI,R10   -1
         BE       2NXAVR      YES-- DEV.ALREADY PERM.DOWN
         LI,R13   0           NO--- TOTAL # ENTRIES
         LI,R14   0                 # ENTRIES PERM.DOWN
         LI,R15   0                 1ST ENTRY INDEX
         LB,R8    DCT4,R1           DEV.TYPE INDEX
         LI,R6    1                 DCT INDEX
         LI,R5    DCTSIZ            # ENTRIES IN DCT
CHKAGAIN EQU      %
         CB,R8    DCT4,R6
         BE       SAMECHAN    YES-- EQUIVALENT TYPE INDEX VALUES
NEWENT   EQU      %           NO---
         AI,R6    1                 TO NEXT DCT
         BDR,R5   CHKAGAIN    NO--- DONE SEARCH
SETINDX  EQU      %           YES--
         LW,R4    R15               GET INDEX OF 1ST ENTRY
         BEZ      2NXAVR      NO--- ANY FOUND(CANT HAPPEN, ACTUALLY)
         LH,R12   DCT1P,R4    YES-- GET DEV.ADDR.
         LI,R11   MIOPCNTM          MIOP MASK
         CI,R10   MIOPMASK          CHECK 4 MIOP
         BANZ     %+2         YES-- MIOP TYPE
         LI,R11   SIOPCNTM    NO--- SIOP, SIOP MASK
         CS,R10   R12
         BNE      GETNXDCT    NO--- SAME CONTROLLER
         CW,R13   R14         YES--
         BNE      PREAVR      NO--- CONT.PERM.DOWN ,ALSO VALUES =
         B        CHK4AVR
*----------------
POSTAVR  EQU      %
         AI,R15   1                 NEXT DCT
         AI,R13   -1                TOTAL # ENTRIES -1
         BDR,R14  SETINDX     NO--- DONE
         B        2NXAVR      YES--
*----------------
PREAVR   EQU      %
         LB,R11   DCT24,R4
         CI,R11   PERDWND
         BANZ     CHK4AVR     NO--- THIS DEV.AVAIL.
*                             YES--
GETNXDCT EQU      %
         AI,R15   1                 NEXT DCT
         CI,R15   DCTSIZ
         BGE      2NXAVR      YES-- END OF DCT
         B        SETINDX     NO---
*----------------
SAMECHAN EQU      %
         LH,R12   DCT1P,R6          GET DEV.ADDR.
         CI,R12   -1
         BE       NEWENT      YES-- DEV.ALREADY PERM.DOWN
         LI,R11   MIOPCNTM    NO--- MIOP MASK
         CI,R10   MIOPMASK          CHECK 4 MIOP
         BANZ     %+2         YES-- MIOP TYPE
         LI,R11   SIOPCNTM    NO--- SIOP, SIOP MASK
         CS,R10   R12
         BNE      NEWENT      NO--- SAME CONTROLLER
         AI,R13   1           YES-- TOTAT # ENTRIES
         LB,R9    DCT24,R6
         CI,R9    PERDWND
         BAZ      NEWENT      NO--- THIS DEV.PERM.DOWN
         AI,R14   1           YES-- # ENTRIES PERM.DOWN +1
         CI,R15   0
         BNEZ     NEWENT      YES-- 1ST DCT FOUND ALREADY
         STW,R6   R15         NO--- SAVE 1ST DCT INDEX
         B        NEWENT
*----------------
         PAGE
*----------------
PROCTYPE EQU      %
         LW,R13   E0,R3             GET ENTRY WRD-1 (FLAGS & DEV.ADDR.)
         CW,R13   Y4
         BANZ     NXT:TYPE    NO--- DEV.IN SYSTEM
         LW,R12   E1,R3       YES-- GET ENTRY WRD-2 (DEV/CONT MOD#'S)
         LH,R11   R12               DEV.MOD# (WITH SIGN EXT.)
         STH,R12  R12
         LH,R12   R12               CONT.MOD# (WITH SIGN EXT.)
         LI,R1    1                 CURRENT DCT INDEX
         LI,R2    DCTSIZ            # DCT ENTRIES
CHKNXDCT EQU      %
         CH,R11   DEVMOD#,R1
         BE       DEVMODOK    YES-- FIND DEV.MOD#
NOTHIS1  EQU      %           NO---
         AI,R1    1                 NEXT DCT
         BDR,R2   CHKNXDCT    NO--- DONE SEARCH
         B        NOADDEV     YES-- CANT ADD DEV.
*----------------
DEVMODOK EQU      %
         CH,R12   CNTMOD#,R1
         BNE      NOTHIS1     NO--- FIND CONT.MOD#
*                             YES--
         LB,R14   DCT24,R1          GET FLAGS
         CI,R14   PERDWND
         BANZ     DEV:FND     NO--- ALREADY CONFIGURE THIS DEVICE
TRYNXT   EQU      %           YES--
         BDR,R2   TRYNXDCT    NO--- END OF DCT'S
         AI,R1    1           YES--
NOADDEV  EQU      %                 CANNOT ADD DEV.TO SYSTEM
         AI,R1    -1
NOADDEV1 EQU      %
         LI,R5    4                 # CHAR.
         LW,R13   R11               DEV.
         SLS,R13  16                  MOD#
         BAL,R10  HEXHEXE     ****  CONVERT TO EBCDIC
*
*  R14 = CONVERTED DEV.MOD# IN EBCDIC
*
         LW,R15   R14               SAVE DEV.MOD#
         LW,R13   E0,R3             GET ENTRY WRD-1 AGAIN
         LI,R5    1
         LB,R5    R13,R5            GET DEV.TYPE INDEX
         LH,R14   OH:NM,R5          TYPE MNEMONIC
         SLD,R14  16
         AI,R15   ' ,'
         LCI      2
         STM,R14  DEVTYP            PUT INTO MESSAGE
         LCI      0
         PSM,R0   STK               SAVE REGISTERS
         LW,R13   E0,R3
         BAL,R11  MVNDD       ****  FORM 'NDD'
*
*  R6 =  'NDD' IN EBCDIC
*
         STW,R6   DEVADDR           PUT INTO MESSAGE
         LI,R12   NOADD             'XXXX,XXXX CANNOT BE ADDED TO SYST.'
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         LCI      0
         PLM,R0   STK               RESTORE REGISTERS
         B        NXT:TYPE
*----------------
TRYNXDCT EQU      %
         LB,R5    DCT4,R1           CURRENT DEV.TYPE
         AI,R1    1                 NEXT DCT ENTRY
         CB,R5    DCT4,R1
         BE       CHKNXDCT    YES-- THIS SAME DEV.TYPE AS PREVIOUS
         AI,R1    -1          NO--- BUT POSSIBLE, NEEDS FURTHER CHECKS
         LI,R5    1
         LB,R5    R13,R5            GET TYPE MNEMONIC INDEX
         CB,R5    DCT4,R1
         BE       NOADDEV1    YES-- LOOKING FOR THIS DEV.TYPE
         AI,R1    1           NO--- TO NEXT DCT ENTRY
         B        CHKNXDCT
*----------------
DEV:FND  EQU      %
*
*  R1 =  DCT INDEX
*  R3 =  INDEX INTO CONFIG.TABLE OF CURRENT ENTRY
*  R13=  FLAGS & PRIMARY DEV.ADDR.
*
         CB,1     MB:SDI
         BNE      %+4
         INT,7    13                IF CHANGING SWAPPER
         CH,7     DCT1,1            MUST NOT ACTUALLY DO IT
         BNE      TRYNXT
         LI,R6    1
         LB,R7    R13,R6            GET TYPE MNEMONIC INDEX
         CB,R7    DCT4,R1
         BNE      TRYNXT      NO--- IS THIS THE DEVICE TYPE
*                             YES--
         LI,R12   -1                NON-DUAL FLAG
         CW,R13   Y2
         BAZ      %+2         NO--- DUAL ACCESS CONFIG.ENTRY
         LW,R12   E2,R3       YES-- DUAL FLAG = ALT.DEV.ADDR.
         LB,R6    DCT2,R1           GET CHAN.(QUEUING) INDEX
         LB,R6    CIT3,R6           GET CHAN.FLAGS
         CI,R6    DUALACS
         BAZ      SYSGSNGL    NO--- SYSGENED AS DUAL ACCESS, SINGLE
         LW,R0    DCT9,R1     YES-- GET SAVED SC1/SC2 FLAGS
         LB,R0    R0
         SLS,R0   -1
         AND,R0   L(SC1+SC2)
         LB,R8    DCT3,R1
         AND,R8   L(SC1+SC2)        GET SC1/SC2 FROM DCT3
         OR,R0    R8                  & MERGE WITH DCT9 SC1/SC2
         CI,R12 -1
         BE       SC1:SC2     NO--- RECONFIGURED AS DUAL ACCESS, SINGLE
         CI,R0    SC1+SC2     YES--
         BNE      CANTMIX     NO--- IS IT SYSGENED FOR DUAL ACCESS
CONFG:IT EQU      %           YES--
         LH,R8    OH:NM,R7          GET DEV.TYPE MNEMONIC
         CI,R8    FE:OPL
         BE       CHK:FE      YES-- IS IT 'FE'
         LI,R0    DCT26       NO---
         BEZ      CHGDCT      NO--- FECP TYPE SYSTEM
         MTB,0    DCT26,R1    YES--
         BNEZ     NOADDEV1    NO--- CAN DEV.ADDR.BE CHANGED
CHGDCT   EQU      %           YES-- NOT 'ME','MO','RB',ETC...
         LH,R0    DCT1P,R1          GET ORIGINAL DEV.ADDR.
         LH,R9    DCT1A,R1          SAVE ALT TOO
         STH,R13  DCT1,R1           NEW PRIMARY DEV. ADDR
         STH,R13  DCT1P,R1          NEW PRIMARY DEV.ADDR.
         STH,R13  DCT1A,R1          NEW ALTERNATE DEV.ADDR.=PRIMARY
         CI,R12   -1
         BE       %+2         NO--- DUAL ACCESS, SINGLE
         STH,R12  DCT1A,R1    YES-- NEW ALTERNATE DEV.ADDR.
         STH,R13  R12               PUT ADDRS TOGETHER
         STH,R0   R9
         SCS,R9   8                 FIND PRIMARY FIRST
         SCS,R12  8
         LI,R7    7                 SET TO FIND MI AND PI TOO
         LI,R6    X'F0006'
CHGPOL0  LI,R5    C%PSZE            SIZE OF TABLE
         BEZ      CHGPOLX           NOT THERE, FORGET IT
         CB,R9    C%PADDR,R5        FIND OLD ENTRY
         BE       CHGPOL            FOUND IT, DO IT
         BDR,R5   %-2
CHGPOL2  LH,R12   R12               NOW DO ALTERNATE
         LH,R9    R9
         AND,R9   M16
         BNEZ     CHGPOL0-1
CHGPOLX  RES
         CI,R8    FE:OPL
         BE       FE:SPEC     YES-- IS IT 'FE'
*                             NO---
         LD,R8    DCT16,R1          GET OLD 'YYNDD'
         BAL,R11  MVNDD       ****  CONVERT TO EBCDIC
*
*  R6 =  CONVERTED 'NDD'
*
         SLS,R6   -8
         LW,R7    M24
         STS,R6   R9                REPLACE OLD 'NDD'
         STD,R8   DCT16,R1            WITH NEW 'NDD'
         LW,R13   R0                GET DEV.ADDR.(ORIGINAL)
         LB,R8    DCT4,R1           DEV.TYPE INDEX
         LI,R6    1                 DCT ENTRY
         LI,R5    DCTSIZ            # DCT ENTRIES
NEXTENT  EQU      %                 SEARCH FOR EQUIVALENT TYPE  ENTRY
         CB,R8    DCT4,R6
         BE       EQUCHAN     YES-- FIND EQUIVALENT ENTRY, POSSIBLY
2NEXTENT EQU      %           NO---
         AI,R6    1                 TO NEXT ENTRY
         BDR,R5   NEXTENT     NO--- DONE
FE:SPEC  EQU      %           YES--
         PSW,R1   STK               SAVE DCT INDEX
         LI,R2    0                 DEV.AVAIL.FLAG
         BAL,R11  SETPERDN    ****  SET DEV.AVAIL.& RESOURCE COUNTS
         PLW,R6   STK               GET DCT INDEX (WAS IN R1)
         BAL,R11  SETSC1:2    ****  SET SC1/SC2 IN DCT3 FROM DCT9
         B        NXT:TYPE
*----------------
CHK:FE   EQU      %
         LI,R0    DCT26
         BEZ      NOADDEV1    NO--- FECP IN SYSTEM
         B        CHGDCT      YES--
*----------------
CHGPOL   RES                        ADJUST 560 PROCESSOR ADDRESS TABLE
         STB,R12  C%PADDR,R5
         STS,R6   R9                AND LOOK FOR MI AND PI
         STS,R6   R12
         CI,R6    7                 ARE WE DONE (STOP AT 8)
         BAZ      CHGPOL2           YES
         BIR,R6   CHGPOL0           NO
SYSGSNGL EQU      %
         CI,R12   -1
         BE       CONFG:IT    NO--- RECONFIGURED AS DUAL ACCESS, SINGLE
CANTMIX  EQU      %           YES-- CANNOT MIX DUAL/SINGLE ACCESS TYPES
         LI,R12   NOMIX             'DUAL/SINGLE ACCESS MIXTURE'
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         LW,R12   E1,R3             DEV.
         LH,R11   R12                 MOD#
         B        NOADDEV1
*----------------
EQUCHAN  EQU      %
         LH,R10   DCT1P,R6          CURRENT DEV.ADDR.
         LI,R11   MIOPCNTM          MIOP MASK
         CI,R13   MIOPMASK          MASK TO CHK.4 MIOP
         BANZ     %+2         YES-- MIOP TYPE
         LI,R11   SIOPCNTM    NO--- SIOP, SIOP MASK
         CS,R10   R13               CURRENT VS.ORIGINAL DEV.ADDR.
         BNE      2NEXTENT    NO--- SAME CONTROLLER
         LB,R9    DCT24,R6    YES-- SET BOTH
         AND,R9   NPERDWNC            PRIMARY & ALTERNATE
         STB,R9   DCT24,R6            CONTROLLERS TO AVAILABLE
         B        2NEXTENT
*----------------
RTOTSAVE EQU      %
         PSW,R11  STK               SAVE RETURN
         BAL,R11  SETPERDN    ****  SAVE SH:RTOT VALUES
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
SC1:SC2  EQU      %
         CI,R0    SC1+SC2
         BE       CANTMIX     YES-- SYSGENED DUAL, INPUT SINGLE
         B        CONFG:IT    NO--- SYSGENED SINGLE
*----------------
         PAGE
*****************
*D*
*D*      NAME:    SETSC1:2
*D*      DESCRIPTION:
*D*               MOVE SC1/SC2 FROM DCT9 TO DCT3.
*D*
*D*      INPUT:   R6 = DCT INDEX
*D*
*D*      CALL:    R11 = LINK
*D*
*D*      REGISTERS:  R9,R14-R15 USED, R6,R11 SAVED
*D*
*****************
         SPACE    3
SETSC1:2 EQU      %           <---  ENTER
         LI,R14   0
         LW,R15   L((SC1+SC2)**25)
         LS,R14   DCT9,R6           GET SAVED SC1/SC2 STATUS
         LB,R14   R14
         SLS,R14  -1
         LI,R15   SC1+SC2
         LB,R9    DCT3,R6
         STS,R14  R9                SET ORIGINAL SC1/SCW VALUE
         STB,R9   DCT3,R6
         LI,R14   0
         LW,R15   L((SC1+SC2)**25)
         STS,R14  DCT9,R6           SET SAVE SC1/SC2 = 0
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    SETPERDN
*        DESCRIPTION:
*  SETPERDN ROUTINE
*
*    SET DEVICE & CONTROLLER TO NOT AVAILABLE OR AVAILABLE & SET COUNTS
*
*    INPUT:
*        R0 = -1  REMOVE A DEVICE
*        R1 =     DCT INDEX WHEN R3>0
*        R2 = 0   SET AVAILABLE
*           > 0   SET NOT AVAILABLE
*        R3 = 0   SET ALL ENTRIES ACCORDING TO R2
*           > 0   SET ONLY ENTRY R1 ACCORDING TO R2
*        R4 =     # ENTRIES WHEN REMOVE DEVICE
*        R6 =     DCT INDEX WHEN REMOVE DEVICE
*
*    CALL:
*        R11 =    LINK
*
*        REGISTERS:  R0-R1,R4-R6,R12,R14-R15 USED, R3,R11 SAVED
*FIN*
*****************
         SPACE    3
SETPERDN EQU      %           <---  ENTER
         STW,R3   TEMP              SAVE INDEX FLAG
         PSW,R11  STK               SAVE RETURN
         PSW,R3   STK               SAVE CONFIG.TABLE INDEX
         MTW,0    REMVFLG
         BNEZ     SET:IT      YES-- REMOVE ENTRY
*                             NO--- PART
         MTW,0    FND:TYPE
         BEZ      MOVERTOT    NO--- ANY :TYPE REQUESTS
*                             YES--
         CI,R3    0
         BNEZ     SET:ENT     YES-- SET ONLY ONE ENTRY
         LI,R0    -1          NO--- SET ALL ENTRIES & - COUNT
MOVERTOT EQU      %
         LI,R4    SV:RSIZ+1         # ENTRIES IN SH:RTOT
MVRTOT   EQU      %
         LH,R5    SH:RTOT,R4        SAVE RESOURCE
         STH,R5   TSH:RTOT,R4         COUNT TABLE
         BDR,R4   MVRTOT      NO--  DONE MOVE
         MTW,0    FND:TYPE    YES--
         BEZ      ALL:DONE    NO--- ANY :TYPE ENTRIES
         LI,R4    DCTSIZ      YES-- # ENTRIES TO SET
         LI,R6    1                 DCT TABLE ENTRY
SET:IT   EQU      %
         LI,R3    PERDWND+PERDWNC+DONTALLO
*                                   FORM MASK
SET:NXT  EQU      %
         LB,R5    DCT24,R6          SET/RESET
         LW,R15   R5                SAVE FLAGS
         STS,R2   R5                  APPROPRIATE
         STB,R5   DCT24,R6            FLAGS
         MTW,0    REMVFLG
         BEZ      NORMV       NO--- REMOVE REQUEST
         CI,R15   PERDWND     YES--
         BANZ     NOINCDEC    YES-- DEV.DOWN ALREADY
NORMV    EQU      %           NO---
         MTW,0    TEMP
         BNEZ     NOINIT      NO--- 1-ST TIME IN, NO, DONT INITIALIZE
         LI,R15   SC1+SC2     YES--
         LB,R5    DCT3,R6
         LW,R12   R5
         AND,R5   L(SC1+SC2)        SAVE ORIGINAL SC1/SC2
         LI,R14   0
         STS,R14  R12               SET ORIGINAL SC1/SC2 = 0
         STB,R12  DCT3,R6
         STB,R5   R14
         LW,R15   L((SC1+SC2)**24)
         SLD,R14  1
         STS,R14  DCT9,R6           SAVE ORIGINAL SC1/SC2 FLAGS
NOINIT   EQU      %
         CLM,R6   RBLIMS
         BCR,9    REMOTE      YES-- REMOTE BATCH DEVICE
         LB,R5    SNDDX       NO--- SYMBIONT TABLE SIZE
CHKNXT   EQU      %
         CB,R6    SNDDX,R5          CHECK DCT INDEX
         BE       SYMB        YES-- SYMBIONT DEVICE
         BDR,R5   CHKNXT      NO--- DONE SEARCH
SETCOUNT EQU      %           YES--
         LI,R5    SV:RSIZ+1
         LB,R12   DCT4,R6           DEV.TYPE INDEX
2NXRES   EQU      %
         CB,R12   SB:RTY,R5
         BE       INC:DEC     YES-- FIND DEV.RESOURCE
         BDR,R5   2NXRES      NO--- DONE SEARCH
NOINCDEC EQU      %           YES--
         AI,R6    1
         BDR,R4   SET:NXT     NO--- DONE
ALL:DONE EQU      %           YES--
         PLW,R3   STK               RESTORE CONFIG.TABLE INDEX
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
SET:ENT  EQU      %
         LW,R6    R1                DCT ENTRY
         LI,R4    1                 # ENTRIES TO SET
         LI,R0    1                 + COUNT
         B        SET:IT
*----------------
REMOTE   EQU      %
         MTW,0    REMVFLG
         BEZ      SETCOUNT    NO--- MODIFY 'OFFBIT' FLAG IN RB:FLAG
*                             YES-- :REMOVE DEVICE SETS FLAG
         LI,R14   OFFBIT            FLAG SETTING
         CI,R2    0
         BNEZ     %+2         NO--- DEV.FOUND, DEV.NOT AVAIL.
         LI,R14   0           YES-- FLAG SETTING, DEV.AVAIL.
         LI,R15   OFFBIT
         STS,R14  RB:FLAG,R6        SET TO OFF/NOT OFF
         B        SETCOUNT
*----------------
SYMB     EQU      %
         CI,R2    0
         BEZ      SYMBAVAL    YES-- DEV.FOUND, SET SYMB.AVAIL.
         LI,R11   'Q'         NO--- SET SYMB.NOT AVAIL.
         LB,R12   SYMX,R5           INPUT/OUTPUT FLAG
         CI,R12   OUTPUT
         BANZ     %+2         YES-- OUTPUT SYMBIONT
         LI,R11   'L'         NO--- INPUT
         STB,R11  SSIG,R5           SET SYMBIONT SIGNAL
         LI,R11   NOTAVAIL
         STB,R11  SSTAT,R5          SET STATUS = NOT AVAILABLE
         B        NOINCDEC
*----------------
SYMBAVAL EQU      %
         STB,R2   SSTAT,R5          STATUS = NOT ACTIVE
         STB,R2   SSIG,R5           SIGNAL = 0
         B        NOINCDEC
*----------------
INC:DEC  EQU      %                 INCREMENT/DECREMENT RESOURCE COUNT
         MTW,0    REMVFLG
         BNEZ     DEC:REMV    YES-- REMOVE TYPE
*                             NO--- PART
         CI,R0    0
         BLZ      INCDECOK    NO--- INCREMENTING RESOURCE COUNTS
DEC:REMV EQU      %           YES--
         LW,R1    NOCOUNTS          CHECK FOR NO RESOURCE DECREMENT
         BGZ      NOINCDEC          DONT COUNT THIS ONE DOWN
         LW,R1    R6                CHECK 4 PUBLIC PACKS
         AI,R1    -BATAPE
         BLZ      INCDECOK    NO--- TAPE OR PACK TYPE
         CI,R1    AVRTBLSIZ   YES--
         BL       INCDECOK    NO--- PACK TYPE
         CI,R1    AVRTBLNE    YES--
         BGE      INCDECOK    NO--- PACK TYPE
         LD,R14   AVRTBL,R1   YES--
         CI,R15   0
         BLZ      NOINCDEC    YES-- PUBLIC PACK
INCDECOK EQU      %           NO---
         LH,R12   SH:RTOT,R5
         CI,R0    0
         BLZ      DEC         YES-- DECREMENT COUNT
DOINCDEC EQU      %           NO--- INCREMENT
         AW,R12   R0                INCREMENT/DECREMENT
         STH,R12  SH:RTOT,R5          RESOURCE COUNT
         B        NOINCDEC
*----------------
DEC      EQU      %                 DECREMENT RESOURCE COUNT
         CI,R12   0
         BEZ      NOINCDEC    YES-- MINIMUM # ALREADY REACHED
         B        DOINCDEC    NO---
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    ORGANIZ
*        DESCRIPTION:
*  ORGANIZ ROUTINE
*
*    LOOK AT ALL DEVICES WITHIN MUC TYPE CONTROLLERS & MAKE
*    DEVICE ADDRESSES SEQUENTIAL (WITHIN CONFIG.TABLE :TYPE ENTRYS)
*    THIS MEANS, IF TAPE ADDRESS ARE:  A82,A85,A80, & A84
*    THEN THEY WILL BECOME:  A80,A81,A82, & A83
*
*        <<<< ORGANIZATION OF DEVICE ADDRESSES IS BYPASSED >>>>
*        <<<< FOR ALL MUC TYPE DEVICES (I.E., DIALABLE TYPE>>>>
*        <<<< DEVICES), AS THERE ARE TOO MANY NON-DIALABLE>>>>
*        <<<< TYPE DEVICES WHICH CANNOT BE CHANGED TO AN   >>>>
*        <<<< ASCENDING SEQUENCE.                          >>>>
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  FINDENT,MVNDD,MSGLL.
*        REGISTERS:  R1,R3,R8-R10,R12-R15 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
ORGANIZ  EQU      %           <---  ENTER
         MTW,0    FND:TYPE
         BEZ      *R11        --->  RETURN, NO :TYPE ENTRIES
         PSW,R11  STK               SAVE RETURN
         LI,R3    0                 ENTRY INDEX INTO CONFIG.TABLE
INCR:2NX EQU      %
         LI,R8    0                 FLAG FOR :TYPE ENTRY SEARCH
         BAL,R11  FINDENT     ****  FIND AN ENTRY IN CONFIG.TABLE
*
*  R3 =  INDEX INTO CONFIG.TABLE OF :TYPE ENTRY
*  CC1=1 END OF CONFIG.TABLE FOUND
*
         BCR,8    ORG:IT      NO--- END OF TABLE
         PLW,R11  STK         YES-- RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
ORG:IT   EQU      %
         LW,R12   E0,R3             PRIMARY DEV.ADDR.& FLAGS (OLD)
         CI,R12   MUC
         BAZ      INCR:2NX    NO--- THIS ENTRY MULTI-UNIT CONT.
         CW,R12   Y08         YES--
         BANZ     INCR:2NX    YES-- THIS ENTRY ALREADY LOOKED AT
         LI,R13   MIOPCNTM    NO--- MIOP MASK
         LI,R10   0                 RELATIVE DEV.#
         LI,R15   MIOPCNTM          MIOP MASK
         LI,R14   0                 SINGLE ACCESS(NO ALT.DEV.ADDR.)(OLD)
         CW,R12   Y2                OLD ALT.FLAG
         BAZ      %+2         NO--- OLD ALT.EXIST
         LW,R14   E2,R3       YES-- ALTERNATE DEV.ADDR.(OLD)
         PSW,R3   STK               SAVE CURRENT CONFIG.TABLE INDEX
         LI,R3    0
         STW,R3   OUTRLVL           RESET OUTER LEVEL TO CAN BE ADDED
NXTLEVEL EQU      %
         LI,R8    0                 FLAG FOR :TYPE ENTRY SEARCH
*
* ORIGINAL ENTRY INFO
*  R10 = RELATIVE DEVICE #
*  R12 = PRIMARY DEV.ADDR.& FLAGS
*  R13 = MIOP MASK
*  R14 = ALTERNATE DEV.ADDR.FOR DUAL ACCESS
*  R15 = MIOP MASK
*
         BAL,R11  FINDENT     ****  FIND ANOTHER ENTRY IN CONFIG.TABLE
*
*  R3 =  INDEX INTO CONFIG.TABLE OF NEW :TYPE ENTRY
*  CC1=1 END OF CONFIG.TABLE FOUND
*
         BCR,8    CHK4SAME    NO--- END OF TABLE
         PLW,R3   STK         YES-- RESTORE ORIGINAL INDEX
         LW,R8    E0,R3             WORD-1 OF OUTER LEVEL ENTRY
         OR,R8    OUTRLVL           SET TO CANNOT BE ADDED TO SYSTEM
         STW,R8   E0,R3               IF INNER LEVEL CONFLICT FOUND
         B        INCR:2NX
*----------------
CHK4SAME EQU      %                 R12=PRIM., R14=ALT.
         LW,R8    E0,R3             NEW ENTRIES PRIM.DEV.ADDR.& FLAGS
         CS,R12   E0,R3             OLD PRIM.VS.NEW PRIM.
         BNE      NOTPRIM     NO--- PRIM.=PRIM.
         CI,R14   0           YES-- OLD ALT.FLAG
         BEZ      CHK4ALT     NO--- OLD ALT.EXIST
         CW,R8    Y2          YES-- NEW ALT.FLAG
         BAZ      BADMIX      NO--- NEW ALT.EXIST
         CS,R14   E2,R3       YES-- OLD ALT.VS.NEW ALT.
         BNE      BADMIX      NO--- ALT.=ALT.
*                             YES--
DO:ORG   EQU      %
         OR,R8    Y08               SET MUC ORDERED
         LI,R1    1
         LB,R1    R12,R1            GET TYPE MNEMONIC INDEX
         LB,R11   TB:FLGS,R1        GET TYPE FLAGS
         CI,R11   RAD
         BNE      CHNGADDR    NO--- RAD TYPE
         STW,R8   E0,R3       YES-- LEAVE ADDR.AS IS
         B        ORGDONE
*----------------
CHNGADDR EQU      %
********
*  THIS BYPASSES CHANGING DEV.ADDR. TO ASCENDING SEQUENCE
****
         SPACE    2
         B        ORGDONE
****
*  BYPASSED CODE FOLLOWS
*----------------
         SPACE    2
         AND,R8   DEV#MSK           REMOVE OLD DEV.#
         OR,R8    R10               ADD NEW DEV.#
         STW,R8   E0,R3             REPLACE OLD ENTRY WITH NEW
         CW,R8    Y2
         BAZ      ORGDONE     NO--- DUAL ACCESS ENTRY
         LW,R9    E2,R3       YES-- NEW ENTRIES ALT.DEV.ADDR.
         AND,R9   DEV#MSK           REMOVE OLD DEV.#
         OR,R9    R10               ADD NEW DEV.#
         STW,R9   E2,R3             REPLACE OLD ENTRY WITH NEW
ORGDONE  EQU      %
         AI,R10   1                 NEXT DEV.#
         B        NXTLEVEL
*----------------
BADMIX   EQU      %                 R12=PRIM., R14=ALT.
         OR,R8    Y4                SET CANNOT BE ADDED
         STW,R8   E0,R3               TO SYSTEM
         LW,R11   Y4
         STW,R11  OUTRLVL           SET OUTER LEVEL TO CANNOT BE ADDED
         LCI      0
         PSM,R0   STK               SAVE REGISTERS
         PSW,R14  STK               SAVE ALT.ADDR.
         LW,R13   R12               PRIM.ADDR.
         BAL,R11  MVNDD       ****  CONVERT NDD
*
*  R6 =  CONVERTED NDD
*
         AI,R6    -' '+','
         STW,R6   1STNDDS           PUT INTO MESSAGE
         PLW,R13  STK               RESTORE ALT.ADDR.
         LW,R6    BLANK+1
         CI,R13   0
         BEZ      NO:ALT1     NO--- ANY ALT.ADDR.
*                             YES--
         BAL,R11  MVNDD       ****  CONVERT NDD
*
*  R6 =  CONVERTED NDD
*
NO:ALT1  EQU      %
         AI,R6    -' '+')'
         STW,R6   1STNDDS+1         PUT INTO MESSAGE
         LW,R13   E0,R3             PRIM.ADDR.
         BAL,R11  MVNDD       ****  CONVERT NDD
*
*  R6 =  CONVERTED NDD
*
         AI,R6    -' '+'('
         SCS,R6   -8
         STW,R6   2NDNDDS           PUT INTO MESSAGE
         LW,R6    BLANK+1
         LW,R13   E0,R3
         CW,R13   Y2
         BAZ      NO:ALT2     YES-- SINGLE ACCESS
         LW,R13   E2,R3       NO--- DUAL
         BAL,R11  MVNDD       ****  CONVERT NDD
*
*  R6 = CONVERTED NDD
*
NO:ALT2  EQU      %
         AI,R6    -' '+','
         SCS,R6   -8
         STW,R6   2NDNDDS+1         PUT INTO MESSAGE
         LI,R12   DUALMIX           'DUAL ACCESS DEF.CONFLICTS----'
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         LCI      0
         PLM,R0   STK               RESTORE REGISTERS
         B        NXTLEVEL
*----------------
NOTPRIM  EQU      %
         CI,R14   0                 OLD ALT.FLAG
         BEZ      PRIM:ALT    NO--- OLD ALT.EXIST
         CW,R8    Y2          YES-- NEW ALT.FLAG
         BAZ      ALT:PRIM    NO--- NEW ALT.EXIST
         CS,R14   E2,R3       YES-- OLD ALT.= NEW ALT.
         BE       BADMIX      YES-- ALT.DEV.ADDR.SAME CONT.
         CS,R14   E0,R3       NO--- OLD ALT.VS.NEW PRIM.
         BE       BADMIX      YES-- ALT.=PRIM.
         CS,R12   E2,R3       NO--- OLD PRIM.VS.NEW ALT.
         BE       BADMIX      YES-- PRIM.=ALT.
         B        NXTLEVEL    NO---
*----------------
CHK4ALT  EQU      %
         CW,R8    Y2                NEW ALT.FLAG
         BANZ     BADMIX      YES-- NEW ALT.EXIST
         B        DO:ORG      NO---
*----------------
PRIM:ALT EQU      %
         CW,R8    Y2                NEW ALT.FLAG
         BAZ      NXTLEVEL    NO--- NEW ALT.EXIST
         CS,R12   E2,R3       YES-- OLD PRIM.VS.NEW ALT.
         BE       BADMIX      YES-- PRIM.=ALT.
         B        NXTLEVEL    NO---
*----------------
ALT:PRIM EQU      %
         CS,R14   E0,R3             OLD ALT.VS.NEW PRIM.
         BE       BADMIX      YES-- ALT.=PRIM.
         B        NXTLEVEL    NO---
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    HEXEHEX
*        DESCRIPTION:
* HEXEHEX ROUTINE
*
*        CONVERT A 'YYNDD' (SIGMA), 'YYNDD' (TAURUS) OR 'VALUE'(TAURUS)
*        VALUE FROM EBCDIC TO HEX.. IF TAURUS = 0, CONVERT AS SIGMA
*        'YYNDD'. IF TAURUS = 1, CONVERT AS TAURUS 'YYNDD' OR 'VALUE',
*        THAT IS, 'YYNDD' IF R5 = 3, & 'VALUE'   IF R5 = 4.
*
*    INPUT:
*             R5  = # CHAR.TO CONVERT
*             R13 = 3 OR 4 EBCDIC CHAR.(LEFT JUSTIFIED,BLANK FILLED)
*
*    OUTPUT:
*             R14 = CONVERTED VALUE RIGHT JUSTIFIED & ZERO FILLED
*
*    CALL:
*             R10 = LINK
*
*        INTERFACE:  SYNTAX-ERROR-ROUTINES.
*        REGISTERS:  R1,R5,R13-R15 USED, R10 SAVED
*FIN*
*****************
         SPACE    3
HEXEHEX  EQU      %          <---   ENTER
         LI,R14   0
         MTW,0    SPECNVRT
         BNEZ     TAUCNVT     YES-- SPECIAL CONVERSION REQUESTED
         MTW,0    M:TAURUS    NO---
         BNEZ     TAUCNVT     YES-- TAURUS TYPE CONVERSION
         CI,R5    3           NO--- SIGMA
         BNE      NAMERR      EEEE  SIGMA 'NDD' REQUIRES 3 DIGITS
         LB,R14   R13
         AI,R14   -'A'
         BLZ      NAMERR      EEEE  MUST BE CHANNEL LETTER  'A' - 'P'
         CI,R14   X'16'             CHECK FOR >'P' OR '0' - 'F' DIGIT
         BG       NAMERR      EEEE  NOT 'A' - 'P'
         CI,R14   8                 CONVERT
         BLE      %+2                 'A' = 0, 'B' = 1, THRU
         AI,R14   -7                  'P' = F
         AI,R5    -1                # CHAR.LEFT
         SLS,R13  8                 REMOVE EBCDIC 'N' FROM 'NDD'
NXTDGTE  EQU      %
         LB,R15   R13               CONVERT
         AI,R15   -'0'                A
         BGEZ     %+2                 CHAR.
         AI,R15   X'39'               TO HEX.
         CI,R15   X'F'
         BG       NAMERR      EEEE  NOT HEX.NUMBER
         CI,R15   0
         BLZ      NAMERR      EEEE  BAD DIGIT
         SCS,R15  -4
         SLD,R14  4                 FORM RESULT
         SCS,R13  8                 TO NEXT DIGIT
         BDR,R5   NXTDGTE     NO--- DONE CONVERSION
         B        *R10        YES-- RETURN
*----------------
TAUCNVT  EQU      %
         CI,R5    4
         BE       NXTDGTE     YES-- 'VALUE' TYPE
*                             NO--- 'YYNDD' TYPE
         CI,R5    3
         BNE      NAMERR      EEEE  'NDD' REQUIRES 3 DIGITS
         LB,R14   R13               GET 'N'
         LI,R15   #CLUNT            MATRIX SIZE
         LI,R1    0
NXTCLUNT EQU      %
         CB,R14   CLUSUNT,R1        SEARCH FOR 'N'
         BE       FNDCLUNT    YES-- FIND 'N'
         AI,R1    2           NO--- TO NEXT MATRIX ENTRY
         BDR,R15  NXTCLUNT    NO--- DONE SEARCH
*                             YES--
         B        NAMERR      EEEE
*----------------
FNDCLUNT EQU      %
         AI,R1    1                 TO CLUSTER/UNIT CODE
         LB,R14   CLUSUNT,R1        GET CLUSTER/UNIT PER 'N'
         SLS,R13  8                 POSITION TO 'DD'
         AI,R5    -1                # CHAR.TO CONVERT -1
         B        NXTDGTE           FORMS A 'VALUE' TYPE FROM 'NDD'
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    HEXHEXE
*        DESCRIPTION:
*  HEXHEXE ROUTINE
*
*        CONVERT A VALUE IN HEX. TO AN EBCDIC #
*
*    INPUT:
*             R5  = # CHAR.TO CONVERT
*             R13 = CHAR., LEFT JUSTIFIED
*
*    OUTPUT:
*             R14 = CONVERTED VALUE RIGHT JUSTIFIED & ZERO FILLED
*
*    CALL:
*             R10 = LINK
*
*        REGISTERS:  R5,R13-R14 USED, R10,R12 SAVED
*FIN*
*****************
         SPACE    3
HEXHEXE  EQU      %           <---  ENTER
         PSW,R12  STK               SAVE INFO
         LW,R14   L(C'0000')
NXTDGTH  EQU      %
         SLS,R14  8                 MAKE ROOM FOR NEXT EBCDIC CHAR.
         LI,R12   0
         SLD,R12  4                 GET NEXT DIGIT
         AI,R12   '0'               CONVERT
         CI,R12   '9'                 A
         BLE      %+2                 CHAR.
         AI,R12   -X'39'              TO EBCDIC
         OR,R14   R12
         BDR,R5   NXTDGTH     NO--- DONE CONVERSION
         PLW,R12  STK         YES-- RESTORE INFO
         B        *R10        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    MVTOMSG
*        ENTRY:   MVNDD
*        DESCRIPTION:
*  MVTOMSG ROUTINE
*  MVNDD ROUTINE
*
*        MVTOMSG FORMS A MESSAGE BY MOVING ONE TO ANOTHER
*        MVNDD, ADD 'NDD' TO MESSAGE & RETURN RESULTS
*
*    INPUT:
*             R6  = MESSAGE ADDR.OF SOURCE(TEXTC FORM)
*             R13 = DEVICE ADDRESS
*
*    OUTPUT:
*             R6  = EBCDIC NDD LEFT JUSTIFIED BLANK FILLED
*
*    CALL:
*             R11 = LINK
*
*        INTERFACE:  HEXHEXE.
*        REGISTERS:  R3-R6,R9-R10,R13 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
MVTOMSG  EQU      %           <---  ENTER
         LI,R9    CPSZ              DESTINATION LENGTH
         LI,R4    CP1               DESTINATION ADDR.(BYTE)
         LI,R10   ' '               BLANK
BLNK     EQU      %
         STB,R10  0,R4              BLANKS
         AI,R4    1                   TO DESTINATION
         BDR,R9   BLNK                AREA
         LI,R3    1
         LB,R5    *R6               SOURCE LENGTH
         LI,R4    CP1
MVEINFO  EQU      %
         LB,R10   *R6,R3            MOVE SOURCE
         STB,R10  0,R4                INFO
         AI,R3    1                   INTO
         AI,R4    1                   DESTINATION
         BDR,R5   MVEINFO             AREA
********
         SPACE    3
********
*  MVNDD ENTRY (SUB-ENTRY TO MVTOMSG ROUTINE)
********
         SPACE    3
MVNDD    EQU      %           <---  ENTER
         SCS,R13  -8
         MTW,0    M:TAURUS
         BNEZ     TARUSMD     YES-- TAURUS SYSTEM
         STB,R13  R6          NO--- SIGMA SYSTEM, 'N'
         LB,R6    R6                GET 'N' IN R6
         AI,R6    'A'
         CI,R6    'I'
         BLE      %+2               <= 'H'
         AI,R6    7                 > 'H', <= 'P'
         B        GOT:N
*----------------
TARUSMD  EQU      %
         LI,R5    #CLUNT            MATRIX SIZE
         LI,R4    1
NXT:N    EQU      %
         CB,R13   CLUSUNT,R4        SEARCH FOR 'N'
         BE       GET:N       YES-- FIND 'N'
         AI,R4    2           NO--- TO NEXT MATRIX ENTRY
         BDR,R5   NXT:N       NO--- DONE SEARCH
         LI,R6    ' '         YES-- DEFAULT = BLANK
         B        GOT:N
*----------------
GET:N    EQU      %                 FOUND 'N', GET EBCDIC
         AI,R4    -1                TO CLUSTER/UNIT CHAR.
         LB,R6    CLUSUNT,R4        GET CLUSTER/UNIT CHAR. 'N'
GOT:N    EQU      %
         LI,R5    2
         BAL,R10  HEXHEXE     ****  CONVERT 'DD'
*
*  R14 = CONVERTED VALUE
*
         STH,R14  R6
         SCS,R6   16                FORM 'NDD'
         SLS,R6   8                 PUT 'NDD'
         AI,R6    ' '                 INTO
         STW,R6   NDD                 MESSAGE
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    PRIVPACK
*        DESCRIPTION:
*  PRIVPACK ROUTINE
*
*        DETERMINE IF DEVICE REFERENCE IS TO A DISK PACK, & IF SO,
*        DISK PACK MUST BE PRIVATE
*
*    INPUT:
*             R1  = DCT INDEX
*
*    OUTPUT:
*             R4  = AVR TABLE INDEX
*
*    RETURN IF :
*
*        1. DEVICE NOT DISK PACK
*        2. DEVICE IS PRIVATE DISK PACK
*
*    OTHERWISE, NO RETURN
*
*    CALL:
*             R11 = LINK
*
*        INTERFACE:  BILDMSG.
*        REGISTERS:  R4,R6,R8-R9 USED, R11 SAVED
*FIN*
*****************
         SPACE    3
PRIVPACK EQU      %           <---  ENTER
         LW,R4    R1                DETERMINE
         AI,R4    -BATAPE             AVR TABLE INDEX
         BLZ      *R11        --->  RETURN - NOT DISK PACK (IS DEVICE)
         CI,R4    AVRTBLSIZ
         BL       *R11        --->  RETURN - NOT DISK PACK (IS TAPE)
         CI,R4    AVRTBLNE
         BGE      *R11        --->  RETURN - NOT DISK PACK (IS OTHER)
         LD,R8    AVRTBL,R4         DISK PACK,
         CI,R9    0                   DETERMINE IF PUBLIC OR PRIVATE
*                             YES-- PRIVATE PACK
         BGEZ     *R11        --->  RETURN - IS PRIVATE DISK PACK
*                             NO--- PUBLIC
         LI,R6    NOPRVPCK          'ITEM NOT PRIVATE PACK'
         B        BILDMSG     --->  RETURN & GET NEXT COMMAND
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    AUTOCNFG
*        DESCRIPTION: THIS PROCEDURE IS CURRENTLY NOT IMPLEMENTED...
*  AUTOCNFG ROUTINE
*
*    AUTOCNFG IS THE DRIVER FOR THE AUTOMATIC RECONFIGURATOR
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  IOPCNFG,MSGOC.
*        REGISTERS:  ALL SAVED
*FIN*
*****************
         SPACE    3
         DO       AUTO=1
AUTOCNFG EQU      %           <---  ENTER
         LCI      0
         PSM,R0   STK               SAVE ALL
CHKNXTAD EQU      %
         LW,R10   AUTOADD           GET NEXT HARDWARE ADDR.TO CHECK
         CW,R10   MAXADDR
         BG       CHKMODE     YES-- AT END OF HARDWARE ADDRESSES
         LW,R0    B:R11       NO--- SET LOC.0 = 'B *R11' WHEN IOPCNFG=0
         BAL,R11  IOPCNFG     ****  GO TO AUTO.RECNFIG.ANNALYZER
         BCR,8    FNDIT       YES-- FIND THIS ADDRESS
NXTAUTO  EQU      %           NO---
         MTW,1    AUTOADD           TO NEXT DEVICE ADDRESS
         LW,R10   AUTOADD
         CI,R10   MUC
         BAZ      CHKSUC      YES-- SINGLE UNIT CONTROLLER
         MTW,0    MUCFLG      NO--- MULTI-UNIT
         BNEZ     CHKNXTAD    YES-- IN MUC MODE
         LI,R10   MUC         NO--- THEN MUST MAKE
         AWM,R10  AUTOADD             ADDR.A SUC TYPE
         B        CHKNXTAD
*----------------
CHKSUC   EQU      %
         MTW,0    MUCFLG
         BEZ      CHKNXTAD    YES-- IN SUC MODE YET
         LI,R10   MUC         NO--- THEN MUST MAKE
         AWM,R10  AUTOADD             ADDR.AN MUC TYPE
         B        CHKNXTAD
*----------------
CHKMODE  EQU      %
         MTW,0    MUCFLG
         BEZ      CHNGMODE    NO--- DONE WITH AUTO.RECONFIG.
         LCI      0           YES--
         PLM,R0   STK               RESTORE ALL
         B        *R11        --->  RETURN
*----------------
CHNGMODE EQU      %
         MTW,1    MUCFLG            SET MUC MODE
         LI,R10   MUC               INITIALIZE
         STW,R10  AUTOADD             HARDWARE ADDRESS TO MUC TYPE
         LI,R12   DIAL              'DIAL TAPES/PACK-----'
         BAL,R11  MSGOC       ****  OUTPUT TO OC
         LI,R0    DA(CPINOC)
         :SIO,0   *OCNDD      IIOO
WAITOCIN EQU      %
         :TIO,0   *OCNDD      IIOO
         BCS,12   WAITOCIN          WAIT FOR RESPONSE
         B        CHKNXTAD
*----------------
FNDIT    EQU      %
*
*  HARDWARE ADDRESS IS FOUND
*
*    BUILD CONFIGURATION TABLE ENTRY
*
         B        NXTAUTO
*----------------
         FIN
         PAGE
*****************
*D*
*D*      NAME:    SYNTAX-ERROR-ROUTINES
*D*      ENTRY:   BADCMND
*D*      ENTRY:   NAMERR
*D*      ENTRY:   TERMERR
*D*      ENTRY:   DONTMIX
*D*      ENTRY:   CANTADD
*D*      ENTRY:   BADUAL
*D*      ENTRY:   NOAREA
*D*      ENTRY:   CONTINU
*D*  ERROR ROUTINES FOR BADCMND,NAMERR,TERMERR,DONTMIX,CANTADD,
*D*      BADUAL,NOAREA,CONTINU.
*D*
*D*      INTERFACE:  MSG%LL,MSGLL,XIT.
*D*
*****************
BADCMND  EQU      %           <---  ENTER
NAMERR   EQU      %           <---  ENTER
         BAL,R10  MSG%LL      ****  OUTPUT '%' TO LL
         LI,R12   BADINFO           'UNKNOWN INFO-----'
ERRCMN   EQU      %           <---  ENTER
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         B        XIT         --->  EXIT
*----------------
TERMERR  EQU      %           <---  ENTER
         BAL,R10  MSG%LL      ****  OUTPUT '%' TO LL
         LI,R12   BADTERM           'INVALID TERMINATOR'
         B        ERRCMN      --->  EXIT
*----------------
DONTMIX  EQU      %           <---  ENTER
         BAL,R10  MSG%LL      ****  OUTPUT '%' TO LL
         LI,R12   NOMIX             'DUAL/SINGLE ACCESS MIXTURE'
         B        ERRCMN      --->  EXIT
*----------------
CANTADD  EQU      %           <---  ENTER
         LW,R1    RELCHAR           CHAR.POSITION OF TYPE MNEMONIC FIELD
         AI,R1    1                 ALLOW FOR TEXTC FORMAT
         LI,R12   '%'
         STB,R12  %MSG%,R1          PUT '%' INTO BLANK MESSAGE
         STB,R1   %MSG%             MESSAGE SIZE (TEXTC TYPE)
         PSW,R1   STK               SAVE INDEX
         BAL,R10  MSG%LL      ****  OUTPUT '%' TO LL
         PLW,R1   STK               RESTORE INDEX
         LI,R12   ' '
         STB,R12  %MSG%,R1          REPLACE '%' WITH BLANK
         LI,R12   NOADD             '***TTTT---VVVV CANNOT BE ADDED'
         B        ERRCMN      --->  EXIT
*----------------
BADUAL   EQU      %           <---  ENTER
         LI,R12   DUALSAME          'DUAL ACCESS DEFINED BAD----'
         B        ERRCMN      --->  EXIT
*----------------
NOAREA   EQU      %           <---  ENTER
         BAL,R10  MSG%LL      ****  OUTPUT '%' TO LL
         LI,R12   AREAGONE          '***NO SPACE LEFT FOR CONFIG.INFO'
         B        ERRCMN      --->  EXIT
*----------------
CONTINU  EQU      %           <---  ENTER
         LW,R14   R11               SAVE RETURN
         BAL,R10  MSG%LL      ****  OUTPUT '%' TO LL
         LI,R12   NOCONT            'CONTINUATION ILLEGAL'
         BAL,11   ERMSG             OUTPUT ERROR MESSAGE
         B        *R14        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    MSG%LL
*        DESCRIPTION:
*  MSG%LL ROUTINE
*
*    PUT '%' INTO MESSAGE WHICH IDENTIFIES WHERE ERROR WAS FOUND
*
*    CALL:
*        R10 =    LINK
*
*    CHAR.SCAN PLIST CONTAINS LAST RELATIVE CHAR.POSITION LOOKED
*    AT WHEN COMMANDS ERROR WAS FOUND. WORD 'CCP' CONTAINS VALUE.
*
*        INTERFACE:  MSGLL.
*        REGISTERS:  R1-R2,R11-R12 USED, R10 SAVED
*FIN*
*****************
         SPACE    3
MSG%LL   EQU      %           <---  ENTER
         LW,R1    SCNPLST+CCP       GET REL.CHAR.POS.
         AI,R1    1                 ALLOW FOR TEXTC FORMAT
         LI,R2    '%'
         STB,R2   %MSG%,R1          PUT '%' INTO BLANK MESSAGE
         STB,R1   %MSG%             MESSAGE SIZE (TEXTC TYPE)
         PSW,R1   STK               SAVE INDEX
         LI,R12   %MSG%             '   %   '
         PSW,R10  STK               SAVE RETURN
         BAL,R11  MSGLL       ****  OUTPUT TO LL
         PLW,R10  STK               RESTORE RETURN
         PLW,R1   STK               RESTORE INDEX
         LI,R2    ' '
         STB,R2   %MSG%,R1          REPLACE '%' WITH BLANK
         B        *R10        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    MSGOC
*        DESCRIPTION:
*  MSGOC ROUTINE
*
*    OUTPUTS A MESSAGE TO OC DEVICE.
*
*    INPUT:
*        R12 =    MESSAGE ADDRESS (TEXTC TYPE)
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  MSGOUT,RECNFGOC.
*        REGISTERS:  R9 USED, R1-R2,R11 SAVED
*FIN*
*****************
         SPACE    3
MSGOC    EQU      %           <---  ENTER
         DO1      TEST=1            DO ONLY IF IN TEST MODE
         B        MSGUC       --->  EXIT
*----------------
         PSW,R11  STK               SAVE RETURN
         LCI      R2-R1+1
         PSM,R1   STK               SAVE INFO
         LI,R1    CPOUTOC           CHAN.PROG.ADDR.
         LI,R2    RECNFGOC          ROUTINE ADDR.FOR DISPLAY ON OC
         BAL,R9   MSGOUT      ****  DISPLAY MESSAGE
         LCI      R2-R1+1
         PLM,R1   STK               RESTORE INFO
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    MSGLL
*        DESCRIPTION:
*  MSGLL ROUTINE
*
*    OUTPUTS A MESSAGE TO LL DEVICE.
*    ENTERS MESSAGE IN XDELTA PATCH FILE IF CONFIGURATION SUMMARY.
*
*    INPUT:
*        R12 =    MESSAGE ADDRESS (TEXTC TYPE)
*
*    CALL:
*        R11 =    LINK
*
*        INTERFACE:  MSGOUT,XDELTA,RECNFGLL.
*        REGISTERS:  R9-R10,R12-R13 USED, R0-R2,R11 SAVED
*FIN*
*****************
         SPACE    3
ERMSG    RES
         MTW,1    ERCNT
MSGLL    EQU      %           <---  ENTER
         DO       TEST=1            DO ONLY IF IN TEST MODE
MSGUC    EQU      %           <---  ENTER
         LB,R13   *R12              MESSAGE SIZE
*                             ****  OUTPUT TO LL
,DISPUC  M:WRITE  M:LO,(BUF,*R12),(SIZE,*R13),(BTD,1)
         B        *R11        --->  RETURN
*----------------
         FIN                        END OF TEST MODE CODE
         PSW,R11  STK               SAVE RETURN
         LCI      R2-R0+1
         PSM,R0   STK               SAVE INFO
         PSW,R12  STK               SAVE MESSAGE ADDRESS
         LI,R1    CPOUTLL           CHAN.PROG.ADDR
         LI,R2    RECNFGLL          ROUTINE ADDR.FOR DISPLAY ON LL
         BAL,R9   MSGOUT      ****  DISPLAY MESSAGE
         PLW,R12  STK               RESTORE MESSAGE ADDRESS
         MTW,0    MSGFLG
         BEZ      XXIT        NO--- ENTER MESSAGE IN PATCH FILE
         LCI      0           YES--
         PSM,R0   STK               SAVE REGISTERS
         BAL,R10  *XDLTMSG    ****  ENTER XDELTA ROUTINE
         LCI      0
         PLM,R0   STK               RESTORE REGISTERS
XXIT     EQU      %
         LCI      R2-R0+1
         PLM,R0   STK               RESTORE INFO
         PLW,R11  STK               RESTORE RETURN
         B        *R11        --->  RETURN
*----------------
         PAGE
*****************
*DO*
*D*      NAME:    MSGOUT
*        DESCRIPTION:
*  MSGOUT ROUTINE
*
*    DISPLAY MESSAGE ON OC OR LL DEVICE
*
*    INPUT:
*        R1  =    CHANNEL PROGRAM ADDR.
*        R2  =    OUTPUT ROUTINES ADDR.(RECNFGOC/RECNFGLL)
*        R12 =    MESSAGE ADDRSS (TEXTC TYPE)
*
*    CALL:
*        R9  =    LINK
*
*        REGISTERS:  R0,R10,R12-R13 USED, R9 SAVED
*FIN*
*****************
         SPACE    3
MSGOUT   EQU      %           <---  ENTER
         LB,R13   *R12              MESSAGE SIZE
         SLS,R12  2                 MAKE BYTE ADDRESS
         AI,R12   1                 BTD = 1
         STW,R13  1,R1              SET SIZE
         LW,R13   M24
         STS,R12  0,R1              SET ADDRESS
         LW,R0    R1
         SLS,R0   -1                DA(IOCDW)
         BAL,R10  *R2         ****  MESSAGE TO OC OR LL
         B        *R9         --->  RETURN
*----------------
         PAGE
*****************
*  M E S S A G E S
*****************
M:BAD:N  EQU      %
         DATA,1   M:BAD:NS-1,X'15',X'15'
         DATA,10  '** CANNOT '
         DATA,8   'CONVERT '
VALN     EQU      WA(%)
         DATA,3   '''N'''
         DATA,4   ' IN '
VALX     EQU      WA(%)
         DATA,7   '''YYNDD'''
         DATA,1   X'15',X'15'
M:BAD:NS EQU      BA(%)-BA(M:BAD:N)
         BOUND    4
********
BADINFO  EQU      %
         DATA,1   BADSZ-1,' '
         DATA,15  'UNKNOWN COMMAND'
         DATA,12  ', FIELD, OR '
         DATA,5   'VALUE'
BADSZ    EQU      BA(%)-BA(BADINFO)
         BOUND    4
********
BADTERM  EQU      %
         DATA,1   BDTERMSZ-1,' '
         DATA,8   'INVALID '
         DATA,10  'TERMINATOR'
BDTERMSZ EQU      BA(%)-BA(BADTERM)
         BOUND    4
********
NOCONT   EQU      %
         DATA,1   NOCONTSZ-1,' '
         DATA,13  'CONTINUATION '
         DATA,7   'ILLEGAL'
NOCONTSZ EQU      BA(%)-BA(NOCONT)
         BOUND    4
********
         DO       TEST=1
NEWLINE2 EQU      %
         DATA,1   2
         DATA,2   X'1515'           2 NEW LINES
         BOUND    4
********
         FIN                        END OF TEST MODE CODE
NO:TYPE  EQU      %
         DATA,1   NO:TYPSZ-1,' '
         DATA,9   'ALL :TYPE'
         DATA,9   '/:REMOVE '
         DATA,9   'COMMANDS '
         DATA,7   'IGNORED'
NO:TYPSZ EQU      BA(%)-BA(NO:TYPE)
         BOUND    4
********
KEEPDVAD EQU      %
         DATA,1   KEEPSZ-1,' '
         DATA,15  '**KEEP ALL DEV.'
         DATA,11  'ADDR.AS IS '
         DATA,11  'EXCEPT FOR '
         DATA,14  ':TYPE/:REMOVE '
         DATA,7   'CHANGES'
KEEPSZ   EQU      BA(%)-BA(KEEPDVAD)
         BOUND    4
********
NOADD    EQU      %
         DATA,1   NOADDSZ-1,' '
         DATA,2   '**'
DEVTYP   DATA,8   'TTTTTT ,'
DEVADDR  DATA,4   'VVVV'
         DATA,12  '  CANNOT BE '
         DATA,15  'ADDED TO SYSTEM'
NOADDSZ  EQU      BA(%)-BA(NOADD)
         BOUND    4
********
NORCNFG  EQU      %
         DATA,1   NORCNFGS-1,' '
         DATA,3   'NO '
         DATA,16  'RECONFIGURATION '
         DATA,9   'PERFORMED'
NORCNFGS EQU      BA(%)-BA(NORCNFG)
         BOUND    4
********
DUALMIX  EQU      %
         DATA,1   DUALMIXS-1,' '
         DATA,12  'DUAL ACCESS '
         DATA,11  'DEFINITION '
         DATA,9   'CONFLICTS'
         DATA,2   ' ('
1STNDDS  EQU      %
         DATA,4   'NDD,'
         DATA,4   'NDD)'
2NDNDDS  EQU      %
         DATA,4   '(NDD'
         DATA,4   ',NDD'
         DATA,1   ')'
DUALMIXS EQU      BA(%)-BA(DUALMIX)
         BOUND    4
********
DUALSAME EQU      %
         DATA,1   DUALSAMS-1,' '
         DATA,12  'DUAL ACCESS '
         DATA,8   'DEFINED '
         DATA,10  'ILLEGAL   '
BAD:NDDS EQU      %
         DATA,4   'NDD,'
         DATA,4   'NDD '
DUALSAMS EQU      BA(%)-BA(DUALSAME)
         BOUND    4
********
NOMIX    EQU      %
         DATA,1   NOMIXSZ-1,' '
         DATA,12  'DUAL/SINGLE '
         DATA,14  'ACCESS MIXTURE'
NOMIXSZ  EQU      BA(%)-BA(NOMIX)
         BOUND    4
********
AREAGONE EQU      %
         DATA,1   A:GONESZ-1,' '
         DATA,12  '***NO SPACE '
         DATA,9   'LEFT FOR '
         DATA,11  'CONFIG.INFO'
A:GONESZ EQU      BA(%)-BA(AREAGONE)
         BOUND    4
********
         DO       AUTO=1
DIAL     EQU      %
         DATA,1   DIALSZ-1
         DATA,1   X'15'             1 NEW LINE
         DATA,16  'DIAL TAPES/PACKS'
         DATA,15  ' TO UNIQUE #''S '
         DATA,13  'BY CONTROLLER'
         DATA,1   X'15'             1 NEW LINE
         DATA,14  'TYPE NEW LINE '
         DATA,10  'WHEN READY'
DIALSZ   EQU      BA(%)-BA(DIAL)
         BOUND    4
         FIN
********
TOP      EQU      %
         DATA,1   TOPSZ-1
         DATA,1   '1'               TOP OF PAGE
TOPSZ    EQU      BA(%)-BA(TOP)
         BOUND    4
********
ASTER    EQU      %
         DATA,1   ASTERSZ-1,' '
         DO1      20
         DATA,4   '****'
         DATA,2   '**'
ASTERSZ  EQU      BA(%)-BA(ASTER)
         BOUND    4
********
DASH     EQU      %
         DATA,1   ASTERSZ-1,' '
         DO1      20
         DATA,4   '----'
         DATA,2   '--'
         BOUND    4
********
RECNFGM  TEXTC    '                       ',;
                  'F I N A L   ',;
                  'C O N F I G U R A T I O N'
********
SYSGENM  TEXTC    '                    ',;
                  'S Y S G E N E D   ',;
                  'C O N F I G U R A T I O N'
********
TITL1    EQU      %
         DATA,1   TITL1SZ-1,' '
         DATA,12  '            '
         DATA,14  'D E V I C E   '
         DATA,16  'R E S O U R C E '
         DATA,14  '  C O N F I G '
         DATA,13  'U R A T I O N'
TITL1SZ  EQU      BA(%)-BA(TITL1)
         BOUND    4
ERCNTM   TEXTC    '***0000 RECONFIGURATION ERRORS'
********
TITL2    EQU      %
         ORG      ERCNTM+1
ERCNT    DATA     0
         ORG      TITL2
         DATA,1   TITL2SZ-1,' '
         DATA,10  'DEV-TYP : '
         DATA,9   'DEV-ID : '
         DATA,11  'DEV-ADDR :D'
         DATA,8   'CT-CIT: '
         DATA,11  'PUB/PRIV : '
         DATA,7   'TYPE : '
         DATA,7   'RTOT : '
         DATA,8   'GENERAL '
         DATA,11  'INFORMATION'
TITL2SZ  EQU      BA(%)-BA(TITL2)
         BOUND    4
********
BLANK    EQU      %
         DATA,1   BLNKSZ-1,' '
         DATA,2   '  '
BLK      EQU      %
         DATA,4   '    '
BLNKSZ   EQU      BA(%)-BA(BLANK)
         BOUND    4
********
IMG      EQU      %
         DATA,1   IMGSZ-1,' '
         DATA,1   ' '
DVTP     EQU      BA(%)
         DATA,10  'YYMMMM    '
DVID     EQU      BA(%)
         DATA,10  'YYNDD     '
DVAD     EQU      BA(%)
         DATA,9   'AAAA     '
DCTI     EQU      BA(%)
         DATA,2   'II'
         DATA,1   '-'
CITI     EQU      BA(%)
         DATA,2   'II'
         DATA,2   '  '
N:AP:P   EQU      BA(%)
         DATA,3   '   '
PBPRV    EQU      BA(%)
         DATA,10  'XXXX      '
TP       EQU      BA(%)
         DATA,7   'YY     '
TOT      EQU      BA(%)
         DATA,7   'TT     '
GENINFO  EQU      BA(%)
         DATA,10  'XXXXXXXXXX'
         DATA,7   'XXXXXXX'
GENINFSZ EQU      BA(%)-GENINFO
:SYM     EQU      BA(%)
         DATA,1   ' '
IMGSZ    EQU      BA(%)-BA(IMG)
         BOUND    4
********
IMGX     DATA,1   IMGSZ-1,' ',' ',' '
         BOUND    4
********
PERMDWNM EQU      %
         TEXTC    'NOT PRESENT'
********
NOPARTM  EQU      %
         TEXTC    'NON-PARTITIONABLE'
********
ALREDPTM EQU      %
         TEXTC    'ALREADY PARTITIONED'
PATH%MSG TEXTC    '-NO PATH REMAINING'
*
PATHS    EQU      %
         DATA     X'20'             THIS ENTRY FOR FLAG PARTITIONING
         DATA     2                 RESTRICT TO SC2
         DATA     1                 RESTRICT TO SC1
         DATA     0                 UN-USED
********
NOPRVPCK EQU      %
         TEXTC    'NOT PRIVATE PACK'
********
DEVCNST  TEXT     ',DEV.'
CONTCNST TEXT     ',CONT.'
REMVCNST TEXT     '  REMOVE  '
PARTCNST TEXT     ' PARTITION'
NTPRTM   EQU      %
NOPRTDM  TEXT     'NO-PART-DEV      '
NOPRTCM  TEXT     'NO-PART-CONT     '
SYMBM    TEXT     'SYMBIONT         '
********
CANTPART EQU      %
         DATA,1   CANTSZ-1,' '
         DATA,6   'CANNOT'
PRTMV    EQU      HA(%)
         DATA,10  'XXXXXXXXXX'
PRTMVSZ  EQU      BA(%)-BA(PRTMV)
CNT      EQU      HA(%)
         DATA,6   ',XXXXX'
CNTSZ    EQU      BA(%)-BA(CNT)
NDD      EQU      %
         DATA,4   'NDD '
CP1      EQU      BA(CANTPART)+28
         DATA,12  'XXXXXXXXXXXX'
         DATA,8   'XXXXXXXX'
CPSZ     EQU      BA(%)-CP1         # POSITIONS IN 'XXX--XX' PART
CANTSZ   EQU      BA(%)-BA(CANTPART)
         BOUND    4
********
DEVALU   DATA,1   PARTMSZ-1,' '
         DATA,8   '   DEV. '
         BOUND    4
****
CONTVALU DATA,1   PARTMSZ-1,' '
         DATA,8   '  CONT. '
         BOUND    4
********
PARTM    EQU      %
         DATA,1   PARTMSZ-1,' '
         DATA,8   '  XXXXXX'
PRTMSZ   EQU      BA(%)-BA(PARTM)
NDDPARTM EQU      %
         DATA,4   'NDD '
         DATA,11  'PARTITIONED'
PARTMSZ  EQU      BA(%)-BA(PARTM)
         BOUND    4
********
TAPE     TEXT     'TAPE'
PACK     TEXT     'PACK'
********
PKTP:PRT EQU      %
         DATA,1   PKTPSZ-1,' '
         DATA,2   '**'
PKTP1    EQU      %
         DATA,4   'XXXX'
         DATA,2   '  '
PKTP2    EQU      HA(PKTP:PRT)+5
         DATA,2   'YY'
PKTP3    EQU      %
         DATA,4   'XXXX'
         DATA,14  ' PARTITIONED, '
         DATA,6   'DIAL  '
PKTP4    EQU      %
         DATA,4   'XXXX'
         DATA,14  ' NOT AVAILABLE'
PKTPSZ   EQU      BA(%)-BA(PKTP:PRT)
         BOUND    4
********
Q:BAD1   EQU      %
         DATA,1   Q:BAD1SZ-1,' '
         DATA,4   '****'
         DATA,16  'QUEUING CONFLICT'
         DATA,14  ' BETWEEN DCT  '
Q11      EQU      BA(%)
         DATA,2   'I1'
         DATA,10  ' AND DCT  '
Q12      EQU      BA(%)
         DATA,2   'I2'
Q:BAD1SZ EQU      BA(%)-BA(Q:BAD1)
         BOUND    4
********
Q:BAD2   EQU      %
         DATA,1   Q:BAD2SZ-1,' '
         DATA,4   '    '
         DATA,14  'QUEUE FOR DCT '
Q21      EQU      BA(%)
         DATA,2   'I2'
         DATA,12  ' CHANGED TO '
         DATA,12  'THAT OF DCT '
Q22      EQU      BA(%)
         DATA,2   'I1'
Q:BAD2SZ EQU      BA(%)-BA(Q:BAD2)
         BOUND    4
*****************
         PAGE
*****************
*  D A T A
*****************
         BOUND    8
STKSZ    EQU      75
STK      PZE      %+1
         GEN,16,16  STKSZ,0
         RES      STKSZ
********
%MSG%    EQU      %                 BLANK BUFFER FOR '%'
         DO1      21
         TEXT     '    '
********
1ST:FLG  DATA     0                 =0 1-ST ':' CMND., >0 N-TH ':' CMND.
GOFLG    DATA     0                 =0 NO :GO, >0 :GO FOUND
TYPINDX  DATA     0                 CONTAINS DEV.TYPE MNEMONIC INDEX
SUPRPART DATA     0                 =0 PROCESSING :PART COMMAND
*                                   =Y14 PROCESSING :REMOVE COMMAND
REM:PART DATA     0                 =Y1 PROCESSING :PART INFO
*                                   =Y04 PROCESSING :REMOVE INFO
REMVFLG  DATA     0                 =0 :PART, >0 :REMOVE
RELCHAR  DATA     0                 REL.CHAR.POS.FROM SCANNER OF A FIELD
DEV#MSK  DATA,2   -1,MIOPCNTM       DEV.ADDR.& FLAGS MASK
SNGLFLG  DATA     0                 SINGLE ACCESS FLAG >0
DUALFLG  DATA     0                 DUAL ACCESS FLAG >0
M:TAURUS DATA     0                 =0 SIGMA, >0 TAURUS (560)
SPECNVRT DATA     0                 SET =1 WHEN CONVERT AS 'VALUE'
SAVEFLG  DATA     0                 =0 NO :SAVE, >0 :SAVE FOUND
1STIME   DATA     0                 =0 SEARCH ENTIRE M:MODNUM FOR
*                                      DEV.MOD.# MATCH 1ST
*                                   >0 DO SPECIAL SEARCH OF
*                                      M:MODNUM FOR MOD.#'S, I.E.,
*                                      COMPLETE CROSS CHECK
FND:CRD  DATA     0                 =0 NO : CARD, >0 : CARDS FOUND
FND:TYPE DATA     0                 =0 NO :TYPE, >0 :TYPE FOUND
FND:PART DATA     0                 =0 NO :PART, >0 :PART FOUND
FND:REMOVE  DATA  0                 =0 NO :REMOVE, >0 :REMOVE FOUND
MSGFLG   DATA     0                 =0 NO MSG.IN PATCH FILE
*                                   =1 ENTER MSG.IN PATCH FILE
XDLTMSG  DATA     0                 ROUTINE IN XDELTA, ENTRY POINT
         DO       AUTO=1
AUTOADD  DATA     0                 AUTO.RECONFIG.DEV.ADDR.COUNTER
MUCFLG   DATA     0                 =0 SUC MODE, =1 MUC MODE
MAXADDR  DATA     X'3FFF'           MAXIMUM HARDWARE ADDRESS
         FIN
TMPADDR  DATA     0                 TEMP.HOLD OF DEV.ADDR.
OUTRLVL  DATA     0                 =0 CAN BE ADDED, =Y4 CANNOT BE ADDED
CONTRFLG DATA     0                 =0 DEV.PART., >0 CONT.PART.
DCT3FLG  DATA     0                 DCT3 SC1/SC2 FLAG MASK
DCT9FLG  DATA     0                 DCT9 SC1/SC2 FLAG MASK
DCT24FLG DATA     0                 DCT24 PERDWND,CA,CP FLAG MASK
TEMP     DATA     0                 TEMPORARY DATA
SAMFLG   DATA     0                 =0 NO LOOK 4 SAME ADDR,>0 LOOK
SWAPFLG  DATA     0                 SWAPPER ANALYSIS FLAG
CONT     TEXT     'CONT'
PRIV     TEXT     'PRIV'
PUB      TEXT     'PUB '
SYMBMX   TEXT     ':SYM'
         BOUND    8
DUAL     TEXT     ' DUAL   '
N:P:P    TEXT     'NO PRIM.PATH'
N:A:P    TEXT     'NO ALT. PATH'
NOALLOC  DATA     DONTALLO
NPERDWNC DATA     -PERDWNC-1        CONT.PERM.DOWN MASK
Y5       DATA     X'50000000'
Y14      DATA     X'14000000'
         DO1      AUTO=1
B:R11    B        *R11              SET LOC.0 WHEN SREF NOT DEF'D
********
DEVTYPS  EQU      %                 TYPE MNEMONIC TABLE FLAGS
*                                   FOR UN-ACCEPTABLE DEV.TYPES (PART)
         DATA,2   X'FF'          -0-NULL
         DATA,2   X'30'          -1-NO
         DATA,2   X'73'          -2-TY
         DATA,2   X'C0'          -3-DC
         DATA,2   X'3B'          -4-ME
#DEVTYPS EQU      HA(%)-HA(DEVTYPS)
         BOUND    4
*
NOCOUNTS DATA     0                 FLAG TO ALLOW RESOUCE COUNTING
*
********
TSH:RTOT EQU      %                 SAVED ORIGINAL SH:RTOT COUNT TABLE
         DO1      20
         DATA     0
********
         BOUND    8
DEVMOV   EQU      %
         GEN,8,24 0,BA(DEVCNST)     USED BY
         GEN,8,24 CNTSZ,BA(CNT)       MBS INST.
****
         BOUND    8
CONTMOV  EQU      %
         GEN,8,24 0,BA(CONTCNST)    USED BY
         GEN,8,24 CNTSZ,BA(CNT)       MBS INST.
********
         BOUND    8
REMVMOV  EQU      %
         GEN,8,24 0,BA(REMVCNST)     USED BY
         GEN,8,24 PRTMVSZ,BA(PRTMV)    MBS INST.
****
         BOUND    8
PARTMOV  EQU      %
         GEN,8,24 0,BA(PARTCNST)     USED BY
         GEN,8,24 PRTMVSZ,BA(PRTMV)    MBS INST.
********
         BOUND    8
MV:NT:PT EQU      %
         GEN,8,24 0,BA(NTPRTM)       USED BY
         GEN,8,24 GENINFSZ,GENINFO     MBS INST.
****
         BOUND    8
MV:NT:PD EQU      %
         GEN,8,24 0,BA(NOPRTDM)      USED BY
         GEN,8,24 GENINFSZ,GENINFO     MBS INST.
****
         BOUND    8
MV:NT:PC EQU      %
         GEN,8,24 0,BA(NOPRTCM)      USED BY
         GEN,8,24 GENINFSZ,GENINFO     MBS INST.
****
         BOUND    8
MV:IS:SM EQU      %
         GEN,8,24 0,BA(SYMBM)       USED BY
         GEN,8,24 GENINFSZ,GENINFO    MBS INST.
********
         PAGE
*****************
*  C H A N N E L   P R O G R A M S   -   I O C D 'S
*****************
         BOUND    8
CPOUTLL  EQU      %                 PRINT ON LL DEVICE(FORMAT CONTROL)
         GEN,8,24 X'05',0           ADDR.SET
         GEN,8,24 X'00',0           SIZE SET
********
         BOUND    8
CPOUTOC  EQU      %                 TYPE ON OC DEVICE
         GEN,8,24 X'05',0           ADDR.SET
         GEN,8,24 X'00',0           SIZE SET
********
         DO       AUTO=1
         BOUND    8
CPINOC   EQU      %                 INPUT FROM OC DEVICE
         GEN,8,24 X'86',BA(RELCHAR)
         GEN,8,24 X'00',1
         FIN
*****************
         PAGE
*****************
*  CHARACTER SCAN ROUTINE PLISTS
*****************
SCNPLST  EQU      %
         GEN,8,24 #DEL,BA(DEL)   -0-#D,CLD
         GEN,8,24 1,CONTINU      -1-CNTC,CONTR
         PZE      0              -2-OUTR
CCP      EQU      3                 REL.WORD OF CCP IN SCNPLST
         DATA     0              -3-CCP
FLGS     EQU      4                 REL.WORD OF FLAGS IN SCNPLST
         GEN,8,24 0,0            -4-FLAGS,CBUF
CSL      EQU      5                 REL.WORD OF CSL IN SCNPLST
         DATA     0              -5-CSL
         DATA     0              -6-PCCP
CHSTRG   EQU      7                 REL.WORD OF BUFFER IN SCNPLST
         RES      9              -7-36 CHAR.BUFFER
********
DEL      EQU      %                 LEGITIMATE DELIMITERS
         DATA,1   ','               , COMA
         DATA,1   ' '                 BLANK
         DATA,1   ':'               : COLON
         DATA,1   X'15'               NEW LINE
         DATA,1   X'0D'               RETURN
         DATA,1   X'08'               END-OF-MESSAGE
         DATA,1   X'26'               END-OF-BUFFER
         DATA,1   '('               ( OPEN PARENTHESIS
         DATA,1   ')'               ) CLOSING PARENTHESIS
         DATA,1   '.'               . PERIOD
#DEL     EQU      BA(%)-BA(DEL)     # DELIMITORS
         BOUND    4
*****************
         PAGE
*****************
*  TABLES / VECTORS / CONSTANTS
*****************
MIOPMASK EQU      X'80'             MASK TO CHK.4 MIOP VS.SIOP
MIOPCNTM EQU      X'3FF0'           IOP/CONT.PART OF DEV.ADDR.(MIOP)
SIOPCNTM EQU      X'3F80'           IOP/CONT.PART OF DEV.ADDR.(SIOP)
EOB      EQU      X'26'             END-OF-BUFFER
NL       EQU      X'15'             NEW LINE
CR       EQU      X'0D'             CARRIAGE RETURN
PERIOD   EQU      '.'               PERIOD
BADCONT  EQU      X'FF'             CONTINUATION CARD TERMINATOR
FE:OPL   EQU      'FE'+X'F0000'     FECP DEV.TYPE MNEMONIC
FE:NDD   EQU      X'001E'           FECP VALUE FOR DCT1/1P/1A
ENDFLG   EQU      :ENDFND
MUC      EQU      X'80'             MULTIPLE UNIT CONTROLLER FLAG BIT
NOU      EQU      X'10000'          AVRTBL NOU FLAG
DUALACS  EQU      X'08'             QUEUING CHANNEL DUAL ACCESS
SC1      EQU      1                 SUB-CHANNEL 1 FLAG MASK
SC2      EQU      2                 SUB-CHANNEL 2 FLAG MASK
PERDWNCP EQU      X'08'             PRIM.CONT.PERM.DOWN
PERDWNCA EQU      X'10'             ALT.CONT.PERM.DOWN
PERDWNC  EQU      PERDWNCP+PERDWNCA BOTH PRIM./ALT.CONT.PERM.DOWN
PERDWND  EQU      X'02'             DEV.PERM.DOWN
DOWNCP   EQU      X'08'             PRIM.CONT.PATH DOWN
DOWNCA   EQU      X'10'             ALT.CONT.PATH DOWN
DOWND    EQU      X'20'             DEV.DOWN
PART:DV  EQU      Y01               DEV.PART.ALONE, NOT IN CONT.FLAG
DONTALLO EQU      X'80'             DON'T ALLOCATE FLAG FOR PART.
NOPARTC  EQU      X'20'             CONT.NON-PARTITIONABLE
NOPARTD  EQU      X'01'             DEV.NON-PARTITIONABLE
OUTPUT   EQU      2                 SYMBIONT OUTPUT TYPE
NOTAVAIL EQU      3                 SYMBIONT NOT AVAILABLE
RAD      EQU      X'C0'             TB:FLGS VALUE FOR RAD
*****************
         PAGE
*****************
DCT:FLG1 EQU      %
         LB,R6    DCT24,R1       -0-DEV.
         NOP      0              -1-NULL
         LB,R6    DCT24,R1       -2-CONT.(PRIM.)
         LB,R6    DCT24,R1       -3-CONT.(ALT.)
********
DCT:FLG2 EQU      %
         LB,R6    DCT3,R1        -0-DEV.
         NOP      0              -1-NULL
         LW,R6    DCT9,R1        -2-CONT.(PRIM.)
         LW,R6    DCT9,R1        -3-CONT.(ALT.)
********
PRMDWN   EQU      %
         CI,R6    PERDWND        -0-DEV.
         NOP      0              -1-NULL
         CI,R6    PERDWNCP       -2-CONT.(PRIM.)
         CI,R6    PERDWNCA       -3-CONT.(ALT.)
********
NOPARTN  EQU      %
         CI,R6    NOPARTD        -0-DEV.
         NOP      0              -1-NULL
         CI,R6    NOPARTC        -2-CONT.(PRIM.)
         CI,R6    NOPARTC        -3-CONT.(ALT.)
********
ALREDWN  EQU      %
         CI,R6    DOWND          -0-DEV.
         NOP      0              -1-NULL
         CW,R6    L(DOWNCP**24)  -2-CONT.(PRIM.)
         CW,R6    L(DOWNCA**24)  -3-CONT.(ALT.)
********
DVCNTMOV EQU      %
         LI,R8    DEVMOV         -0-DEV.
         LI,R8    CONTMOV        -1-CONT.
*****************
PARTREMV EQU      %
         LI,R8    REMVMOV        -0-REMOVE
         LI,R8    PARTMOV        -1-PART
*****************
GETDEVAD EQU      %
         LH,R8    DCT1P,R5       -0-SINGLE ACCESS, PRIMARY
         NOP      0              -1-NULL
         LH,R8    DCT1P,R5       -2-DUAL ACCESS, PRIMARY PATH
         LH,R8    DCT1A,R5       -3-DUAL ACCESS, ALTERNATE PATH
*******
*
IOALOAD  EQU      %
         LH,R13   DCT1P,R1          0 FLAGS
         LH,R13   DCT1P,R1          1
         LH,R13   DCT1A,R1          2
         LH,R13   DCT1P,R1          3 (FULL DUAL ACCESS)
*
*******
*
MSG1     TEXTC    '**DO YOU WANT TO SEE SYSGENED CONFIG. - YES OR NO %'
********
GETDVAD  EQU      %
         LH,R13   DCT1P,R7       -0-PRIM.
         NOP      0              -1-NULL
         LH,R13   DCT1P,R7       -2-PRIM.
         LH,R13   DCT1A,R7       -3-ALT.
********
ORIGFLG1 EQU      %           DCT3 SC1/SC2 FLAG MASK TABLE
         DATA,1   SC1            -0-PRIM.
         DATA,1   0              -1-NULL
         DATA,1   SC1            -2-PRIM.
         DATA,1   SC2            -3-ALT.
         BOUND    4
********
ORIGFLG2 EQU      %           DCT9 SC1/SC2 FLAG MASK TABLE
         DATA     SC1**25        -0-PRIM.
         DATA     0              -1-NULL
         DATA     SC1**25        -2-PRIM.
         DATA     SC2**25        -3-ALT.
********
MESG     EQU      %
         LM,R11   N:P:P          -0-PRIM.
         LM,R11   N:A:P          -1-ALT.
*****************
         PAGE
*****************
NAMES    EQU      %                 COMMAND NAME TABLE
         TEXT     'GO  '         -0-:GO
         TEXT     'TYPE'         -1-:TYPE
         TEXT     'PART'         -2-:PART
         TEXT     'END '         -3-:END
         TEXT     'SAVE'         -4-:SAVE
         TEXT     'REMO'         -5-:REMOVE
#NAMES   EQU      %-NAMES
********
CMNDVECT EQU      %                 ROUTINE ENTRY VECTOR
         B        :GO            -0-GO
         B        :TYPE          -1-TYPE
         B        :PART          -2-PART
         B        :END           -3-END
         B        :SAVE          -4-SAVE
         B        :REMOVE        -5-REMOVE
*****************
         PAGE
*****************
*
*   CSE BRANCH TABLES FOR THE THREE MACHINES
*
S7BRANCH  EQU  %
         B        CSE%1:7
         B        CSE%2:7
         B        CSE%3:7
         B        CSE%4:7
         B        CSE%5:7
         B        CSE%6:7
         B        CSE%7:7
         B        CSE%8:7
         B        CSE%9:7
         B        CSE%A:7
         B        CSE%B:7
         B        CSE%C:7
         B        CSE%D:7
         B        CSE%E:7
         B        CSE%F:7
CSEBRANCH%SIZE EQU %-S7BRANCH
S9BRANCH  EQU %
         B        CSE%1:9
         B        CSE%2:9
         B        CSE%3:9
         B        CSE%4:9
         B        CSE%5:9
         B        CSE%6:9
         B        CSE%7:9
         B        CSE%8:9
         B        CSE%9:9
         B        CSE%A:9
         B        CSE%B:9
         B        CSE%C:9
         B        CSE%D:9
         B        CSE%E:9
         B        CSE%F:9
X560BRANCH  EQU %
         B        CSE%1:560
         B        CSE%2:560
         B        CSE%3:560
         B        CSE%4:560
         B        CSE%5:560
         B        CSE%6:560
         B        CSE%7:560
         B        CSE%8:560
         B        CSE%9:560
         B        CSE%A:560
         B        CSE%B:560
         B        CSE%C:560
         B        CSE%D:560
         B        CSE%E:560
         B        CSE%F:560
*****************
         PAGE
*****************
*  TAURUS (560) CLUSTER/UNIT CONVERSION TABLE
*****************
CLUSUNT  EQU      %                 TAURUS CLUSTER/UNIT CONVERSION FOR N
*                                     THIS TABLE IS A MATRIX OR VECTOR
*                                     GIVING AN INTERNAL DESIGNATION
*                                     CODE FOR CLUSTER/UNIT WHEN GIVEN
*                                     AN EXTERNAL CHARACTER DESIGNATION
         CLUNT    'A',0,0,0
         CLUNT    'B',0,1,0
         CLUNT    'C',0,1,1
         CLUNT    'D',0,1,2
         CLUNT    'E',0,1,3
         CLUNT    'F',0,1,4
         CLUNT    'G',0,1,5
         CLUNT    'H',0,2,0
         CLUNT    'I',0,2,1
         CLUNT    'J',0,2,2
         CLUNT    'K',0,2,3
         CLUNT    'L',0,2,4
         CLUNT    'M',0,2,5
         CLUNT    'N',0,3,0
         CLUNT    'O',0,3,1
         CLUNT    'P',0,3,2
         CLUNT    'Q',0,3,3
         CLUNT    'R',0,3,4
         CLUNT    'S',0,3,5
         CLUNT    'T',0,4,0
         CLUNT    'U',0,4,1
         CLUNT    'V',0,4,2
         CLUNT    'W',0,4,3
         CLUNT    'X',0,4,4
         CLUNT    'Y',0,4,5
         CLUNT    'Z',0,5,0
         CLUNT    '0',0,5,1
         CLUNT    '1',0,5,2
         CLUNT    '2',0,5,3
         CLUNT    '3',0,5,4
         CLUNT    '4',0,5,5
         CLUNT    '5',0,6,0
         CLUNT    '6',0,6,1
         CLUNT    '7',0,6,2
         CLUNT    '8',0,6,3
         CLUNT    '9',0,6,4
         CLUNT    X'6D',0,6,5
         CLUNT    '%',0,0,1
         CLUNT    '#',0,0,2
         CLUNT    '@',0,0,3
         CLUNT    ':',0,0,4
#CLUNT   EQU      HA(%)-HA(CLUSUNT)
         BOUND    4
*****************
         PAGE
ACCESS%PATH DATA  0                 EQUAL S.C. BEING REMOVED
*****************
INT:BUF  EQU      %                 INTERNAL BUFFER USED TO HOLD
*                                     :TYPE,:REMOVE,& :PART INFO
V1       EQU      0                 REL.LOC.IN INT:BUF OF CONFIG.TABLE
         RES      V1
E0       RES      1                 ENT:WRD 0 DISP
E1       RES      1                 ENT:WRD 1 DISP
E2       RES      1                 ENT:WRD 2 DISP
         ORG      INT:BUF+511       TO END OF PAGE
V2       EQU      %-E0              SIZE OF INFO BUF
         DATA     0                   1 PAGE FOR BUFFER
*****************
         PAGE
*****************
*  P A T C H    AREA
*****************
PCHSZ    EQU      100
PCH      EQU      %
         RES      PCHSZ             PATCH AREA
*****************
         SPACE    3
         END

