TITLE  'ICATS QUIT COMMAND ROUTINE'                            QUI00010
*********************************************************************** QUI00020
*                                                                     * QUI00030
*  MODULE NAME =  QUIT                                                * QUI00040
*                                                                     * QUI00050
*  FUNCTION =  SET THE FLAG THAT TELLS THE DISPATCHER TO QUIT         * QUI00060
*              DISPATCHING TASKS - IN OTHER WORDS, QUIT RUNNING       * QUI00070
*              THE ICATS PROGRAM AND RETURN TO CMS.                   * QUI00080
*              THE QUIT COMMAND IS ONLY VALID FROM THE CONSOLE.       * QUI00090
*                                                                     * QUI00100
*  ENTRY POINTS =  QUIT                                               * QUI00110
*                                                                     * QUI00120
*  LINKAGE =  BALR R14,R15 FROM ICATS MAINLINE.                       * QUI00130
*                                                                     * QUI00140
*  REGISTER CONTENTS UPON ENTRY =                                     * QUI00150
*      R2  = POINTS TO THE ICATS COMMON DATA AREA, AS ALWAYS.         * QUI00160
*      R14 = RETURN ADDRESS BACK TO ICATS MAINLINE                    * QUI00170
*      R15 = ENTRY POINT TO THIS MODULE                               * QUI00180
*                                                                     * QUI00190
*  REGISTER USAGE =                                                   * QUI00200
*      R0-R1 = USED TO PASS PARAMETERS TO SUBROUTINES.                * QUI00210
*      R2 =  USED TO ADDRESS THE ICATS COMMON DATA AREA.              * QUI00220
*      R3-R10 = FREE                                                  * QUI00230
*      R11 = MY BASE REGISTER                                         * QUI00240
*      R14 = MY RETURN ADDRESS WHEN I CALL SOMEBODY                   * QUI00250
*      R15 = SUBROUTINE ADDRESS                                       * QUI00260
*                                                                     * QUI00270
*  MODULE LOGIC:                                                      * QUI00280
*      1)  SEE WHERE THIS COMMAND CAME FROM.  REJECT THIS             * QUI00290
*          COMMAND IF IT DIDN'T COME FROM THE CONSOLE.                * QUI00300
*      2)  ELSE GO AHEAD AND SET THE QUIT FLAG.                       * QUI00310
*                                                                     * QUI00320
*  NORMAL EXIT =                                                      * QUI00330
*      R15 = 0                                                        * QUI00340
*                                                                     * QUI00350
*  EXTERNAL REFERENCES = NONE                                         * QUI00360
*                                                                     * QUI00370
*  MACROS =  ICDATA = ICATS COMMON DATA AREA                          * QUI00380
*            ETTE   = ENTER TRACE TABLE ENTRY SUBROUTINE              * QUI00390
*                                                                     * QUI00400
*  CHANGE ACTIVITY                                                    * QUI00410
*    DATE        NAME       REASON FOR CHANGE                         * QUI00420
*  04/19/83  RICK JASPER    BROKEN AWAY FROM ICATS MAINLINE INTO      * QUI00430
*                           SEPARATE SUBROUTINE                       * QUI00440
*                                                                     * QUI00450
*********************************************************************** QUI00460
         PRINT GEN,NODATA                                               QUI00470
QUIT     CSECT                                                          QUI00480
         USING ICDATA,R2            ADDRESS ICATS COMMON DATA AREA      QUI00490
         USING *,R15              USE R15 FOR NEXT INSTRUCTION ONLY     QUI00500
         STM   R0,R14,QUITREGS    SAVE ALL THE REGISTERS                QUI00510
         DROP  R15                                                      QUI00520
         USING QUIT,R11                                                 QUI00530
         LR    R11,R15            SWITCH BASE REGISTER TO R11           QUI00540
         TM    FLAGB,CONSCMD      CONSOLE COMMAND ??                    QUI00550
         BO    QUITCONA           REJECT IF COMMAND NOT FROM CONSOLE    QUI00560
         L     R15,AREJECT        GO TO REJECT-THIS-COMMAND ROUTINE     QUI00570
         BALR  R14,R15                                                  QUI00580
         B     QUITBYE                                                  QUI00590
QUITCONA OI    FLAGA,ENDPGM           IT'S MILLER TIME                  QUI00600
         SR    R15,R15                RETURN CODE = 0                   QUI00610
QUITBYE  LM    R0,R14,QUITREGS        RESTORE ALL THE REGISTERS         QUI00620
         BR    R14                    BYE BYE                           QUI00630
QUITREGS DS    15F                                                      QUI00640
         LTORG                                                          QUI00650
         ICDATA                                                         QUI00660
         END                                                            QUI00670