         PCC      0
*
*
********************
*  0.    PREAMBLE  *
********************
*
*
*  PROGRAM NAME:  'CONTROL' - CP-V SYSTEM CONTROL MONITOR
*
*
*
*  PURPOSE:       SYSTEM PERFORMANCE IS REGULATED THROUGH THE ADJUST-
*                 MENT OF CRITICAL PARAMETERS GOVERNING THE ALLOCA-
*        TION OF SYSTEM RESOURCES SUCH AS ON-LINE CPU QUANTUM, MAXIMUM
*        NUMBER OF DISK PACK SPINDLES AVAILABLE TO BATCH USERS, MIN-
*        IMUM AMOUNT OF UNINTERRUPTED CPU TIME GUARANTEED TO ANY USER,
*        ETC. THESE PARAMETERS TOGETHER WITH PARTITION ATTRIBUTES MAY
*        BE DISPLAYED OR ALTERED, AND CURRENTLY ALLOCATED RESOURCE
*        VALUES MAY BE DISPLAYED THROUGH THE USE OF 'CONTROL'.
*
*
*             A LIST OF COMMANDS RECOGNIZED BY 'CONTROL' FOLLOWS. THE
*        NUMBER FOLLOWING THE COMMAND NAME IN PARENTHESES IS THE CODE
*        SECTION NUMBER UNDER WHICH A DESCRIPTION OF THE COMMAND
*        BEHAVIOR MAY BE FOUND.
*
*        1.   ADD (21)              7.   PARTITION (SEE 'PART' MODULE)
*        2.   DROP (21)             8.   PROCEED (28)
*        3.   BUILD (23)            9.   QUIT (29)
*        4.   CONTROL &            10.   READ (30)
*             CONTROL'BANG' (24)   11.   SLEEP (31)
*        5.   END (25)             12.   TIME (32)
*        6.   LIST (26)            13.   'SET' (33)
*
         PAGE
*
*             MOST OF THE SUBROUTINES REQUIRED FOR 'CONTROL' USAGE
*        ARE FOUND IN THE MODULE 'CONSUB'. A LIST OF EXTERNAL REFERENCES
*        TO NECESSARY SUBROUTINES APPEARS IN CODE SECTION 4. THE MODULE
*        'PART' CONTAINS ALL THE LOGIC TO REFERENCE AND UPDATE THE
*        MULTI-BATCH PARTITION TABLES. THEREFORE, THESE THREE MODULES
*        NEED TO BE LOADED TOGETHER WITH 'MONSTK' TO OBTAIN AN EXECU-
*        TABLE LOAD MODULE.
*
*             'CONTROL' MAY RUN AS A BATCH PROCESSOR, ON-LINE PROCESSOR,
*        OR GHOST JOB. IF A BATCH OR ON-LINE PROCESSOR, 'CONTROL'
*        INPUT COMMANDS MAY BE STORED IN A FILE WHICH MAY BE ASSIGNED
*        OR SET TO THE M:SI DCB, OR USE OF 'CONTROL' MAY BE INITIATED
*        FROM THE M:SI DEFAULT DEVICE AND TRANSFERRED TO FILE INPUT
*        SUBSEQUENTLY THROUGH ISSUING A 'READ FID' COMMAND.
*        ALSO, DISPLAY INFORMATION MAY BE OUTPUT TO A FILE OR LINE
*        PRINTER BY REASSIGNMENT OF THE M:LO AND M:DO DCB'S.
*        DEFAULT FOR INPUT AND OUTPUT ARE: THE USER'S TERMINAL FOR
*        ON-LINE USERS, THE CARD READER AND LINE PRINTER FOR BATCH USERS
*        AND THE OPERATOR'S CONSOLE FOR GHOST JOBS.
*
*             IF, WHILE READING OR WRITING A FILE, 'CONTROL' ENCOUNTERS
*        AN I/O ERROR WITH A CODE OF LESS THAN X'40', THE M:SI, M:LO,
*        AND M:DO DCB'S WILL BE RE-OPENED TO THEIR DEFAULT DEVICES
*        AND CONTROL WILL PROMPT FOR INPUT COMMANDS. IF THE ERROR IS
*        OF A GREATER SEVERITY, THE MONITOR WILL CLEAN UP THE I/O,
*        AND THE JOB WILL BE ABORTED WITH AN APPROPRIATE ERROR MESSAGE.
*
*             A USER PRIVILEGE OF X'80' IS REQUIRED FOR DISPLAYING
*        INFORMATION. A PRIVILEGE OF X'C0' IS REQUIRED FOR MODIFYING
*        SYSTEM PARAMETER LIMITS OR PARTITION ATTRIBUTES.
*
*             FURTHER DISCUSSION OF 'CONTROL' COMMAND OPERATION AND
*        SUGGESTED IMPLEMENTATION CAN BE FOUND IN THE CP-V SYSTEM
*        MANAGEMENT REFERENCE MANUAL (90 16 74).
         PAGE
*
***************************
*  .1    MODULE FUNCTION  *
***************************
*
*
*  FUNCTION:      THE BULK OF THE WORK IN 'CONTROL' CONSISTS OF
*                 ACCESSING AND ASSOCIATING TABULAR INFORMATION FOR
*        THE DISPLAY AND UPDATE OF SYSTEM PARAMETERS. BASICALLY, THE
*        PROGRAM OPERATES IN A COMMAND LOOP AS FOLLOWS: THE PROGRAM IS
*        INITIALIZED BY CHECKING THE INPUT-OUTPUT DCB'S TO SEE IF THEY
*        HAVE ALREADY BEEN ASSIGNED. IF NOT, THEY ARE OPENED TO DEFAULT
*        DEVICES AND THE COMMAND LOOP IS ENTERED. A PROMPT IS ISSUED
*        TO THE INPUT DEVICE AND A USER COMMAND IS READ BY THE SUB-
*        ROUTINE 'READSI'. IF THE COMMAND IS A 'SET' (SET SYSTEM
*        PARAMETER TO A VALUE), IT IS DETECTED BY THE PRESENCE OF AN
*        '=' AND CONTROL IS TRANSFERRED TO THE APPROPRIATE MODULE.
*        OTHERWISE, THE FIRST LETTER(S) OF THE INPUT COMMAND ARE COM-
*        PARED TO A SERIES OF POSSIBLE COMMAND KEY-WORDS
*        FOR A MATCH AND EXECUTION IS PASSED TO THE CORRESPONDING
*        MODULE. WHENEVER A SYSTEM PARAMETER IS TO BE CHANGED, DISPLAYED,
*        OR ADDED OR DROPPED FROM A DISPLAY LIST, A SEARCH FOR ITS
*        'CONTROL' NAME (E.G. B7TM, OSP, QUAN) IS MADE IN TABLE
*        'ATERM1'. THE INDEX OR OFFSET OF THE NAME IN 'ATERM1' BECOMES
*        THE INDEX TO THE PARAMETER'S HIGH AND LOW LIMITS, PRINT FLAG.
*        SCALING FACTOR FOR DISPLAY, AND SIDING FOR DISPLAY IN TABLES
*        'AHIGH1', 'ALOW1', 'APRIN1', 'ASCAL1', AND 'ATEXT1'. AFTER
*        EACH COMMAND IS APPROPRITELY IMPLEMENTED, CONTROL IS PASSED TO
*        THE COMMAND LOOP.
*
*             IF AT ANY TIME A BREAK IS ISSUED FROM THE USER INPUT
*        DEVICE, 'CONTROL' REMEMBERS THE INTERRUPTED ENVIRONMENT
*        AND EXECUTION MAY BE RESUMED AT THAT POINT BY INPUTTING A
*        'PROCEED' COMMAND.
*
         PAGE
*
*             THIS VERSION OF 'CONTROL' PROVIDES THE SYSTEM MANAGEMENT
*        A POWERFUL CAPABILITY IN THAT INPUT AND OUTPUT MAY BE ASSIGNED
*        TO FILES. THIS ALLOWS DYNAMIC CONTROL OF THE SYSTEM'S PERFOR-
*        MANCE UNDER PROGRAM CONTROL. A PERFORMANCE CONTROL PROGRAM
*        MAY BE WRITTEN TO QUERY THE CP-V PERFORMANCE MONITOR FOR
*        CURRENT DATA AS WELL AS 'CONTROL'. DEPENDING UPON THE OUT-
*        COME, A SERIES OF 'CONTROL' COMMANDS COULD BE STORED IN A
*        FILE AND INPUT TO 'CONTROL' FOR PROCESSING. OR A STANDARD
*        SET OF COMMANDS COULD BE ASSEMBLED IN A SERIES OF FILES, EACH
*        REFERENCING A SUBSEQUENT FILE, FOR EXECUTION AT PREDETERMINED
*        TIMES DURING THE DAY. EACH FILE WOULD SET THE SYSTEM UP TO
*        HANDLE THE USER LOAD PECULIAR TO THE OPERATING ENVIRONMENT
*        AT THAT TIME OF DAY.
*
         PAGE
*
*********************************
*  .2    MODULE IN-CORE HEADER  *
*********************************
*
*
*  IN-CORE HEADER:        THE IN-CORE HEADER CREATED FOR THIS MODULE
*                 IS FOUND IN CODE SECTION 1 (ASSEMBLY ENVIRONMENT)
*                 AND HAS THE FOLLOWING FORMAT:
*
*        TEXT     '########'
*        TEXT     'CP-V CONTROL D00'
*        TEXT     '################'
*        TEXT     '06-26-75'
*ICTRACE TEXT     ' 0:TRACE'
*        TEXT     '########'
*
*                       WHEN INITIALIZATION BEGINS A TRACE CODE OF
*                 X' D' IS LOADED INTO THE LOW ORDER 16 BITS OF THE
*                 HEADER AT 'ICTRACE'. EACH SUCCESSIVE PROGRAM SECTION
*                 LOADS A UNIQUE TWO-DIGIT CODE INTO THE HEADER TO
*                 PROVIDE A CURRENT EXECUTION TRACE IN CASE OF A SYSTEM
*                 FAILURE (HEAVEN FORBID). TRACE CODES AND THEIR
*                 CORRESPONDING MODULES APPEAR BELOW:
*
         PAGE
*
*                 TRACE CODE        CODE SECTION
*                 ----------        ------------
*                      0            PROGRAM NOT ACTIVE
*                      1            'ADD'
*                      2            'DROP'
*                      3            'BUILD'
*                      4            'CONTROL'/'CONTROL-BANG'
*                      5            'END'
*                      6            'LIST'
*                      7            'PARTITION'
*                      8            'PROCEED'
*                      9            'QUIT'
*                      A            'READ'
*                      B            'SLEEP'
*                      C            'TIME'
*                      D            INITIALIZATION
*                      E            COMMAND LOOP
*                      F            BREAK CONTROL
*
*
*                       SUB-CODES ARE USED TO INDICATE SUBROUTINE EXECU-
*                 TION AND ARE STORED IN BYTE 0 OF ICTRACE OVERLAYING A
*                 BLANK IF NO SUBROUTINE HAD PREVIOUSLY BEEN EXECUTED
*                 BY THAT MODULE OR ANOTHER SUB-CODE. ALL SUB-CODES
*                 ARE GENERATED ONLY FOR THE INITIAL TESTING LEVELS
*                 2 AND 1 EXCEPT THOSE NOTED BY AN ASTERISK (*) WHICH
*                 WILL CONTINUE TO FUNCTION IN THE PRODUCTION ENVIRON-
*                 MENT. ALL CURRENT SUB-CODES ARE SHOWN BELOW:
*
         PAGE
*
*                 TRACE SUB-CODE    SUBROUTINE     MODULE
*                 --------------    ----------     ------
*                     BLANK         NO SUBROUTINE ENTERED
*                       0                -            -
*                       1           MAP (34) *     CONTROL
*                       2           READSI (14) *  CONSUB
*                       3           ABNXX (20) *   CONSUB
*                       4           APEND (10)     CONSUB
*                                   BOUT (10)      CONSUB
*                                   BOUTX (10)     CONSUB
*                       5           DECTOBIN (12)  CONSUB
*                       6           OUTITEM (15)   CONSUB
*                       7           ITEMFIND (16)  CONSUB
*                       8           SEND (23) *    CONSUB
*                       9           BINOUT (24)    CONSUB
*                       A           MAIN (11) *    PART
*                       B           GETDATA (13)   PART
*                       C           ADD (11)       PART
*                       D           ATRA (11)      PART
*                       E           BUILD (11)     PART
*                       F           CLEAR (11)     PART
*                       G           DISPLAY (11)   PART
*                       H           DROP (11)      PART
*                       I           ATRN (11)      PART
*                       J           SET (11)       PART
*                       K           STORE (11)     PART
*                       L           DISPA (14)     PART
*                       M           DISPX (14)     PART
*
         PAGE
*
***********************************
*  .3    INDEX TO CODED SECTIONS  *
***********************************
*
*        0.       PREAMBLE
*        1.       ASSEBMLY ENVIRONMENT
*        2.       PROCEDURES
*        3.       CONDITIONAL ASSEBMLY PARAMETERS
*        4.       EXTERNAL REFERENCES AND DEFINITIONS
*        5.       STATIC ASSEBMLY PARAMETERS
*        6.       DATA CONSTANTS
*        7.       STATIC DATA POINTERS
*        8.       STATIC DATA TABLES
*        9.       MESSAGES AND OTHER TEXT
*       10.       INITIALIZATION
*       11.       BREAK CONTROL
*       12.       COMMAND LOOP
*       13.       SWITCH
*       20.       COMMAND HANDLERS PREAMBLE
*       21.       'ADD'
*       22.       'DROP'
*       23.       'BUILD'
*       24.       'DCON'
*       25.       'END'
*       26.       'LIST'
*       28.       'PROCEED'
*       29.       'QUIT'
*       30.       'READ'
*       31.       'SLEEP'
*       32.       'TIME'
*       33.       SET COMMAND
*       34.       SUBROUTINES (MAP,TYPEDO)
*       40.       DYNAMICALLY MODIFIED DATA
*       41.       DYNAMICALLY MODIFIED DATA BUFFERS
*
         PAGE
*
********************************
*  1.    ASSEMBLY ENVIRONMENT  *
********************************
*
         SYSTEM   SIG7P
         SYSTEM   BPM
ATERM1   CSECT    1
         DATA     0,0
AVAL1    CSECT    0                 MAY BE STORED INTO AT INITIALIZATION
         DATA     0
ASCAL1   CSECT    1
         DATA     0
ATEXT1   CSECT    1
         DATA     0
ALOW1    CSECT    1
         DATA     0
AHIGH1   CSECT    1
         DATA     0
ALOX     CSECT    1
         DATA,1   0
AHIX     CSECT    1
         DATA,1   0
STSMSK   CSECT    1
         DATA     0
33SET14  CSECT    1
         B        33SET6
33SET17  CSECT    1
         B        33SET7
CBDSTK   CSECT    1
CDSTK    CSECT    0
         DATA,1   0
CS:CONTROL:PROCEDURE CSECT 1        PROCEDURE CONTROL SECTION
CS:CONTROL:TEXT CSECT 1             STATIC DATA CONTROL SECTION
CS:CONTROL:DATA CSECT 0             DATA CONTROL SECTION
*
*  1.1   IN-CORE HEADER GENERATION
*
         TEXT     '########'        2 WORDS
         TEXT     'CP-V CONTROL D00' 4 WORDS
         TEXT     '################' 4 WORDS
         TEXT     '06-26-75'        2 WORDS
ICTRACE  TEXT     ' 0:TRACE'        XX=TRACE NUMBER;0==>NOT ACTIVE
         TEXT     '########'        2 WORDS
