*M*      TICKEYIN OPERATOR COMMUNICATION SEGMENT OF TIC MODULE OF TP
         TITLE     'TIC - OPCOM - UTILITIES'
*P*  NAME:        TICKEYIN
*P*  PURPOSE:     TICKEYIN HANDLES TIC COMMANDS ISSUED BY THE CP-V
*P*               OPERATOR FOLLOWING AN INTERRUPT.
*P*  DESCRIPTION: WHEN THE TIC IS INTERRUPTED BY THE OPERATOR, IT GAINS
*P*               CONTROL AT LOCATION #TIC#INT IN TICROOT, DUE TO ITS
*P*               PREVIOUS USE OF THE M:INT SERVICE.  THE TIC FIRST
*P*               EXAMINES ITS TASK-STACK TO ASCERTAIN WHETHER THIS IS
*P*               AN OPERATOR INTERRUPTION OR A 'BREAK' OF A SLAVE
*P*               TERMINAL. UPON FINDING AN OPERATOR INTERRUPT,
*P*               TICKEYIN IS INVOKED AND THE TIC OPERATOR INTERRUPT
*P*               CODE FIRST OBTAINS A COMMAND FROM THE OPERATOR.
*P*               POSSIBLE COMMANDS ARE: REGULATE, NET, FREE, ACQUIRE,
*P*               MESSAGE, DISPLAY, AND X.  IT THEN ACTS ON THAT
*P*               COMMAND.
*P*  REFERENCE:   CP-V TP REFERENCE MANUAL, 90 31 12
         PCC       0
*
*
*
         SYSTEM    SIG7                                                 TIC00010
         SYSTEM   TPPROCS
         M:PT     1
         SYSTEM   TICPROCS
         PAGE
