TITLE  'ICATS FAKE A READ-A-REQUEST-CONTROL-BLOCK-FROM-A-UTS ROUTINE'  FAK00010
*********************************************************************** FAK00020
*                                                                     * FAK00030
*  MODULE NAME =  FAKE UTS READ REQUEST CONTROL BLOCK                 * FAK00040
*                                                                     * FAK00050
*  FUNCTION =  SIMULATE A REQUEST CONTROL BLOCK READ FROM A UTS       * FAK00060
*              BY READING DATA FROM THE CMS FILE ICATS REQUEST A.     * FAK00070
*              THIS ROUTINE READS THE FIRST 16 LINES AND PUTS         * FAK00080
*              THE FIRST 8 CHARACTERS OF EACH LINE WHERE THE          * FAK00090
*              CALLER WANTED THE DATA.                                * FAK00100
*                                                                     * FAK00110
*  ENTRY POINTS =  FAKERRCB                                           * FAK00120
*                                                                     * FAK00130
*  LINKAGE =  THE UTS COMMAND DISPATCHER IN THE ICATS MAINLINE        * FAK00140
*             IS JUST STARTING TO DISPATCH THIS UTS REQUEST, AND      * FAK00150
*             WANTS TO GET THE REQUEST CONTROL BLOCK FROM THE UTS.    * FAK00160
*             BUT, THIS REQUEST DIDN'T COME FROM A REAL UTS,          * FAK00170
*             IT CAME FROM A FAKE INTERRUPT VIA THE FAKIT COMMAND.    * FAK00180
*             THE CALLER DID THIS                                     * FAK00190
*                 LA    R0,XXX             BUFFER LENGTH              * FAK00200
*                 LA    R1,BUFFER          BUFFER ADDRESS (PARM0)     * FAK00210
*                 L     R15,AREADRCB                                  * FAK00220
*                 BALR  R14,R15                                       * FAK00230
*             TO GET TO THE UTS I/O ROUTINE AND THE UTS I/O           * FAK00240
*             ROUTINE DETERMINED THIS WAS A FAKE INTERRUPT, SO        * FAK00250
*             IT DID THIS                                             * FAK00260
*                 L     R15,FAKERRCB                                  * FAK00270
*                 BALR  R14,R15                                       * FAK00280
*             TO GET TO ME.                                           * FAK00290
*                                                                     * FAK00300
*  REGISTER CONTENTS UPON ENTRY =                                     * FAK00310
*     R0  = THE LENGTH OF THE INPUT BUFFER.  THIS SHOULD BE A         * FAK00320
*           MULTIPLE OF 8.                                            * FAK00330
*     R1  = THE BUFFER ADDRESS.                                       * FAK00340
*     R2  = POINTS TO THE ICATS COMMON DATA AREA AS ALWAYS.           * FAK00350
*     R14 = RETURN ADDRESS BACK TO THE UTS I/O ROUTINE.               * FAK00360
*     R15 = ADDRESS OF THIS SUBROUTINE (USED FOR BASE REG).           * FAK00370
*                                                                     * FAK00380
*  REGISTER CONTENTS UPON EXIT =                                      * FAK00390
*         R15 = 0 = EVERYTHING WENT OK.                               * FAK00400
*      OR R15 = 4 = THE FILE ICATS REQUEST A DOES NOT EXIST.          * FAK00410
*                                                                     * FAK00420
*     REGISTER USAGE:                                                 * FAK00430
*     R0  = FREE                                                      * FAK00440
*     R1  = FREE                                                      * FAK00450
*     R2  = ICATS COMMON DATA AREA BASE REGISTER (ICDATA)             * FAK00460
*  R3-R7  = FREE                                                      * FAK00470
*     R8  = BUFFER ADDRESS POINTER.  WHERE TO PUT THE NEXT 8 BYTES.   * FAK00480
*     R9  = FREE                                                      * FAK00490
*     R10 = USED TEMPORARILY TO HOLD THE RETURN CODE                  * FAK00500
*     R11 = BASE REGISTER FOR THIS ROUTINE                            * FAK00510
* R12-R13 = FREE                                                      * FAK00520
*     R14 = RETURN ADDRESS FOR WHEN I CALL SUBROUTINES                * FAK00530
*     R15 = SUBROUTINE ADDRESS                                        * FAK00540
*                                                                     * FAK00550
*  MODULE LOGIC =                                                     * FAK00560
*      I)  XXXXXX                                                     * FAK00570
*          1)  XXXXXX                                                 * FAK00580
*              A)  XXXXXX                                             * FAK00590
*              B)  XXXXXX                                             * FAK00600
*              C)  XXXXXX                                             * FAK00610
*                                                                     * FAK00620
*  NORMAL EXIT =                                                      * FAK00630
*      R15 = 0                                                        * FAK00640
*                                                                     * FAK00650
*  EXTERNAL REFERENCES = NONE                                         * FAK00660
*                                                                     * FAK00670
*  CONTROL BLOCKS =  ICDATA   (ICATS COMMON DATA AREA)                * FAK00680
*                                                                     * FAK00690
*  NON-STANDARD MACROS (FOUND IN ICATS MACLIB)                        * FAK00700
*            ICDATA = ICATS COMMON DATA AREA DSECT.                   * FAK00710
*                                                                     * FAK00720
*  CHANGE ACTIVITY                                                    * FAK00730
*    DATE        NAME       REASON FOR CHANGE                         * FAK00740
*  04/21/83  RICK JASPER    BROKEN AWAY FROM ICATS MAINLINE INTO      * FAK00750
*                           SEPARATE SUBROUTINE                       * FAK00760
*                                                                     * FAK00770
*********************************************************************** FAK00780
         EJECT                                                          FAK00790
         PRINT GEN,NODATA                                               FAK00800