*
         TITLE    '''CONTROL'' - CP-V SYSTEM CONTROL MONITOR'
*
**********************
*  2.    PROCEDURES  *
**********************
*
*
*********PROC NAMES:    CONDITIONAL TEXT (%TEXT)
*                       CONDITIONAL TEXT WITH COUNT (%TEXTC)
*                       CONDITIONAL DATA (%DATA)
*
*        TYPE:          COMMAND
*
*        CALL FORMAT:   %TEXT,FLG  ARG
*                       %TEXTC,FLG ARG
*                       %DATA,FLG  ARG
*
*
*                       WHERE 'FLG' IS A CONDITIONAL ASSEMBLY FLAG:
*                            FLG>0 ===> ASSEMBLE PROTOTYPE INSTRUCTION
*                            FLG<=0 ===> NO ASSEMBLY
*                       'ARG' IS A VALID ARGUMENT FOR THE PROTOTYPE
*                       DIRECTIVE/COMMAND. LABEL FIELDS, IF PRESENT,
*                       ARE HONORED.
*
*        DATE:          AUGUST 25, 1971
*
*        PURPOSE:       TO PROVIDE A CONDITIONAL ASSEMBLY OF SPECIFIED
*                       METASYMBOL DIRECTIVES OR COMMANDS BASED ON THE
*                       SETTING OF A CONDITIONAL ASSEMBLY FLAG.
*
         PAGE
*
%TEXT    CNAME    1
%TEXTC   CNAME    2
%DATA    CNAME    3
         PROC
         LOCAL    C@FLG,C@TEXT,C@TEXTC,C@DATA,C@END
C@FLG    SET      CF(2)             IS ASSEMBLY FLAG ON?
         DO       C@FLG>0           YES ===> ASSEMBLE INSTRUCTION
           GOTO,NAME C@TEXT,C@TEXTC,C@DATA  WHICH ONE WAS IT?
C@TEXT     EQU      %
LF         TEXT     AF              GENERATE TEXT WITH LABEL, IF ANY
           GOTO,1   C@END
C@TEXTC    EQU      %               GENERATE TEXTC WITH LABEL
LF         TEXTC    AF
           GOTO,1   C@END
C@DATA     EQU      %               GENERATE DATA STATEMENT
LF         DATA     AF
           GOTO,1   C@END
           FIN
C@END      PEND
*
         PAGE
*
*
*********PROC NAME:     TYPE
*
*        TYPE:          COMMAND
*
*        CALL FORMAT:   TYPE  'CHARACTER STRING'
*
*        PURPOSE:       TO PROVIDE A PROCEDURE FOR TYPING MESSAGES
*                       ON THE 'DO' DEVICE.
*
*        REGISTER USE:  R1, R2
*
TYPE     CNAME
         PROC
         LOCAL    TY@TA
         DISP     %
         USECT    CS:CONTROL:TEXT
         DO       TCOR(AF(1),S:C)=1  DO ONLY IF CHAR STRING
TY@TA      SET      %               SET SYMBOL TO 1ST BYTE OF STRING
LF(2)      TEXTC    AF(1)           SET LABEL TO TEXTC STRING, IF ANY
         ELSE                       IF SYMBOL, SET LOCAL TO 1ST BYTE
TY@TA      SET      AF(1)           OF PREVIOUSLY CREATED STRING
           FIN
CSEND:CONTROL:TEXT SET %            BUMP END OF TEXT POINTER FOR DUMP
         USECT    CS:CONTROL:PROCEDURE ANALYSIS.
LF(1)    EQU      %                 SET LABEL FIELD, IF ANY
*********CK%CODE  SAVE REGISTERS
         DO       CK%CODE>=1        FOR LEVELS 1 & 2 ONLY
           LCI      2               LOAD CONDITION CODES FOR PSM
           PSM,R1   *SPDADR         SAVE REGS R1,R2
         FIN
*********CK%CODE  END
         LI,R2    TY@TA
         BAL,R1   TYPEDO          >>M:WRITE THROUGH M:DO DCB
*********CK%CODE  RESTORE REGISTERS R1,R2 AFTER 'TYPE' EXECUTION
         DO       CK%CODE>=1
           LCI      2               PREPARE FOR PLM
           PLM,R1   *SPDADR         RESTORE R1,R2
         FIN
*********CK%CODE  END
         PEND
         PAGE
*
*
*********PROC NAMES:    GENERATE TRACE CODE (TRACE%, CK%TRACE)
*
*        TYPE:          COMMAND
*
*        CALL FORMAT:   TRACE%   'STRING'
*
*                       WHERE STRING=1 CHARACTER (SUB-CODE) OR 2 CHAR-
*                       ACTERS (MAIN CODE IN EBCDIC FORMAT WHICH IDEN-
*                       TIFY THE CALLING ROUTINE.
*
*        DATE:          NOVEMBER 18, 1971
*
*        PURPOSE:       TO PROVIDE A SIMPLE MEANS TO GENERATE A TRACE-
*                       CODE OR SUB-CODE AT THE START OF A ROUTINE.
*                       THE SPECIFIED TRACE-CODE IS STORED IN THE
*                       IN-CORE HEADER AT THE BEGINNING OF THE LOAD
*                       MODULE DATA SECTION.
*
*
TRACE%   CNAME    0                 UNCONDITIONAL ASS'Y OF TRACE-CODE
CK%TRACE CNAME    1                 CONDITIONAL ASS'Y OF TRACE-CODE
         PROC
         LOCAL    TR@NC,TR@AF,TR@OP
TR@AF    SET      AF                GET AF LIST; NOT JUST LIST NAME
TR@NC    SET      S:NUMC(TR@AF)     GET # CHARS IN TRACE-CODE
         ERROR,X'2',(TR@NC>2)|(TR@NC=0)|(TCOR(AF,S:C))=0 ;
         'PROC.TRACE%.# TRACE BYTES>2 OR =0, OR NOT CHAR STRING'
TR@OP    SET      X'75',X'55'       SET UP OP-CODE TBL WITH STB & STH
         DO       (NAME=0)|(CK%CODE>=1) UNCOND OR CK%CODE=1,2
           LI,R0    TR@AF           GET CHECK-CODE
           GEN,8,7,17  TR@OP(TR@NC),0,ICTRACE  STB OR STH
         FIN
         PEND
*
         PAGE
*
*
*********PROC NAMES:    LOAD STD REGS AND BAL TO SUBR (LBAL%)
*                       LOAD STD REGS AND BRANCH TO ROUTINE (LBR%)
*
*        TYPE:          COMMAND PROCEDURES
*
*        CALL FORMAT:   LBAL%,R  SUBR,AF1,AF2,AF3,AF4
*                       LBR%     SUBR,AF1,AF2,AF3,AF4
*
*                       WHERE: LBAL%,LBR%=PROC NAMES
*                              R=BAL REGISTER (FOR LBAL%)
*                              AF1=DATA TO BE LOADED INTO REG SR1
*                              AF2=DATA TO BE LOADED INTO REG SR2
*                              AF3=DATA TO BE LOADED INTO REG SR3
*                              AF4=DATA TO BE LOADED INTO REG SR4
*                              SUBR=TARGET SUBROUTINE OR ROUTINE
*
*                       AND, ANY AF(N) MAY HAVE THE FOLLOWING SYNTAX:
*                              ADR
*                              (W,<*>ADR <,REG>)
*                              (H,<*>ADR <,REG>)
*                              (B,<*>ADR <,REG>)
*                              (WAM,<*>ADR <,REG>)
*                              (HAM,<*>ADR <,REG>)
*                              (BAM,<*>ADR <,REG>)
*
*                       WHERE: ADR=SYMBOLIC OR ABSOLUTE ADDRESS (IF
*                                  IT IS THE ONLY SPECIFICATION IN AF,
*                                  A LOAD IMMEDIATE IS GENERATED).
*                              <*>=OPTIONAL INDIRECT ADDRESS
*                              <REG>=OPTIONAL INDEX REGISTER
*                              W=WORD LOCATION (LOAD WORD GENERATED)
*                              H=HALFWORD LOCATION (LOAD HALFWORD
*                                GENERATED).
*                              B=BYTE LOCATION (LOAD BYTE GENERATED)
*                              WAM=LOAD WORD AND MASK WA
*                              HAM=LOAD WORD AND MASK HA
*                              BAM=LOAD WORD AND MASK BA
*
*
*  DESCRIPTION:   THE PURPOSE OF BOTH PROCS IS TO SET UP STANDARD
*                 REGISTERS SR1-SR4 FOR A CALL TO THE SPECIFIED SUB-
*        ROUTINE. LBAL% PRODUCES A BRANCH AND LINK INSTRUCTION ON
*        THE REGISTER SPECIFIED IN COMMAND FIELD 2 AND LBR% PRODUCES
*        A DIRECT BRANCH TO THE ROUTINE SPECIFIED. ANY OF THE REG-
*        ISTER SPECIFICATIONS MAY BE LEFT BLANK IF A COMMA IS PLACED
*        TO INDICATE PRESENCE OF THE PARAMETER. (THIS IS NECESSARY ONLY
*        IF ANOTHER REGISTER SPECIFICATION FOLLOWS).
*
*                 DATA TO BE LOADED INTO THE REGISTERS MAY BE A SINGLE
*        SYMBOL (INWHICH CASE A LOAD IMMEDIATE INSTRUCTION WILL BE
*        GENERATED) OR A KEYWORD (W,H, OR B) AND A SYMBOL (IN WHICH
*        CASE A LOAD WORD, HALFWORD, OR BYTE INSTRUCTION WILL BE GEN-
*        ERATED). AN INDIRECT ADDRESS MAY BE SPECIFIED BY PLACING AN
*        ASTERISK IN FRONT OF THE ADDRESS SYMBOL IN ALL CASES EXCEPT
*        FOR THE IMMEDIATE ADDRESS FORMAT. AN INDEX REGISTER MAY BE
*        SPECIFIED FOLLOWING THE SYMBOLIC ADDRESS IN ALL CASES EXCEPT
*        FOR THE IMMEDIATE ADDRESS FORMAT. IF THE DATA WHICH IS LOADED
*        IS TO BE MASKED TO PRODUCE A WORD, HALFWORD OR BYTE ADDRESS,
*        'WAM', 'HAM', OR 'BAM' MAY BE USED AS KEYWORDS IN WHICH CASE
*        A 'LW' INSTRUCTION WILL BE GENERATED FOLLOWED BY AN 'AND' WITH
*        A 17-BIT, 18-BIT, OR 19-BIT MASK.
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY             INTERNAL            EXIT
*        -----             --------            ----
*        'R'=USER SUPPLIED SR1-SR4=LOAD REGS   ALL REGS PRESERVED
*        BAL REGISTER      'R'=BAL REG
*
*
LBR%     CNAME    0             <<  LOAD STD REG & BRANCH TO SUBR
LBAL%    CNAME    1             <<  LOAD STD REG & BAL TO SUBR
         PROC
         LOCAL    I,LB@BR,LB@SR,LB@E1,LB@E2,LB@3,LB@F,LB@OP,;
                  LB@M
*
LB@E1    SET      (NAME=1)&(NUM(CF(2))=0) SET ERR FLG IF LBAL% & NO REG
LB@E2    SET      NUM(AF(1))=0            SET ERR FLG IF NO SUBR ADR
         GOTO,LB@E1|LB@E2  LB@3     SKIP CODE GEN IF ERROR CONDITION
*
LB@BR    SET      CF(2)             GET SYMBOLIC REGISTER SPECIFICATION
LB@SR    SET      ,SR1,SR2,SR3,SR4  CREATE STD REG LIST // TO AF
LB@OP    SET      X'32',X'52',X'72' CREATE LW,LH,LB OP-CODE LIST
LB@M     SET      ,,,X'1FFFF',X'3FFFF',X'7FFFF'  CREATE WA,HA,BA MSK LST
*
LF       SET      %                 SET LABEL FIELD  %, IF ANY
I        SET      1                 INITIALIZE AF INDEX
*
         DO       NUM(AF)-1         DO FOR ALL STD REGS SPECIFIED
I         SET      I+1              INCREMENT AF INDEX TO NEXT REG
LB@F      SET      SCOR(AF(I,1),W,H,B,WAM,HAM,BAM)   GET KEYWORD INDEX
          DO       LB@F=0         ->IS SPEC AN IMMEDTE VAL/NULL?
           DO1      NUM(AF(I))>0      YES-IS IT IMMEDIATE VAL?
             LI,LB@SR(I) AF(I)        YES-LOAD IMMEDIATE ADDRESS
          ELSE                    ->GO TO 'DO' END;TRY NXT FIELD
*
*                                   E.P. TO GEN LW,LH, OR LB
           DO       LB@F<4      <-  DO ONLY IF NO MASK DESIRED
             GEN,1,7,4,3,17 AFA(I,2),LB@OP(LB@F),; GEN INDRCT BIT,OP,
                      LB@SR(I),AF(I,3),AF(I,2)    REG,INDEX REG,ADR
           ELSE                     DO IF MASK DESIRED
             GEN,1,7,4,3,17 AFA(I,2),X'32',LB@SR(I),; GEN INDIRECT
                      AF(I,3),AF(I,2)     BIT,OP-CODE,REG,
*                                   INDEX REG, REF ADDRESS
             AND,LB@SR(I) L(LB@M(LB@F)) MASK WA,HA, OR BA
           FIN
          FIN                   <-
         FIN
*
*
         DO       NAME=0            DO IF DIRECT BRANCH DESIRED
           B        AF(1)         >>BRANCH TO ROUTINE
         ELSE                       DO IF BAL DESIRED
           BAL,LB@BR AF(1)        >>BAL TO SUBROUTINE
         FIN
*
LB@3     ERROR,X'5',LB@E1  'PROC.LBAL%.NO BAL REG SPECIFIED'
         ERROR,X'5',LB@E2  'PROC.LBR%/LBAL%.NO BRANCH TARGET SPECIFIED'
*
         PEND
*
****** TABLE PROC DESCRIPTION ******
*        AF(1)  -  PARAMETER NAME
*        AF(2)  -  REF
*        AF(3)  -  MULTIPLIER USED FOR SCALING.
*                  EXCEPTION:  0 MEANS 0.5
*        AF(4)  -  MIN VALUE
*        AF(5)  -  MAX VALUE
*        AF(6)  -  LISTING ORDER CODE
*        AF(7)  -  MASK FOR STORE SELECT.  USED ONLY FOR
*                  PARAMETERS WHICH OCCUPY PARTIAL WORD.
*
TABLE    CNAME
         PROC
UUU      SET      %
         USECT    ATERM1
         TEXT     AF(1)
         DO       S:NUMC(AF(1))<5
         DATA     '    '
         FIN
ATERMEND SET      %-2
         USECT    AVAL1
         DO       AF(2)=BLANK
         DATA     AF(2)
         ELSE
         DATA     AF(2)+F
         FIN
         USECT    ATEXT1
         DATA     UUU
         USECT    ASCAL1
         DATA     AF(3)
         USECT    ALOW1
         DO       NUM(AF(4))=1
         DATA     AF(4)
         USECT    ALOX
         DATA,1   0
         ELSE
         GEN,1,7,24 1,AF(3)&X'7F',AF(4,1)+F
         USECT    33SET17
I        SET      %-33SET17
         B        AF(4,2)
         USECT    ALOX
         DATA,1   I
         FIN
         USECT    AHIGH1
         DO       NUM(AF(5))=1
         DATA     AF(5)
         USECT    AHIX
         DATA,1   0
         ELSE
         DO       TCOR(AF(5,1),S:INT)
         DATA     AF(5,1)
         ELSE
         GEN,1,7,24 1,AF(3)&X'7F',AF(5,1)+F
         FIN
         USECT    33SET14
I        SET      %-33SET14
         B        AF(5,2)
         USECT    AHIX
         DATA,1   I
         FIN
         USECT    CBDSTK
         ORG      CBDSTK
         RES,1    AF(6)
         DATA,1   #ATERM1
CBD%ERR  SET      CBD%ERR||1**(AF(6)&31)
         USECT    CDSTK
         DATA,1   0
         USECT    STSMSK
         DO       NUM(AF)=7
         DATA     AF(7)
         ELSE
         DATA     -1
         FIN
         USECT    UUU
         PEND
         PAGE
******GENERATE  'GENERALIZED RESOURCE MANAGEMENT' PARALLEL TABLES
*        AF(1)  -  GERMCLS
*        AF(2)  -  JOBCLS
*        AF(3)  -  TYPECLS
*        AF(4)  -  REF
*        AF(5)  -  MIN VALUE
*        AF(6)  -  MAX VALUE
*THIS GERM TABLE CORRESPONDS TO THE OTHER TABLE
GERMTAB  CNAME
         PROC
VVV      SET      %
         USECT    ASCAL1
         DATA,1   0
         DATA,1   AF(1)
         DATA,1   AF(2)
         DATA,1   AF(3)
         USECT    AVAL1
         DATA     AF(4)+F
         USECT    ALOW1
         DO       TCOR(AF(5),S:INT)
         DATA     AF(5)
         ELSE
         GEN,1,31 1,AF(5)+F
         FIN
         USECT    AHIGH1
         DO       TCOR(AF(6),S:INT)
         DATA     AF(6)
         ELSE
         GEN,1,31 1,AF(6)+F
         FIN
         USECT    ATEXT1
         DATA     VVV
         USECT    VVV
         PEND
         PAGE
*
*******************************************
*  3.    CONDITIONAL ASSEMBLY PARAMETERS  *
*******************************************
*
*                       NOTE: ALL CONDITIONAL ASSEMBLY PROCS BEGIN WITH
*                       '%' AND MAY BE LOCATED THROUGH THE USE OF A
*                       CONCORDANCE LISTING.
*
CK%CODE  EQU      0     THREE LEVELS OF MODULE CHECK-OUT ARE PROVIDED
*                       BY THE INCLUSION OF CHECK-CODES WITH CERTAIN
*                       OF THE TEST TABLE ENTRIES AND CONDITIONAL
*                       ASSEMBLY OF THE 'CONTROL' AREAS WHICH CHECK
*                       THE TABLE CODES FOR CORRECT ACCESS. ON THE
*                       FIRST GO-AROUND, THESE CHECK-CODES WILL BE
*                       INCLUDED WITH EACH APPLICABLE TABLE ENTRY AND
*                       WILL BE COMPARED TO SIMILAR CODES IN THE FIRST
*                       CHECK-OUT LEVEL OF THE 'CONTROL' MODULE.
*                       WHEN THE 'CONTROL' UPDATES HAVE BEEN FIRMED UP
*                       THROUGH INITIAL TESTING (LEVEL 2), 'CONTROL'
*                       WILL BE LOADED WITH THE NEW SYSTEM TABLES
*                       AS PRODUCED BY SYSGEN.
*
*                       ULTIMATELY, 'CONTROL' WILL BE TESTED WITH NO
*                       GUARD-CODE IN CONJUNCTION WITH PRODUCTION
*                       SYSGEN TABLES.
*
*                 0 ===> PRODUCTION VERSION - NO GUARD-CODE
*                 1 ===> INTERMEDIATE TESTING - PRODUCTION TABLES.
*                 2 ===> INITIAL TESTING - GUARD-CODE IN TABLE ENTRIES
*
*
         PAGE
*
*                       NOTE: CONDITIONAL ASSEMBLY PARAMETERS WERE INI-
*                       TIATED UNDER UTS B00 DEVELOPMENT OF 'CONTROL'
*                       TO EXCLUDE CERTAIN SYSTEM CONTROL PARAMETERS
*                       (SUCH AS SL:IOC) WHICH WERE THEN NOT BEING
*                       ACCESSED BY THE SYSTEM BUT AT SOME FUTURE
*                       DATE COULD BE USEFULLY IMPLEMENTED.
*                       SECTIONS CURRENTLY AFFECTED BY CONDITIONAL
*                       ASSEMBLY ARE:
*
*        MODULE NAME    SECTION #   SECTION NAME
*        -----------    ---------   ------------
*        CONTROL        4.2         EXTERNAL REFERENCES
*        CONTROL        9           'ITEM' NAMES
*
         PAGE
*
*********************************************
*  4.    EXTERNAL REFERENCES & DEFINITIONS  *
*********************************************
*
*  4.1   SYSTEM PARAMETER EXTERNAL REFERENCES
*
         REF      J:JIT
         REF,1    JB:PRIV           BYTE REF TO PRIV LEV ADR
         REF,1    JB:PCW            LINE WIDTH FOR ONLINE USERS
         REF      S:MBSF            MULTI-BATCH SCHEDULER FLAG
         REF      M:UC
         REF      M:SI
         REF      M:LO
         REF      M:DO
         REF      M:C
         REF      LPART             # BATCH PARTITIONS IN THIS SYSTEM
         REF      S:CUIS
         REF      U:MISC            HOLDS REMAINING RETENTION TIME
         REF      UH:FLG2           USED TO CHECK FOR DISCONNECTED USER
         REF      SH:STEAL          SYMBIONT PFA STEALING FLAG
         REF      SL:COMAXG         COMODE BLOCKING SIZE (IN BLOCKS)
*
         REF      PPSTART           END OF MONITOR DATA
         SREF     COCGFLG           FOR OUM COMMAND; INFORM HARDWIRED USERS
         SREF     COC               SEE IF COC HANDLER EXISTS
         PAGE
*
*                 SYSTEM NAME     SYSGEN OPTION       CONTROL NAME
*                 -----------     -------------       ------------
*  :IMC COMMAND:
*
         REF      S:BUAIS         MAXB                BU
         REF      S:OUAIS         MAXOL               OU
         REF      S:GUAIS         MAXG                GU(M)
         REF      SMUIS                               UM
         REF      SL:QMIN         MINQUAN             QMIN
         REF      SL:SQUAN                            SQUAN
         REF      SL:QUAN         QUANTA              QUAN
         REF      SL:TB           BLOCK               TB
         REF      SL:UB           UNBLOCK             UB
         SREF     SL:OLTO         LOGTIME             OLTO
         SREF     SL:OITO         INTIME              OITO
         SREF     SL:ONCB         COCBUF              ONCB
         REF      PL:CHG
         REF      SL:PI           PI                  PI
         REF      SL:RET          RETIM               RETIM
*
*  GENERATED BY SYSGEN IMC (DEFAULT - NO OPTION POSSIBLE)
*
         REF      SL:OXMF           -                 OXIOC
         REF      SL:OIMF           -                 OIIOC
         REF      SL:BXMF           -                 BXIOC
         REF      SL:BIMF           -                 BIIOC
         REF      S:BUIS            -                 BUC
         REF      S:OUIS            -                 OUC
         REF      S:GUIS            -                 GUC
         PAGE
*  :ELIMIT COMMAND - D00 ADDITIONS:
*
         REF      SL:ETIME        TIME                ETIME
         REF      SL:ELO          LO                  ELO
         REF      SL:EPO          PO                  EPO
         REF      SL:EDO          DO                  EDO
         REF      SL:EUO          UO                  EUO
         REF      SL:ETS          TSTORE              ETS
         REF      SL:EPS          PSTORE              EPS
*
*  :SCPU COMMAND
*
         SREF     SL:BSTRT          SLV CPU AUTO-START INHIBIT
         SREF     SH:MAXQ           SLV CPU MAX COMPUTE INTERVAL/JOB
         SREF     SH:MINQ           SLV CPU INTERRUPT INTERVAL
         SREF     SL:MPCALR         COMPUTE TIME VS. CAL RATE THRESHOLD
         SREF     NSCPU             # OF SLV CPUS; 0 IMPLIES NONE
*
*  GERM CONTROL ITEMS
*
         REF      SH:RNM,SV:RSIZ
         REF      SV:LIM
         REF      SV:FTYM
*
         REF      DCTSIZ            TO SEARCH DCT TABLES
         REF      DCT3              PARTITIONED FLAG
         REF      DCT4              DEVICE TYPE
         REF      DCT23             HGP DISPLACEMENT
         REF      DCT22             SECONDARY STORAGE FLAG
         REF      DCT24             NOT THERE FLAG
         REF      HGP               PRIVATE FLAG
         REF      SH:RTOT
         REF      SH:RGSUM,SH:RGCU,SB:RGMX,SB:RGDF
         REF      SH:ROSUM,SH:ROCU,SB:ROMX,SB:RODF
         REF      SH:RBSUM,SH:RBCU,SB:RBMX,SB:RBDF
*
         REF      SL:GMX,SL:GDF
         REF      SL:OMX,SL:ODF
         REF      SL:BMX,SL:BDF
*
         REF      S:SYMDG
         REF      S:SYMDO
         REF      S:SYMDB
*
         REF      SB:RTY
*
*
*  CP-V B00 ADDITIONS
*
         REF      SL:BPRIO,SL:OPRIO,SL:GPRIO
         SREF     SL:RAMR,SL:RATOR,RASIZE
         SREF     SL:AIRM,SL:AIRTO
*
*
*  CP-V C00 ADDITIONS
*
*     TRANSACTION PROCESSING
*
         SREF     SL:PWP            PHYSICAL WORK PAGE LIMIT
         SREF     PWPTABLE          ORIGIN OF PHYSICAL PAGE TABLE
         SREF     PWPEND            END OF PHYSICAL PAGE TABLE
         PAGE
*
*  4.2   SUBROUTINE REFS (TO MODULE 'CONSUB')
*
         REF      CSEND:CONSUB:DATA  END CONSUB REENTRANT DATA
         REF      CS:RED:SIZE       CONSUB REENTRANT DATA SECTION SZ
         REF      READSI            READ M:SI FOR ITEM NAME
         REF      BOUT,BOUTX,APEND  OUTPUTS AND/OR APPENDS CHAR STRING
         REF      DECINX            CONVERTS EBCDIC DECIMAL TO BINARY
         REF      DECOUT            CONVERTS BIN# TO EBCDIC DEC
         REF      SPACE             APPENDS BLANK(S) TO OUTPUT BUFFER
         REF      NEWLN             SPACES FORM N LINES
         REF      ITEMFIND          RETURNS INDEX OF ITEM NAME IN ATERM1
         REF      SAD               SEARCH & DELETE ITEM FROM LIST
         REF      PRESCAN           PACK INPUT LINE
         REF      SETPROMPT         SET PROMPTS FOR GHOSTS
         REF      OCTOLP,LPTOOC     SWITCH OUTPUT FOR GHOSTS
         REF      RDNAME            READS AN ITEM NAME FROM M:SI
         REF      SEND              OUTPUTS 'BUFFER' TO M:LO
         REF      ABNSI,ABNDO,ABNLO I/O ABNORMAL RETURN ADDRESSES
         REF      OPENDCB,SETDCB    STANDARD M:OPEN,M:SETDCB CALS
         REF      CLOSE             CLOSE SPECIFIED DCB, IF OPEN
         REF      OBUFX             INDEX TO NXT AVAILABLE BUF CHAR
         REF      OBUFSZ            SIZE OF OUTPUT BUFFER
****FOR GERM
         REF      GERMFIND          DETMNE CODE WORD FOR GERM ITEM
         REF      GERMFILL          FILLS GERM ITEM OR VALUE LIST
         REF      MKNME             RECONSTRUCTS NAME FROM CODE
         REF      GOUTRTN           OUTPUT HEADING,NAME AND VALUE
         REF      GTSTVAL           GET/STORE A GERM RELATED VALUE
*
**FROM PART MODULE,FOR RESOURCE ATTRIBUTES
         REF      GATERM            FOR SEARCHING
         REF      GAHEAD            FOR HEADING
         REF,2    GAVMIN            FOR MIN CHECK;HA RES.
         REF,2    GAVMAX            FOR MAX CHECK;HA RES.
         REF,1    GAOSTD            FOR STANDARD OUPUT;BA RES.
         REF      AORDER            START OF PART'S DEFAULT DISPLAY TBL
         REF      #ATERM2           SIZE OF PART'S STANDARD ATTRIBUTE TBL
*
*  4.3   REFS TO PARTITION MODULE ('PART')
*
         REF      PEXEC             'PART' EXECUTION FLAG
         REF      SPD               'PART' STACK POINTER DW
         REF      PART              ENTRY POINT FOR PARTITION CHANGE MOD
         REF      ZEROUT            RELEASE PART DEF STACK PAGES
         REF      9WAR3             NUMERIC OVERFLOW MSGE
         REF      SCAN              COMMAND SCANNER
         REF      CFPTRS            'SLEEP' CMD CMD FIELD PTR TBL
*
*  4.4   EXTERNAL DEFS
*
         DEF      CS:CONTROL:TEXT,CS:CONTROL:PROCEDURE,CS:CONTROL:DATA
         DEF      CSEND:CONTROL:TEXT,CSEND:CONTROL:PROCEDURE
         DEF      CSEND:CONTROL:DATA
         DEF      PATCH
         DEF      FMAP              EXT DEF MON TBLS MAPPING CONSTANT
         DEF      FOMAP             MON TBLS VIRTUAL MAPPING CONSTANT
*                                   FOR PRE-B00 SYSTEM LIMITS.
         DEF      USRPRIV           USER PRIV FLAG;-1=X'80',1=X'B0'
         DEF      10IN11            RTN TO CMND LOOP AFTER I/O ERR
         DEF      TYPEDO            SUBR FOR TYPING MESSAGE ON M:DO
         DO1      CK%CODE>=1        DEF FOR TESTING
           DEF      BFLG            BREAK FLAG; 0=NO BREAK, 1=BREAK
         DEF      JOBX              JOB TYPE CELL;1=GHOST,2=ON-LN,3=BATCH
         DEF      COMMAND           INPUT COMMAND BUFFER
         DEF      CBUFBSZ           COMMAND BUFFER BYTE SIZE
         DEF      CBUFWSZ           COMMAND BUFFER WORD SIZE
         DEF      ERMS1,ERMS4       TEXTC ERROR MESSAGES
         DEF      C28,C27,C29       TEXTC MESSAGE PIECES
         DEF      DFLTSI,DFLTDO,DFLTLO  XX DEVICE DEFAULT LABEL
         DEF      IMCNT             INPUT MESSAGE BYTE CNT
         DEF      BREAK,BREAK3,BREAK5 E.P. FOR BREAK CONTROL HANDLERS
         DEF      ICTRACE           TRACE CODE CELL;IN-CORE HEADER
         DEF      SPDADR            ADR OF USER'S TCB TEMP STACK SPD
         DEF      10INIT
         DEF      ADD1              E.P. TO PROCESS ADD/DROP CMDS
*
         DEF      INDICATR          GERM SYNTAX,I.E. TCMD
         DEF      INDJOB            JOB INDICATION ,I.E.GOB
         DEF      GERMWORD          GERM ITEM CODE
         DEF      GERMBANG          CONTROL BANG INDICATION
         DEF      RCONSTR           DBLWD FOR NAME RECONSTRT
         DEF      GCONSTK           TBL FOR 'ADD' 'DROP' GERM ITEM
         DEF      GCONVAL           TBL FOR GERM ITEM CON BANG
         DEF      #DECTBL           # OF ENTRIES IN DECISION TBL
         DEF      GDECTBL           GERM DECISION TBL
         DEF      GREFTBL           GERM REFERENCE TBL
         DEF      GMINTBL           GERM MIN VALU TBL
         DEF      GMAXTBL           GERM MAX VALU TBL
         DEF      GTEXTBL           GERM TEXT TBL
         DEF      PARTMAIN          FOR 'ADD''DROP' FROM PART/MAIN
** EQU VALUES
         DEF      RPNM#             RSRCE OR SYMBNT NAME #(2)
         DEF      SNM#              SRVCE NAME #(4)
         DEF      NAMEPOS           POSTN. IN NAME TBLS (0)
         DEF      GERMCLS           RSRCE,SRVCE OR SYMBNT (1)
         DEF      JOBCLS            JOB TYPE--SYS,G,O,B (2)
         DEF      TYPECLS           VALUE TYPE--TOTAL,SUM,MAX,DFT (3)
*
         PAGE
*
**************************************
*  5.    STATIC ASSEMBLY PARAMETERS  *
**************************************
*
*
TBLNTP   EQU      'TABLE NOT PARALLEL'
*
FO,FOMAP EQU      X'10000'          MAPPING CONSTANT - PRE B00 SL'S
*
*********CK%CODE  GENERATE MAPPING CONSTANT
*                                   IN TESTING LEVEL 2, USER
         DO       CK%CODE>=2        TABLES WITH SYSTEM DEFS WILL BE
F,FMAP     EQU      0               IMPLEMENTED - NO OFFSET. IN
         ELSE                       PRODUCTION, B00 MON TABLES WILL
F,FMAP     EQU      FO              HAVE NEW PARAMS AND WILL BE
         FIN                        MAPPED AT FO.
*********CK%CODE  END
*
CBUFBSZ  EQU      72                COMMAND BUFFER BYTE SIZE - ACCOM-
         ERROR,X'7',CBUFBSZ>255  'CBUFBSZ>255'  ODATES COMMENT CARDS.
*                                   SHOULD NOT EXCEED 255 BECAUSE
*                                   OF BYTE TRANSACTIONS IN 'PART'.
CBUFWSZ  EQU      (CBUFBSZ+3)/4     COMMAND BUFFER WORD SIZE
*
         PAGE
*
*****************************************
*  5.1   SYMBOLIC REGISTER DEFINITIONS  *
*****************************************
R0       EQU      0
R1,X1    EQU      1
R2,X2    EQU      2
R3,X3    EQU      3
R4,X4    EQU      4
R5,X5    EQU      5
R6,X6    EQU      6
R7,X7    EQU      7
R8,SR1   EQU      8
R9,SR2   EQU      9
R10,SR3  EQU      10
R11,SR4  EQU      11
D1       EQU      12
D2       EQU      13
D3       EQU      14
D4       EQU      15
*
         PAGE
*
*********************************
*  5.2   SPECIFIC ITEM OFFSETS  *
*********************************
*
*
#ATERM1  EQU      DA(ATERMEND)-DA(ATERM1) #VALID ENTRIES IN ITEM TABLE
*
         PAGE
*
**************************
*  6.    DATA CONSTANTS  *
**************************
*
         USECT    CS:CONTROL:TEXT
*
BLANK    TEXT     '        '
BPSD     GEN,8,4,3,17 0,X'F',0,BREAK6 PSD PUSHED INTO USER'S TCB STACK
*                                   ENVIRONMENT BY BREAK TO SIMULATE
         DATA     0                 A BREAK AFTER DELAY.
WK1PSD   GEN,9,1,5,17,4,28 0,1,0,33CONTIN,1,0
SLAVEPSD GEN,8,2,5,17,32   0,3,0,33SET7,0
CMDATA   GEN,8,24 8,BA(COMMAND)     CHAR CNT; MBS SOURCE ADR 'ITEMFIND'
*
C:SMUIS  DATA     SMUIS             MAX # USERS ALLOWED IN SYSTEM
*
AT1DATA  GEN,8,24 #ATERM1,ATERM1    #ENTRIES; TBL ADR FOR 'ITEMFIND'
*
INDICATR TEXTC    'TCMD'
INDJOB   TEXTC    'GOB'
*
RPNM#    EQU      2
SNM#     EQU      4
JOBCLS   EQU      2
TYPECLS  EQU      3
GERMCLS  EQU      1
NAMEPOS  EQU      0
*
         PAGE
*(*)     A NEGATIVE VALUE ==> INDIRECT ADDRESS POINTING TO DYNAMIC MAX
*                             WHERE BITS 1-7 CONTAIN A SCALING FACTOR
*                             TO BE MULTIPLIED BY THE MAX SO THAT
*                             THE COMPARE MADE BE MADE.
*(**)    A -1 VALUE ==> THIS ITEM MAY NOT BE ALTERED; DISPLAY ONLY
*(***)   A -2 VALUE ==> THIS LIMIT WILL HAVE TO BE COMPUTED
*
*
*************************************************
*  9.1   CONTROL PARAMETER DISPLAY SIDINGS  *
*************************************************
*
CBD%ERR  SET      0
         TABLE    'MAXQ3',SH:MAXQ+1,0,(SH:MINQ+1,33GETMIN),32767,;
                  46,X'0000FFFF'
         TEXTC    'SLV CPU MAX QUAN     (MAXQ3)='
         TABLE    'MINQ3',SH:MINQ+1,0,10,(SH:MAXQ+1,33GETMAX),47,;
                  X'0000FFFF'
         TEXTC    'SLV CPU MIN QUAN     (MINQ3)='
         TABLE    'MAXQ2',SH:MAXQ+1,1**15,(SH:MINQ+1,33GETMIN),;
                  32767,44,X'FFFF0000'
         TEXTC    'SLV CPU MAX QUAN     (MAXQ2)='
         TABLE    'MINQ2',SH:MINQ+1,1**15,10,(SH:MAXQ+1,33GETMAX),;
                  45,X'FFFF0000'
         TEXTC    'SLV CPU MIN QUAN     (MINQ2)='
         TABLE    'MAXQ1',SH:MAXQ,0,(SH:MINQ,33GETMIN),32767,42,;
                  X'0000FFFF'
         TEXTC    'SLV CPU MAX QUAN     (MAXQ1)='
         TABLE    'MINQ1',SH:MINQ,0,10,(SH:MAXQ,33GETMAX),43,;
                  X'0000FFFF'
         TEXTC    'SLV CPU MIN QUAN     (MINQ1)='
         TABLE    'BSTRT',SL:BSTRT,1,0,1,40
         TEXTC    'SLV CPU AUTO INHIBIT (BSTRT)='
         TABLE    'MPCALR',SL:MPCALR,0,0,32767,41
         TEXTC    'MP CAL RATE THRESHLD(MPCALR)='
         TABLE    'BUM',S:BUAIS,1,0,(-2,33:BUAIS),2
TBUAIS   TEXTC    'MAX # BATCH USERS      (BUM)='
         TABLE    'BXMF',SL:BXMF,1,(SL:BIMF,33GETMIN),255,12
TBXMF    TEXTC    'MAX BATCH I/O COUNT   (BXMF)='
         TABLE    'BIMF',SL:BIMF,1,1,(SL:BXMF,33GETMAX),14
TBIMF    TEXTC    'MIN BATCH I/O COUNT   (BIMF)='
         TABLE    'PI',SL:PI,1,0,255,10
TPI      TEXTC    'PRIORITY INCREMENT      (PI)='
         TABLE    'QMIN',SL:QMIN,0,0,30000,11
TQMIN    TEXTC    'ONLINE MINIMUM QUAN   (QMIN)='
         TABLE    'SQUAN',SL:SQUAN,0,0,30000,17
TSQUAN   TEXTC    'MSEC CORE-RESIDENCY  (SQUAN)='
         TABLE    'OUM',S:OUAIS,1,0,(-2,33:OUAIS),4
TOUAIS   TEXTC    'MAX # ONLINE USERS     (OUM)='
         TABLE    'OXMF',SL:OXMF,1,(SL:OIMF,33GETMIN),255,13
TOXMF    TEXTC    'MAX ONLINE I/O COUNT  (OXMF)='
         TABLE    'OIMF',SL:OIMF,1,1,(SL:OXMF,33GETMAX),15
TOIMF    TEXTC    'MIN ONLINE I/O COUNT  (OIMF)='
         TABLE    'QUAN',SL:QUAN,0,0,30000,9
TQUAN    TEXTC    'MSEC ONLINE QUANTUM   (QUAN)='
         TABLE    'TB',SL:TB,1,(SL:UB,33GETMIN),128,23
TTB      TEXTC    '# SECS TERMINAL BLOCK   (TB)='
         TABLE    'UB',SL:UB,1,1,(SL:TB,33GETMAX),25
TUB      TEXTC    '# SECS TERM UNBLOCK     (UB)='
         TABLE    'BUC',S:BUIS,1,0,-1,3
TBUIS    TEXTC    'CURRENT # BATCH USERS  (BUC)='
         TABLE    'OUC',S:OUIS,1,0,-1,5
TOUIS    TEXTC    'CURRENT # ONLINE USERS (OUC)='
         TABLE    'GUC',S:GUIS,1,0,-1,7
TGUIS    TEXTC    'CURRENT # GHOST JOBS   (GUC)='
         TABLE    'OLTO',SL:OLTO,50,1,655,19
TOLTO    TEXTC    'LOG-ON TIME-OUT       (OLTO)='
         TABLE    'OITO',SL:OITO,50,1,655,21
TOITO    TEXTC    'TERM INPUT TIME-OUT   (OITO)='
         TABLE    'ONCB',SL:ONCB,1,2,255,27
TONCB    TEXTC    'MAX # COC INPUT BUFS  (ONCB)='
         TABLE    'UM',C:SMUIS-F,1,0,-1,0
TUM      TEXTC    'MAX #USERS IN SYS       (UM)='
         TABLE    'UC',S:CUIS,1,0,-1,1
TUC      TEXTC    'CURRENT # USER IN SYS   (UC)='
         TABLE    'GUM',S:GUAIS,1,0,-1,6
TGUM     TEXTC    'MAX # GHOST JOBS       (GUM)='
         TABLE    'ETIME',SL:ETIME,500,0,1**31-1,18
TETIME   TEXTC    'ELIM DEFAULT - TIME  (ETIME)='
         TABLE    'ELO',SL:ELO,1**17,0,1**15-1,20,X'FFFE0000'
TELO     TEXTC    'ELIM DEFAULT - LO      (ELO)='
         TABLE    'EPO',SL:EPO,1**17,0,1**15-1,22,X'FFFE0000'
TEPO     TEXTC    'ELIM DEFAULT - PO      (EPO)='
         TABLE    'EDO',SL:EDO,1**17,0,1**15-1,24,X'FFFE0000'
TEDO     TEXTC    'ELIM DEFAULT - DO      (EDO)='
         TABLE    'EUO',SL:EUO,1**17,0,1**15-1,26,X'FFFE0000'
TEUO     TEXTC    'ELIM DEFAULT - UO      (EUO)='
         TABLE    'ETS',SL:ETS,1,0,1**16-1,28,X'FFFF'
TETS     TEXTC    'ELIM DEFAULT - TSTORE  (ETS)='
         TABLE    'EPS',SL:EPS,1,0,1**16-1,16,X'FFFF'
TEPS     TEXTC    'ELIM DEFAULT - PSTORE  (EPS)='
         TABLE    'BPRIO',SL:BPRIO,1,192,255,29
         TEXTC    'BASE EXEC PRIO-BATCH (BPRIO)='
         TABLE    'OPRIO',SL:OPRIO,1,192,255,30
         TEXTC    'BASE EXEC PRIO-ONLINE(OPRIO)='
         TABLE    'GPRIO',SL:GPRIO,1,192,255,31
         TEXTC    'BASE EXEC PRIO-GHOST (GPRIO)='
         TABLE    'RAM',SL:RAMR,1,0,RASIZE,32
         TEXTC    'MAXIMUM # READ-AHEADS  (RAM)='
         TABLE    'RATO',SL:RATOR,1,0,32767,33
         TEXTC    'READ-AHEAD TIME-OUTS  (RATO)='
         TABLE    'AIRM',SL:AIRM,1,0,RASIZE,34
         TEXTC    'MAX # AIR ENTRIES     (AIRM)='
         TABLE    'AIRTO',SL:AIRTO,1,0,32767,35
         TEXTC    'AIR TIME-OUT         (AIRTO)='
         TABLE    'PWP',SL:PWP,1,0,PWPEND-PWPTABLE,8
         TEXTC    'PHYSICAL WORK PAGE MAX (PWP)='
         TABLE    'RETIM',SL:RET,1,(-2,33:RETIM),X'FFFF',36,X'FFFF'
TRETIM   TEXTC    'RETENTION TIME       (RETIM)='
         TABLE    'PFA',SH:STEAL,1,0,1,37,X'FFFF'
TPFA     TEXTC    'SYMBIONT OVERFLOW      (PFA)='
         TABLE    'CHUNK',SL:COMAXG,2,5,250,38
         TEXTC    'COMODE BLOCKING SIZE (CHUNK)='
         TABLE    '    ',BLANK,1,0,0,39
         TEXTC    '                             '
UUU      SET      %
         USECT    CBDSTK
         ORG      CBDSTK            TERMINATE CBDSTK
         RES,1    #ATERM1
         DATA,1   0
         USECT    UUU
*        CHECK FOR CBDSTK ERROR(ENTRY MISSING)
         DISP     CBD%ERR
FMASK    SET      X'FFFFFFFF' MASK AVOIDS DPI ON SHIFT
UUU      SET      FMASK**((#ATERM1&31)-32)
         DO1      (#ATERM1&32)=32   INVERT IF TURNING BITS OFF
UUU      SET      (]UUU)&FMASK      NOT UUU
         ERROR,15,CBD%ERR~=UUU  'CONTROL! TABLE ERROR'
*
         PAGE
**** FOR GERM USE
         USECT    ASCAL1
GDECTBL  EQU      %                 GERM DECISION TABLE
         USECT    AVAL1
GREFTBL  EQU      %                 GERM REFERENCE TABLE
         USECT    ALOW1
GMINTBL  EQU      %                 GERM MIN-VAL TABLE
         USECT    AHIGH1
GMAXTBL  EQU      %                 GERM MAX-VAL TABLE
         USECT    ATEXT1
GTEXTBL  EQU      %                 GERM TEXT TABLE
         USECT    CS:CONTROL:TEXT
* USE PROC TO GENERATE GERM TABLES
** DECISION TABLE CONTAINS ALL VALID COMBNTNS OF GERM ITEMS
*** SPECIAL INTERPRETATION FOR MAX VALUE,I.E.AF(6)
****  IF >=0  ,TRUE VALUE (0 IS MEANINGFUL)
****  IF =-1  ,CURRENT VALUE ITEM--NOT MODIFIABLE
****  IF =-2  ,SPECIAL FOR SYSTEM TOTAL RESOURCE
****  IF NEGATIVE(NOT -1/-2)  ,THEN CAN FETCH VALUE VIA REF
*
* TEMP SETUP---> ALL MIN VALS ZERO
* TEMP SETUP---> SOME MAX VALS ARBITRARY
*SYSTEM TOTAL RESOURCE
         GERMTAB  1,0,1,SH:RTOT,0,-2
         TEXTC    'SYSTEM TOTAL RESOURCE'
*GHOST RESOURCE
         GERMTAB  1,1,1,SH:RGSUM,0,SH:RTOT
         TEXTC    'TOTAL *GHOST*  RSRCE '
         GERMTAB  1,1,2,SH:RGCU,0,-1
         TEXTC    'CURNT *GHOST*  RSRCE '
         GERMTAB  1,1,3,SB:RGMX,0,SH:RGSUM
         TEXTC    'MAX GHOST  JOB RSRCE '
         GERMTAB  1,1,4,SB:RGDF,0,SB:RGMX
         TEXTC    'DFT GHOST  JOB RSRCE '
*ONLINE RESOURCE
         GERMTAB  1,2,1,SH:ROSUM,0,SH:RTOT
         TEXTC    'TOTAL *ONLINE* RSRCE '
         GERMTAB  1,2,2,SH:ROCU,0,-1
         TEXTC    'CURNT *ONLINE* RSRCE '
         GERMTAB  1,2,3,SB:ROMX,0,SH:ROSUM
         TEXTC    'MAX ONLINE JOB RSRCE '
         GERMTAB  1,2,4,SB:RODF,0,SB:ROMX
         TEXTC    'DFT ONLINE JOB RSRCE '
*BATCH RESOURCE
         GERMTAB  1,3,1,SH:RBSUM,0,SH:RTOT
         TEXTC    'TOTAL *BATCH*  RSRCE '
         GERMTAB  1,3,2,SH:RBCU,0,-1
         TEXTC    'CURNT *BATCH*  RSRCE '
         GERMTAB  1,3,3,SB:RBMX,0,SH:RBSUM
         TEXTC    'MAX BATCH  JOB RSRCE '
         GERMTAB  1,3,4,SB:RBDF,0,SB:RBMX
         TEXTC    'DFT BATCH  JOB RSRCE '
*GHOST SERVICE LIMITS
         GERMTAB  2,1,3,SL:GMX,0,32767
         TEXTC    'MAX GHOST  JOB SRVCE '
         GERMTAB  2,1,4,SL:GDF,0,SL:GMX
         TEXTC    'DFT GHOST  JOB SRVCE '
*ONLINE SERVICE LIMITS
         GERMTAB  2,2,3,SL:OMX,0,32767
         TEXTC    'MAX ONLINE JOB SRVCE '
         GERMTAB  2,2,4,SL:ODF,0,SL:OMX
         TEXTC    'DFT ONLINE JOB SRVCE '
*BATCH SERVICE LIMITS
         GERMTAB  2,3,3,SL:BMX,0,32767
         TEXTC    'MAX BATCH  JOB SRVCE '
         GERMTAB  2,3,4,SL:BDF,0,SL:BMX
         TEXTC    'DFT BATCH  JOB SRVCE '
*GHOST SYMBIONT AUTHORIZATION
         GERMTAB  3,1,4,S:SYMDG,0,1
         TEXTC    'SYM/FAUTH DFT GHOST  '
*ONLINE SYMBIONT AUTHORIZATION
         GERMTAB  3,2,4,S:SYMDO,0,1
         TEXTC    'SYM/FAUTH DFT ONLINE '
*BATCH SYMBIONT AUTHORIZATION
         GERMTAB  3,3,4,S:SYMDB,0,1
         TEXTC    'SYM/FAUTH DFT BATCH  '
*
         USECT    ASCAL1
#DECTBL  EQU      %-GDECTBL
         USECT    AVAL1
#REFTBL  EQU      %-GREFTBL
I        SET      #DECTBL-#REFTBL
         ERROR,X'F',I<0   'GERM TABLES NOT PARALEL'
         ERROR,X'F',I>0   'GERM TABLES NOT PARALEL'
*
         USECT    VVV
*
******************************************
*  9.3   'CMDS' - COMMAND KEYWORD TABLE  *
******************************************
*
*
*                 'CMDS' CONTAINS A LIST OF COMMAND KEYWORDS WHICH
*        ARE USED BY 'SWITCH'. THE FIRST TWO BYTES OF AN INPUT
*        COMMAND ARE COMPARED AGAINST EACH ENTRY IN ORDER TO OBTAIN
*        AN INDEX INTO A BRANCH VECTOR TABLE WHICH POINTS TO THE
*        APPROPRIATE COMMAND HANDLER.
*
*
         BOUND    4          ENTRY# COMMAND
CMDS     EQU      %          ------ -------
         DATA,2   0                 SUBSCRIPTED TABLE
         DATA,2   C'PR'        1    'PROCEED'
         DATA,2   C'AD'        2    'ADD'
         DATA,2   C'DR'        3    'DROP'
         DATA,2   C'CO'        4    'CONTROL','CONTROL*BANG'
         DATA,2   C'EN'        5    'END'
         DATA,2   C'LI'        6    'LIST'
         DATA,2   C'PA'        7    'PARTITION'
         DATA,2   C'QU'        8    'QUIT'
         DATA,2   C'SL'        9    'SLEEP'
         DATA,2   C'TI'       10    'TIME'
*        DATA,2   C'BU'       11    'BUILD' *FOR FUTURE USE*
*        DATA,2   C'RE'       12    'READ' *FOR FUTURE USE*
*
#CMDS    EQU      HA(%)-1-HA(CMDS)
*
         PAGE
*
**********************
*  9.3   OTHER TEXT  *
**********************
*
*
DELIMS   TEXTC    '=:'              DELIMS FOR PRESCAN CMD PACK
AT13     TEXT     '*****'           'CONTROL' DISPLAY OVERFLOW
AT14     TEXTC    '         CP-V SYSTEM CONTROL PARAMETERS AT '
AT15     TEXTC    ;
         '         ---- ------ ------- ---------- -- ----- --- ------'
C27      TEXTC    ' PERMISSIBLE RANGE = '  USED IN 33SET
C28      TEXTC    '-'               USED IN 33SET
C29      TEXTC    '='
NOTGENED TEXTC    '*THIS SYSTEM NOT GEN''ED FOR '
         PAGE
*
**************************
*  10.   INITIALIZATION  *
**************************
*
*
*  DESCRIPTION:   'INITIALIZATION' IS THE ENTRY POINT TO 'CONTROL' AND
*                 PERFORMS A USER PRIVILEGE LEVEL CHECK, DETERMINES THE
*        TYPE OF JOB (GHOST, ON-LINE, OR BATCH) THAT IS USING 'CONTROL',
*        AND OPENS INPUT/OUTPUT DCB'S WHICH HAVE NOT BEEN 'ASSIGN'ED TO
*        OTHER DEVICES OR OP-LABELS. INITIALIZATION THEN TAKES BREAK
*        CONTROL, INFORMS THE USER THAT HE MAY INPUT COMMANDS AND
*        TRANSFERS CONTROL TO THE MAIN COMMAND LOOP.
*
*
*        NOTE1:   REGISTER USAGE IS AS FOLLOWS:
*
*        ENTRY                 INTERNAL               EXIT
*        -----                 --------              ----
*        R0=TCB SPD ADR        R0-R2=WORK            R0-R2,R4,R8-R11
*                              R4=JOB TYPE INDEX     VOLATILE
*                              R8=DCB ADDRESS
*                              R9=DEFAULT OP-LABEL
*                              R10=ABNORMAL RETURN ADR
*                              R11=I/O BAL REGISTER
*
*
         USECT    CS:CONTROL:PROCEDURE
*
10INIT   EQU      %
         STW,R0   SPDADR            STORE ADR OF USER'S TCB SPD
         TRACE%   ' D'              ' D'=TRACE CODE FOR INITIALIZATION
*****
*        REINITIALIZE AVAL1 TABLE SLOTS FOR MAXQ2,3 & MINQ2,3 IN THE
*        EVENT THAT SH:MAXQ+1 AND SH:MINQ+1 ARE NOT DEFINED.
*        **N.B.** THE 1ST FOUR 'TABLE' ITEMS ARE PRESUMED TO BE
*        MAXQ3, MINQ3, MAXQ2, MINQ2.
*****
         LI,R2    0
         LI,R3    X'FFFF'           MASK FOR AVAL1 STORE
         LI,X4    4                 ASSUME CPUS 2&3 NOT DEFINED
         LCI      NSCPU             GET #SLV CPUS IN THIS SYSTEM
         BCR,3    ZAP2:3            B, IF NONE DEFINED; CLR AVAL1 FOR 2&3
         BCR,2    ZAP2:3            B, IF ONE DEFINED; CLR AVAL1 FOR 2&3
         BCS,1    GETPRIV           B, IF THREE DEFINED; NOTHING TO DO
         LI,X4    2                 ELSE, SET UP TO CLEAR AVAL1 FOR 3
ZAP2:3   EQU      %
         STS,R2   AVAL1,X4          ZAP BAD ADDRESS IN AVAL1 SLOT
         BDR,X4   %-1               CONTINUE
GETPRIV  EQU      %
         LI,R1    JB:PRIV           GET CONTROL USER PRIV LEV JIT ADR
         LB,R1    0,R1              GET PRIVILEGE LEVEL
         CI,R1    X'80'             IF >= X'80'===> MAY USE CONTROL
         BGE      10INIT1         ->USER OK
         TYPE     ' CONTROL REQUIRES AT LEAST PRIVILEGE 80' ERROR
         B        25EXIT            PACK IT UP
10INIT1  EQU      %
         CI,R1    X'C0'             CK FOR C0 PRIV TO ALLOW MONITOR STORE
         BL       %+2               B, IF LESS; WILL ALLOW DISPLAY ONLY
         MTW,2    USRPRIV           ELSE, BUMP PRIV FLG BY 2 +1 BELOW
         MTW,1    USRPRIV           BUMP PRIV FLG FOR 80 PRIV LEVEL
         LI,R4    1                 GET BASE JOB INDEX (GHOST=1)
         LC       J:JIT             WHAT KIND OF JOB IS IT? (3 CHOICES)
         BCS,4    10INIT4         ->  GHOST - JOB TYPE=1
         BCS,8    10INIT3         ->  ON-LINE - SET JOB TYPE INDEX=2
         AI,R4    1                   BATCH - SET JOB TYPE INDEX=3
10INIT3  AI,R4    1             <-  INCREMENT JOB TYPE INDEX
10INIT4  STW,R4   JOBX          <-  SAVE JOB TYPE FOR USE AS INDEX
*                                   INTO DFLTXX TABLES WHERE XX=SI,DO,LO
         LW,R0    DFLTSI,R4         GET SI DEFAULT OP-LBL FOR JOB TYPE
         STW,R0   DFLTSI            STORE IN WORD 0 OF TABLE
         LW,R0    DFLTDO,R4         GET DO DEFAULT OP-LBL FOR JOB TYPE
         STW,R0   DFLTDO            STORE FOR FUTURE INDIRECT ACCESS BY
*                                   I/O CAL ON M:OPEN IN 'ABNXX'.
         LW,R0    DFLTLO,R4         GET LO DEFAULT OP-LABEL
         STW,R0   DFLTLO            STORE
*
*        NOTE2:   IF JOB TYPE IS GHOST, SI, LO AND DO WILL BE OPENED TO
*                 DEFAULT OPTIONS. GHOST NEEDS SPECIAL ATTENTION BECAUSE
*                 IT WILL PROBABLY BE USING THE OC FOR I/O AND WHO
*                 KNOWS WHAT THE DEFAULTS ARE FOR SI, LO AND DO.
*                 ON-LINE AND BATCH JOBS DON'T HAVE TO HAVE THEIR
*                 DCB'S OPENED IN THIS CASE BECAUSE THEY WILL BE
*                 OPENED IMPLICITLY ON THE FIRST READ, BUT THEY DO
*                 NEED THE ABN RETURN ADDRESS SET. ALL GHOST DCB'S
*                 ARE OPENED TO DEFAULT ASSIGNMENTS AS DETERMINED BY
*                 TABLES 'DEFLTXX'.
*
         LI,R8    M:SI              GET THE M:SI DCB ADR
         LI,R10   ABNSI             GET THE ABNORMAL RTN ADR
         CI,R4    1                 IS JOB BATCH OR ONLINE?
         BNE      10INIT5         ->  YES-DON'T OPEN DCB
         LW,R9    DFLTSI              NO-GET JOB SI DEFAULT OP-LABEL
         BAL,R11  OPENDCB         >>OPEN DCB
         B        10INIT6       <<->CHECK LO DCB
*
10INIT5  EQU      %                 SET THE ABNORMAL RETURN ADR IN M:SI
         BAL,R11  SETDCB          <->>SET I/O ABN RTN ADR
10INIT6  EQU      %                 CHECK IF LO DCB OPENED, FOR GHOST
         CI,4     2                 IF ONLINE AND M:LO IS THE TERMINAL,
         BNE      10INIT65          SET LINE WIDTH THEREOF
         M:DEVICE M:LO,(CORRES,M:UC)
         CI,SR1   1
         BNE      10INIT65          NOT THE SAME
         LI,R1    JB:PCW
         LB,R1    0,R1              GET CURRENT LINE SIZE
         CI,R1    11                CHECK PLATEN WIDTH
         BG       %+2
         LI,R1    140
         STW,R1   OBUFSZ
10INIT65 EQU      %
         LI,R8    M:LO          <<  GET THE M:LO DCB ADR
         LI,R10   ABNLO             GET THE ABN RTN ADR
         CI,R4    1                 IS JOB BATCH OR ONLINE?
         BNE      10INIT7         ->  YES-DON'T OPEN DCB
         LW,R9    DFLTLO              NO-GET DEFAULT OP-LABEL
         BAL,R11  OPENDCB         >>OPEN M:LO DCB
         B        10INIT8       <<->CHECK DO DCB
*
10INIT7  EQU      %                 SET ABN RTN ADR IN M:LO DCB
         BAL,R11  SETDCB          <->>SET I/O ABNORMAL RTN ADR FOR M:LO
10INIT8  EQU      %                 CHECK IF DO DCB OPENED, FOR GHOST
         LI,R8    M:DO          <<  FOR THE LAST TIME, OFF WE GO
         LI,R10   ABNDO
         CI,R4    1                 IS JOB BATCH OR ONLINE?
         BNE      10INIT9         ->  YES-DON'T OPEN DCB
         LW,R9    DFLTDO              NO-ALL DCB'S HAVE DIFFERENT
*                                   ENTRY POINTS INTO ABN CODE HANDLER,
*                                   SO THE FAULTY DCB CAN BE IDENTIFIED.
         BAL,R11  OPENDCB         >>OPEN M:DO DCB
         B        10IN10        <<->GO MAP MONITOR TABLES
*
10INIT9  EQU      %                 SET THE ABN RTN ADR IN THE M:DO DCB
         BAL,R11  SETDCB          <<>>SET ABN RTN ADR IN M:DO DCB
10IN10   EQU      %                 TIME TO MAP THE MONITOR TABLE PAGES
*                                   INTO 'CONTROL' VIRTUAL SPACE
         BAL,D4   34MAP1        <<>>MAP ALL NECESSARY MON TABLES
         DISP     F                 STARTING AT CONSTANT 'F'.
*
*INITIALIZE SOME TBL FOR 'PARTITION' PART REGARDING RSRCE
*
         LI,R4    0                 INDX INTO RSRCE NAME TBL
         LI,R5    -1                INDX T SET THE TBL FOR PART
IPART1   AI,R5    1
         AI,R4    1
         CI,R4    SV:RSIZ+1
         BE       IPART2            NO MORE
         LD,R2    BLANK             BLANK FILL
         LH,R0    SH:RNM+F,R4
         STH,R0   R2
         STD,R2   GATERM,R5         SETUP TEXT NAME FOR KEY-WORD
         SLD,R2   -16               TO ALIGN HEADING
         LI,R0    X'0640'           TEXTC FORMAT
         STH,R0   R2
         STD,R2   GAHEAD,R5         SETUP TEXTC NAME FOR HEADING
         LI,R0    0
         LI,R2    GAVMIN
         AW,R2    R5
         STH,R0   0,R2              *ASSUME MIN VAL ALLOWED FOR RSRCE=0
         LH,R0    SH:RTOT+F,X4      USE SYSTEM TOTALS FOR PART'S AVMAX TBL
         AND,R0   =X'FFFF'          ISOLATE VALUE
         CI,R0    255               PLB:MAX IS A BYTE TABLE
         BLE      %+2               SO BRANCH IF VALUE FITS
         LI,R0    255               ELSE, MAKE IT FIT
         LI,R2    GAVMAX
         AW,R2    R5
         STH,R0   0,R2              *MAX VAL CHECK FROM SB:RBMX
         B        IPART1            MORE
IPART2   LI,R0    0                 CUTOFF STD DISPLAY ACCRDNG TO SIZE
         LI,R2    GAOSTD
         AW,R2    R5
         STB,R0   0,R2              STD LIST NOW ESTABLISHED
         LI,X2    BA(AORDER)+6      1ST RESORCE BYTE IN DEFAULT DISP
         LI,R0    #ATERM2+1         GET PART TBL INDEX FOR 1ST GERM ITEM
         STB,R0   0,X2              STORE GERM INDEX FOR DEFAULT DISP
         AI,R0    1                 BUMP GERM INDEX
         AI,X2    1                 BUMP DEFAULT DISPLAY TABLE INDEX
         BDR,R5   %-3               CONTINUE FOR ALL SYSTEM RESOURCES
         M:INT    BREAK         <<>>CAPTURE BREAK CONTROL;HANDLER='BREAK'
         LW,R1    JOBX              GET TYPE OF JOB
         CI,R1    3                 IS IT BATCH?
         BNE      10IN11          ->  NO-SKIP M:SI READ
*                                     YES-IN BATCH, THE 1ST M:READ
*                                     ISSUED RETURNS THE PROCESSOR
*                                     CONTROL CARD FOR PROCESSOR OPTION
*                                   SCAN IF M:SI AND M:C ASSIGNMENTS ARE
*                                   THE SAME.
         M:OPEN   M:C,(TEST)
         M:OPEN   M:SI,(TEST)
         LW,R0    M:C+1             IS M:SI ASSIGNMENT THE SAME AS M:C
         CW,R0    M:SI+1
         BNE      10IN11            NO, HENCE WONT BE PROCESSOR CONTROL CMND.
         LBAL%,SR4 READSI,CBUFBSZ,COMMAND,0 >>READ THE PROCESSOR
*                                   C.C. AND FORGET IT.
*
*
*                 THERE ARE CERTAIN SECTIONS OF CODE FOR WHICH IT
*        IS DESIRABLE THAT NO INTERRUPTION OCCUR. WHEN THESE SECTIONS
*        ARE ENTERED, THE BREAK HANDLER IS CHANGED TO 'BREAK3'. IF A
*        BREAK OCCURS DURING THESE SECTIONS, AND IF NO BREAK IS
*        ACTIVE, A FLAG (SFLG) IS SET TO SIGNAL A DELAYED BREAK AND
*        A TRAP RETURN TO THE INTERRUPTED POINT IS EFFECTED. AS
*        THE SECTION OF CODE IS LEFT, A BAL TO 'BREAK5' IS EXECUTED.
*        HERE A CHECK IS MADE TO SEE IF A DELAYED BREAK IS PENDING. IF
*        SO, THE USER'S TCB STACK IS PUSHED WITH A SIMULATED BREAK
*        ENVIRONMENT, A BREAK IS SET ACTIVE, THE DELAYED BREAK FLAG
*        IS RESET, AND PROCESSING CONTINUES AS IN THE CASE OF A
*        NORMAL BREAK. IF A PROCEED COMMAND IS LATER INPUT, RETURN
*        IS MADE TO THE LOCATION AFTER THE BAL TO 'BREAK5'.
10IN11   EQU      %                 ALL USER ENTRY CHECKS PASSED;
         TYPE     ' CONTROL HERE' <<INITIALIZATION COMPLETE
         B        STAR            >>GO TO COMMAND LOOP
*
         PAGE
*
***********************************
*  11.   'BREAK' - BREAK CONTROL  *
***********************************
*
*
*  DESCRIPTION:         EXECUTION OF THIS ROUTINE IS PREDICATED  UPON
*                       THE USER (IF GHOST) DEPRESSING THE CONSOLE
*        INTERRUPT BUTTON OR, (IF ON-LINE TERMINAL) DEPRESSING THE
*        TERMINAL BREAK KEY. PRIME USES OF THIS FEATURE ARE AS FOLLOWS:
*
*        1.       USER IS AT THE PARTITION CONTROL COMMAND LEVEL AND
*                 WISHES TO 'BREAK OUT' TO CHANGE OR DISPLAY A SYSTEM
*                 PARAMETER(S) WITHOUT DISTURBING THE INFORMATION THUS
*                 FAR KEYED INTO THE PARTITION ATTRIBUTE BUFFER.
*
*        2.       USER IS DISPLAYING A GROUP OF SYSTEM PARAMETERS WITH
*                 THE 'CONTROL' OR 'CONTROL!' KEY-INS AND WISHES TO
*                 INTERRUPT THE DISPLAY TO CHANGE A SYSTEM PARAMETER(S).
*
*        NOTE1:   ONLY ONE BREAK MAY BE ACTIVE AT A TIME. ALL ADDITIONAL
*                 BREAKS ARE IGNORED BY CONTROL.
*
*        A DISCUSSION OF RETURN TO THE INTERRUPTED ROUTINE MAY BE FOUND
*        UNDER THE 'PROCEED' COMMAND.
*
*
*  FUNCTION:            THE IN-CORE TRACE CELL IS SET TO ' F' INDICATING
*                       BREAK CONTROL EXECUTION. THE TEMP STACK POINTER
*        DOUBLEWORD ADDRESS AND STACK PSD ADDRESS ARE SAVED FOR POSSIBLE
*        FUTURE REFERRENCE IN THE 'QUIT' AND 'PROCEED' COMMAND HANDLERS.
*        IF BREAK STATUS IS ALREADY TRUE, THE ENVIRONMENT FROM THIS
*        BREAK IS 'FORGOTTEN' (STACK POINTER MODIFIED) AND NO ACTION
*        IS TAKEN (UNLESS MSP CAUSES A STACK UNDERFLOW) EXCEPT TO RETURN
*        USER TO COMMAND LOOP. IF BREAK STATUS IS FALSE, BREAK STATUS
*        IS SET TRUE AND A MESSAGE IS SENT TO THE USER. CONTROL PROCEEDS
*        TO COMMAND LOOP.
*
*        NOTE2:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY              INTERNAL            EXIT
*        -----              --------            ----
*        R0=SPD ADR         R0-R2=WORK          R0-R3 VOLATILE
*        R1=STK PSD ADR     R3=WORK             R4-R7,SR1-SR4,D1-D4
*                                               PRESERVED
*
*
BREAK    EQU      %
         LI,R2    C' F'             ' F' IS TRACE CODE FOR BREAK CONTROL
         STH,R2   ICTRACE           HANDLER EXECUTION.
         LI,R3    -1                GET 'BREAK' CODE
         XW,R3    BFLG              IS BREAK FLAG ALREADY SET?
         BGEZ     BREAK1          ->  NO - SET & TYPE ACKNOWLEDGEMENT
*                                     YES - IGNORE LAST BREAK
         M:TRTN                   **IN EFFECT, THIS OPERATION RESTORES
*                                   STACK TO PRE-BREAK CONFIGURATION
*                                   THUS IGNORING THE BREAK.
*                                   RETURN CAN BE EFFECTED WITHOUT
*                                   ASKING FOR BREAK CONTROL BECAUSE
*                                   ADDITIONAL BREAKS WILL PRODUCE
*                                   NO RESPONSE ANYWAY. BREAK CONTROL
*                                   WILL PROBABLY BE REGAINED IN
*                                   READSI, QUIT, OR PROCEED.
*        B        INTERRUPTED ROUTINE
BREAK1   EQU      %                 PREVIOUS BREAK NOT IN EFFECT
         STW,R1   PSDW0P            STORE PSD WD 0 ADR
*                                   FROM TCB STACK.
*                                   SAVE 'CONSUB' RE-ENTRANT DATA
         LI,R1    -CS:RED:SIZE      GET NEGATV REENTRANT DATA WD CNT
         LW,R0    CSEND:CONSUB:DATA,R1 <- LOAD NXT DATA WORD
         PSW,R0   *SPDADR           PUSH IT INTO STACK
         BIR,R1   %-2             ->ALL DATA WORDS PUSHED?
*                                     YES-PUSH CURR CONTROL DISP LIST
         LI,R1    -RED:CONTROL:SIZE GET NEGATV RE-ENTRANT DATA WD CNT
         LW,R0    CSEND:CONTROL:DATA,R1 <-LOAD NXT DATA WD
         PSW,R0   *SPDADR           PUSH IT INTO STACK
         BIR,R1   %-2             ->ARE ALL DATA WDS PUSHED?
         TYPE     ' BREAK! CONTROL HERE' ACKNOWLEDGE BREAK
         M:INT    BREAK             ASSURE NORMAL BREAK ROUTINE
         B        STAR            >>GET NEW COMMAND
*
BREAK3   EQU      %                 E.P. TO SIGNAL BREAK , BUT DELAY
*                                   ACTUAL INTERRUPT TIL LATER.
         MTW,0    BFLG          **  IS BREAK ALREADY ACTIVE?
         BLZ      BREAK4          ->  YES-DON'T SET SKIP FLAG
         LI,R0    -1                  NO-GET BREAK SKIP FLAG
         STW,R0   SFLG              STORE IT
BREAK4   M:TRTN                 <-**IGNORE BREAK FOR NOW AND
*                                   RETURN TO WHATEVER WAS HAPPENING
*                                   THAT WE DIDN'T WANT TO BREAK OUT.
BREAK5   EQU      %                 E.P. TO TEST IF A BREAK DID OCCUR
*                                   WHILE BREAKS WERE INHIBITED.
         MTW,0    SFLG          <<  DID A BREAK OCCUR DURING
*                                   INHIBIT?
         BLZ      BREAK7          ->  YES-SIGH* MORE WORK
         M:INT    BREAK           **  NO-RESET BREAK CONTROL TO
*                                     NORMAL ROUTINE.
BREAK6   B        *SR4          **>>RETURN
*                                   BREAK DID OCCUR DURING INHIBIT
BREAK7   LCI      4               ->THIS IS TRICKY
         PSM,R0   *SPDADR           PUSH 4 INTO USER TCB STK
         LW,R3    *SPDADR           GET PTR TO LAST WD PUSHED
         LI,R2    0                 GET ZERO
         STW,R2   -3,R3             STORE IN 1ST WD OF ENVIRONMENT
         SCS,R3   -1                POSITION REG FOR CNT
         SCS,R3   1                 COUNT THE BIT;WHAT WAS STK PTR?
         BEV      BREAK8          ->  ORIGINAL TOP OF STK EVEN
         LI,R2    -1                  ORIGINAL TOP OF STK ODD
         STW,R2   -2,R3             STORE FILLER WORD FOR ODD STK
         LCI      2
         PLM,R2   *SPDADR           PULL BACK TO PSD LOC
         B        BREAK9          ->CONTINUE
BREAK8   LCI      3             <-  EVEN STK
         PLM,R1   *SPDADR           PULL BACK TO PSD LOC
BREAK9   EQU      %                 COMMON CONTINUATION FOR ODD AND
*                                   EVEN STKS.
         LCI      0
         PSM,D3   *SPDADR           ALLOW 2 WDS FOR PSD
         LCI      2
         PSM,D3   *SPDADR           GET LAST 2 REGS
         LW,R1    *SPDADR           GET PTR TO TOP OF STK
         AI,R1    -17               FIND PSD LOC IN STK
         LD,R2    BPSD              GET NEW PSD FOR CONTINUATION
*                                   LATER.
         STD,R2   *R1               STORE AT PSD LOC
         LI,R0    -1                GET BREAK 'TRAP' FLAG
         PSW,R0   *SPDADR           PUSH-LAST WD USER ENVIRONMENT
         STW,R0   BFLG              SET BREAK FLAG ACTIVE
         LI,R0    0
         STW,R0   SFLG              RESET BREAK CONTROL AT 'BREAK'
         B        BREAK1        **->PROCESS DELAYED BREAK
*
         PAGE
*
*********************************
*  12.   'STAR' - COMMAND LOOP  *
*********************************
*
*  DESCRIPTION:   AFTER EACH COMMAND IS COMPLETED, 'CONTROL' RETURNS
*                 HERE. A PROMPT IS ISSUED FOR THE NEXT COMMAND AND
*        APPROPRIATE VARIABLES AND BUFFERS ARE RESET OR CLEARED. THE
*        COMMAND IS SCANNED FOR AN '='. IF IT IS FOUND, EXECUTION IS
*        PASSED TO THE 'SET' COMMAND HANDLER. IF THE COMMAND DOES NOT
*        CONTAIN AND '=', THE FIRST CHARACTER OR CHARACTERS OF THE COM-
*        MAND ARE USED TO BRANCH TO THE APPROPRIATE COMMAND HANDLER.
*
*        NOTE1:  ON ENTRY TO 'STAR', ALL REGISTERS ARE CONSIDERED
*        VOLATILE AND THEIR CONTENTS ARE NOT CRITICAL OR ACCESSED.
*
*        NOTE2:  REGISTER USE IS AS FOLLOWS:
*        ENTRY               INTERNAL                EXIT
*        -----               --------                ----
*        0-15 VOLATILE       R0=WORK                 R3=BYTE INDEX
*                            R1-R3=WORK;PARAMETER
*                            R8=PARAMETER (FROM READSI)
*                            R9=PARAMETER (TO READSI)
*                            R11=RETURN LINK
*
STAR,12STAR EQU %
         LI,R0    C' E'             ' E' IS TRACE CODE FOR COMMAND LOOP
         STH,R0   ICTRACE           STORE IT
         LI,D4    STAR          <<  RETURN LINK FOR OPEN-ENDED SUBRS
         LBAL%,SR4 SETPROMPT,,,'-'
12STAR0  LI,R0    0                 ZERO OUTPUT BUFFER MESSAGE LENGTH
         STW,R0   OBUFX
         LI,R2    CBUFWSZ/2         GET # DOUBLEWORDS IN CMD BUF
         LD,R0    BLANK             BLANK COMMAND BUFFER
         STD,R0   COMMAND-2,R2  <-
         BDR,R2   %-1             ->
         LI,R8    CBUFBSZ           BYTE LENGTH LONGEST INPUT CMND
*                                   LONGEST='READ FID' (5+32 BYTES)
         LI,R9    COMMAND           GET ADR OF COMMAND BUFFER
         LI,R10   0                 NO PRESCAN UNTIL OUTPUT  TEST
         BAL,R11  READSI          >>GET INPUT LINE & RETURN POINTER
         CI,R8    0             <<  (R8)=INDEX TO LAST INPUT MESSAGE
*                                   CHAR; NOT X'15',X'0D', OR X'40'.
         BL       12STAR0         ->IF DELIMITER ONLY, RE-PROMPT
         AI,R8    1                 (R8)=LENGTH OF MESSAGE
         STW,R8   IMCNT             SAVE COMMAND BYTE LENGTH
         M:DEVICE M:SI,(CORRES,M:LO) **IS SI DEVICE=LO DEVICE?
         CI,SR1   1
         BE       12STAR1         ->  YES-DON'T ECHO M:SI ON M:LO
         LBAL%,R7 BOUTX,,1,BA(COMMAND),(W,IMCNT)  <->>  NO-OUTPUT
*                                                       INPUT CMD.
12STAR1  LBAL%,SR4 PRESCAN,(W,IMCNT),COMMAND,DELIMS <<>>PACK INPUT CMD
         AI,SR1   1             <<  INDEX --> BYTE CNT
         STW,SR1  IMCNT             SAVE COMMAND PACKED BYTE CNT
         LW,R3    IMCNT             R3=# BYTES IN CMD
*                                   TEST FOR PARAMETER VALUE CHANGE
         LI,R0    C'='              GET'=' FOR BYTE-BY-BYTE COMPARE
12STAR2  EQU      %                 'SET' CMD IDENTIFICATION ROUTINE
         BDR,R3   %+2           <-->DECREMENT COMMAND BYTE INDEX
         B        13SW1             (R3) IMPORTANT ONLY IF '=' FOUND
*                                   GO IDENTIFY COMMAND
         CB,R0    COMMAND,R3        IS BYTE AN '='?
         BNE      12STAR2         ->  NO - DECREMENT AND COMPARE NEXT
*                                   IT IS A SET COMMAND
         LW,R0    USRPRIV           GET USER PRIVILEGE LEVEL
         CI,R0    3                 IS IT >= C0
         BGE      33SET             B, IF SO; ALLOW SET COMMAND
*                                   R3=NON-VOLATILE INDEX TO '='
         TYPE     ' LIMIT CHANGE REQUIRES AT LEAST PRIVILEGE C0'
         B        12STAR            CONTROL PROMPT
         PAGE
*
***************************************
*  13.   'SWITCH' - IDENTIFY COMMAND  *
***************************************
*
*
*  DESCRIPTION:   THE PURPOSE OF 'SWITCH' IS TO IDENTIFY THE COMMAND
*                 AND DIRECTLY BRANCH TO THE APPROPRIATE COMMAND HANDLER.
*        THIS IS ACCOMPLISHED BY COMPARING THE FIRST HW OF THE INPUT
*        STRING IN COMMAND WITH THE FIRST LETTERS OF THE STANDARD SET OF
*        COMMAND NAME RECOGNIZED BY CONTROL. THE TABLE 'CMDS' CONTAINS
*        A LIST OF ALL CURRENTLY RECOGNIZABLE COMMAND AND THE ENTRY
*        OF THE COMMAND IN THIS TABLE DETERMINES THE BRANCH WHICH
*        IS TAKEN IN THE PARALLEL BRANCH VECTOR TABLE.
*        A 2-BYTE COMPARISON IS MADE TO DISTINGUISH IT FROM 'PARTITION'.
*
*
*        NOTE1: REGISTER USE IS AS FOLLOWS:
*
*        ENTRY               INTERNAL                EXIT
*        -----               --------                ----
*        NO SIGNIFICANT      R0=WORK                 R15=RETURN LINK
*        DATA IN REGS        R1-R2=WORK;PARAMETER
*                            SR4=LINK TO ITEMFIND
*
13SW1    EQU      %                 ENTRY POINT TO DECIPHER COMMAND
         LBAL%,SR4 SETPROMPT,,,'>'
         LBAL%,SR4  ITEMFIND,(W,AT1DATA),(W,CMDATA)  >>GET ENTRY #
         B        13SWG1            NOT FND,SEE IF GERM ITEM
         LI,R1    0                 FOUND,INDICATE NOT GERM
         STW,R1   GERMWORD
         PSW,SR3  *SPDADR       <<  SAVE ENTRY NUMBER
         B        24DCON          >>DISPLAY A CONTROL PARAMETER
13SW2    EQU      %             <-  NOT AN ITEM NAME; IS IT CMD?
         LW,R2    COMMAND           GET 1ST TWO BYTES OF COMMAND
         SAS,R2   -16               SHIFT FOR COMAPRE (NOSIGN EXT)
         LI,R1    0                 INITIALIZE 'CMDS' TBL INDEX
13SW3    AI,R1    1                 INCREMENT INDEX
         CH,R2    CMDS,R1           IS INPUT LINE A CMD?
         BE       13SW5,R1        ->  YES-GO TO HANDLER
         CI,R1    #CMDS               NO-ARE WE DONE?
         BL       13SW3               NO-TRY NEXT CMD
         SLS,R2   -8                  YES-RIGHT-JUST CMD 1ST BYTE
         CI,R2    C'*'              IS IT A COMMAND?
         BE       12STAR          ->  YES-GET NEXT CMD
         B        13SW6           ->  NO-ERROR MSGE
*
13SWG1   EQU      %
         LW,R5    IMCNT             BYTE CNT OF COMMAND TO BE SEARCHED
         STB,R5   SR2
         BAL,SR4  GERMFIND          FIND GERM ITEM
         B        24DCON            GO DISPLAY GERM ITEM
         B        13SW2             NO,NOW SEE IF COMMAND
*
13SW5    EQU      %          ENTRY# COMMAND HANDLER BRANCH VECTOR TBL
         B        12STAR     ------ NULL ENTRY
         B        28PRO        1    'PROCEED'
         B        21ADD        2    'ADD'
         B        22DROP       3    'DROP'
         B        24DMC1       4    'CONTROL','CONTROL*BANG'
         B        25EXIT       5    'END'
         B        26LST1       6    'LIST'
         B        PART         7    'PARTITION'
         B        29QUIT       8    'QUIT'
         B        31SL1        9    'SLEEP'
         B        32TI1       10    'TIME'
*        B        23BU1       11    'BUILD' *FOR FUTURE USE*
*        B        30RE1       12    'READ' *FOR FUTURE USE*
*
         ERROR,X'F',(%-1-13SW5)~=#CMDS  TBLNTP
*
*
13SW6,ERMS1 TYPE ' ILLEGAL COMMAND'
         B        STAR            >>GO TO COMMAND LOOP
*
         PAGE
*
****************************
*  20.   COMMAND HANDLERS  *
****************************
*
*
*  DESCRIPTION:   IN THIS SECTION ARE GROUPED ALL THE 'CONTROL' COMMAND
*                 HANDLERS EXPCEPT FOR 'PARTITION' WHICH IS CONTAINED
*        IN ITS OWN MODULE, 'PART'. A LIST OF VALID COMMANDS TREATED
*        HERE WITH THE SEQUENCE NUMBERS IN WHICH THEY APPEAR FOLLOWS:
*
*        1.   ADD                   7.   PARTITION (SEE 'PART' MODULE)
*        2.   DROP                  8.   PROCEED
*        3.   BUILD (SEE NOTE1)     9.   QUIT
*        4.   CONTROL/CONTROL*BANG 10.   READ (SEE NOTE1)
*        5.   END                  11.   SLEEP (SEE NOTE1)
*        6.   LIST                 12.   TIME
*                      13.   'SET' (SEE NOTE3)
*
*        NOTE1:   THIS COMMAND HAS NOT YET BEEN IMPLEMENTED.
*
*        NOTE2:   MOST COMMAND HANDLERS ARE OPEN-ENDED SUBROUTINES
*                 AND RETURN ON D4. SECOND LEVEL SUBROUTINES ARE
*                 LINKED BY SR4 OR R7, AND R3 SERVES AS THE
*                 ENTRY NUMBER OF THE ITEM NAME IN THE ATERM1 TABLE.
*
*        NOTE3:   THE 'SET' COMMAND SYNTAX IS 'SYSTEM PARAMETER'=NN,
*                 WHERE NN IS SOME NUMBERICAL VALUE. 'SET' IS THE NAME
*                 GIVEN TO THIS COMMAND AS THERE IS NO KEYWORD 'SET'
*                 IN THE COMMAND ITSELF.
         PAGE
*
***************************************************
*        'ADD' & 'DROP' - ADD/DROP DISPLAY ITEMS  *
***************************************************
*
*
*  DESCRIPTION:   'ADD' ADDS ITEM TO A DISPLAY LIST BY ENTERING
*                 THEIR INDICES FROM AN ITEM TABLE INTO A DISPLAY TABLE.
*        'ADD' ALLOWS THE USER TO SPECIFY WHICH CONTROL ITEMS WILL
*        BE DISPLAYED BY THE 'CONTROL' COMMAND AND IN WHAT ORDER THEY
*        WILL BE DISPLAYED. WHEN THE 'ADD' COMMAND IS ISSUED, IF NO
*        ENTRIES EXIST IN THE DISPLAY TABLE (A BYTE TABLE), THEN NO
*        CONTROL ITEMS ARE FLAGGED FOR PRINTING AND THE TABLE IS GOING
*        TO BE SET UP FROM SCRATCH. A ZERO SHOULD BE IN ENTRY 1
*        (FIRST BYTE OF THE TABLE) INDICATING NO ENTRIES BEYOND THIS
*        POINT. AS THE INDICES OF THE CONTROL ITEMS ARE ENTERED
*        BY THE 'ADD' COMMAND, THEIR PRINT FLAGS ARE TURNED ON .
*        WHEN A (CR) IS FINALLY ENTERED, A ZERO IS STORED IN THE
*        LAST ENTRY POSITION TO INDICATE NO MORE CONTROL ITEMS ARE
*        TO HAVE THEIR FLAGS SET FOR DISPLAY. AS ITEMS ARE ADDED TO
*        THE LIST, THEY WILL BE ORDERED SUBSEQUENTLY IN THE TABLE.
*        'DROP'S WILL BE HANDLED BY FINDING THE INDEX OF THE DROP
*        ITEM IN THE TABLE AND MOVING ALL FOLLOWING INDICES, INCLUDING
*        THE ZERO, DOWN ONE PLACE. THE ONLY WAY THE ORDER MAY BE
*        CHANGED, IS TO DROP ALL ATTRIBUTES AND START OVER 'ADD'ING
*        A NEW LIST, EXCEPT FOR THE CASE WHEN AN ITEM HAS PREVIOUSLY
*        BEEN SPECIFIED AND ONE WISHED TO DELETE IT AND TACK IT
*        ONTO THE END OF THE LIST.
*
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY              INTERNAL               EXIT
*        -----              --------               ----
*        D1=DISPLAY LIST    R0-R2=WORK             R4-R6,D1-D4 PRESRVD
*           ADR             R7=LINK                R0-R3,R7,SR1-SR4 VOL
*        D2=STD DISPLAY
*           LIST ADR
*        D4=RTN LINK
*        D3=ITEM LIST
*           BOUNDS
*
*
*
22DROP   EQU      %                 ENTRY POINT FOR 'DROP' COMMAND
         LI,R0    C' 2'         <<  ' 2' IS TRACE CODE FOR 'DROP'
         LI,R2    0                 GET FLAG TO INDICATE 'DROP'
         B        21ADD+2         ->SKIP 'ADD' ENTRY
21ADD    EQU      %
         LI,R0    C' 1'         <<  ' 1' IS TRACE CODE FOR 'ADD'
         LI,R2    1                 STORE TRACE CODE FOR DUMP
         STH,R0   ICTRACE       <-  ACCORDING TO THE CALLING
*                                   ROUTINE, R2 WILL BE SET TO
*                                   0 OR 1 DEPENDING ON WHETHER 'DROP'
*                                   OR 'ADD' WAS CALLED. 1 CAUSES THE
*                                   ITEM TO BE ADDED TO THE DISPLAY LIST
*                                   WHILE 0 CAUSES IT TO BE DROPPED.
         LI,D1    0
         STW,D1   GERMWORD          CLEAR ITFOR NON-GERM OR RSRCE FROM 'PART'
         STW,D1   PARTMAIN          INDICATE ENTRY FROM MAIN ROUTINE
         LI,D1    CDSTK             GET ADR OF DISPLAY LIST
         LI,D2    CBDSTK            GET ADR OF STD DISPLAY LIST
         LW,D3    AT1DATA           GET CONTROL ITEM TBL INFO FOR
*                                   'ITEMFIND'.
ADD1,21ADD0 EQU   %                 E.P. FROM OUTSIDE MODULES FOR 'ADD'
         BAL,R7   RDNAME        <<>>READ M:SI FOR ITEM NAME
         B        *D4           <<>>ERROR RETURN;NO NAME/ERROR ON READ
*                                   IF ONLY CR WAS ENTERED, RETURNS HERE
         LBAL%,SR4 ITEMFIND,(W,D3),(W,CMDATA) <<>>READ GOOD;FIND
*                                                    ITEM NAME INDEX.
         B        21ADDG1           SEE IF GERM ITEM
         LI,R0    0
         STW,0    GERMWORD          CLEAN RESIDUE GERMWORD
         LBAL%,SR4 SAD,,(W,D1)  <<>>WAS ITEM INDEX ALREADY IN TBL?
         NOP                    <<    NO-DETERMINE 'ADD' OR 'DROP'
         LI,R7    0                 INDIACTE NON-GERM
21COME   EQU      %
         CI,R2    0             <<    YES-INDEX DELETED;WAS IT 'DROP'
         BE       21ADD0          ->  YES-GET NEXT NAME
         LW,R1    SR2               ELSE, GET BYTE POINTER TO TABLE END
         EXU      21SEEG1,R7        STORE NEW ITEM INDX IN TBL
         AI,R1    1                 INCREMENT END-OF-TBL PTR
         LI,R0    0                 GET E-O-T CODE
         EXU      21SEEG2,R7        STORE IN TBL
         B        21ADD0          ->GET ANOTHER ITEM NAME
*
21ADDG1  EQU      %                 SEARCH FOR GERM ITEM
         MTW,0    PARTMAIN          SEE IF FROM 'PART
         BCS,3    21ADD1            PART; SEE IF 'ALL'
         LW,R5    IMCNT
         STB,R5   SR2
         BAL,SR4  GERMFIND
         B        21ADDG2           FOUND
         B        21ADD1            NOT FND;GERMWORD=0;SEE IF ALL
21ADDG2  EQU      %                 SEE IF GERM CODE ALREADY IN GCONSTK
         LI,SR2   GCONSTK
         LW,SR3   GERMWORD
         BAL,SR4  SAD
         NOP
         LI,R7    1                 INDICATE GERM ITEM
         B        21COME
21ADD1   EQU      %             <-  WASN'T AN ITEM NAME; WAS IT 'ALL'?
         LW,R0    COMMAND           GET FIRST WORD OF ITEM NAME
         CW,R0    L('ALL ')         IS IT 'ALL'
         BE       21ADD2          ->  YES,ENTER/DELETE ALL INDICES
         LW,R0    R2                SAVE R2 OVER TYPE
         PSW,D4   *SPDADR           SAVE BAL REG
         BAL,D4   33SET9            OUTPUT 'NO SUCH CONTROL NAME' MSG
         PLW,D4   *SPDADR           RETRIEVE BAL REG
         LW,R2    R0                RESTORE R2 OVER TYPE
         B        21ADD0            TRY AGAIN
*
21ADD2   EQU      %                 'ALL' SPECIFIED
         CI,R2    0             <-  WAS IT 'ADD'?
         BNE      21ADD3          ->  YES-COPY 'C*BANG' TBL
         STB,R2   *D1                 NO-SET E-O-T IN BYTE 0
         MTW,0    PARTMAIN          SEE IF FROM MAIN OR PART
         BCS,3    *D4               PART; ALL DONE
         STW,R2   GCONSTK           MAIN;SET E-O-T IN GERM TBL
         B        *D4             <-RETURN, CANT DO ANY MORE
21ADD3   EQU      %
         LI,R1    -1                INITIALIZE BYTE INDEX
21ADD3A  EQU      %
         AI,R1    1             <-  INCREMENT CBDSTK INDEX
         LB,R0    *D2,R1            GET BYTE FROM 'C*BANG' TBL;E-O-T?
         BEZ      21ADD4          ->  YES-QUIT
         STB,R0   *D1,R1              NO-STORE BYTE IN CONTROL
*                                     DISPLAY TABLE.
         B        21ADD3A           GO AND GET NEXT BYTE
21ADD4   STB,R0   *D1,R1        <-  MARK END-OF-TBL
         MTW,0    PARTMAIN          IF ROM PART;
         BCS,3    *D4               THEN ALL DONE
         LI,SR4   0                 NOW DO THE GERM STUFF,FILL GCONSTK
         STW,SR4  GERMBANG          WITH ALL VALID COMBN. CODE FOR 'ALL'
         BAL,SR4  GERMFILL
         B        *D4               RETURN
*
21SEEG1  STB,SR3  *D1,R1
         STW,SR3  GCONSTK,R1
21SEEG2  STB,R0   *D1,R1
         STW,R0   GCONSTK,R1
         PAGE
*
************************************************************
*  24.   'DCON' - DISPLAY SYSTEM CONTROL PARAMETER VALUES  *
************************************************************
*
*
**********************************************************************
*  24.1  'CONTROL'/'CONTROL*BANG' - DISPLAY MULTIPLE CONTROL VALUES  *
**********************************************************************
*
*
*  DESCRIPTION:   'DMCON' IS CALLED AS A RESULT OF ENTERING
*                 A 'CONTROL' OR 'CONTROL*BANG' COMMAND. A SEARCH IS
*        MADE ON THE INPUT COMMAND FIELD TO DETERMINE WHICH COMMAND
*        CAUSED THE ROUTINE TO BE ENTERED. AN EXCLAMATION MARK INDICATES
*        THAT THE COMMAND WAS 'CONTROL*BANG'. DEPENDING ON WHICH COM-
*        MAND INITIATED THE CALL, ONE OF TWO TABLES IS ACCESSED.
*        'CDBSTK' IS A BYTE TABLE CONTAINING THE 'ATERM1' ENTRY NUMBERS
*        OF ALL CONTROL PARAMETERS. 'CDSTK' IS ALSO A BYTE TABLE AND
*        IT CONTAINS THE 'ATERM1' ENTRY NUMBERS OF THOSE CONTROL ITEMS
*        WHICH HAVE BEEN 'ADD'ED TO THE CONTROL DISPLAY LIST.
*
*                 FOR EACH ENTRY NUMBER IN THE INDICATED DISPLAY LIST,
*        A SYSTEM PARAMETER IS LOADED AND STORED IN A SNAPSHOT BUFFER
*        TO INSURE THAT PARAMETERS WERE NOT CHANGED DURING THE OUTPUT
*        PROCESS.
*
*                 A HEADING IS OUTPUT WITH THE TIME OF DAY AND FOR
*        EACH ENTRY IN THE APPROPRIATE DISPLAY LIST, A TEXT SIDING
*        DESCRIBING THE PARAMETER IS OUTPUT AND THE VALUE ASSOCIATED
*        WITH IT. THE VALUES ARE OUTPUT TWO TO A LINE, DEPENDING ON THE
*        SETTING OF A FLIP-FLOP FOR OUTPUT OR NO-OUTPUT. FIVE SPACES
*        ARE PROVIDED FOR THE DISPLAY OF EACH PARAMETER VALUE. IF AN
*        OVERFLOW WOULD OCCUR DUE TO THE EBCDIC DECIMAL NUMBER BEING
*        TOO LARGE, AN OVERFLOW COUNTER IS INCREMENTED AND THE 'ATERM1'
*        ENTRY NUMBER IS PUSHED. WHEN THE DISPLAY HAS BEEN COMPLETED,
*        A MESSAGE IS OUTPUT INDICATING THAT OVERFLOW HAS OCCURRED
*        AND EACH ITEM NOT DISPLAYED IS DISPLAYED AS A SINGLE VALUE
*        BY CALLING 'DCON'.
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*        ENTRY              INTERNAL              EXIT
*        -----              --------              ----
*        D4=RTN LINK        R0-R1=WORK            R0-R7,SR1-SR4,D1
*                           R2=COMPARE BYTE       VOLATILE
*                           R3='BANG' INDX;TBLX   D2-D4 PRESERVED
*                           R4=DISPLAY TBL ADR
*                           R5=PAGE HALF FLIP-FLOP
*                           R6=ITEM INDEX
*                           R7=BAL REG
*                           SR1-SR4=SUBR REG
*                           D1=DISPLAY OVERFLOW CNT
*
*
*  24.1.1         MAIN ROUTINE TO DISPLAY CONTROL VALUES & TEXT SIDINGS
*
24DMC1   EQU      %                 E.P. FOR MULTIPLE CONTROL PARAMETER
*                                   DISPLAY ('CONTROL'/'CONTROL*BANG'
*                                   COMMANDS)../
         TRACE%   ' 4'          <<  SET IN-CORE HEADER TRACE CODE
         BAL,R7   OCTOLP            PUT BIG OUTPUT ON LP
         LI,R3    8                 INITIALIZE 'CONTROL*BANG' BYT CNT
         CW,R3    IMCNT             IS CMD ABBREVIATED?
         BLE      %+2             ->  NO-DON'T COMPARE ON GARBAGE
*                                     AFTER CMD.
         LW,R3    IMCNT               YES-DON'T COMPARE PREVIOUS GARBAGE
*                                     IN BUF.
         AI,R3    -1            <-  CONVERT BYTE CNT TO INDEX
         LI,R2    C'!'              GET AN EXCLAMATION MARK
24DMC2   CB,R2    COMMAND,R3    <-  IS BYTE='EXCLAMATION'?
         BE       24DMC4          ->  YES-CMD='CONTROL*BANG'
         BDR,R3   24DMC2          ->  NO-ARE THERE BYTE LEFT?
*                                     YES-TRY AGAIN
         LI,SR4   0
         STW,SR4  GERMBANG          NOT BANG
         LI,R4    CDSTK               NO-GET 'CONTROL' DISPLAY TBL ADR
         LB,R2    CDSTK             CK FOR PRESENCE OF TABLE ENTRIES
         BNEZ     24DMC5          ->  YES-CONTINUE
         LW,R2    GCONSTK           SEE IF ANY GERM ITEMS
         BNEZ     24DMC7            WANT HEADING
         TYPE     ' NO PRINT FLAGS SET'
         B        24DMC99         ->RETURN
*                                   'SNAP' THE SYSTEM PARAMETERS
24DMC4   EQU      %             <-  E.P. FOR 'CONTROL*BANG'
         LI,R4    CBDSTK            GET 'CONTROL*BANG' DISPLAY TBL ADR
         LI,SR4   1
         STW,SR4  GERMBANG          INDICATE IT IS CONTROL BANG
24DMC5   EQU      %             <-  E.P. FOR 'CONTROL'
         LI,R1    -1                INITIALIZE BYTE TBL INDX
24DMC6   AI,R1    1             <-  INCREMENT BYTE TBL INDX
         LB,R3    *R4,R1            ARE WE DONE?
         BEZ      24DMC7          ->  YES-OUT
         LW,R2    AVAL1,R3            NO-GET ADDRESS OF SYS PARAM
         LW,R2    *R2               SNAP SYS PARAM
         STW,R2   ANEW1,R3          SAVE IT
         B        24DMC6          ->GET NXT PARAM
24DMC7   EQU      %             <-  OUTPUT HEADER
         M:TIME   TIMEBUF         **GET CURRENT TIME
         LBAL%,SR4 NEWLN,1      **>>SPACE DOWN A LINE
         LBAL%,R7 APEND,,,AT14      APPEND 'CP-V SYS CNTRL PARAMS AT'
         LBAL%,R7 BOUTX,,1,BA(TIMEBUF),16 <<>>OUTPUT TIME,DATE
         LBAL%,R7 BOUT,,,AT15   <<>>UNDERLINE DATE/TIME MSGE
         LI,R5    0             <<  INITIALIZE PRINT/NO PRINT
*                                   FLIP-FLOP.
         LI,D1    0                 INITIALIZE DISPLAY OVERFLOW CNT
         LI,R3    -1                INITIALIZE PARAM HEADER PTR
24DMC8   EQU      %                 OUTPUT SYS PARAMS,2 TO A LINE
         AI,R3    1             <-  INCREMENT PARAM HEADER PTR
         LB,R6    *R4,R3            ARE WE DONE?
         BEZ      24DMC12         ->  YES-OUT
         CI,R5    0                   NO-ARE WE PRINTING RIGHT HALF
*                                     OF PAGE?
         BE       24DMC8A           B, IF NOT; SKIP BLANKS
         LBAL%,SR4 SPACE,3        >>  YES-SPACE OVER 3 BLANKS
24DMC8A  EQU      %
         LI,SR3   X'FFFF'           MASK FOR MONITOR ADR OF PARAMETER
         AND,SR3  AVAL1,X6          CK FOR PARAM DEFINED IN THIS SYSTEM
         BNEZ     24DMC9            B, IF DEFINED; APPEND DESCRIPTION
         LBAL%,R7 APEND,,,WA(NOTGENED)  APPEND 'NOT GEN''ED FOR' MSG
         LI,SR3   ATERM1            GET POINTER TO PARAMETER TEXT NAMES
         AW,SR3   R6
         AW,SR3   R6                NOW IT'S A WORD ADDRESS
         SLS,SR3  2                 NOW MAKE IT A BYTE ADDRESS
         LI,SR4   6                 WILL OUTPUT 6 BYTES OF THE NAME
         B        24DMC10B          FINISH UP THE OUTPUT LINE
24DMC9   LBAL%,R7 APEND,,,(W,ATEXT1,R6) <-<<>>APPEND DESCRIPTION
         LW,SR2   ANEW1,R6          GET SYS PARAM
         CW,SR2   BLANK             CK FOR BLANK LINE OUTPUT
         BNE      24DMC9A           B, IF NOT; SCALE INPUT
         LI,SR3   BLANK             ELSE, LOAD SR3 WITH ADR OF BLANKS
         LI,SR4   5                 5 BLANKS INSTEAD OF EBCDIC DECIMAL
         B        24DMC10A          APPEND MORE BLANKS TO THE BLANKS
24DMC9A  EQU      %
         AND,SR2  STSMSK,R6         EXTRACT INPUT VALUE FROM WORD
         LBAL%,SR4 33SCIN,(W,ASCAL1,R6)  SCALE INPUT VALUE
*                                   PARAM FOR DISPLAY.
         LBAL%,SR4 DECOUT,(W,SR2) <<>>CONVERT BIN TO DEC
         LB,SR1   *SR3          <<  GET DECIMAL BYTE CNT
         CI,SR1   5                 IS DEC BYTE CNT>5?
         BG       24DMC80         ->  YES-GO TO DISPLAY OVERFLOW RTNE
         BE       24DMC10         ->  NO-IS DEC FIELD FILLED?
*                                     YES-DON'T BLANK-FILL
         AI,SR1   -5                  NO-CALCULATE # SPACES TO BLNK FILL
         LCW,SR1  SR1               MAKE IT POSITIVE
         LBAL%,SR4 SPACE          >>INSERT BLANKS
24DMC10  EQU      %
         LB,SR4   *SR3              GET BYTE COUNT OF STRING
24DMC10A EQU      %
         SLS,SR3  2                 CONVERT WA TO BA
         AI,SR3   1                 CALCULATE BA(1ST BYTE OF STR)
24DMC10B EQU      %
         LBAL%,R7 BOUTX,,(W,R5)   >>APPEND DECIMAL# & OUTPUT/DON'T
*                                   OUTPUT.
24DMC11  EQU      %                 CONTROL VALUE & DESCRIPTION PRINTED
         LCW,R5   R5          <-<<  REVERSE PRINT/NO PRINT FLIP-FLOP
         AI,R5    1                 R5=.NOT.R5
         B        24DMC8          ->FIND ANOTHER PRINT PARAMETER
*
24DMC12  EQU      %                 WE'RE DONE;ATERM1 LIST EXHAUSTED
         CI,R5    0             <-  WAS LAST PARAMETER OUTPUT?
         BE       24DMC14         ->  YES-SKIP OUTPUT
         LBAL%,R7 SEND            >>  NO-OUTPUT LAST PARAM ON 1ST
*                                   HALF OF PAGE.
24DMC14  CI,D1    0             <<  WAS THERE DISPLAY OVERFLOW?
         BG       24DMC82         ->  YES-OUTPUT OVERFLOWED VALUES
         B        24GCON1
*
24GCON1  EQU      %                 NOW PROCESS GERM ITEMS
         MTW,0    GERMBANG
         BCS,3    24GBN1            GO BANG
         LW,R7    GCONSTK           SEE IF ANY GERM ITEM AT ALL
         BEZ      24DMC99           N0-RETURN
         LI,R1    -1                TO INSURE GERM ITEMS WERE NOT CHNGD
24GCON2  AI,R1    1                 DURING OUTPUT,SNAP THEM
         LW,R3    GCONSTK,R1
         BEZ      24GOUT            NOW OUTPUT FOR CONTROL
         STW,R3   GERMWORD
         LI,SR2   0                 GET VALUE
         LI,SR1   0                 GET ASSOCIATED VALUE
         BAL,SR4  GTSTVAL
         STW,SR1  GCONVAL,R1        VALUE IN SR1
         B        24GCON2           MORE
24GBN1   EQU      %
         BAL,SR4  GERMFILL          FILL GCONVAL WITH ALL VALUE
24GOUT   EQU      %
         LI,R5    0                 FOR PRINT/NOT PRINT
         LI,R1    -1                INDX FOR GCONVAL(NON-BANG,SAME GCONSTK)
         MTW,0    GERMBANG
         BCR,3    24GOUT1
*NOW DO THE OUTPUT FOR GERM ITEMS FOR CONTROL BANG
         LI,R2    -1                INDX INTO GTEXTBL TBL
24GBN2   EQU      %
         LI,R3    0                 FOR NAME VARIATIONS
         AI,R2    1
         CI,R2    #DECTBL
         BE       24GBN5            ALL DONE
         LW,R0    GDECTBL,R2        GET GERMCLS CODE
         LH,R7    R0
         EXU      24GBN11,R7
24GBN3   AI,R3    1
         CW,R3    SR1
         BE       24GBN2
         AI,R1    1
         STB,R3   R0
         STW,R0   GERMWORD
24GBN4   BAL,SR4  GOUTRTN           GO OUTPUT GERM ITEM
         LCW,R5   R5
         AI,R5    1
         MTW,0    GERMBANG
         BCR,3    24GOUT1           JUST CONTROL
         B        24GBN3
24GBN11  EQU      %-1
         LI,SR1   SV:RSIZ+1
         LI,SR1   SV:LIM+1
         LI,SR1   SV:FTYM+1         NUM OF SYM + NUM OF FAUTH
24GBN5   CI,R5    0
         BE       24DMC99
         LBAL%,R7 SEND
         B        24DMC99
*
24GOUT1  EQU      %                 FOR CONTROL DISPLAY
         AI,R1    1
         LW,R0    GCONSTK,1
         BEZ      24GBN5            ALL DONE
         STW,R0   GERMWORD          PREPARE
         LI,R2    0
         STB,R2   R0                DONT NEED NAMEPOS
         LI,R2    -1
24GOUT2  AI,R2    1                 DETERMINE R2 AS THE INDX
         CI,R2    #DECTBL            INTO GTEXTBL TO FACILITATE
         BE       24ERROR
         CW,R0    GDECTBL,R2         THE HEADING OUTPUT
         BNE      24GOUT2
         B        24GBN4
*
24ERROR  TYPE     'ERROR: CONTROL DISPLAY'
         M:ERR
*
*  24.1.2         SUBROUTINES
*
24DMC80  EQU      %                 DISPLAY OVER FLOW PUSH ROUTINE
         AI,D1    1             <-  INCREMENT DISPLAY OVER FLOW CNT
         PSW,R6   *SPDADR           SAVE ITEM INDEX FOR LATER DISPLAY
         LBAL%,R7 BOUTX,,(W,R5),BA(AT13),5 >>OUTPUT '*****' FOR DEC#
         B        24DMC11       <<->RETURN
*
24DMC82  EQU      %                 DISPLAY OVERFLOW PULL ROUTINE
         LBAL%,SR4 NEWLN,1      <-..SKIP A LINE
         TYPE     9WAR3         <<  OUTPUT '***==>NUMERIC
*                                   DISPLAY OVERFLOW'
         STW,D4   D3                SAVE RETURN ADR
24DMC83  EQU      %
         PLW,R3   *SPDADR           GET ENTRY # OF NAME
         LBAL%,R7 APEND,,,(W,ATEXT1,R3) <-<<>>APPEND DESCRIPTION
         BAL,D4   24DCON1         >>OUTPUT CONTROL VALUE;ARE THERE MORE?
         BDR,D1   24DMC83       <<    YES-REPEAT
         LW,D4    D3                  NO-RESTORE RETURN LINK
         B        24GCON1           GO PROCESS GERM ITEMS
*
24DMC99  EQU      %                 COMMON EXIT PT FOR CONTROL PARAMS
*                                   DISPLAY.
         BAL,R7   LPTOOC            PUT LITTLE OUTPUT ON OC IF GHOST
         B        *D4           <->>RETURN
*
         PAGE
*
***************************************************
*  24.5  'DCON' - DISPLAY A SINGLE CONTROL VALUE  *
***************************************************
*
*
*  DESCRIPTION:   'CONTROL' PULLS AN ITEM INDEX NUMBER FROM THE TCB
*                 STACK AND OUTPUTS THE VALUE FROM THE DATA CELL
*        INDICATED BY THAT ITEM INDEX. IN LEVEL 2 TESTING, A CHECK
*        IS MADE TO ASCERTAIN THAT THE CORRECT DATA CELL IS BEING
*        ACCESSED FOR THE ITEM INDICATED. THIS IS DONE BY COMPARING THE
*        CHECK-CODE FROM THE DATA CELL, IF ANY, TO A PARALLEL ENTRY IN
*        A TABLE OF CHECK-CODES ('CKCDS'). IF THE CODE DOES NOT
*        MATCH, AN ERROR OCCURS. IF THE ITEM REQUIRES SCALING, IT
*        IS MULTIPLED BY THE SCALING FACTOR BEFORE OUTPUT (E.G. THE
*        ITEM WOULD BE DOUBLED IF CONVERSION WERE CORE PAGES -->
*        1K CORE INCREMENTS).
*
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY             INTERNAL             EXIT
*        -----             --------             ----
*        D4=RTN LINK       R0-R2=WORK           R0-R3,R7,SR1-SR4
*                          R3=ENTRY # OF NAME   VOLATILE
*                          R7=RETURN SUBR LINK  R4-R6,D1-D4 PRESERVED
*                          R8-R9=MULTIPLY REGS
*
*
24DCON   EQU      %                 ENTRY POINT FOR DISPLAY OF SINGLE
*                                   CONTROL PARAMETER.
         TRACE%   ' 4'          <<  GET TRACE-CODE FOR 'DCON'
         LBAL%,SR4 SPACE,1          START OUT BUF WITH A BLANK
         MTW,0    GERMWORD          SEE IF GERM ITEM
         BNEZ     24DCONA           B, IF NOT; GO APPEND ITEM NAME
         PLW,R3   *SPDADR           GET ENTRY # OF NAME
         LI,SR3   X'FFFF'           MASK FOR MONITOR ADR OF PARAMETER
         AND,SR3  AVAL1,X3          CK FOR PARAM DEFINED IN THIS SYSTEM
         BEZ      33SET9A           B, IF NOT; OUTPUT 'NOT GEN''ED' MSG
24DCONA  EQU      %
         LBAL%,R7 BOUTX,,0,BA(COMMAND),(W,IMCNT)  >>APPEND ITEM NAME
*                                   TO OUTPUT BUFFER
         LBAL%,R7 APEND,,,C29   <<>>APPEND '=' TO OUT BUF
24DCON1  EQU      %
         MTW,0    GERMWORD
         BNEZ     24DGERM           GO DISPLAY GERM ITEM
         LW,R1    AVAL1,R3      <<  R1=ADR OF CONTROL PARAM
         LW,R9    0,R1              R9=VALUE OF CONTROL PARAM
         AND,R9   STSMSK,R3         EXTRACT VALUE FROM WORD
         LBAL%,SR4 33SCIN,(W,ASCAL1,R3)  SCALE THE PARAM FOR DISPLAY
         LBAL%,SR4 DECOUT,(W,R9) <<>>CONVERT BIN# TO EBCDIC DEC
         LBAL%,R7 BOUT          <<>>APPEND DECIMAL# AND OUTPUT LINE
         B        *D4           <<>>RETURN TO MAIN LOOP
*
24DGERM  EQU      %
         LI,SR2   0                 GET A VALUE
         LI,SR1   0                 GET AN ASSOCIATED VALUE
         BAL,SR4  GTSTVAL           OUTPUT IN SR1
         BAL,SR4  DECOUT            CONVERT
         BAL,R7   BOUT
         B        *D4
         PAGE
*
********************************
*  25.   'END' - EXIT CONTROL  *
********************************
*
*
*
25EXIT   EQU      %
         TRACE%   ' 5'              STORE TRACE-CODE
         LI,R8    M:SI              GET DCB ADDRESS
         BAL,R11  CLOSE           >>CLOSE AND SAVE M:SI, IF OPEN
         LI,R8    M:DO          <<  GET DCB ADDRESS
         BAL,R11  CLOSE           >>CLOSE AND SAVE, IF OPEN
         LI,R8    M:LO          <<  GET DCB ADDRESS
         BAL,R11  CLOSE           >>CLOSE AND SAVE M:LO, IF OPEN
         M:EXIT                 ****IT'S ALL OVER
*
         PAGE
*
********************************************************
*  26.   'LIST' - LIST ALL PARAMETERS IN DISPLAY LIST  *
********************************************************
*
*
*  DESCRIPTION:   'LIST' EXAMINES THE DISPLAY LIST 'CDSTK' FOR ITEM
*                 INDICES. IT DOES A BOTTOM-UP, FIRST-IN/FIRST-OUT
*        SEARCH ON THE BYTE TABLE. AS IT FINDS AN INDEX, THE
*        CORRESPONDING CONTROL ITEM NAME IS OUTPUT. THE TABLE IS
*        SCANNED UNTIL A BYTE VALUE OF ZERO IS FOUND AT WHICH POINT
*        'LIST' RETURNS CONTROL TO THE CALLING ROUTINE.
*
*
*
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY            INTERNAL             EXIT
*        -----            --------             ----
*        D4=RTN LINK      R0=WORK REG          R0-R1,R3-R4,R7,SR1-SR4
*                         R3=DISPLAY TBL INDX  VOLATILE
*                         R4=CONTROL ITEM      R2,R5-R6,D1-D4
*                         R7=BAL REG           PRESERVED
*                         SR1=# BLANKS
*                         SR2=OUTPUT FLAG
*                         SR3=BA(ITEM)
*                         SR4=ITEM BYTE CNT
*                         D4=RTN LINK
*
*
26LST1   EQU      %                 E.P. TO LIST ITEMS IN THE CONTROL
*                                   PARAMETER DISPLAY LIST.
         LI,R3    -1            <<  INITIALIZE CONTROL DISPLAY TBL INDX
26LST2   EQU      %                 GET ITEM INDX LOOP
         AI,R3    1             <-  INCREMENT CONTROL DISP TBL INDX
         LB,R4    CDSTK,R3          HAS TBL END BEEN REACHED?
         BEZ      26LSTG1           FOR GERM ITEMS
         LBAL%,SR4 SPACE,1        >>PUT A BLANK IN OUPUT BUF
         ANLZ,SR3 26LST3        <<  GET DA(OUTPUT ITEM)
         SLS,SR3  3                 CONVERT TO BYTE ADR
         LBAL%,R7 BOUTX,,1,,8     >>PRINT ITEM NAME
         B        26LST2        <<->GET NEXT ITEM
*
26LST3   LD,0     ATERM1,R4         DATA FOR ANLZ INSTRUCTION
*
26LSTG1  EQU      %                 NOW LIST GERM ITEMS
         LI,R3    -1
26LSTG2  AI,R3    1
         LW,R4    GCONSTK,R3        EXAMINE LIST TBL
         STW,R4   GERMWORD
         BEZ      *D4               ALL DONE;END OF TBL
         LBAL%,SR4 SPACE,1
         BAL,SR3  MKNME             GO RECONSTRUCT GERM ITEM NME
         LI,SR3   BA(RCONSTR)       NAME NOW IN RCONSTR
         LBAL%,R7 BOUTX,,1,,8       OUTPUT
         B        26LSTG2           MORE
*
*****************************
*  28    (PR)OCEED COMMAND  *
*****************************
*
*
*  DESCRIPTION:   THE 'PROCEED' COMMAND IS NORMALLY ISSUED TO RESORE
*                 EXECUTION CONTROL AT THE POINT WHERE A PREVIOUS
*        BREAK WAS DETECTED BY THE SYSTEM. IF NO PREVIOUS UNANSWERED
*        (SEE NOTE1) BREAK WAS SENT BY THE USER, THIS COMMAND
*        IS IGNORED. IN ALL CASES, EXCEPT ONE, WHERE AN UNANSWERED
*        BREAK OCCURRED, THE 'PROCEED' COMMAND RESTORES CONTROL AT THE
*        POINT WHERE EXECUTION WAS INTERRUPTED. THE EXCEPTION OCCURS
*        WHEN 'PART' (PARTITION CONTROL) IS EXECUTING IN MASTER MODE
*        AND A BREAK IS ISSUED. IN THIS CASE, CONTROL WILL BE RETURNED
*        TO THE POINT IMMEDIATELY FOLLOWING THE FIRST CAL AFTER THE LPSD
*        SWITCH TO SLAVE MODE.
*
*        NOTE1:   AN UNANSWERED BREAK IS A BREAK FOR WHICH NO 'PROCEED',
*                 OR 'QUIT' COMMAND HAS BEEN ISSUED.
*
*        NOTE2:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY                INTERNAL                  EXIT
*        -----                --------                  ----
*        R15=LINK REGISTER    R0,R1=WORK                R0,R1 VOLATILE
*                                                       R2-R15 PRESERVED
*
*
28PRO    EQU      %
         LI,R0    C' 8'             ' 8' IS TRACE CODE FOR PROCEED
         STH,R0   ICTRACE           COMMAND HANDLER; UPDATE CORE HDR
         MTW,0    BFLG              IS BREAK FLAG SET? (SET=-1)
         BGEZ     28PRO1          ->  NO - INFORM USER
*                                     RESTORE 'CONTROL' RE-ENTRANT
*                                     DATA.
         LI,R1    RED:CONTROL:SIZE    YES-GET CNT RE-ENTRANT DATA WORDS
         PLW,R0   *SPDADR           PULL PREVIOUS DATA BLOCK,ONE WD
*                                   AT A TIME.
         STW,R0   RED:CONTROL:START-1,R1 RESTORE TO RE-ENT AREA
         BDR,R1   %-2               MORE WORDS?
*                                     RESTORE 'CONSUB' PUSHED ENVIRON
         LI,R1    0                   NO-INITIALIZE RE-ENTRANT DATA
*                                     INDEX.
28PRO0   AI,R1    -1                DECREMENT RE-ENTRANT DATA INDEX
         PLW,R0   *SPDADR       <-  PULL PREVIOUS DATA BLOCK,
*                                   ONE WORD AT A TIME.
         STW,R0   CSEND:CONSUB:DATA,R1 RESTORE TO REENTRANT AREA
         CI,R1    -CS:RED:SIZE    ->MORE WORDS?
         BG       28PRO0          ->  YES-PULL NEXT WORD
         LBAL%,SR4 SETPROMPT,,,0    RESTORE PREVIOUS COC PROMPT
         LI,R1    X'1FFFF'            NO - GET 17-BIT ADR MASK
         LS,R0    *PSDW0P           LOAD PUSHED PSD ADDRESS
         STW,R0   PSDW0REF          STORE IT UNTIL RETURN FROM M:TRTN
         LW,R0    L(28PRO2)         SUBSTITUTE BFLG ROUTINE FOR RTN ADR
         STS,R0   *PSDW0P           IN PUSHED PSD.
*
*                       NOTE:  THE REASON WE ARE GOING THROUGH ALL THESE
*                       GYRATIONS IS THAT IF BFLG IS CLEARED BEFORE
*                       THE PULL IN M:TRTN, USER COULD POSSIBLY BREAK
*                       AND THEN THERE WOULD BE 2 ENVIRONMENTS IN THE
*                       STACK WITH LOGIC TO ONLY PULL ONE. RIGHT ON!
*
         M:TRTN                   >>RESTORE INTERRUPTED ENVIRONMENT
*                                   EXCEPT FOR INSTRUCTION ADDRESS
*        B        28PRO2            M:TRTN=AN EFFECTIVE BRANCH
28PRO1   EQU      %             <-  NO BREAK ISSUED
,QPMESGE TYPE     ' NO BREAK ISSUED' INFORM USER
         B        *D4             >>GET ANOTHER COMMAND
*
28PRO2   EQU      %             <<  RETURN FROM M:TRTN
         PSW,R0   *SPDADR           SAVE R0
         LI,R0    0                 RESET BREAK FLAG
         STW,R0   BFLG
         PLW,R0   *SPDADR           RESTORE R0
         B        *PSDW0REF       >>ALL REGISTERS ARE RESTORED;
*                                   BFLG IS CLEAR; GO TO INTERRUPTED LOC
         PAGE
*
**********************************
*  29.   'QUIT' COMMAND HANDLER  *
**********************************
*
*
*  DESCRIPTION:   THE PURPOSE OF THE QUIT COMMAND IS TO CAUSE 'CONTROL'
*                 TO 'FORGET' THE ENVIRONMENT SAVED IN THE TCB BY A
*        PREVIOUS BREAK AND ALLOW COMMAND PROCESSING IN A NORMAL
*        MANNER. IF BREAK STATUS IS NOT ACTIVE, THE COMMAND IS IGNORED.
*        IF BFLG = -1 (ACTIVE), A TEST IS MADE TO DETERMINE IF BREAK
*        OCCURRED IN PARTITION CONTROL. IF SO, THE PARTITION CONTROL
*        FLAG IS RESET AND THE CONTENTS OF THE REGISTER BLOCK ON THE
*        PREVIOUS ENTRY TO 'PART' ARE LOST. IN EITHER CASE, THE PREVIOUS
*        INTERRUPTED ENVIRONMENT IS 'FORGOTTEN', THE BREAK FLAG RESET,
*        AND A MESSAGE SIGNIFYING AN END TO THE INTERRUPTED STATUS
*        SAVE IS TYPED.
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS;
*
*        ENTRY               INTERNAL               EXIT
*        -----               --------               ----
*        R15=RETURN LINK     R0-R1=WORK             R0-R2 VOLATILE
*                            R2='TYPE' REG          R3-R15 PRESERVED
*        NOTE2:   THE 'QUIT' HANDLER IS OPEN-ENDED AND RETURNS ON D4
*
*
29QUIT   EQU      %
         LI,R0    C' 9'         <<  ' 9' IS TRACE CODE FOR 'QUIT' CMD
         STH,R0   ICTRACE           UPDATE IN-CORE HEADER
         MTW,0    BFLG              IS BREAK FLAG SET? (SET=-1)
         BGEZ     29QUIT2         ->  NO - INFORM USER
         MTW,0    PEXEC               YES - IS 'PART' EXECUTION FLG SET?
         BLEZ     29QUIT1         ->    NO-DON'T RESET 'PART' STACK
         LI,R1    X'7FFF'           MASK FOR STACK WD CNT
         LS,R1    SPD+1             GET WORD COUNT
         LCW,R1   R1                MAKE IT NEGATIVE
         MSP,R1   SPD               ZAP PUSHED REGISTERS IN 'PART'
         BAL,SR4  ZEROUT        >>RELEASE PART DEF STK VIRTUAL
*                                   PAGES, IF ALLOCATED.
         LI,R0    0             <<  DISCONTINUE PARTITION CONTROL
         STW,R0   PEXEC             EXECUTION STATUS.
29QUIT1  EQU      %                 'FORGET' THE PRE-BREAK ENVIRONMENT
         LI,R0    X'7FFF'           MASK FOR WD CNT
         LI,R1    1                 IN SECOND WD OF SPDWD
         AND,R0   *SPDADR,R1        GET WORD COUNT
         LCW,R1   R0                MAKE NEGATIVE
         MSP,R1   *SPDADR           ZAP PUSHED ENVIRONMENT IN TCB STACK
         TYPE     ' FINI'           NOTIFY USER
         LI,R0    0                 CLEAR BREAK FLAG LAST IN CASE OF
         STW,R0   BFLG              ANOTHER BREAK.
         B        29QUIT3         ->LEAVE ROUTINNE
29QUIT2  EQU      %                 BREAK FLAG NOT SET
         TYPE     QPMESGE           ' NO BREAK ISSUED'
29QUIT3  B        *D4               RETURN
*
         PAGE
*
****************************************************
*  30.   'READ' - READ CONTROL COMMANDS FROM FILE  *
****************************************************
*
*
30READ   EQU      %                 E.P. FOR 'READ FID' COMMAND
         B        *D4             >>BACK TO COMMAND LOOP
*
         PAGE
*
******************************************
*  31.   'SLEEP' - PUT CONTROL TO SLEEP  *
******************************************
*
*
*  DESCRIPTION:   'SLEEP' COMMANDS ARE OF TWO TYPES: 1) GO TO SLEEP FOR
*                 X MINUTES, 2) SLEEP UNTIL HH:MM. THE FORMATS
*        FOR THESE COMMANDS ARE:
*
*        1.       'SLEEP N', WHERE N = NUMBER OF MINUTES TO SLEEP
*                            (N<=1439).
*        2.       'SLEEP HH:MM', WHERE HH = HOUR AND MM = MINUTE ON
*                                ON 24-HOUR CLOCK (HH<=23, MM<=59).
*
*        IN ALL CASES, THE ROUTINE IMPOSES ERROR AND LIMIT CHECKS ON
*        THE DECIMAL NUMBERS. IN CASE 1, THE NUMBER OF MINUTES
*        SPECIFIED IS TRANSLATED INTO .02 MINUTE INCREMENTS AND AN
*        M:WAIT CAL IS EXECUTED. IN CASE 2, THE DIFFERENCE IN .02
*        MINUTE UNITS BETWEEN THE CURRENT TIME AND THE INPUT TIME IS
*        CALCULATED AND AN M:WAIT CAL IS EXECUTED.
*
*
*        NOTE1:   THE BATCH PROCESSING MAINUAL SAYS THE M:WAIT TIME IS
*                 MODULO-24 BUT DON'T YOU BELIEVE IT.
*
*        NOTE2:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY              INTERNAL            EXIT
*        -----              --------            ----
*        D4=RTN LINK        R0,R3=WORK          R0-R7,SR1-SR4 VOLATILE
*                           R1=CF2 BYT CNT      D1-D4 PRESERVED
*                           R2=CHAR BUF
*                           R5=INPUT MINS BUF
*                           R7=INPUT HRS BUF
*                           SR1-SR4=SUBR REGS
*
*
31SL1    EQU      %                 E.P. TO CALCULATE # .02 MIN UNITS
*                                   TO SLEEP.
         LW,SR1   IMCNT         <<  GET # CHARS IN INPUT CMD
         AI,SR1   -1                MAKE IT AN INDEX TO LAST CHAR
         LBAL%,SR4  SCAN,,COMMAND   SEPERATE INPUT CMD INTO FIELDS
         LB,R0    CFPTRS        <<  GET # FIELDS FOUND
         CI,R0    2                 # FIELDS>=2?
         BL       31SL80          ->  NO-ERROR MESSAGE
         LI,R3    X'1FFFF'            YES-GET 17-BIT ADR MASK
         LW,R3    CFPTRS+2          GET BA(CF2)
         LB,R1    CFPTRS+2          GET BYTE CNT OF CF2
31SL3    EQU      %                 DETERMINE 'SLEEP N' OR 'SLEEP HH:MM'
         LB,R2    0,R3          <-  GET CF2 BYTE
         CI,R2    C':'              IS CMD 'SLEEP HH:MM'?
         BE       31SL5               YES-PROCESS CMD
         AI,R3    1                   NO-INCREMENT BA
         BDR,R1   31SL3           ->ANY BYTES LEFT IN CF2?
*                                     NO-CMD = 'SLEEP N'
*  31.1  CASE 1 - 'SLEEP N'
*
         LBAL%,SR4 DECINX,(W,CFPTRS+2),R7,31SL80 >>TRANSLATE DEC#
         CI,R7    1439          <<  IS WAIT REQUESTED>=24 HRS?
         BGE      31SL80          ->  YES-ERR MSGE
         MI,R7    50                  NO-CALCULATE .02 MIN UNITS
         B        31SL9           ->EXECUTE WAIT
*
*  31.2  CASE 2 - 'SLEEP HH:MM'
*
31SL5    EQU      %                 PROCESS 'SLEEP HH:MM' CMD
         LB,R0    CFPTRS+2      <-  GET CF2 BYTE CNT
         CI,R0    5                 IS BYTE CNT=5?
         BNE      31SL82          ->  NO-ERR MSGE
         CI,R1    3                   YES-':' CORRECTLY PLACED?
         BNE      31SL82          ->  NO-ERR MSGE
*                                     YES-CORRECT FORMAT (HH:MM)
         LW,SR1   CFPTRS+2          GET BA(HRS)
         LI,R0    2                 GET BYTE CNT (HRS)
         STB,R0   SR1               STORE IT
         LBAL%,SR4 DECINX,,R7,31SL80 >>TRANSLATE HRS TO BIN#
         CI,R7    23            <<  IS HR<=23?
         BG       31SL80          ->  NO-ERRMSGE
         MI,R7    50*60               YES-CONVERT HRS TO .02 MIN UNITS
         AI,SR1   3                 INC BA TO MINS
         LBAL%,SR4 DECINX,,R5,31SL80 >>TRANSLATE MINS TO BIN#
         CI,R5    59            <<  IS MIN<=59?
         BG       31SL80          ->  NO-ERRMSGE
         MI,R5    50                  YES-CONVERT MINS TO .02 MIN UNITS
         AW,R7    R5                SUM DESIRED # .02 MIN UNITS
         M:TIME   TIMEBUF,TMS     **GET CURRENT TIME IN BIN
         LB,R5    SR2           **  GET CURRENT HRS
         MI,R5    50*60             CONVERT HRS TO .02 MIN UNITS
         SLS,SR2  8                 ZERO HRS
         SLS,SR2  -24               RIGHT-JUSTIFY MINS
         MI,SR2   50                CONVERT MINS TO .02 MIN UNITS
         AW,R5    SR2               SUM # CURR .02 MIN UNITS
         CW,R5    57                CURRENT TIME:INPUT TIME?
         BG       31SL7           ->  >-CALC # .02 MINS TO WAIT
         BE       31SL99          ->  =-RETURN
         SW,R7    R5                  <-CALC THE DIFFERENCE
         B        31SL9           ->EXECUTE M:WAIT
31SL7    EQU      %                 CURRENT TIME>INPUT TIME
         AI,R5    -24*60*50     <-  CALC #.02 MINS IN DAY
         LAW,R5   R5                #.02 MINS UNTIL END OF DAY
         AW,R7    R5                GET #.02 MINS UNTIL REQUESTED TIME
         B        31SL9           ->EXECUTE WAIT
*
31SL9    EQU      %                 WAIT TIME CALCULATED
         M:WAIT   *R7           <-**EXECUTE WAIT
         B        31SL99        **->RETURN
*
*  31.3  ERROR MESSAGE SUBROUTINES
*
31SL80   EQU      %                 PRINT ERR MSGE
         TYPE     ERMS3         <-  OUTPUT 'INVALID NUMBER'
         B        31SL99          ->RETURN
31SL82   EQU      %             <-
         TYPE     ' INVALID TIME FORMAT' OUTPUT ERR MSGE
         B        31SL99          ->RETURN
31SL99   EQU      %                 COMMON EXIT
         B        *D4           <->>RETURN
*
*
         PAGE
*
***********************************************
*  32.   'TIME' - OUTPUT CURRENT TIME OF DAY  *
***********************************************
*
*
*  DESCRIPTION:   'TIME' UESE THE STANDARD BPM CAL TO GET THE CURRENT
*                 TIME OF DAY AND OUTPUTS THIS ON M:LO USING 'CONTROL'
*        SUBROUTINES.
*
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY              INTERNAL            EXIT
*        -----              --------            ----
*        D4=RTN LINK        SR1-SR4=SUBR REGS   R0-R2,SR1-SR4 VOLATILE
*                           D4=RTN LINK         R3-R7,D1-D4 PRESERVED
*
*
32TI1    EQU      %                 E.P. TO OUTPUT TIME OF DAY
         M:TIME   TIMEBUF       <<**GET CURRENT TIME OF DAY
         LBAL%,SR4 SPACE,1      **>>ALIGN TIME UNDER CMD
         LBAL%,R7 BOUTX,,1,BA(TIMEBUF),5 <<>>OUTPUT TIME
         B        *D4           <<>>RETURN
*
         PAGE
*
*************************
*  33.   'SET' COMMAND  *
*************************
*
*
*  DESCRIPTION:   'SET' RECEIVES A COMMAND STRING (SET CONTROL ITEM 'A'
*                 TO VALUE 'B'; E.G. BCM=32), BREAKS OFF THE EBCDIC
*        DECIMAL AND TRANSLATES IT TO BINARY, CHECKS THE NEW VALUE
*        AGAINST PERMISSIBLE HIGH AND LOW LIMITS, AND STORES IT IN
*        THE MONITOR TABLES. SOME SYSTEM VALUES HAVE MAXIMUMS OR
*        MINIMUMS WHICH FLUCTUATE WITH CHANGES IN OTHER PARAMETERS;
*        FOR EXAMPLE, SL:B7TM (MAX BATCH 7-TRACK TAPES) HAS AS ITS
*        MAXIMUM SL:7T (TOTAL NUMBER OF 7-TRACK TAPES AVAILABLE TO
*        THE SYSTEM). THEREFORE, A DATA VALUE CANNOT BE RETRIEVED
*        FROM A STATIC TABLE FOR COMPARISONS, MAX OR MIN. THESE
*        DYNAMIC MAXIMUMS AND MINIMUMS HAVE THEIR ADDRESSES STORED
*        IN TABLES 'AHIGH1' AND 'ALOW1' AND THEIR VALUES ARE FETCHED
*        FOR LIMIT CHECKS. OTHER PARAMETERS NEED TO HAVE THEIR VALUES
*        COMPUTED FROM AN ARITHMETIC RELATIONSHIP BETWEEN A NUMBER
*        OF PARAMETERS. THESE SPECIAL CASES HAVE JUMP TABLE INDICES
*        ASSIGNED TO THEM IN TABLES 'AHIX' AND 'ALOX'. WHEN A
*        POTENTIAL SYSTEM VALUE IS INPUT TO 'SET' FOR LIMIT CHECKS
*        THE SPECIAL CASE ROUTINES ARE REACHED THROUGH INDEXING INTO
*        A BRANCH VECTOR TABLE WITH THESE INDICES.
*
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY            INTERNAL            EXIT
*        -----            --------            ----
*        R3=BYTE INDEX    R0=WORK             R0-R3,SR1-SR4,D1-D3
*        TO INPUT COMMAND R1=BYTE INDEX       VOLATILE
*        '=' SIGN         R2=COMPAR BYTE      R4-R7,D4 PRESERVED
*                         R3=PTR TO '=';
*                            ITEM INDEX
*                         R4=LOW LIM WORK
*                         R5=RESCHEDULE FLG
*                         R7=BAL REG
*                         SR1=SUBR PARAM REG
*                         SR2=SUBR PARAM REG
*                         SR3=SUBR PARAM REG
*                         SR4=LINK REG TO SUBRS
*                         D1=MIN LIMIT OR FLAG
*                         D2=BINARY #
*                         D3=MAX LIMIT
*
*
33SET    EQU      %                 ENTRY POINT TO SET SYSTEM LIMIT
*                                   R3=BYTE INDEX TO INPUT COMMAND '='
         LI,R2    C' '          <<  SEARCH FOR 1ST BYT OF SYS LIMIT
*                                   GET BLANK COMPARE CHAR
         LI,R1    -1                INITIALIZE BYTE INDEX
         LI,SR2   BA(COMMAND)       GET BEGINNING BA OF SL NAME BUF
33SET2   AI,R1    1                 INCREMENT NAME FIELD BYTE PTR
         CW,R1    R3            <-  HAS '=' BEEN REACHED?
         BE       33SET9          ->  YES-ILLEGAL COMMAND
         CB,R2    COMMAND,R1          NO-IS BYTE A BLANK?
         BE       33SET2          ->  YES-SKIP IT. FIND SL 1ST BYTE
         AW,SR2   R1                  NO-GET BA(1ST BYTE OF SL NAME)
         LW,R2    R3                GET PTR TO NXT BYTE AFTER NAME
         SW,R2    R1                CALCULATE NAME BYTE COUNT
         STB,R2   SR2               STORE IT IN BYTE 0 SR3 FOR ITEMFIND
*                                   ANY BLANKS FOLLOWING NAME WILL BE
*                                   TRANSPARENT TO 'ITEMFIND'.
         LBAL%,SR4 ITEMFIND,(W,AT1DATA)  >>FIND ITEM ENTRY# IN ATERM1
         B        33GERM            COULD BE A GERM ITEM
         LI,SR1   -1
         STW,SR1  GERMWORD          INDICATE NON-GERM
         PSW,SR3  *SPDADR       <<  SAVE ITEM ENTRY #
33SET2A  EQU      %
         LI,SR1   0                 INITIALIZE BA(1ST BYTE OF DEC#)
33SET3   EQU      %                 COUNT # BYTES IN DEC #
         AI,R3    1             <-  INCREMENT BYTE PTR
         CW,R3    IMCNT             PAST END OF STRING?
         BGE      33SET5              YES-CONVERT DEC # TO BIN
33SET3A  EQU      %
         CB,R2    COMMAND,X3        ELSE, CK IF A BLANK OR DELIMITOR
         BGE      33SET4          ->  YES-CHECK END OF DECIMAL
         CI,SR1   0                   NO-HAS BEGINNING ADR BEEN SET?
         BG       33SET3          ->  YES-FIND END OF DEC #
         LI,SR1   BA(COMMAND)         NO-GET DEC # BASE ADR
         AW,SR1   R3                GET BA(1ST BYTE OF DEC #)
         B        33SET3          ->FIND END OF DECIMAL #
33SET4   EQU      %                 CHECK FOR END OF DECIMAL
         CI,SR1   0             <-  HAS BA(DEC#) BEEN FOUND?
         BG       33SET5A         ->  YES-DONE;CONVERT DEC TO BIN
         B        33SET3          ->  NO-TRY NEXT BYTE
33SET5   EQU      %                 TEST # FOR SIGNIFICANCE & CONVERT
         CI,SR1   0                 IS DEC # BYTE COUNT=0?
         BE       33SET10         ->  YES-OUTPUT INVALID # MSGE
33SET5A  EQU      %
         ANLZ,R3  33SET3A           ELSE, GET BA(1ST BYTE AFTER DEC#)
         SW,R3    SR1               CALCULATE LENGTH OF DECIMAL
         STB,R3   SR1               BYTE CNT-->SR1 BYTE 0
         LBAL%,SR4 DECINX,,D3,33SET10  >>CONVERT DEC# TO BIN (ERR RTN)
         LI,R5    0                 GET 'NO-RESCHEDULE' FLAG. IF RAIS-
*                                   ING A MAX SYS LIM, COULD CAUSE
*                                   RESOURCES TO OPEN UP FOR 'CAN'T
*                                   RUN' QUEUE. SET FLAG TO 1 IN MAX
*                                   LIMIT FETCH.
         LW,R3    GERMWORD
         CI,R3    -1                SEE IF ENTRY # PUSHED FOR NON-GERM
         BNE      33MXMN
         PLW,R3   *SPDADR           PULL ITEM INDEX
         LI,SR3   X'FFFF'           MASK FOR MONITOR ADR OF PARAMETER
         AND,SR3  AVAL1,X3          CK IF PARAM DEFINED IN THIS SYSTEM
         BEZ      33SET9A           B, IF NOT; OUTPUT 'NOT GEN''ED' MSG
         LW,D2    AHIGH1,R3         GET PARAM MAX LIM/SPEC CASE FLG
         BLZ      33SET11         ->  SPECIAL CASE/DISPLAY ONLY
*                                     STATIC MAXIMUM
33SET6   EQU      %                 MAXIMUM LIMIT IN D2
         LW,D1    ALOW1,R3          GET PARAM MIN/SPEC CASE FLG
         BLZ      33SET16         ->  SPECIAL CASE
*                                     STATIC MINIMUM
33SET7   CLR,D1   D3            <-  IS MIN<=VALUE<=MAX?
         BCS,6    33SET12         ->  NO-OUTPUT ERR MSGE
*                                     YES-SCALE VALUE & STORE
         LBAL%,SR4 33SCOUT,(W,ASCAL1,R3),(W,D3)  SCALE OUTPUT VALUE
         LW,R1    AVAL1,R3      <<  GET SYS PARAM ADDRESS
         CI,R5    1                 WERE MAX BATCH RESOURCES RESET?
         LW,R3    STSMSK,R3         GET STORE SELECT MASK
         LW,R2    SR2
         STS,R2   *R1               STORE VALUE
MBSFLG   EQU      %                 MIGHT HAVE TO RESCHEDULE/REPARTITION
         CI,R5    1                 IF SYS TOT/BCH SUM MODIFIED
         BNE      %+2
         STW,R5   S:MBSF+F          YES, SET MBS FLG TO 1
         CI,R5    X'FFFF'           MUST WE REPARTITION
         BNE      *D4               NO
         STS,5    PL:CHG+F
         STW,5    S:MBSF+F
33SET8   B        *D4         <->>RETURN   SUCCESSFULLY
*
*  33.2  END OF MAIN CODE - ERROR HANDLERS FOLLOW
*
33SET9A  TYPE     ' SYSTEM NOT GEN''ED FOR THAT CONTROL NAME'
         B        33SET8            RETURN TO COMMAND LEVEL
33SET9   EQU      %                 UNIDENTIFIED ITEM NAME
,ERMS5   TYPE     ' NO SUCH CONTROL NAME'  <-  OUTPUT ERR MSGE
         B        33SET8          ->RETURN
*
33SET10  EQU      %                 DECIMAL NUMBER TOO LONG/0 DIGS/NOT#
         LW,R0    GERMWORD
         CI,R0    -1                IF NOT PUSHED,DONT PULL
         BNE      %+2
         PLW,R0   *SPDADR       <-  PULL USELESS ITEM INDEX
,ERMS3   TYPE     ' INVALID NUMBER' OUTPUT ERR MSGE
         B        33SET8          ->RETURN
*
33SET11  EQU      %                 DECIDE IF ITEM IS DISPLAY ONLY OR
*                                   SPECIALLY COMPUTED MAX
         CI,D2    -1            <-  IS MAXIMUM TO BE COMPUTED?
         BL       33SET13         ->  YES-GO COMPUTE MAX
,ERMS4   TYPE     ' ''CURRENT'' VALUES MAY NOT BE ALTERED'  NO-ERR MSGE
         B        33SET8          ->RETURN
*
33SET12  EQU      %                 NUMBER NOT WITHIN MIN-MAX RANGE
,ERMS2   TYPE     ' NUMBER NOT WITHIN LEGAL RANGE'  <-  OUTPUT ERR MSGE
         LBAL%,R7 APEND,,,C27     >>APPEND ' PERMISSIBLE RANGE = '
         LBAL%,SR4 DECOUT,(W,D1) <<>>CONVERT MIN LIM TO EBCDIC
         LBAL%,R7 APEND         <<>>APPEND LOWER LIMIT
         LBAL%,R7 APEND,,,C28   <<>>APPEND '-'
         LBAL%,SR4 DECOUT,(W,D2) <<>>CONVERT MAX LIM TO EBCDIC
         LBAL%,R7 BOUT          <<>>APPEND MAX# & OUTPUT MSGE
         B        33SET8          ->RETURN
*
*  33.3  ROUTINES TO CALCULATE MAXS AND MINS FOR DYNAMIC DEPENDENT LIMS
*
33SET13  EQU      %                 COMPUTE MAX LIMS FOR SPECIAL CASES
         LB,R1    AHIX,R3       <-  GET PTR TO APPROPRIATE RTNE
         B        33SET14,R1      ->GO CALCULATE MAX
*
33GETMAX EQU      %
         LW,SR1   ASCAL1,X3         GET SCALING FACTOR
         LW,SR2   *D2               GET MAX LIMIT
         AND,SR2  STSMSK,X3         ISOLATE MAX VALUE BASED ON MASK
         BAL,SR4  33SCIN          >>SCALE LIMIT FOR COMPARE
         LW,D2    SR2           <<  GET LIMIT
         B        33SET6          ->CONTINUE
*
33:BUAIS EQU      %                 E.P. TO CALCULATE S:BUAIS LIMIT
         LW,R2    S:OUAIS+F     <-  GET MAX# ON-LINE USERS ALLWD IN SYS
         AW,R2    S:GUAIS+F         ADD MAX# GHOSTS ALLOWED IN SYS
         LI,D2    SMUIS             GET MAX# USERS ALLOWED IN SYS
         SW,D2    R2                NOW (D2)=# OF USER SLOTS AVAILABLE
         CI,D2    LPART             CK POSSIBLE MAXB VS.#PARTITIONS
         BLE      %+2               B, IF #PARTITIONS GREATER THAN #SLOTS
         LI,D2    LPART             ELSE, SET UPPER BOUND=#PARTITIONS
         LI,R5    1                 SET MBS RESCHEDULE FLAG
         B        33SET6          ->CONTINUE
*
33:OUAIS EQU      %                 E.P. TO CALCULATE S-OUAIS LIM
         LW,R2    S:BUAIS+F     <-  GET MAX# BATCH USERS ALLOWD IN SYS
         AW,R2    S:GUAIS+F         ADD MAX# GHOSTS ALLOWED IN SYS
         LI,D2    SMUIS             GET MAX# USERS ALLOWED IN SYS
         SW,D2    R2                REMAINDER=MAX# OU POSSIBLE
         CW,D3    S:OUAIS+F         C/REQUESTED ONLINE USER MAX W/CURRENT
*                                   .. ONLINE USER MAX
         BLE      33:OUAIS5         BLE; NOT TRYING TO INCREASE MAX
         CW,D3    D2                C/REQUESTED ONLINE USER MAX W/MAX
*                                   .. CURRENTLY ALLOWABLE
         BG       33:OUAIS5         BG; NOT LEGAL COMMAND
         LI,R1    COC               SEE IF COC HANDLER EXISTS
         BEZ      33:OUAIS5         B/DOESN'T EXIST
         LI,R1    X'1000'           L/ONLINE-USER-MAX-INCREASED FLAG
         STS,R1   COCGFLG+F         S/FLAG IN COCG FLAG; INFORM HARDWIRED USERS
33:OUAIS5 ;
         B        33SET6          ->CONTINUE
*
33SET16  EQU      %                 COMPUTE MIN LIMS FOR SPEC CASES
         LB,R1    ALOX,R3       <-  GET PTR TO APPROP ROUTINE
         B        33SET17,R1      ->GO CALCULATE MIN
*
33GETMIN EQU      %
         LW,SR1   ASCAL1,X3         GET SCALING FACTOR
         LW,SR2   *D1               GET MIN LIMIT
         AND,SR2  STSMSK,X3         ISOLATE MIN VALUE BASED ON MASK
         BAL,SR4  33SCIN          >>SCALE LIMIT FOR COMPARE
         LW,D1    SR2           <<  GET LIMIT
         B        33SET7            CONTINUE
*
33GERM   EQU      %                 FOR GERM ITEMS
         BAL,SR4  GERMFIND
         B        33SET2A           FOUND; GO CHECK DECIMAL NUMBER
         B        33SET9            NOT FOUND;ERR RTN
33MXMN   EQU      %                 CHECK IF CAN BE MODIFIED
         LI,SR2   0                 GET
         LI,SR1   1                 GET MAX
         BAL,SR4  GTSTVAL
         LW,D2    SR1
         BLZ      33MAX1            IF <0,LOOK FURTHER
         LW,R1    GERMWORD
         LI,R2    0
         STB,R2   R1                ZERO NAME POSITION
         CI,R1    X'10301'          *IS IT BATCH SUM(JOB CLASS TOTAL)
         BE       33BSUM            YES,GO
         CI,R1    X'10303'          *IS IT BATCH MAX
         BE       33BMXDF
         CI,R1    X'10304'          *IS IT BATCH DFT
         BNE      33OTHER           IF NEITHER,GO
33BMXDF  EQU      %
         LI,R5    X'FFFF'           INDICATE RE-PARTITIONING
         B        33OTHER
33BSUM   EQU      %
         LI,R5    1                 INDICATE RE-SCHEDULING
33OTHER EQU       %
33MXMN1  LI,SR2   0                 GET
         LI,SR1   2                 GET MIN
         BAL,SR4  GTSTVAL
         LW,D1    SR1
         BLZ      33MIN1
*
33MXMN2  CLR,D1   D3                IS MIN<=VALUE<=MAX
         BCS,6    33SET12           NO-OUTPUT ERR MSG
*NOW HAVE TO STORE VALUE INTO MON.TBL.
         LI,SR2   1                 STORE
         LW,SR1   D3                SPECIFIEDL VALUE IN D3
         BAL,SR4  GTSTVAL
         B        MBSFLG
*
33MAX1   EQU      %                 CHECK AGAINST MAX VALU
         CI,D2    -1
         BE       ERMS4             ERROR; CAN'T MODIFY CURRENT VALUES
         CI,D2    -2                HAS TO BE -2 TO INDICATE
         BNE      33ERR1             A SYS TOT RSRCE
         LW,R1    GERMWORD
         LI,R2    0
         STB,R2   R1
         CI,R1    X'10001'
         BNE      33ERR2
         LI,R5    1                 INDICATE RE-SCHEDULING
         LB,R4    GERMWORD          GET NAME POST.
         LB,R1    SB:RTY+F,R4       GET RSRCE TYPE INDX
         BEZ      33CORE            0 MEANS IT IS SPECIAL--CORE
         LI,D2    0
         LI,R4    DCTSIZ            OTH ENTRY NOT USED
33MAX2   CB,R1    DCT4+F,R4         IS THIS LOOKED FOR ITEM?
         BNE      33MAX3            NO
         LI,SR2   X'20'
         CB,SR2   DCT3+F,R4         IS DEVICE PARTITIONED?
         BANZ     33MAX3            YES - DONT COUNT IT
         LI,SR2   X'02'
         CB,SR2   DCT24+F,R4        IS DEVICE NOT PRESENT
         BANZ     33MAX3            YES - DONT COUNT IT
         LB,R2    DCT22+F,R4        IF SECONDARY STORAGETYPE DEVICE
         BEZ      33MAXC            (ISNT)
         LH,R2    DCT23+F,R4        IF SECONDARY STORAGETYPE DEVICE
         LW,R2    HGP+1+F,R2        MUST BE PRIVATE
         CI,R2    X'4000'
         BAZ      33MAX3
33MAXC   RES
         AI,D2    1                 THIS DEVICE COUNTS
33MAX3   BDR,R4   33MAX2
         B        33MXMN1           GO DO MIN CHECK
*
33CORE   EQU      %                 CORE-STORED AS K,SPECIFIED AS K
         TYPE     'CORE--SPECIAL RSRCE,MAX SET AT 1216K'
         LI,D2    1216
         B        33MXMN1
*
33MIN1   EQU      %                 NO ACTION,ASSUME ALL MINS 0
         B        33MXMN2           *
         PAGE
*
*  ADJUST WAIT TIME ON EVERY SUSPENDED USER TO
*  REFLECT NEW VALUE OF RETIM.
33:RETIM EQU      %
         LI,D1    0                 MUST MAKE LIMITS TEST HERE
*                                   CAUSE OF THIS ROUTINES SPECIAL
         CLR,D1   D3                FUNCTION
         BCS,6    33SET12           NOT WITHIN LIMITS
         M:SYS                      GO TO MASTER MODE
         LPSD,0   WK1PSD            SET WRITE KEY = 01
33CONTIN EQU      %
         LW,SR2   D3                COPY NEW VALUE
         SW,SR2   SL:RET            NEWVAL-OLDVAL
         BEZ      33RETXIT          NO MODIFICATIONS TO MAKE
         MI,SR2   50                CONVERT TO 1.2 SECOND UNITS
         LI,R0    1                 MIN REMAINING WAIT TIME
         LI,SR3   X'80'
         LI,R1    SMUIS             GET MAX USERS ALLOWED IN SYST
         LH,SR1   UH:FLG2,R1        GET USER FLAGS
         CI,SR1   X'40'             IS IT A DISCONNECTED USER
         BANZ     33RETSET          B IF YES
33RETNXT BDR,R1   %-3               TRY THE NEXT GUY
33RETXIT LPSD,0   SLAVEPSD          SLAVE MODE, RTN. TO 33SET7
33RETSET WD,SR3   X'1500'           DISABLE CLOCK3
         MTW,0    U:MISC,R1         DID HE TIC TO ZERO?
         BGZ      %+3
         WD,SR3   X'1400'           ENABLE CLOCK3
         B        33RETNXT          AND TRY THE NEXT GUY
         AWM,SR2  U:MISC,R1         UPDATE WAIT TIME
         BGZ      %+2
         STW,R0   U:MISC,R1         MIN. WAIT TIME
         WD,SR3   X'1400'           ENABLE CLOCK3
         B        33RETNXT          AND LOOK SOME MORE
*
33ERR1   TYPE     'ERROR:MAX HAS TO BE -2 TO SIGNAL SPECIAL RSRCE'
         M:ERR
33ERR2   TYPE     'ERROR:HAS TO BE SPECIAL RSRCE--CORE'
         M:ERR
*
*
*  33.4  PARAMETER SCALING SUBROUTINES
*
*
*        NOTE2:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY                      EXIT
*        -----                      ----
*        SR1=SCALING KEY            SR2=SCALED PARAMETER
*        SR2=VALUE TO BE SCALED     SR1 VOLATILE
*                                   R0-R7,SR3-SR4,D1-D4 PRESERVED
*
*        NOTE3:   CONVENTIONS FOR SCALING KEYS ARE AS FOLLOWS:
*
*        33SCIN                     33SCOUT
*        ------                     -------
*        0==>MULTIPLY BY 2          0==>MULTIPLY BY 1/2
*        1==>IDENTITY               1==>IDENTITY
*        2+==>DIVIDE BY SCALE       2+==>MULTIPLY BY SCALE
*
*
33SCOUT  EQU      %                 E.P. TO SCALE A PARAMETER TO BE
*                                   STORED IN THE MONITOR TABLES.
         CI,SR1   0             <<  IS PARAM TO BE SCALED BY 1/2?
         BNEZ     %+3             ->  NO-MULTIPLY BY SCALE
         SLS,SR2  -1                  YES-OUTPUT VAL=INPUT #/2
         B        %+2             ->
         MW,SR1   SR1           <-  OUTPUT# = INPUT# * SCALE INTEGER
         B        *SR4          <->>RETURN
*
33SCIN   EQU      %                 E.P. TO SCALE A PARAMETER ACCESSED
*                                   FROM MONITOR TABLES.
         CI,SR1   0             <<  IS PARAM TO BE SCALED BY 2?
         BNEZ     %+3             ->  NO-DIVIDE BY SCALE
         SLS,SR2  1                   YES-MULTIPLY BY 2
         B        %+2             ->
         DW,SR2   SR1           <-  DIVIDE SYS PARAM BY SCALE
         B        *SR4            >>RETURN
*
         PAGE
*
***********************
*  34.   SUBROUTINES  *
***********************
*
*
**********************************
*  34.1  DYNAMIC MEMORY CONTROL  *
**********************************
*
*
*  DESCRIPTION:   'MAP' CALCULATES THE PAGE ADDRESS OF THE HIGHEST PAGE
*                 NECESSARY TO ACCESS ALL MONITOR TABLES CONTAINING
*        SYSTEM PARAMETERS. MONITOR REAL PAGES ARE MAPPED ONE AT A TIME
*        INTO THE USER'S VIRTUAL MEMORY AT 'FO' UNTIL ALL REQUESTED
*        PAGES HAVE BEEN MAPPED. THEN THE MONITOR JIT IS MAPPED INTO
*        VIRTUAL MEMORY AND RETURN IS EFFECTED.
*
*
*        NOTE1:   IT IS NECESSARY TO MAP THE MONITOR PAGES INTO THE
*                 USER'S VIRTUAL MEMORY SPACE BECAUSE THE USER WITH
*                 PRIVILEGE LEVEL X'80' CANNOT GET INTO MASTER MODE TO
*                 LOOK AT THE MONITOR DIRECTLY. TO SIMPLIFY PROGRAMMING,
*                 THE PAGES ARE MAPPED REGARDLESS OF PRIVILEGE - THUS
*                 IT IS NOT NECESSARY TO GET MASTER MODE TO EXAMINE OR
*                 CHANGE THE PARAMETERS.
*
*                 THE PARTITION CONTROL MODULE IS A SPECIAL CASE BECAUSE
*                 MASTER MODE IS NEEDED TO PREVENT INTERRUPTS DURING
*                 TABLE UPDATE WHICH MIGHT RESULT IN THE MULTI-BATCH
*                 SCHEDULER REQUIRING ACCESS TO PARTIALLY UPDATED
*                 PARTITION TABLE.
*
         PAGE
*
*        NOTE2:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY               INTERNAL             EXIT
*        -----               --------             ----
*        R15=RETURN          R1=WORK              R0,R4-R15 PRESERVED
*                            R2=HIGH PAGE ADDRESS R1-R3 VOLATILE
*                            R3=MASK
*
*
34MAP1   EQU      %                 E.P. TO MAP MONITOR PGS INTO VIRTUAL
         DO       CK%CODE>=2        IF TESTING ,NO NEED TO MAP
         B        *D4
         FIN
*
         LI,R1    512               PAGE SIZE
         LI,R2    PPSTART+X'1FF'    EXTENT OF MONITOR DATA AREA
         LI,R3    X'1FE00'          WORD ADR--->PAGE # MASK
34MAP4   EQU      %                 MAP ONE MONITOR PAGE
         CAL1,8   SADCAL        <-**HAS VIRTUAL SPACE BEEN ALLOCATED
         BCS,8    34MAP5        **->  YES-GROAN, REASSEMBLE
         AWM,R1   SADCAL              NO-BUMP CORE PAGE ADR IN FPT
         AWM,R1   SADCAL+1          BUMP VIRTUAL PAGE ADR IN FPT
         CS,R2    SADCAL            ARE ALL MONITOR PAGES MAPPED
         BG       34MAP4          ->  NO - MAP ANOTHER MONITOR PAGE
         BL       *D4             >>  YES - AND JIT HAS BEEN MAPPED TOO
         LI,R2    J:JIT             ALL MON PAGES MAPPED; GET MON JIT ADR
         STS,R2   SADCAL            MAP MONITOR JIT LAST
         B        34MAP4          ->LAST TIME THROUGH THE LOOP
*
*
34MAP5   EQU      %                 SAD CAL ERROR RETURN
         TYPE     ' SAD CAL FAILURE IN ''34MAP'' - REASSEMBLE'
*
*        NOTE:    THE ONLY REASONS FOR SAD CAL ERROR RETURNS ARE:
*
*                 1)   THE USER ISSUING THIS CAL DID NOT HAVE THE
*                      PROPER PRIVILEGE LEVEL: X'80' FOR READ ACCESS AND
*                      X'B0' FOR STORE ACCESS.
*                      (PRIVILEGE ALREADY CHECKED IN INIT)
*                 2)   THE VIRTUAL ADDRESS WAS ALREADY ASSIGNED TO THE
*                      CALLING PROGRAM.
*
         M:SNAP   'DATA 0',(CS:CONTROL:DATA,CSEND:CONTROL:DATA)
         M:ERR                   ***ERROR EXIT
*
         PAGE
*
********************************************************
*  34.2  'TYPEDO' - TYPE A MESSAGE ON THE M:DO DEVICE  *
********************************************************
*
*
*  DESCRIPTION:   'TYPEDO' IS A SUBROUTINE CALLED BY THE PROC
*                 'TYPE' TO OUTPUT A CHARACTER STRING ON THE M:DO
*        DEVICE. A SUBROUTINE CALL WAS USED IN THE PROC AS OPPOSED
*        TO IN-LINE CODE GENERATION BECAUSE THERE WERE A MULTITUDE
*        OF PROC INSTANCES AND A FAIR AMOUNT OF CODE IS NEED TO
*        HANDLE THE ABNORMAL CONDITIONS WHICH MAY ARISE. THE FOUR
*        STANDARD REGISTERS R8-R11 ARE SAVED IN CASE OF A RECOVERABLE
*        ABNORMAL I/O CONDITION WHICH DESTROYS THESE REGISTERS.
*        BREAK CONTROL IS RELINQUISHED BEFORE THE I/O CALL IS ISSUED
*        SO THAT THE USER WILL NOT BE ABLE TO INTERRUPT IN CASE OF
*        AN ABNORMAL I/O RETURN.
*
*        NOTE1:   REGISTER USE IS AS FOLLOWS:
*
*        ENTRY               INTERNAL          EXIT
*        -----               --------          ----
*        R1=RETURN LINK      R1=MSGE BYTE CNT  R0-R2=VOLATILE
*        R2=TEXTC ADR        R2=TEXTC ADR      R3-R15=PRESERVED
*                            SR1=ADR FOLOWING
*                            CAL (IF ERROR)
*                            SR3=ABN CODE (IF
*                            ERROR)
*                            R7=BAL REG
*
*
TYPEDO   EQU      %                 E.P. FOR M:DO TYPE SUBROUTINE
         PSW,R1   *SPDADR       <<  SAVE RETURN ADDRESS
         LCI      4                 PREPARE TO SAVE STD REGS
         PSM,SR1  *SPDADR           PUSH SR1-SR4
         M:INT    0               **GIVE UP BREAK CONTROL
         LB,R1    *R2             **GET MESSAGE BYTE COUNT
34TY1    M:WRITE  M:DO,(BUF,*R2),(SIZE,*R1),(ABN,34TY3),(BTD,1)  **
         M:DEVICE M:DO,(CORRES,M:LO)  ****CHECK DCB DEVICE CORRES-
         CI,SR1   1                 PONDENCE. IS DO DEV=LO DEV?
         BE       34TY2           ->  YES-DON'T ECHO DO ON LO
         PSW,R7   *SPDADR             NO-PUSH R7
         LBAL%,R7 BOUT,,,(W,R2)   >>ECHO DO ON LO
         PLW,R7   *SPDADR       <<  RESTORE BAL REG
34TY2    M:INT    BREAK         <-**REGAIN BREAK CONTROL
         LCI      4             **  PREPARE TO GET PUSHED REGS
         PLM,SR1  *SPDADR           RESTORE SR1-SR4
         PLW,R1   *SPDADR           RESTORE R1
         B        *R1           >>RETURN   FROM CAL OK;RETURN
*
34TY3    EQU      %             <-  ABNORMAL RETURN
         PSW,R1   *SPDADR           SAVE R1
         LB,R1    R10               GET ABNORMAL CODE
         CI,R1    X'1C'             WAS IT END-OF-VOLUME?
         BNE      34TY4           >>  NO-HANDLE ABN RTN
         M:CVOL   M:DO            **  YES-CLOSE VOL,GET NXT VOL
         LB,R1    *R2               RELOAD MESSAGE BYTE COUNT
         B        34TY1           ->ATTEMPT M:WRITE AGAIN
*
34TY4    EQU      %                 SEND ABN RTN TO ABNXX
         PLW,R1   *SPDADR       <-  RESTORE R1
         B        ABNDO           >>GO TO ABN HANDLER
*
CSEND:CONTROL:PROCEDURE RES 0       END OF PROCEDURE SECTION
*
         PAGE
*
*******************************************
*  40.   DYNAMICALLY MODIFIED DATA CELLS  *
*******************************************
*
         USECT    CS:CONTROL:DATA
*
*  40.1  VARIABLES AND FLAGS
*
JOBX     RES      1                 JOB TYPE CELL;1=GHOST,2=O/L,3=BATCH
USRPRIV  DATA     0                 USER PRIV LEV FLAG(1=80,2=B0,3=C0)
SPDADR   DATA     0                 TCB STACK POINTER DW (SPD) ADR
SADCAL   GEN,8,24 X'07',0           FIRST REAL PAGE ADDRESS
         DATA     FO                1ST VIRTUAL PAGE FOR MON MAPPING
TIMEBUF  TEXT     '                '     CURRENT TIME
*
         BOUND    8
RCONSTR  RES      2
*
*ACTUALLY,GCONSTK (THIS GOES FOR CDSTK TOO) SHOULD BE PLACED
* IN RE-ENTRANT DATA AREA, SO THAT
*        WHEN A CONTROL DISPLAY (NOT BANG) IS INTERRUPTED(VIA BREAK)
*        , AND LATER RETURNED (VIA PROCEED),
*        THE CONTINUED DISPLAY WOULD ONLY CONTAIN ORIGINAL ITEMS
*
*AS OF NOW,IF ITEMS ARE ADDED AFTER THE BREAK AND THEN RETURNED,
* THE CONTINUED DISPLAY COULD RESULT IN ERRONEOUS VALUES FOR THOSE
* SUBSEQUENTLY ADDED ITEMS.(CDSTK,GCONSTK NOW EXTENDED WHILE
*  ANEW1,GCONVAL MIGHT CONTAIN RESIDUES)
* IN THIS CASE ,BETTER RE-DO A DISPLAY
*
*AND BEFORE THE RETURN WILL INCLUDE (IN ADDITION TO ANY SUBSEQUENTLY
*ADDED CONTROL ITEMS) THOSE ITEMS THAT ARE IN EFFECT BEFORE THE INTERRUPTION.
*
*        NOTE:    FULL-BLOWN CAPABILITY WILL DEMAND A 331 WORD STACK
*        DUE TO THE UNLIKELINESS OF A FULL BLOWN GERM AND ALSO TO CUT
*        DOWN TCB SIZE,THE FOLLWOING ASSUMPTION COULD BE MADE:::::
*6 RSRCE ITEMS,10 SRVCE ITEMS,6 SYMBNT ITEMS
*  WHICH WOULD MEAN A GCONSTK OF 151 WORDS
*
GCONSTK  DATA     0
         RES      330
*
*
         PAGE
*
*
*
*        DFLTXX = OP-LABEL DEFAULT TABLE WHERE XX = SI,DO, OR LO. IN
*        CASE OF ERROR OR ABNORMAL RETURN ON AN 'ASSIGN'ED FILE, ALL
*        DCB(S ARE CLOSED AND RE-OPENED TO THEIR DEFAULT ASSIGNMENTS
*        VIA THESE TABLES, PROVIDING COMPLETE RECOVERY FROM ABN I/O
*        RETURNS.
*
*                     G   O/L   B   G=GHOST, O/L=ON-LINE, B=BATCH
*                   ---- ---- ----  ENTRY ZERO OF EACH TABLE WILL
DFLTSI   DATA     0,'OC','UC','SI'  CONTAIN THE DEFAULT OP-LABEL FOR THAT
DFLTDO   DATA     0,'OC','UC','DO'  DCB AND THE TYPE OF JOB AT RUN TIME.
DFLTLO   DATA     0,'OC','UC','LO'
*
         PAGE
*
***************************************************************
*  41.   DYNAMICALLY MODIFIED DATA BUFFERS & RE-ENTRANT DATA  *
***************************************************************
*
*
PATCH    RES      100               PATCH AREA
*
RED:CONTROL:START EQU %             RE-ENTRANT DATA STARTS HERE
*
SFLG     DATA     0                 'SKIP BREAK FOR NOW' FLAG
PSDW0P   DATA     0                 TCB STACK PSD WORD 0 POINTER
PSDW0REF DATA     0                 'PROCEED' TEMPORARY PSD REF ADR
BFLG     DATA     0                 BREAK FLAG=-1 IF BREAK OCCURRED
IMCNT    DATA     0                 SIZE OF ITEM NAME/INPUT STRING
         BOUND    8
COMMAND  EQU      %                 INPUT COMMAND/ITEM NAME/STR BUFFER
         DO1      CBUFWSZ
         TEXT     '    '
         PAGE
*
ANEW1    EQU      %-1               SNAPSHOT TBL FOR SYS PARAMETERS
         RES      #ATERM1
*
*THE FOLLOWING ARE RE-ENTRANT
GERMWORD DATA     0
GERMBANG DATA     0
PARTMAIN DATA     0
*
*FULL BLOWN GERM WOULD DEMAND
*GCONVAL RES      330
*
*TO CUT IT DOWN ,COULD USE A GCONVAL OF 150
*
GCONVAL  RES      330
*
RED:CONTROL:SIZE EQU %-RED:CONTROL:START WORD SIZE OF CONTROL
CSEND:CONTROL:DATA EQU %
*                                   RE-ENTRANT DATA.
         END      10INIT