*        REGISTER UTILIZATION BY THE TIC                                TIC00540
*                                                                       TIC00550
*        THE TIC-EXECUTIVE 'OWNS' THREE REGISTERS, NAMELY               TIC00560
*        REGISTERS ONE, TWO, AND THREE.  THEY ARE EQU'ED BELOW.         TIC00570
*                                                                       TIC00580
*        TIC-TASKS SHOULD NOT USE THESE REGISTERS.                      TIC00590
*                                                                       TIC00600
*        REGISTER '#DEV' CONTAINS THE LOGICAL DEVICE NUMBER             TIC00610
*        THAT THE TIC-TASK IS WORKING ON.  SEVERAL PROCEDURES           TIC00620
*        (E.G. #T#GET) ASSUME THAT IT IS CORRECT!                       TIC00630
*                                                                       TIC00640
#DEV     EQU       1                                                    TIC00650
#ERR     EQU       2                   HOLDS STATUS ON #CHECK RETURN    TIC00660
#ARG     EQU       2                   ARGUMENT TO PROC REGISTER        TIC00670
#BAL     EQU       3                   REGISTER WE BAL ON INTO TIC EXEC TIC00680
#OWN     EQU       4                   REG THAT POINTS TO SUB LOCAL STORTIC00690
*        TIC TABLE NAMES ARE DEFINED WITH LISTS FOR                     TIC00710
*        FLEXIBLIITY.  FOR NOW, THE LIST CONSISTS OF THE                TIC00720
*        ADDRESS OF THE INDIRECT WORD THAT POINTS TO THE                TIC00730
*        TABLE AND THE LENGTH OF A TABLE ENTRY IN BYTES.                TIC00740
*                                                                       TIC00750
*                                                                       TIC00830
#DEV#DCB#POINTER SET #DEV#DCB#POINTER#IW,2                              TIC00840
*                                                                       TIC00880
#MDL#WAKEUP#ECB              SET       #MDL#WAKEUP#ECB#IW,8             TIC00890
#DEV#LINE#IDENTIFIER         SET       #DEV#LINE#IDENTIFIER#IW,4        TIC00950
#DEV#MULTIPOINT#INDEX        SET       #DEV#MULTIPOINT#INDEX#IW,1       TIC00960
*
#DEV#LINE#STATUS#BITS        SET       #DEV#LINE#STATUS#BITS#IW,2
#LINE#SWITCHABLE   SET 1024
#LINE#SWITCH#DONT  SET 2048
*
#DEV#REGULATION    SET #DEV#REGULATION#IW,1                             TIC00980
*
*                                                                       TIC01010
*                                                                       TIC01023
#DCB#TABLE                   SET       #DCB#TABLE#IW,4                  TIC01024
*                                                                       TIC01030
*                                                                       TIC01040
*                                                                       TIC01050
#DEV#LOGON#BLOCK SET #DEV#LOGON#BLOCK#IW,4,0                            TIC01060
*                                                                       TIC01070
*        THE FOLLOWING FIELDS ARE IN THE BLOCK                          TIC01080
*        POINTED TO BY THE ABOVE.                                       TIC01090
*                                                                       TIC01100
#DEV#GET#LIST#LENGTH SET #DEV#LOGON#BLOCK#IW,4,3,4                      TIC01110
#DEV#DMODE         SET #DEV#LOGON#BLOCK#IW,4,0,1                        TIC01120
#DEV#USING#TFD     SET #DEV#LOGON#BLOCK#IW,4,1,4                        TIC01130
#DEV#DOING         SET #DEV#LOGON#BLOCK#IW,4,1,1                        TIC01140
#DEV#GET#LIST#ID   SET #DEV#LOGON#BLOCK#IW,4,1,2                        TIC01150
#DEV#DOLLARS#LAL   SET #DEV#LOGON#BLOCK#IW,4,4,4                        TIC01160
#DEV#QUESTIONS#LAL SET #DEV#LOGON#BLOCK#IW,4,5,4                        TIC01170
#DEV#AT#NAME#LAL     SET #DEV#LOGON#BLOCK#IW,4,6,4                      TIC01180
#DEV#CRUNCH#NAME#LALS SET #DEV#LOGON#BLOCK#IW,4,7,4                     TIC01190
         PAGE
         REF      #BIGGEST#TIC#TASK INPUT; WORD; USED TO DELIMIT LOOPS
*,*  THROUGH VARIOUS DEV-TASK TABLES
         REF #DEV#LINE#IDENTIFIER#IW INPUT; WORD; USED TO OBTAIN LINE
*,*  ID OF MDL-TASK OR DEV-TASK ON POINT-TO-POINT LINE, OR PHYSICAL
*,*  ADDR OF STATION FOR MDL-TASK
         REF #DEV#DCB#POINTER#IW INPUT; WORD; USED TO OBTAIN OFFSETS
*,*  INTO THE #DCB#TABLE TABLE OF DCB ADDRESSES; OFFSETS>0 FOR REGULAR
*,*  STATIONS, OFFSETS<0 FOR MULTIPOINT LINES
         REF      #DCB#TABLE#IW     INPUT; RIGHT HALF; USED TO OBTAIN
*,*                                 WA OF ZERO'TH #DCB#TABLE ENTRY
         REF      TICINTOPERATORLATER INPUT, OUTPUT; USED TO TELL IF
*,*  OPERATOR KEYINS ARE CURRENTLY PERMITTED
         REF      TICINTREPLY       INPUT; 20-WD BLOCK; USED TO HOLD
*,*  OPERATOR'S REPLY TO M:KEYIN CAL
         REF      #CURRENT#PROCESS#DEV  INPUT; WORD; TASK NO. OF TIC-TASK
*,*                                 THAT IS CURRENTLY RUNNING
         REF      ABORTCOUNT        INPUT,OUTPUT; WORD; USED TO KEEP
*,*  TRACK OF NO. OF MACHINE ERRORS AND TIC LOGIC ERRORS ALLOWED VS. NO.
*,*  OCCURRED
         REF      #BIGGEST#MDL#TASK INPUT; WORD; USED TO DELIMIT LOOPS
*,*  THROUGH MDL PORTIONS OF DEV TABLES
         REF      #MESSAGE#CHAIN    INPUT; WORD; USED TO DETERMINE WHERE
*,*  TO ADD AN ENTRY TO THE CHAIN OF PENDING MESSAGES
         REF      #REGULATE#QUESTION INPUT; EQU; USED TO DENOTE BIT 31
*,*  OF #DEV#REGULATION TABLE ENTRY FOR ?-REGULATION
         REF      #REGULATE#AT      INPUT; EQU; USED TO DENOTE BIT 30
*,*  OF #DEV#REGULATION TABLE ENTRY FOR @-REGULATION
         REF      #REGULATE#CRUNCH  INPUT; EQU; USED TO DENOTE BIT 29
*,*  OF #DEV#REGULATION TABLE ENTRY FOR #-REGULATION
         REF      #DEV#REGULATION#IW INPUT; BITS 29-31; USED BY REGULATE
*,*  COMMAND PROCESSOR TO DECIDE WHETHER AN ACTION IS PERMISSIBLE
         REF      #DEV#LINE#STATUS#BITS#IW OUTPUT; BITS 29&31; USED TO SET
*,*  FLAGS AS NEEDED FOR OPERATOR 'REGULATE' AND 'ACQUIRE' COMMANDS
         REF      #LINE#REGULATED   OUTPUT; BIT 29 OF #DEV#LINE#STATUS#BITS;
*,*  SET WHEN PROCESSING THE OPERATOR 'REGULATE'COMMAND
         REF      #LINE#UNACQUIRED  OUTPUT; BIT 31 OF #DEV#LINE#STATUS-
*,*  #BITS; SET TO INDICATE ACQUIRED STATUS FOR OPERATOR 'ACQUIRE'
*,*  COMMAND
         REF      #NET#ECB          OUTPUT; WORD; POSTED OR CLEARED TO
*,*  CONTROL ALL TIC DEVICE I/O AS APPROPRIATE
*,*  'DISPLAY' COMMAND PROCESSOR TO DETERMINE WHAT A STATION'S CURRENT
*,*  ACTIVITY IS
         REF      #DEV#LOGON#BLOCK#IW INPUT; WORD; USED BY OPERATOR
*,*  'DISPLAY' COMMAND PROCESSOR TO OBTAIN ORIGINATING STATION NAME
         REF      #DEV#MULTIPOINT#INDEX#IW INPUT; WORD; USED BY OPERATOR
*,*  'ACQUIRE' COMMAND PROCESSOR TO OBTAIN THE M:LIST INDEX OF A STATION
         REF   #MDL#WAKEUP#ECB#IW  INPUT; DOUBLEWD; USED BY OPERATOR
*,*  'ACQUIRE' AND 'FREE' COMMAND PROCESSORS TO POST AN ECB
*,*  CORRESPONDING TO A GIVEN MULTIPOINT LINE NUMBER
         REF      #X#ED             OUTPUT; WORD; SET BY OPERATOR 'X'
*,*  PROCESSOR TO INDICATE THAT AN X COMMAND HAS BEEN RECEIVED
         REF      FIELD6789LOADAAAAAAAACODE  ENTRY POINT USED BY
*,*                                 FIELD6789LOADAAAAAAAA PROC
         REF      FIELD6789POINTTOSTRINGCODE  ENTRY POINT USED BY
*,*                                 FIELD6789POINTTOSTRING PROC
         REF      #FREE#MAIN#BYTES#CODE  ENTRY POINT USED BY
*,*                                 #FREE#MAIN#BYTES PROC
         REF      #LINE#REESTABLISH
         REF      MOCLINEERR        INPUT; USED FOR I/O ERROR RETURN
         REF      MOCLINEABN        INPUT; USED FOR ABN I/O RETURN
         REF      SIGNALATTENTIONCODE  ENTRY POINT USED BY
*,*                                 SIGNALATTENTION PROC
         REF      #TYPE89#CODE      ENTRY POINT USED BY #TYPE89 PROC
         REF      #EXIT#CODE        ENTRY POINT USED BY #EXIT PROC
         REF      #GET#MAIN#BYTES#CODE  ENTRY POINT USED BY
*,*                                 #GET#MAIN#BYTES PROC
         REF      HEXTABLE          CONSTANTS
         REF      COCLINEERR        ERROR RETURN ADDRESS
         REF      COCLINEABN        ABNORMAL RETURN ADDRESS
         REF      #LINE#AWAITING#ACQUIRE  CONSTANT USED TO CHECK
*,*                                 LINE STATUS
         DEF      KEYINDATA    USED FOR PATCHING TICKEYIN DATA
         DEF      KEYINDEF     USED FOR PATCHING TICKEYIN PROCEDURE
         REF      TICINTECB         OUTPUT; USED WITH M:KEYIN CAL
*,*                                 TO POST ECB
         REF      SGLDTRTN          ENTRY POINT IN TICROOT USED WHEN ABOUT
*,*  TO BRING IN TICLABOR SEGMENT PRIOR TO ISSUING M:TRTN AFTER COMMAND
*,*  ENTERED BY OPERATOR HAS BEEN PERFORMED.
         DEF      OPERATORPROMPT    ENTRY POINT FOR TICKEYIN
         PAGE
*                                                                       TIC72120
KEYINDATA  CSECT  0
OPERATORDISPLAYBUFFER        TEXT      'XDEVICE '
OPERATORDISPLAYBUFFERID      TEXT      'AAAABBBB'
                             TEXT      ' IS XXAC'
                             TEXT      'QUIRED  '
                             TEXT      'AND '
OPERATORDISPLAYBUFFERNOT     TEXT      ' CCC LOG'
                             TEXT      'GED '
                             DATA      X'D6D54B15'
*    END OF OUTPUT IF NOT LOGGED ON.......
                             TEXT      'NAME IS '
OPERATORDISPLAYBUFFERNAME    TEXT      'DDDDEEEE'
*    END OF OUTPUT IF UNACQUIRED AND LOGGED ON.......
                             TEXT      ' AND IS '
OPERATORDISPLAYBUFFERDOING   TEXT      'FFFFGGGG'
                             TEXT      'ING. REG'
                             TEXT      'ULATED: '
         TEXT      'H I J   '
*                                                                       TIC72180
         BOUND     8                                                    TIC72190
OPERATORDISPLAYDOINGS RES 0                                             TIC72200
         TEXT      '     IDL'
         TEXT      'DORMANT-'                                           TIC72211
         TEXT      '    WAIT'                                           TIC72212
         TEXT      '  ACCEPT'                                           TIC72213
         TEXT      '  REPORT'                                           TIC72214
         TEXT      ' COMMAND'                                           TIC72215
         PAGE
*
*                                                                       TIC72220
*                                                                       TIC72230
KEYINDEF CSECT    1
*
TICINTMTRTN RES   0
         B        SGLDTRTN
*
OPERATORPROMPT MTW,1 TICINTOPERATORLATER BUMP TO PREVENT REENTRANCE.
         M:KEYIN   (MESS,TICINTMESS),(REPLY,TICINTREPLY),;              TIC24250
                   (SIZE,80),(ECB,TICINTECB)
         LI,6      BA(TICINTREPLY)+1   BA OF OPERATOR'S COMMAND.        TIC24270
         LB,7      TICINTREPLY         LENGTH PLUS START                TIC24280
         AI,7      BA(TICINTREPLY)+1-1  MINUS ONE FOR EOM IS END+1.     TIC24290
*
*
*
OPERATORCOMMAND RES 0                                                   TIC24310
         LB,8      0,6                 GET FIRST LETTER OF COMMAND.     TIC24320
         LI,10     OPCOMMANDTABLESIZE  TABLE SIZE.                      TIC24330
         LI,9      OPCOMMANDLETTERTABLE SCAN                            TIC24340
         CB,8      *9                    TABLE                          TIC24350
         BE        OPCOMMANDBAL           FOR A                         TIC24360
         AI,9      1                       LETTER                       TIC24370
         BDR,10    %-3                      MATCH.                      TIC24380
*                                                                       TIC24390
*        HERE ON BAD COMMAND.                                           TIC24400
*                                                                       TIC24410
OPERATORCOMMANDNOT RES 0               HERE ON VARIOUS                  TIC24420
OPERATORCOMMANDBAD RES 0                SYNTAX PROBLEMS                 TIC24430
OPERATORBAD RES    0                     WITH COMMAND.                  TIC24440
OPERATORNOWHERE RES 0                                                   TIC24450
*                                                                       TIC24460
*O*  MESSAGE:     'BAD TIC COMMAND SYNTAX'
*O*  ACTION:      CHECK SYNTAX OF TIC OPERATOR COMMAND ENTERED.
*O*  MEANING:     PRINTED AFTER ONE OF SEVERAL POSSIBLE SYNTAX ERRORS
*O*               WAS DISCOVERED BY TIC IN PROCESSING AN OPERATOR
*O*               COMMAND.
         M:TYPE    (MESS,OPERATORBADMESS)                               TIC24470
         MTW,-1    TICINTOPERATORLATER ALLOW ANOTHER ENTRANCE.
         B         TICINTMTRTN         AND EXIT.
OPERATORBADMESS TEXTC 'BAD TIC COMMAND SYNTAX'                          TIC24490
*                                                                       TIC24500
*                                                                       TIC24510
*                                                                       TIC24520
OPCOMMANDBAL RES   0                   HERE WITH COMMAND IDENTIFIED.    TIC24530
         LW,9      *9                  GET WHERE TO BAL TO.             TIC24540
         BAL,15    *9                  BAL THERE.                       TIC24550
*                                                                       TIC24560
*        (NOTE THAT OPCOMMAND PROCESSORS DON'T                          TIC24570
*        RETURN VIA R15, BUT RATHER USE THE                             TIC24580
*        FOLLOWING LABEL.)                                              TIC24590
*                                                                       TIC24600
OPERATORDIDCOMMAND RES 0                                                TIC24610
         MTW,-1    TICINTOPERATORLATER NOW ALLOW ANOTHER ENTRANCE.
         B         TICINTMTRTN         COMMAND DONE; SO OUT.            TIC24620
*                                                                       TIC24630
*                                                                       TIC24640
*                                                                       TIC24650
OPCOMMANDLETTERTABLE RES 0                                              TIC24660
         GEN,8,24  'M',OPERATORMESSAGE                                  TIC24670
         GEN,8,24  'D',OPERATORDISPLAY                                  TIC24680
         GEN,8,24  'N',OPERATORNET                                      TIC24690
         GEN,8,24  'R',OPERATORREGULATE                                 TIC24700
         GEN,8,24  'A',OPERATORACQUIRE                                  TIC24710
         GEN,8,24  'F',OPERATORFREE                                     TIC24720
         GEN,8,24  'X',OPERATORX                                        TIC24730
OPCOMMANDTABLESIZE EQU %-OPCOMMANDLETTERTABLE                           TIC24740
*
TICINTMESS TEXTC   'TIC HERE: '                                         TIC24760
         TITLE     'TIC - OPCOM - UTILITIES'
*                                                                       TIC69760
*        BUILD LIST OF AFFECTED STATIONS BY #DEV NUMBER.                TIC69770
*                                                                       TIC69780
*        ENTER WITH C(R8) = FIRST FOUR CHAR OF STATION-SPECIFICATION.   TIC69790
*                   C(R9) = LAST FOUR CHAR OF STATION-SPECIFICATION.    TIC69800
*                                                                       TIC69810
*        RETURNS IN R8 DSP OF A LIST OF HW #DEV NUMBERS,                TIC69820
*        FOLLOWED BY A HW -1.                                           TIC69830
*                                                                       TIC69832
*        USES R5 AND R10.                                               TIC69833
*                                                                       TIC69840
MAKESTATIONLIST RES 0                                                   TIC69850
         AI,8      0                   SEE IF NO FIELD = ALL STATIONS.  TIC69860
         BEZ       MAKESTATIONLISTALL  OVER IF SO.                      TIC69870
*
*        FIRST CONVERT THE EBCDIC IN R9
*        TO HEX IN CASE WE GET TO THE CODE
*        DOWN AT MAKESTATIONLIST237-242:
*
         CW,9      ='    '             IS IT HEX IN EBCDIC.
         BE        MAKESTATIONLIST205  OVER IF NOT.
*
         LW,5      9
         LI,9      0
         LB,#ARG   5
         EOR,#ARG  =X'F0'
         CI,#ARG   X'F0'
         BAZ       %+2
         AI,#ARG   9-48
         SLS,9     4
         OR,9      #ARG
         SLS,5     8
         AI,5      0
         BNEZ      %-9
*                                                                       TIC69880
MAKESTATIONLIST205 RES 0
         LW,5      #BIGGEST#TIC#TASK   FOR ALL STATIONS, SEE IF SPECIFIETIC69890
MAKESTATIONLIST210 RES 0                                                TIC69900
         #T#GET,10,5 #DEV#LINE#IDENTIFIER STATION'S IDENTIFIER.         TIC69910
         CW,10     8                   IS IT THE SAME?                  TIC69920
         BEZ       MAKESTATIONLIST250  OUT IF THE SAME.                 TIC69930
         BDR,5     MAKESTATIONLIST210  LOOP TRYING FOR MATCH.           TIC69940
*                                                                       TIC69950
*        FALL THROUGH ON NO HIT WITH POINT-TO-POINT                     TIC69960
*        LINE-ID'S - SO TRY MULTI-POINT ID'S:                           TIC69970
*                                                                       TIC69980
         LW,5      #BIGGEST#MDL#TASK
MAKESTATIONLIST220 RES 0
         #T#GET,10,5 #DEV#LINE#IDENTIFIER
         CW,10     8
         BE        MAKESTATIONLIST230
         BIR,5     MAKESTATIONLIST220
*                                                                       TIC69990
*        FALL THROUGH ON NO MULTI-POINT MATCH EITHER.                   TIC70000
*                                                                       TIC70010
         LI,8      0                   RETURN NO LIST.                  TIC70020
         B         *15                                                  TIC70030
*
MAKESTATIONLIST230 RES 0
         CW,9      ='    '
         BE        MAKESTATIONLIST645
*
*        FALL THROUGH WHEN IT'S A PARTICULAR MULTIPOINT STATION.
*
         LW,10     5                   COPY MDC-TASK NUMBER.
*
         LW,5      #BIGGEST#TIC#TASK   FOR ALL DEV-TASKS,
MAKESTATIONLIST237 RES 0                SEE IF
         #T#GET,#ARG,5 #DEV#DCB#POINTER  MDL-TASK
         CW,#ARG   10                     NUMBER AND
         BNE       MAKESTATIONLIST242      PHYSICAL
         #T#GET,#ARG,5 #DEV#LINE#IDENTIFIER IDENTIFIER
         CW,#ARG   9                          AGREE.
         BE        MAKESTATIONLIST250  OUT TO MAKE LIST IF SO.
MAKESTATIONLIST242 RES 0
         BDR,5     MAKESTATIONLIST237  LOOP FOR ALL DEV-TASKS.
*
         LI,8      0                   IF NO MATCH,
         B         *15                  RETURN NO LIST.
*                                                                       TIC70040
MAKESTATIONLIST250 RES 0               HERE TO MAKE ONE-POINT-TO-POINT- TIC70050
*                                      STATION LIST.                    TIC70060
         #GET#MAIN#BYTES 4                                              TIC70070
         LW,8      #ARG                COPY DSP TO RETURN REGISTER.     TIC70080
         SLS,#ARG  -1                  HA OF LIST.                      TIC70090
         STH,5     0,#ARG              STATION'S #DEV --> LIST.         TIC70100
         AI,#ARG   1                   BUMP TO NEXT (= LAST) HW.        TIC70110
MAKESTATIONLIST290 RES 0                                                TIC70120
         LI,10     -1                  FENCE.                           TIC70130
         STH,10    0,#ARG              TO LIST.                         TIC70140
         AI,8      0                   SET RETURN CC.                   TIC70150
         B         *15                 AND RETURN.                      TIC70160
*                                                                       TIC70170
MAKESTATIONLISTALL RES 0               HERE TO MAKE LIST OF ALL STATIONSTIC70180
         LW,#ARG   #BIGGEST#TIC#TASK   NUMBER OF STATIONS.              TIC70190
         AI,#ARG   1                   PLUS ONE FOR FENCE.              TIC70200
         SLS,#ARG  1                   DOUBLED FOR HALFWORDS.           TIC70210
         #GET#MAIN#BYTES                GET THAT MANY BYTES.            TIC70220
*                                                                       TIC70230
         LW,8      #ARG                DSP OF LIST TO RETURN REGISTER.  TIC70240
*                                                                       TIC70250
         SLS,#ARG  -1                  HA OF LIXT.                      TIC70260
         LW,10     #BIGGEST#TIC#TASK   PUT ALL                          TIC70270
         STH,10    0,#ARG               STATIONS                        TIC70280
         AI,#ARG   1                     INTO LIST.                     TIC70290
         BDR,10    %-2                                                  TIC70300
*                                                                       TIC70310
         B         MAKESTATIONLIST290  BACK TO STORE FENCE AND EXIT.    TIC70320
*
*
*
MAKESTATIONLIST645 RES 0               HERE FOR ALL STATIONS ON
*                                       THE INDICATED MULTIPOINT LINE
         LW,10     5                   COPY MDL-TASK NUMBER.
         LW,5      #BIGGEST#TIC#TASK   FOR ALL DEV-TASKS.
         LI,9      2                   COUNT THE
MAKESTATIONLIST670 RES 0                ONES THAT ARE
         #T#GET,#ARG,5 #DEV#DCB#POINTER  ASSOCIATED
         CW,#ARG   10                     WITH THIS
         BNE       %+2                      MDL LINE.
         AI,9      2                   (COUNT IS 2*N+2 FOR EASE LATER)
         BDR,5     MAKESTATIONLIST670
*
         LW,#ARG   9                   GET 2*N+2 BYTES.
         #GET#MAIN#BYTES
         LW,8      #ARG                COPY STORAGE DSP TO RETURN REGIST
         SLS,#ARG  -1                  HA OF LIST.
         STW,#ARG  9                   TO R9.
*
         LW,5      #BIGGEST#TIC#TASK   FOR ALL DEV-TASKS.
MAKESTATIONLIST690 RES 0                SCAN
         #T#GET,#ARG,5 #DEV#DCB#POINTER  AGAIN
         CW,#ARG   10                     AND PUT
         BNE       %+4                     RIGHT ONES
         LW,#ARG   9                        INTO LIST.
         STH,5     0,#ARG
         AI,9      1
         BDR,5     MAKESTATIONLIST690
*
         LI,10     -1                  THEN PUT
         LW,#ARG   9                    FENCE AT
         STH,10    0,#ARG                THE END.
*
         AI,8      0                   SET RETURN CC.
         B         *15                 AND RETURN.
         PAGE                                                           TIC70330
*                                                                       TIC70340
*                                                                       TIC70350
*                                                                       TIC70360
OPERATORMESSAGE RES 0                  HERE ON "!MESSAGE"               TIC70370
         FIELD6789LOADAAAAAAAA,OPERATORCOMMANDNOT GET COMMAND NAME      TIC70380
         CW,8      ='M   '                                              TIC70390
         BE        %+3                                                  TIC70400
         CD,8      OPERATORMESSAGENAME                                  TIC70410
         BNE       OPERATORCOMMANDNOT                                   TIC70420
*                                                                       TIC70430
         LW,5      6                   COPY SCAN POINTER.               TIC70440
         FIELD6789LOADAAAAAAAA,OPERATORCOMMANDNOT GET NEXT FIELD.       TIC70450
         LB,10     8                   ISOLATE FIELD'S FIRST CHARACTER. TIC70460
*                                                                       TIC70470
         CI,10     ''''                SEE IF FIELD IS QUOTED.          TIC70480
         BNE       OPERATORMESSAGELIST IF NO QUOTES, MAKE STATION LIST. TIC70490
*                                                                       TIC70500
*        SECOND FIELD WAS QUOTED.  SO WE WANT TO SEND TO ALL STATIONS   TIC70510
*                                                                       TIC70520
         LW,6      5                   PUT SCAN POINTER BACK.           TIC70530
*                                                                       TIC70540
         LI,8      0                   AND SET FOR LIST OF ALL STATIONS.TIC70550
*                                                                       TIC70560
*                                                                       TIC70570
OPERATORMESSAGELIST RES 0                                               TIC70580
         BAL,15    MAKESTATIONLIST                                      TIC70590
         BEZ       OPERATORNOWHERE                                      TIC70600
         LW,12     8                                                    TIC70610
*                                                                       TIC70620
*        WHEN HERE, DSP OF STATION LIST IS IN R12.                      TIC70630
*                                                                       TIC70640
         FIELD6789POINTTOSTRING,OPERATORMESSAGEBAD                      TIC70650
*                                                                       TIC70660
         LW,#ARG   9                   CHARACTER COUNT.                 TIC70670
         AI,#ARG   1                   PLUS A BYTE FOR TEXTC.
         #GET#MAIN#BYTES                GET SPACE FOR 'EM.              TIC70680
         LW,10     8                   BA OF QUOTED STRING.             TIC70690
         LW,11     #ARG                BA OF WHERE TO PUT STRING.       TIC70700
         STB,9     0,#ARG              TEXTC COUNT --> STRING.
         STB,9     11                  PUT IN COUNT.                    TIC70710
         STW,11    13                  AND SAVE BA & COUNT WORD.        TIC70715
         AI,11     1                   MBS PAST THE COUNT BYTE.
         MBS,10    0                   MOVE BYTES (<255 'CAUS OF OP'S LLTIC70720
*                                                                       TIC70730
*        WHEN HERE, DSP TO STATION LIST IN R12 AND                      TIC70740
*        DSP TO MESSAGE IN R8.                                          TIC70750
*                                                                       TIC70760
         #GET#MAIN#BYTES 12            GET THREE WORDS.                 TIC70770
         AND,#ARG  =X'7FFFF'           NEATEN BA.                       TIC70780
         SLS,#ARG  -2                  INTO A WA.                       TIC70790
*                                                                       TIC70800
         STW,12    1,#ARG              STATION LIST DSP TO WORD ONE.    TIC70810
         STW,13    2,#ARG              MESSAGE LAL TO WORD TWO.         TIC70820
*                                                                       TIC70830
         LW,9      #MESSAGE#CHAIN      CHAIN THE THREE WORD             TIC70840
         STW,#ARG  #MESSAGE#CHAIN       BLOCK INTO THE CHAIN            TIC70850
         STW,9     *#ARG                 OF PENDING MESSAGES.           TIC70860
*                                                                       TIC70870
         B         OPERATORDIDCOMMAND                                   TIC70880
*                                                                       TIC70890
*                                                                       TIC70900
*                                                                       TIC70910
OPERATORMESSAGEBAD RES 0                                                TIC70920
         LW,#ARG   12                  DSP OF STATION LIST.             TIC70930
         #FREE#MAIN#BYTES              RETURN SPACE.                    TIC70940
         B         OPERATORCOMMANDBAD  AND EXIT                         TIC70950
*                                                                       TIC70960
*                                                                       TIC70970
*                                                                       TIC70980
         BOUND     8                                                    TIC70990
OPERATORMESSAGENAME TEXT 'MESSAGE '                                     TIC71000
         PAGE                                                           TIC71010
*                                                                       TIC71020
*        HERE ON OPERATOR 'REGULATE' COMMAND.                           TIC71030
*                                                                       TIC71040
OPERATORREGULATE RES 0                                                  TIC71050
*                                                                       TIC71060
         FIELD6789LOADAAAAAAAA,OPERATORBAD GET COMMAND NAME.            TIC71070
         CW,8      ='R   '             CHECK IT.                        TIC71080
         BE        %+3                 SHOULD BE 'REGULATE'             TIC71090
         CW,9      ='LATE'             OR                               TIC71100
         BNE       OPERATORCOMMANDNOT  JUST FIRST LETTER.               TIC71110
*
         STW,6     13                  REMEMBER THE SCAN POINTER.
*                                                                       TIC71120
         FIELD6789LOADAAAAAAAA,OPERATORBAD                              TIC71130
         LB,10     8                                                    TIC71140
         CI,10     '?'                                                  TIC71150
         BE        OPERATORREGULATE200 ALL IF @?# HERE.                 TIC71160
         CI,10     '@'                                                  TIC71170
         BE        OPERATORREGULATE200 ALL IF @?# HERE.                 TIC71180
         CI,10     '#'                                                  TIC71190
         BE        OPERATORREGULATE200 ALL IF @?# HERE.                 TIC71200
         CI,10     'O'                 ALL IF ON/OFF HERE.
         BE        OPERATORREGULATE200
*                                                                       TIC71230
         BAL,15    MAKESTATIONLIST                                      TIC71240
         BEZ       OPERATORCOMMANDBAD                                   TIC71250
         B         OPERATORREGULATE210
*                                                                       TIC71300
OPERATORREGULATE200 RES 0                                               TIC71310
         LI,8      0                   SET TO CREATE LIST
         BAL,15    MAKESTATIONLIST      OF ALL STATIONS.
*
OPERATORREGULATE210 RES 0
         LW,14     8                   COPY DSP OF STATION LIST.
*
         LW,6      13                  RE-LOAD SCAN POINTER.
OPERATORREGULATE220 RES 0
         FIELD6789LOADAAAAAAAA,OPERATORREGULATEBAD
         LB,10     8                   GET FISST CHAR OF FIELD.
         CI,10     'O'                 ISS IF ON/OFF
         BNE       OPERATORREGULATE220 LOOP UNTIL WE FIND IT.
*
         SLS,8     8                   GET NEXT CHARACTER OF FIELD.
         LB,10     8                   ISOLATED.
         CI,10     'N'                 SEE IF 'ON'
         BE        OPERATORREGULATE500 OVER IF 'ON'
         CI,10     'F'                 SEE IF 'OFF'
         BE        OPERATORREGULATE400 OVER IF 'OFF'
*
*        FALL THROUGH IF NO ON/OFF FIELD.
*
OPERATORREGULATEBAD RES 0
         LW,#ARG   14                  RETRIEVE DSP OF STATION LIST.
         #FREE#MAIN#BYTES              AND FREE IT.
         B         OPERATORCOMMANDBAD  AND COMPLAIN ABOUT SYNTAX.
*
*
*
OPERATORREGULATE400 RES 0              HERE ON 'OFF'
         LW,6      13                  RE-LOAD SCAN POINTER.
         LI,12     0                   LOAD BITS TO OR IN.
*
OPERATORREGULATE405 RES 0
         FIELD6789LOADAAAAAAAA,OPERATORREGULATEBAD NO WAY TO TAKE CF(2).
         LB,10     8                   ISOLATE FIRST BYTE.
         CI,10     'O'                 ARE WE AT 'OFF' YET.
         BE        OPERATORREGULATE440 OVER IF SO.
*
         CI,10     '?'                 TEST FOR
         BNE       %+2                  EACH CHARACTER
         OR,12     =#REGULATE#QUESTION   AND ADJUST R12.
         CI,10     '@'
         BNE       %+2
         OR,12     =#REGULATE#AT
         CI,10     '#'
         BNE       OPERATORREGULATE405
         OR,12     =#REGULATE#CRUNCH
         B         OPERATORREGULATE405
*
OPERATORREGULATE440 RES 0
         AI,12     0                   SEE IF NO REGULATIONS.
         BNEZ      %+2                 OVER IF SOME REGULATION.
         LI,12     #REGULATE#QUESTION+#REGULATE#AT+#REGULATE#CRUNCH
*                                      (NO REGULATION = ALL REGULATION)
*
         LW,7      14                  COPY DSP OF STATION LIST.
         SLS,7     -1                  MAKE IT A HA.
OPERATORREGULATE450 RES 0
         LH,5      0,7                 GET A STATION BY #DEV.
         BLZ       OPERATORREGULATE700 OVER IF DONE EM ALL.
         #T#GET,10,5 #DEV#REGULATION   GET CURRENT REGULATION.
         OR,10     12                  AND CHANGE APPROPO.
         #T#PUT,10,5 #DEV#REGULATION   AND PUT THEM BACK.
         #T#GET,10,5 #DEV#LINE#STATUS#BITS ALSO SIGNAL
         OR,10     =#LINE#REGULATED     THAT WE REGULATED.
         #T#PUT,10,5 #DEV#LINE#STATUS#BITS
         AI,7      1                   BUMP TO NEXT STATION OR FENCE.
         B         OPERATORREGULATE450 AND PROCESS IT.
*
*
*
OPERATORREGULATE500 RES 0              HERE ON 'ON'.
         LW,6      13                  RE-LOAD SCAN POINTER.
         LI,12     -1                  SET TO LEAVE ALL BITS ON.
*
OPERATORREGULATE505 RES 0
         FIELD6789LOADAAAAAAAA,OPERATORREGULATEBAD
         LB,10     8                   ISOLATE FIRST BYTE OF FIELD.
         CI,10     'O'                 ARE WE AT 'ON' YET.
         BE        OPERATORREGULATE540 OVER IF SO.
*
         CI,10     '?'                 ADJUST R12
         BNE       %+2                  FOR THE PRESENT
         AND,12    =(-#REGULATE#QUESTION-1) FIELDS.
         CI,10     '@'
         BNE       %+2
         AND,12    =(-#REGULATE#AT-1)
         CI,10     '#'
         BNE       OPERATORREGULATE505
         AND,12    =(-#REGULATE#CRUNCH-1)
         B         OPERATORREGULATE505
*
OPERATORREGULATE540 RES 0
         LW,7      14                  COPY DSP OF STATION LIST.
         SLS,7     -1                  AND MAKE IT A HA.
*
         CI,12     -1                  SEE IF NO REGULATIONS PRESENT.
         BNE       %+2                 OVER IF SOME PRESENT.
         LI,12     0                   IF NONE PRESENT, 'ON' ALL.
OPERATORREGULATE550 RES 0
         LH,5      0,7                 GET THE #DEV OF A STATION.
         BLZ       OPERATORREGULATE700 DONE IF ITS THE FENCE.
*
         #T#GET,10,5 #DEV#REGULATION   GET CURRENT REGULATIONS.
         AND,10    12                  AND ADJUST THEM.
         #T#PUT,10,5 #DEV#REGULATION   AND PUT THEM BACK.
         #T#GET,10,5 #DEV#LINE#STATUS#BITS AND THEN
         OR,10     =#LINE#REGULATED     INDICATE WE
         #T#PUT,10,5 #DEV#LINE#STATUS#BITS REGULATED HIM.
*
         AI,7      1                   BUMP TO NEXT STATION OR FENCE.
         B         OPERATORREGULATE550 AND GO PROCESS.
*
*
*
OPERATORREGULATE700 RES 0              HERE WHEN DONE REGULATIOG.
         LW,#ARG   14                  DSP OF STATION LIST.
         #FREE#MAIN#BYTES              FREE THE STATION LIST.
         B         OPERATORDIDCOMMAND  AND WE ARE DONE.
         PAGE                                                           TIC71320
*                                                                       TIC71330
*        HERE ON OPERATOR 'NET' COMMAND.                                TIC71340
*                                                                       TIC71350
OPERATORNET RES    0                                                    TIC71360
*                                                                       TIC71370
         FIELD6789LOADAAAAAAAA                                          TIC71380
         CW,8      ='NET '                                              TIC71390
         BE        %+3                                                  TIC71400
         CW,8      ='N   '                                              TIC71410
         BNE       OPERATORBAD                                          TIC71420
*                                                                       TIC71430
         FIELD6789LOADAAAAAAAA                                          TIC71440
         CW,8      ='OFF '                                              TIC71450
         BE        OPERATORNETOFF                                       TIC71460
         CW,8      ='ON  '                                              TIC71470
         BNE       OPERATORBAD                                          TIC71480
*                                                                       TIC71490
OPERATORNETON RES  0                                                    TIC71500
         #POST#ECB #NET#ECB                                             TIC71510
         B         OPERATORDIDCOMMAND                                   TIC71520
*                                                                       TIC71530
OPERATORNETOFF RES 0                                                    TIC71540
         #CLEAR#ECB #NET#ECB                                            TIC71550
         B         OPERATORDIDCOMMAND                                   TIC71560
         PAGE                                                           TIC71570
*                                                                       TIC71580
*        HERE ON OPERATOR 'DISPLAY' COMMAND.                            TIC71590
*                                                                       TIC71600
OPERATORDISPLAY RES 0                                                   TIC71610
*                                                                       TIC71620
         FIELD6789LOADAAAAAAAA,OPERATORCOMMANDNOT                       TIC71630
         CW,8      ='D   '             MAKE                             TIC71640
         BE        %+3                  SURE                            TIC71650
         CW,9      ='LAY '               GOOD                           TIC71660
         BNE       OPERATORCOMMANDNOT     COMMAND.                      TIC71670
*                                                                       TIC71680
         FIELD6789LOADAAAAAAAA,OPERATORDISPLAYALL GET STATIONS.         TIC71690
         B         OPERATORDISPLAYLIST  AND OVER TO MAKE LIST.          TIC71700
*                                                                       TIC71710
OPERATORDISPLAYALL RES 0               HERE ON ALL STATIONS.            TIC71720
         LI,8      0                                                    TIC71730
*                                                                       TIC71740
OPERATORDISPLAYLIST RES 0                                               TIC71750
         BAL,15    MAKESTATIONLIST     MAKE LIST OF STATIONS TO DISPLAY.TIC71760
         BEZ       OPERATORCOMMANDBAD  OUT IF NO STATIONS.              TIC71770
*                                                                       TIC71780
*        HERE WITH DSP OF LIST OF HW STATION                            TIC71790
*        NUMBERS IN R8.  DISPLAY 'EM.                                   TIC71800
*                                                                       TIC71810
         LW,14     8                   REMEMBER DSP FOR LATER FREEING.  TIC71820
*                                                                       TIC71830
         SLS,8     -1                  R8 TO HW ADDRESS OF #DEV NUMBERS.TIC71840
*                                                                       TIC71850
         LW,7      8                                                    TIC71860
*                                                                       TIC71862
OPERATORDISPLAY222 RES 0                                                TIC71863
         LH,5      0,7                 GET A #DEV TO DISPLAY.
         BLZ       OPERATORDISPLAYDONE OVER WHEN WE HIT FENCE.          TIC71880
*                                                                       TIC71890
*        HAVE #DEV TO DISPLAY IN R5.
*                                                                       TIC71910
*        WE CAN USE STATIC STORAGE TO FORMAT OUR                        TIC71920
*        DISPLAY LINE BECAUSE THIS IS NOT RE-ENTRANT                    TIC71930
*        ROUTINE SINCE IT IS M:INT CONTROLLED.                          TIC71940
*                                                                       TIC71950
         #T#GET,10,5 #DEV#LINE#IDENTIFIER
         STW,10    OPERATORDISPLAYBUFFERID                              TIC71970
         LW,11     ='    '
         STW,11    OPERATORDISPLAYBUFFERID+1
*
         #T#GET,6,5 #DEV#DCB#POINTER   SEE IF MULTIPOINT
         BGZ       OPERATORDISPLAY340  OVER IF NOT.
*
*        FALL THROUGH IF MULTIPOINT.
*        R10 HAS PHYSICAL ADDRESS.
*
         SLD,10    -16                 CONVERT
         LI,12     4                    PHYSICAL
         LI,10     0                     ADDRESS
         SLD,10    4                      IN R10
         LW,#ARG   10                      TO EBCDIC
         LB,10     HEXTABLE,#ARG            PHYSICAL
         SLS,13    8                         ADDRESS
         OR,13     10                         IN R13.
         BDR,12    %-6
*
         #T#GET,12,6 #DEV#LINE#IDENTIFIER GET REAL ID OF MULTIPOINT LINE
         STW,12    OPERATORDISPLAYBUFFERID STORE UDENTIFIER.
         STW,13    OPERATORDISPLAYBUFFERID+1 AND PHYSICAL ADDRESS.
*
OPERATORDISPLAY340 RES 0
*                                                                       TIC71972
         LW,11     =' NOT'             SET NOT LOGGED ON - FOR BELOW.
         STW,11    OPERATORDISPLAYBUFFERNOT                             TIC71980
         LI,6     51                SHORT CNT IN CASE NOT LOGGED ON.
         #T#GET,9,5    #DEV#LINE#STATUS#BITS
         CI,9     #LINE#UNACQUIRED
         BAZ      OPERATORDISPLAY370
         LI,11    X'E4D5'           PUT 'UN' BEFORE ACQUIRED
         B        OPERATORDISPLAY372
OPERATORDISPLAY370  RES  0
         LI,11    X'4040'
OPERATORDISPLAY372  RES  0
         STH,11   OPERATORDISPLAYBUFFERID+3
*                                                                       TIC71981
         #T#GET,10,5 #DEV#LOGON#BLOCK  SEE IF LOGGED ON.
         BEZ       OPERATORDISPLAY600  SEND SHORT MESSAGE IF NOT.
*                                                                       TIC72010
OPERATORDISPLAY400 RES 0                                                TIC72012
         LW,11     =' IS '             IF LOGGED ON, TURN               TIC72014
         STW,11    OPERATORDISPLAYBUFFERNOT 'NOT' INTO 'IS'.            TIC72015
*                                                                       TIC72016
         LW,11     ='    '             BLANK OUT NAME PLACE             TIC72061
         STW,11    OPERATORDISPLAYBUFFERNAME      IN THE                TIC72062
         STW,11    OPERATORDISPLAYBUFFERNAME+1     MESSAGE.             TIC72063
*                                                                       TIC72064
         #T#GET,6,5 #DEV#AT#NAME#LAL   GET POINTER TO HIS NAME.
         LB,11     6                   ISOLATE BYTE COUNT.              TIC72071
         AI,11     -1                  LESS TRAILING PERIOD.            TIC72072
         LI,#ARG   BA(OPERATORDISPLAYBUFFERNAME) WHERE TO PUT NAME.
         LB,12     0,6                 COPY                             TIC72074
         STB,12    0,#ARG               HIS
         AI,6      1                     NAME                           TIC72076
         AI,#ARG   1                      TO
         BDR,11    %-4                     MESSAGE.                     TIC72078
*
         CI,9     #LINE#UNACQUIRED
         BAZ      OPERATORDISPLAY420
         LI,6     68                TRUNCATE OUTPUT AFTER NAME
         B        OPERATORDISPLAY600  IF UNACQUIRED & LOGGED ON.
OPERATORDISPLAY420  RES  0
         #T#GET,6,5  #DEV#DOING
         LD,10    OPERATORDISPLAYDOINGS,6
         STW,10   OPERATORDISPLAYBUFFERDOING
         STW,11   OPERATORDISPLAYBUFFERDOING+1
         LI,6     88
         #T#GET,9,5 #DEV#REGULATION    SEE IF REGULATED.
         BEZ       OPERATORDISPLAY600  SEND MIDDLE LENGTH IF NOT.
*
*        FALL THROUGH IF SOME REGULATION.
*
         LI,6     100               MSG LENGTH UP TO REGULATION.
         CI,9      #REGULATE#QUESTION  SEE IF ?-REG.
         BAZ       %+4                 OVER IF NOT.
         LI,8      '?'                 IF SO, PUT CHAR
         STB,8     OPERATORDISPLAYBUFFER,6 IN OUTPUT BUFFER
         AI,6      2                     AND BUMP POINTER.
         CI,9      #REGULATE#AT
         BAZ       %+4                 AND THE SAME FOR OTHER TWO ...
         LI,8      '@'
         STB,8     OPERATORDISPLAYBUFFER,6
         AI,6      2
         CI,9      #REGULATE#CRUNCH
         BAZ       %+4
         LI,8      '#'
         STB,8     OPERATORDISPLAYBUFFER,6
         AI,6      2
*
OPERATORDISPLAY600 RES 0
         STB,6     OPERATORDISPLAYBUFFER BYTE COUNT --> TEXTC COUNT.
*
         M:TYPE    (MESS,OPERATORDISPLAYBUFFER)
*
         AI,7      1                   BUMP TO NEXT HW STATION #DEV.
         B         OPERATORDISPLAY222  AND GO TO DISPLAY NEXT STATION.
*                                                                       TIC72240
OPERATORDISPLAYDONE RES 0                                               TIC72250
         LW,#ARG   14                  GET DSP OF THE LIST OF STATIONS  TIC72260
         #FREE#MAIN#BYTES                AND FREE THE LIST.             TIC72270
*                                                                       TIC72280
         B         OPERATORDIDCOMMAND  AND WE ARE DONE WITH COMMAND.    TIC72290
         PAGE
*
*        HERE ON OPERATOR 'ACQUIRE' COMMAND.
*
         BOUND     8
OPERATORACQUIRETEXT TEXT 'ACQUIRE '
OPERATORACQUIRE RES 0
*
         FIELD6789LOADAAAAAAAA,OPERATORCOMMANDNOT
         CW,8      ='A   '             MAKE SURE
         BE        %+3                  IT'S REALLY
         CD,8      OPERATORACQUIRETEXT   THIS COMMAND.
         BNE       OPERATORCOMMANDNOT
*
         FIELD6789LOADAAAAAAAA,OPERATORACQUIREALL
         B         %+2                 OVER IF STATION(5) INDICATED.
OPERATORACQUIREALL LI,8 0              NO INDICATION = ALL STATIONS.
         BAL,15    MAKESTATIONLIST       CREATE LIST OF #DEV'S TO ACQUIR
         LW,14     8                      AND REMEMBER DSP OF LIST.
         BEZ       OPERATORCOMMANDBAD
*
         LW,7      8                   COPY BA OF LIST.
         SLS,7     -1                  TO HA OF LIST.
*
OPERATORACQUIRE222 RES 0
         LH,5      0,7                 GET A STATION'S #DEV
         BLZ       OPERATORACQUIRE700  OVER IF AT FENCE.
*
         #T#GET,8,5 #DEV#LINE#STATUS#BITS GET LINE STATUS.
         CI,8      #LINE#UNACQUIRED    SEE IF ALREADY ACQUIRED.
         BAZ       OPERATORACQUIRE650  OVER IF SO.
*
         #T#GET,8,5 #DEV#DCB#POINTER   SEE IF MULTIPOINT.
         BLZ       OPERATORACQUIRE400  OVER IF SO.
*
*        HERE TO ACQUIRE A CXXX LINE.
*
         #T#GWA,8,5 #DEV#LINE#IDENTIFIER
         M:GETLINE *8                  NO ERROR TEST IN CASE WE ALREADY
*                                      OWN IT BUT HAD FAILED ON OPEN.
*
         #T#GET,4,5 #DEV#DCB#POINTER
         LW,8      *#DCB#TABLE#IW,4
         #T#GWA,9,5 #DEV#LINE#IDENTIFIER
         M:OPEN    *8,(LINE,*9),(ERR,OPERATORACQUIRE620),;
                                (ABN,OPERATORACQUIRE620)
         M:SETDCB  *8,(ERR,COCLINEERR),(ABN,COCLINEABN)
         M:PURGE   *8
*
OPERATORACQUIRE390 RES 0               SET STATION'S ACQUIRED BIT:
         #T#GET,9,5 #DEV#LINE#STATUS#BITS SET LINE/STATION
         AND,9     =(-#LINE#UNACQUIRED-1)  STATUS TO
         CI,9      #LINE#SWITCHABLE    IF LINE IS SWITCHABLE,
         BAZ       %+2                  THEN REMIND OURSELVES
         AND,9     =(-#LINE#SWITCH#DONT-1) TO NOT FOR NOW.
         #T#PUT,9,5 #DEV#LINE#STATUS#BITS   ACQUIRED.
         B         OPERATORACQUIRE650
*
OPERATORACQUIRE400 RES 0
*
*        HERE TO ACQUIRE A MXXX STATION.
*
         #T#GET,4,5 #DEV#DCB#POINTER   PUT THE STATION
         LW,8      *#DCB#TABLE#IW,4     BACK INTO THE
         #T#GET,9,5 #DEV#MULTIPOINT#INDEX LIST.
         M:MDFLST  *8,(INCL,9),(PSL)
*
         #T#GET,9,4 #DEV#LINE#STATUS#BITS
         OR,9      =(#LINE#REESTABLISH)
         #T#PUT,9,4 #DEV#LINE#STATUS#BITS
         #T#POST,#ARG,4 #MDL#WAKEUP#ECB
*
         #T#GET,9,4 #DEV#LINE#STATUS#BITS GET STATUS OF LINE
         CI,9      #LINE#UNACQUIRED    SEE IF NOT ACQUIRED.
         BAZ       OPERATORACQUIRE474  OVER IF ALREADY ACQUIRED.
         #T#GWA,9,4 #DEV#LINE#IDENTIFIER GET ID AND GET LINE.
         M:GETLINE *9                  NO ERROR TEST - SOMEHOW WE MAY
*                                      ALREADY OWN IT
*
         #T#GWA,9,4 #DEV#LINE#IDENTIFIER
         M:OPEN    *8,(LINE,*9),(ERR,OPERATORACQUIRE620),;
                                (ABN,OPERATORACQUIRE620)
         M:SETDCB  *8,(ERR,MOCLINEERR),(ABN,MOCLINEABN)
*
         #T#GET,9,4 #DEV#LINE#STATUS#BITS SET LINE
         AND,9     =(-#LINE#UNACQUIRED-1)  STATUS TO
         #T#PUT,9,4 #DEV#LINE#STATUS#BITS   ACQUIRED.
*
OPERATORACQUIRE474 RES 0
         #T#GET,9,4 #DEV#LINE#STATUS#BITS        INDICATE WE ACQUIRED
         AND,9     =(-#LINE#AWAITING#ACQUIRE-1)   IN CASE ANYONE IS
         #T#PUT,9,4 #DEV#LINE#STATUS#BITS          WAITING FOR TOGGLE.
*
         B         OPERATORACQUIRE390  AND GO SET STATION ACQUIRED.
*
*
OPERATORACQUIRE620 RES 0
         M:TYPE    (MESS,OPERATORACQUIREMESS)
*O*  MESSAGE:     'UNABLE TO GET OR OPEN LINE'
*O*  ACTION:      IF STATION-ID USED WITH ACQUIRE COMMAND, CHECK FOR
*O*               VALID ID; OTHERWISE, CHECK ALL STATIONS IN NETWORK.
*O*  MEANING:     TIC'S ATTEMPT TO SERVICE AN OPERATOR ACQUIRE
*O*               COMMAND FAILED.
         B         OPERATORACQUIRE700
OPERATORACQUIREMESS TEXTC 'UNABLE TO GET OR OPEN LINE'
*
*
*
OPERATORACQUIRE650 RES 0
         AI,7      1                   BUMP TO NEXT STATION IN LIST.
         B         OPERATORACQUIRE222  AND GO TO PROCESS.
*
*
*
OPERATORACQUIRE700 RES 0
         LW,#ARG   14                  FREE SPACE OF
         #FREE#MAIN#BYTES               STATION LIST.
*
         B         OPERATORDIDCOMMAND  AND WE'RE DONE.
         PAGE
*
*        HERE ON OPERATOR 'FREE' COMMAND.
*
         BOUND     8
OPERATORFREETEXT TEXT 'FREE    '
OPERATORFREE RES   0
*
         FIELD6789LOADAAAAAAAA,OPERATORCOMMANDNOT
         CW,8      ='F   '             MAKE SURE
         BE        %+3                  IT'S REALLY
         CD,8      OPERATORFREETEXT      THIS COMMAND.
         BNE       OPERATORCOMMANDNOT
*
         FIELD6789LOADAAAAAAAA,OPERATORFREEALL
         B         %+2                 OVER IF STATION(5) INDICATED.
OPERATORFREEALL LI,8 0                 NO INDICATION = ALL STATIONS.
         BAL,15    MAKESTATIONLIST     CREATE LIST OF STATIONS TO FREE.
         LW,14     8                   REMEMBER DSP OF LIST.
         BEZ       OPERATORCOMMANDBAD
*
         LW,7      8                   COPY BA OF LIST.
         SLS,7     -1                  TO HA OF LIST.
*
OPERATORFREE222 RES 0
         LH,4      0,7                 GET A STATION'S #DEV.
         BLZ       OPERATORFREE700     OVER IF AT FENCE.
*
         #T#GET,5,4 #DEV#DCB#POINTER   SEE IF MULTIPOINT.
         BLZ       OPERATORFREE400     OVER IF SO.
*
*        HERE TO FREE A CXXX LINE.
*
         LW,8      *#DCB#TABLE#IW,5
         M:SETDCB  *8,(ERR,OPERATORFREE370),(ABN,OPERATORFREE370)
         M:CLOSE   *8
OPERATORFREE370 RES 0
         #T#GWA,8,4 #DEV#LINE#IDENTIFIER
         M:RLSLINE *8
*
         #T#GET,9,4 #DEV#LINE#STATUS#BITS
         OR,9      =#LINE#UNACQUIRED
         CI,9      #LINE#SWITCHABLE    NEATEN ANY
         BAZ       %+2                  SWITCH-DONT BITS
         OR,9      =#LINE#SWITCH#DONT    (NOT MY LOGIC)
         #T#PUT,9,4 #DEV#LINE#STATUS#BITS
*
         B         OPERATORFREE650
*
*
*
OPERATORFREE400 RES 0
*
*        HERE TO FREE A MXXX STATION.
*
         BAL,15    MDLSTARTTOFREESTATION SIGNAL TO FREE R4 GUY.
         #T#POST,#ARG,5 #MDL#WAKEUP#ECB   AND LET MDL-TASK DO THE REST.
*
*
*
OPERATORFREE650 RES 0
         AI,7      1                   BUMP TO NEXT STATION IN LIST.
         B         OPERATORFREE222     AND GO TO PROCESS.
*
*
*
OPERATORFREE700 RES 0
         LW,#ARG   14                  FREE SPACE OF
         #FREE#MAIN#BYTES               STATION LIST.
*
         B         OPERATORDIDCOMMAND  AND WE'RE DONE.
*
MDLSTARTTOFREESTATION RES 0
*
*        #DEV OF STATION TO FREE IS IN R4.
*        BAL'ED TO ON R15.
*        ACTUAL CONTENTS OF #DEV=R1 NOT USED.
*        USES R8 AND R9.
*        RETURNS R5 AS MDL-TASK NUMBER FOR THIS DEV-TASK.
*
         #T#GET,5,4 #DEV#DCB#POINTER   GET MDL #DEV CORRESPONDING TO R5.
*
         #T#GET,9,4 #DEV#LINE#STATUS#BITS
         OR,9     =(#LINE#UNACQUIRED)
         #T#PUT,9,4 #DEV#LINE#STATUS#BITS
*
         #T#GET,9,5 #DEV#LINE#STATUS#BITS
         OR,9     =(#LINE#REESTABLISH)
         #T#PUT,9,5 #DEV#LINE#STATUS#BITS
*
         B        *15
         PAGE                                                           TIC72300
*                                                                       TIC72310
*        HERE ON OPERATOR 'X' COMMAND.                                  TIC72320
*                                                                       TIC72330
OPERATORX RES      0                                                    TIC72360
         LI,8      1                   INDICATE THAT WE
         STW,8     #X#ED                HAVE BEEN XED.
*
         #POST#ECB #NET#ECB            GET BY 'NET OFF' TO SEE THE 'X'.
*                                                                       TIC72380
         FIELD6789LOADAAAAAAAA         SKIP THE 'X'.
         FIELD6789LOADAAAAAAAA,OPERATORDIDCOMMAND LOOK FOR 'NOW'.
         CW,8      ='NOW '             IS IT A 'NOW'                    TIC72400
         BNE       OPERATORDIDCOMMAND  DONE IF NOT.                     TIC72410
*
         MTW,-2    #X#ED               INDICATE XED 'NOW'.
*                                                                       TIC72420
         LW,#DEV   #BIGGEST#TIC#TASK   FOR ALL TIC-TASKS,               TIC72430
OPERATORX200 RES   0                    WE MUST SIGNAL                  TIC72440
         SIGNALATTENTION                 AN ATTENTION.                  TIC72450
*
         #T#GET,4  #DEV#DCB#POINTER    GET INDEX TO DCB POINTER.
         BLEZ      OPERATORX215        (OVER IF MULTI-POINT)
         LW,5      *#DCB#TABLE#IW,4    KILL ANY PENDING READ OF DEVICE
         M:PURGE   *5                   SO DEV-TASK CAN LOOK AT XED FLAG
*
OPERATORX215 RES   0
         BDR,#DEV  OPERATORX200                                         TIC72460
*
         LW,#DEV   #BIGGEST#MDL#TASK   FOR ALL MDL-TASKS,
         BEZ       OPERATORDIDCOMMAND   IF THERE ARE ANY,
OPERATORX400 RES   0                     WAKE 'EM UP
         #T#GET,4  #DEV#DCB#POINTER       SO THEY GET
         LW,5      *#DCB#TABLE#IW,4        A CHANCE TO
         M:MDFLST  *5,(HALT)                LOOK AT THE
         BIR,#DEV  OPERATORX400              XED FLAG.
*                                                                       TIC72470
         B         OPERATORDIDCOMMAND                                   TIC72480
         END