FAKERRCB CSECT                                                          FAK00810
         USING ICDATA,R2            ADDRESS ICATS COMMON DATA AREA      FAK00820
         USING FAKERRCB,R15     USE R15 FOR NEXT INSTRUCTION ONLY       FAK00830
         STM   R0,R14,UTSIOREG  SAVE CALLERS REGISTERS                  FAK00840
         DROP  R15                                                      FAK00850
         USING FAKERRCB,R11      USE R11 FOR THIS ROUTINE'S BASE REG    FAK00860
         LR    R11,R15           SWITCH BASE REGISTER TO R11            FAK00870
         LR    R7,R0             SAVE BUFFER LENGTH                     FAK00880
         LR    R8,R1             SAVE BUFFER ADDRESS                    FAK00890
         FSOPEN 'ICATS REQUEST A'                                       FAK00900
         LTR   R15,R15           CHECK FOR FILE-DOES-NOT-EXIST          FAK00910
         BNZ   RCBNONE           NOPE, FILE'S NOT THERE                 FAK00920
RCBREAD  DS    0H                                                       FAK00930
         SH    R7,=H'8'          QUIT READING IF WE'RE OUT OF           FAK00940
         BM    RCBCONT           ROOM IN CALLER'S BUFFER                FAK00950
         FSREAD 'ICATS REQUEST A',BUFFER=RCBINBUF,BSIZE=80              FAK00960
         LTR   R15,R15           SEE IF END-OF-FILE YET                 FAK00970
         BNZ   RCBCONT           YEP, WE'RE DONE HERE                   FAK00980
         MVC   0(8,R8),RCBINBUF  MOVE IN THE FIRST 8 BYTES ONLY         FAK00990
         LA    R8,8(R8)          POINT TO NEXT PARM AREA                FAK01000
         B     RCBREAD           READ IN THE NEXT LINE                  FAK01010
RCBCONT  LA    R10,0          RETURN CODE = 0 = EVERYTHING'S GREAT      FAK01020
         FSCLOSE 'ICATS REQUEST A'                                      FAK01030
RCBBYE   LR    R15,R10           TRANSFER RETURN CODE                   FAK01040
         LM    R0,R14,UTSIOREG                                          FAK01050
         BR    R14            BYE                                       FAK01060
*                                                                       FAK01070
RCBNONE  WRTERM 'GIVE ME THE ICATS REQUEST FILE ON MY A-DISK'           FAK01080
         LA    R10,4          RC = 4 = ICATS REQUEST A DOES NOT EXIST   FAK01090
         B     RCBBYE                                                   FAK01100
*                                                                       FAK01110
UTSIOREG DS    15F                                                      FAK01120
RCBINBUF DS    CL80                                                     FAK01130
         LTORG                                                          FAK01140
         ICDATA                                                         FAK01150
         END                                                            FAK01160