MGX TITLE 'DMTMGX (RSCS) VM/370 - RELEASE 6' 00001000
*. 00002000
* MODULE NAME - 00003000
* 00004000
* DMTMGX 00005000
* 00006000
* FUNCTION - 00007000
* 00008000
* THIS ROUTINE TAKES AN MESSAGE REQUEST BUFFER AND 00009000
* CONSTRUCTS THE MESSAGE FROM THE INFORMATION IN THAT 00010000
* BUFFER AND THE MESSAGE TEXT FOUND IN DMTMSG. 00011000
* 00012000
* ATTRIBUTES - 00013000
* 00014000
* REUSABLE 00015000
* 00016000
* ENTRY POINTS - 00017000
* 00018000
* DMTMGX- TO WRITE A MESSAGE 00019000
* 00020000
* ENTRY CONDITIONS - 00021000
* 00022000
* R1 = ADDR OF MESSAGE ELEMENT 00023000
* R14= RETURN ADDRESS 00024000
* R15= ENTRY ADDRESS 00025000
* 00026000
* EXIT CONDITIONS - 00027000
* 00028000
* NORMAL - RETURN TO CALLER 00029000
* 00030000
* 00031000
* ERROR - NONE 00032000
* 00033000
EJECT 00034000
* 00035000
* CALLS TO OTHER ROUTINES - 00036000
* 00037000
* PMSGREQ - TO STACK A MESSAGE FOR DMTREX 00038000
* DMTREXHC - TO WRITE A MESSAGE TO CP 00039000
* DMTSIG - TO ALERT A ANOTHER TASK WITH A MESSAGE ELEMENT 00040000
* 00041000
* EXTERNAL REFERENCES - 00042000
* 00043000
* TCOM - COMMON ROUTINE VECTOR TABLE 00044000
* TLINKS - LINK TABLE CHAIN 00045000
* DMTMSG - MESSAGE TABLE 00046000
* 00047000
* TABLES / WORKAREAS - 00048000
* 00049000
* NONE 00050000
* 00051000
* REGISTER USAGE - 00052000
* 00053000
* ALL SUBROUTINES IN THE MODULE CONFORM GENERALLY TO THIS USAGE; 00054000
* ANY INDIVIDUAL DEVIATIONS OR EXTENSIONS ARE LISTED WITH THE 00055000
* COMMAND DESCRIPTION 00056000
* 00057000
* GPR0 = WORK 00058000
* GPR1 = LINK TABLE ADDRESSABILITY 00059000
* GPR2 = BUFFER LOAD POINTER 00060000
* GPR3 = BUFFER LOAD LIMIT 00061000
* GPR4 = VARIABLE FIELD POINTER 00062000
* GPR5 = VARIABLE FIELD LIMIT 00063000
* GPR6 = SOURCE MSG POINTER 00064000
* GPR7 = SOURCE MSG LIMIT 00065000
* GPR8 = WORK 00066000
* GPR9 = WORK 00067000
* GPR10 = WORK 00068000
* GPR11 = WORK 00069000
* GPR12 = BASE REGISTER 00070000
* GPR13 = WORK 00071000
* GPR14 = RETURN 00072000
* GPR15 = COMMON ROUTINE VECTOR TABLE ADDRESSABILITY 00073000
* 00074000
* NOTES - 00075000
* 00076000
* NONE 00077000
* 00078000
EJECT 00079000
* 00080000
* OPERATION - 00081000
* 00082000
* 1. BUILD THE MESSAGE HEADER 00083000
* 00084000
* 2. FIND THE MESSAGE IN THE MESSAGE TABLE 00085000
* 00086000
* 3. MOVE MESSAGE FROM TABLE TO OUTPUT BUFFER 00087000
* SUBSTITUTING THE VARIABLE FIELDS FOR EACH 00088000
* $ ENCOUNTERED. 00089000
* 00090000
* 4. GIVE THE BUILT MESSAGE TO THE APPROPRIATE 00091000
* HANDLER BASED ON THE ACTION CODE OF: 00092000
* X'80' RSS OPERATOR 00093000
* X'40' ORIGINATING LINKID 00094000
* X'20' VIRTUAL MACHINE USERID 00095000
* X'10' LOCAL CP OPERATOR 00096000
* 00097000
*. 00098000
EJECT 00099000
DMTMGX CSECT 00100000
SPACE 2 00101000
* MESSAGE ROUTING CODE EQUATES 00102000
SPACE 00103000
RSS EQU X'80' RSS OPERATOR CONSOLE 00104000
ORIG EQU X'40' 'ORIGINATING' LINK ID 00105000
VMID EQU X'20' VIRTUAL MACHINE USER ID 00106000
CP EQU X'10' LOCAL CP OPERATOR 00107000
SPACE 00108000
USING DMTMGX,R15 GET TEMPORARY ADDRESSABILITY 00109000
STM R0,R15,MGXSAVE SAVE REGISTERS 00110000
DROP R15 00111000
USING SVECTORS,0 GET SVECTORS ADDRESSABILITY 00112000
USING DMTMGX,R12 GET THE RIGHT ADDRESSABILITY 00113000
USING COMDSECT,R15 GET COMMON ROUTINE ADDR 00114000
LR R12,R15 AND UPDATE R12 00115000
LA R13,MGXCSAVE GET COMMON ROUTINE SAVE AREA ADDR 00116000
* 00117000
* BUILD THE MESSAGE 00118000
* R2,R3 BUFFER LOAD POINTER AND LIMIT 00119000
* R4,R5 VARIABLE FIELD POINTER AND LIMIT 00120000
* R6,R7 SOURCE MSG POINTER AND LIMIT 00121000
* 00122000
CLI 0(R1),25 LONG ENOUGH? 00123000
BL MGXERROR NO 00124000
* 00125000
* BUILD THE MESSAGE HEADER 00126000
* 00127000
MVC MGXBUFFR(3),MGXNAME DMT INITIALLY 00128000
MVC MGXBUFFR+3(3),20(R1) MODULE NAME 00129000
LH R0,24(R1) REQUESTED MSG NUMBER 00130000
CVD R0,MGXWORK CONVERT TO DECIMAL 00131000
UNPK MGXBUFFR+6(3),MGXWORK+6(2) TO OUTPUT 00132000
OI MGXBUFFR+8,X'F0' SET CORRECT ZONE 00133000
MVC MGXBUFFR+9(1),23(R1) ACTION CODE 00134000
MVI MGXBUFFR+10,C' ' PREPARE TO CLEAR BUFFER 00135000
MVC MGXBUFFR+11(L'MGXBUFFR-11),MGXBUFFR+10 CLEAR OUT 00136000
* 00137000
* INITIALIZE POINTERS 00138000
* 00139000
LA R2,MGXBUFFR+11 START BEYOND HEADER LEN (NO BLANK YET) 00140000
LA R3,MGXBUFFR+L'MGXBUFFR OUTPUT LIMIT 00141000
LA R4,28(R1) FIRST VARIABLE (IF PRESENT) 00142000
SR R5,R5 CLEAR FOR IC 00143000
IC R5,0(R1) LENGTH OF REQUEST -1 00144000
LA R5,1(R5,R1) END OF MSG REQ ELEMENT 00145000
LA R5,7(R5) LENGTH+7 TO FIND NEXT DWORD BDY @VA03482 00145100
SRL R5,3 DIVIDE BY 8 00146000
SLL R5,3 BUMP BACK TO LOWER DWORD BD 00147000
* 00148000
* SCAN MESSAGE TABLE 00149000
* 00150000
L R6,MGXMSGS TABLE OF MSGS 00151000
MGXMSCAN EQU * 00152000
CLC 4(2,R6),24(R1) NUM MATCH TO REQ? 00153000
BE MGXMHIT YES 00154000
ICM R6,B'1111',0(R6) GET THE NEXT MSG POINTER 00155000
BZ MGXNOHIT LAST IF ZERO 00156000
B MGXMSCAN AND CONTINUE 00157000
EJECT 00158000
* 00159000
* R6 ADDR OF MSG ENTRY FOR NOW 00160000
* 00161000
MGXMHIT EQU * 00162000
TM MGXBUFFR+9,X'3F' ANY ACTION CODE IN REQ? 00163000
BNZ MGXGOTAC YES - USE IT 00164000
MVC MGXBUFFR+9(1),9(R6) DEFAULT TO DEFINED AC CODE 00165000
MGXGOTAC EQU * 00166000
ICM R0,B'0010',2(R1) ROUTING CODE FROM REQ 00167000
BNZ MGXGOTRC USE AS SPECIFIED 00168000
ICM R0,B'0010',6(R6) DEFAULT DEFINED ROUT CODE 00169000
MGXGOTRC EQU * 00170000
ICM R0,B'0001',3(R1) SEV CODE FROM REQ 00171000
BNZ MGXGOTSC USE AS SPECIFIED 00172000
ICM R0,B'0001',7(R6) DEFAULT DEFINED SEV CODE 00173000
MGXGOTSC EQU * 00174000
STCM R0,B'0011',MGXMSGRC SAVE ROUT & SEV CODES 00175000
SR R7,R7 CLEAR R7 FOR IC 00176000
IC R7,8(R6) GET LENGTH OF MSG 00177000
LA R7,9(R7,R6) ADDR OF END OF MSG TEXT 00178000
LA R6,11(R6) ADDR OF START OF MSG TXT 00179000
SPACE 1 00180000
MGXMORE EQU * 00181000
CLR R2,R3 IS IT FULL? 00182000
BNL MGXBUILT YES - TRUNCATE IT 00183000
CLR R6,R7 ANY MORE SPECIFIED? 00184000
BNL MGXBUILT NO - DONE 00185000
CLI 0(R6),C'$' SUB? 00186000
BE MGXDOSUB YES - GO DO IT 00187000
MVC 0(1,R2),0(R6) MOVE NON - $ CHARACTER 00188000
LA R2,1(R2) BUMP BUFFER POINTER 00189000
LA R6,1(R6) BUMP SOURCE PTR 00190000
B MGXMORE NEXT 00191000
SPACE 1 00192000
MGXDOSUB EQU * 00193000
SR R8,R8 INITIALIZE $ COUNTER 00194000
MGXNXSUB EQU * 00195000
LA R6,1(R6) BUMP SOURCE POINTER 00196000
LA R8,1(R8) UPDATE $ COUNT 00197000
CLR R6,R7 MORE TO GO? 00198000
BNL MGXENSUB NO 00199000
CLI 0(R6),C'$' ANOTHER $? 00200000
BE MGXNXSUB YES - KEEP COUNTING 00201000
MGXENSUB EQU * 00202000
LR R0,R8 TOTAL NUMBER OF DOLLAR SIGNS 00203000
BCT R0,MGXMVSUB GO PROCESS MULTIPLE $ SUBS 00204000
MGXLASUB EQU * FINAL SUB PROCESSING 00205000
CLR R4,R5 ANY MORE? 00206000
BNL MGXLAZIP NOPE 00207000
SPACE 00208000
LA R9,7 START AT RIGHT 00209000
MGXLASCN EQU * 00210000
LA R10,0(R9,R4) NEXT CHAR TO LOOK AT 00211000
CLI 0(R10),C' ' BLANK? 00212000
BNE MGXSBFIN NO - QUIT 00213000
BCT R9,MGXLASCN KEEP HUNTING 00214000
CLI 0(R4),C' ' LAST BLANK? 00215000
BNE MGXSBFIN NO - DO IT 00216000
LA R4,8(R4) BUMP TO NEXT 00217000
* 00218000
* ALL BLANK LAST SPECIFICATION 00219000
* 00220000
MGXLAZIP EQU * 00221000
LR R0,R8 COUNT 00222000
BCTR R0,0 LESS ONE 00223000
LTR R0,R0 ONLY ONE TO START? 00224000
BZ MGXELIPS ONLY SINGLE $ 00225000
MGXBKSET EQU * 00226000
SLL R0,3 *8 - CHAR COUNT FOR BACK SCAN 00227000
MGXBKSCN EQU * 00228000
BCTR R2,0 BACK ONE 00229000
CLI 0(R2),C' ' BLANK 00230000
BNE MGXCHIT (MUST BUMP THERE) NO 00231000
BCT R0,MGXBKSCN KEEP LOOKING 00232000
MGXELIPS EQU * ALL BLANK INSERT ELIPSIS 00233000
LR R9,R3 END OF BUFFER 00234000
SR R9,R2 LEFT IN BUFFER 00235000
BNP MGXBUILT TRUNCATE IF NONE 00236000
LA R10,3 (L'ELIPSIS) MUST BE GREATER THAN ZERO 00237000
CLR R10,R9 ENOUGH IN BUFFER? 00238000
BNH MGXELFIT YES 00239000
LR R10,R9 TRUNCATE 00240000
MGXELFIT EQU * 00241000
BCTR R10,0 DOWN BY ONE 00242000
EX R10,MGXELMOV MOVE IN ELIPSIS 00243000
LA R2,1(R10,R2) UPDATE LOAD POINT 00244000
B MGXMORE DO MORE 00245000
SPACE 00246000
MGXCHIT EQU * 00247000
LA R2,1(R2) AJUST BACK 00248000
B MGXMORE DO MORE OUTPUT 00249000
SPACE 1 00250000
MGXSBFIN EQU * 00251000
* 00252000
* R9 COUNT OF NONBLANK -1 00253000
* 00254000
LA R9,1(R9) EXACT NONBLANK COUNT 00255000
LR R10,R3 END OF BUFFER 00256000
SR R10,R2 LEFT IN BUFFER 00257000
BNP MGXBUILT NONE AT ALL 00258000
CLR R9,R10 ENOUGH? 00259000
BNH MGXLAFIT YES 00260000
LR R9,R10 TRUNCATE 00261000
MGXLAFIT EQU * 00262000
BCTR R9,0 DOWN BY ONE 00263000
EX R9,MGXSBMOV MOVE IN 00264000
LA R4,8(R4) BUMP VARIABLE PTR 00265000
LA R2,1(R9,R2) BUMP LOAD POINT 00266000
B MGXMORE BACK FOR MORE 00267000
SPACE 00268000
MGXMVSUB EQU * 00269000
CLR R4,R5 MORE SUBS TO BE HAD? 00270000
BNL MGXDRY NOPE - SEE IF ANY NONBLANK 00271000
LA R9,8(R2) ANOTHER SUB VARIABLE FOLLOWS 00272000
CLR R9,R3 ENOUGH SPACE? 00273000
BNH MGXSBFIT YES 00274000
LR R9,R3 TRUNCATE 00275000
MGXSBFIT EQU * 00276000
SR R9,R2 COUNT TO MOVE 00277000
BCTR R9,0 DOWN BY ONE 00278000
EX R9,MGXSBMOV MOVE IN NEXT PIECE 00279000
LA R2,1(R9,R2) BUMP LOAD POINT 00280000
CLR R2,R3 AT END? 00281000
BNL MGXBUILT YES 00282000
LA R4,8(R4) BUMP VARIABLE POINTER 00283000
BCT R0,MGXMVSUB DO NEXT SUB 00284000
B MGXLASUB SPECIAL TREATMENT FOR LAST 00285000
SPACE 1 00286000
MGXDRY EQU * 00287000
* 00288000
* R0 CONTAINS TOTAL UNPROCESSED $ COUNT -1 00289000
* 00290000
LR R9,R8 TOTAL $ COUNT 00291000
SR R9,R0 TOTAL PROCESSED $ +1 00292000
BCTR R9,0 TOTAL PROCESSED $ COUNT 00293000
LR R0,R9 SET FOR BACK SCAN 00294000
B MGXBKSET GO DO IT 00295000
SPACE 2 00296000
MGXSBMOV MVC 0(0,R2),0(R4) TO BE EXECUTED FROM ABOVE 00297000
MGXELMOV MVC 0(0,R2),=C'...' MOVE ELIPSIS FROM ABOVE 00298000
EJECT 00299000
* 00300000
* UNDEFINED MESSAGE NUMBER 00301000
* 00302000
MGXNOHIT EQU * 00303000
SR R5,R5 CLEAR R5 FOR INSERT @VA05951 00303300
IC R5,0(R1) GET REAL LENGTH OF ELE. -1 @VA05951 00303600
LA R5,1(R5,R1) GET REAL END OF ELEMENT @VA07411 00303910
CLR R5,R4 ANY TEXT SUPPLIED? 00304000
BNH MGXELIPS NOPE - JUST AN ELIPSIS 00305000
LR R9,R5 00306000
MGXDSCAN EQU * 00307000
BCTR R9,0 LAST CHAR ADDR 00308000
CLI 0(R9),C' ' IS IT BLANK? 00309000
BNE MGXDHIT NO 00310000
CLR R9,R4 AGAIN 00311000
BH MGXDSCAN NOT DONE, GO AROUND AGAIN. @VA05476 00312000
B MGXELIPS NOTHING NONBLANK 00313000
SPACE 1 00314000
MGXDHIT EQU * 00315000
LA R9,1(R9) INCREMENT BY ONE TO CORRECT @VA05476 00315500
* COUNT. 00315600
SR R9,R4 COUNT OF NON BLANK SUPPLIED TEXT 00316000
LR R10,R3 UPDATE R10 00317000
SR R10,R2 COUNT OF BUFFER SPACE 00318000
CLR R9,R10 ENOUGH SPACE IN BUFFER? 00319000
BNH MGXDOK YES 00320000
LR R9,R10 TRUNCATE OTHERWISE 00321000
MGXDOK EQU * 00322000
BCTR R9,0 DOWN BY ONE 00323000
EX R9,MGXDMOVE MOVE IN SUPPLIED TEXT 00324000
LA R2,1(R9,R2) UPDATE LOAD POINT 00325000
MVC MGXMSGRC(2),2(R1) GET ROUTING AND SEV. CODES @VA05476 00325500
B MGXBUILT FINISH UP 00326000
SPACE 1 00327000
MGXDMOVE MVC 0(0,R2),0(R4) TO BE EXECUTED FROM ABOVE 00328000
EJECT 00329000
MGXBUILT EQU * 00330000
LA R3,MGXBUFFR GET START OF BUFFER 00331000
SR R2,R3 CHAR COUNT OF VARIABLE OUTPUT 00332000
LR R3,R2 MUST HAVE IN R3 00333000
LR R4,R1 SAVE ELEMENT ADDR 00334000
L R2,TLINKS GET LINKTABLE CHAIN 00335000
LA R2,8(R2) ADDR OF LOCAL LINK TABLE 00336000
TM MGXMSGRC,ORIG GIVE TO A LINK? 00337000
BNO MGXNOLIN NO 00338000
LA R0,8 GET THE LENGTH OF THE ENTRY 00339000
LA R1,4(R4) LINKID TO GIVE MESSAGE TO 00340000
L R15,TCOM COMMON ROUTINE ADDR LIST 00341000
L R15,GLINKREQ GET LINK TABLE ENTRY ROUTINE 00342000
BALR R14,R15 AND EXECUTE IT 00343000
LTR R15,R15 FOUND? 00344000
BNZ MGXNOLIN NO REJECT IT 00345000
LA R1,0(R1) CLEAR OUT HIGH ORDER BYTE 00346000
CLR R2,R1 SAME AS OUR LINK TABLE 00347000
BE MGXTOLOC YES 00348000
USING LINKTABL,R1 GET LINKTABL ADDRESSABILITY 00349000
TM LFLAG,LACTIVE IS THE LINK ACTIVE? 00350000
BNO MGXNOLIN SKIP IF NOT 00351000
L R0,LACTTNME GET THE LINK TASKNAME 00352000
LA R1,MGXBUFFR-12 GET START OF THIS PART OF BU @VA03279 00353010
MVC 4(8,R1),4(R4) MOVE IN THE DEST LOCID @VA03279 00353020
MVC 0(4,R1),MGXMSGEL MOVE IN HEADER 00354000
LA R5,11(R3) UPDATE COUNT @VA03279 00355010
STC R5,0(R1) STORE IN MSG ELEMENT 00356000
MVC 3(1,R1),3(R4) SEVERITY CODE 00357000
L R15,ALERTREQ GET SYSTEM ALERT PROCESSOR ADDR 00358000
BALR R14,R15 GO ALERT THE TASK 00359000
* 00360000
* IGNORE REJECTS FOR NOW 00361000
* 00362000
MGXNOLIN EQU * 00363000
TM MGXMSGRC,RSS ROUTE TO OUR OPERATOR CONSOLE? 00364000
BNO MGXNOPR NO 00365000
MGXTOLOC EQU * 00366000
LA R1,MGXBUFFR-12 GET START OF MSG @VA03279 00367010
MVC 4(8,R1),LINKID-LINKTABL(R2) MOVE IN OUR LINKID @VA03279 00367020
LA R15,11(R3) GET THE MSG ELEMENT COUNT @VA03279 00367030
STC R15,0(R1) STORE CHAR COUNT 00369000
MVC 3(1,R1),3(R4) MOVE SEVERITY CODE 00370000
* R2 CONTAINS LOCAL LINK TABLE ADDR 00371000
L R15,TCOM GET COMMON ROUTINE ADDR 00372000
L R15,PMSGREQ MESSAGE STACK ROUTINE 00373000
BALR R14,R15 STACK THE MESSAGE 00374000
* 00375000
* IGNORE REJECTS FOR NOW 00376000
* 00377000
MGXNOPR EQU * 00378000
LA R1,MGXBUFFR-L'MGXCMAND MOVE TO BUFFER 00379000
MVC 0(L'MGXCMAND,R1),MGXCMAND MOVE 00380000
LA R2,L'MGXCMAND(R3) GET COUNT 00381000
TM MGXMSGRC,VMID GIVE TO A LOCAL V.M.? 00382000
BNO MGXNOVM NO 00383000
CLI 12(R4),C' ' IS A VM ID SPECIFIED? 00384000
BE MGXNOVM SKIP IT IF NOT 00385000
MVC 2(8,R1),12(R4) SET SPECIFIED ID 00386000
L R15,HVCREQ GET CP WRITE ROUTINE ADDR 00387000
BALR R14,R15 TO LOCAL VM 00388000
* 00389000
* IGNORE REJECTS FOR NOW 00390000
* 00391000
MGXNOVM EQU * 00392000
TM MGXMSGRC,CP LOCAL OPERATOR? 00393000
BNO MGXEXIT NO - QUIT 00394000
MVC 2(8,R1),MGXCPID CP OPERATOR USERID 00395000
LA R2,L'MGXCMAND(R3) RESTORE COUNT 00396000
L R15,HVCREQ GET CP WRITE ROUTINE ADDR 00397000
BALR R14,R15 SEND TO LOCAL OPERATOR 00398000
* 00399000
* IGNORE REJECTS FOR NOW 00400000
* 00401000
MGXEXIT EQU * 00402000
SR R0,R0 CLEAR RETURN 00403000
B MGXCOMX ENTER COMMON EXIT 00404000
SPACE 00405000
MGXERROR EQU * 00406000
LA R15,16 SET ERROR RETURN 00407000
MGXCOMX EQU * 00408000
LM R0,R14,MGXSAVE RESTORE REGISTERS 00409000
BR R14 RETURN TO CALLER 00410000
EJECT 00411000
*---------------------------------------------------------------------* 00412000
* * 00413000
* MESSAGE EXECUTOR CONTROL AREA * 00414000
* * 00415000
*---------------------------------------------------------------------* 00416000
SPACE 2 00417000
MGXNAME DC CL8'DMTMGX' NAME FOR ROUTINE 00418000
HVCREQ DC V(DMTREXHC) CP WRITE ROUTINE ADDR 00419000
SPACE 1 00420000
MGXSAVE DC 16F'0' GENERAL REGISTER SAVE AREA 00421000
MGXCSAVE DC 18F'0' GENERAL REGISTER SAVE AREA 00422000
MGXWORK DC D'0' OBJECT OF A CVD INSTRUCTION 00423000
MGXMSGS DC V(DMTMSG) STANDARD MSG TABLE ADDRESS 00424000
REXREQ DC V(DMTREXHC) WRITE TO CP ENTRY 00425000
SPACE 2 00426000
* 00427000
* MESSAGE OUTLINE ACCULULATOR 00428000
* 00429000
MGXPREFX DC CL12' ' @VA03279 00430010
MGXBUFFR DC CL120' ' OUTPUT MESSAGE 00431000
SPACE 00432000
MGXCMAND DC C'M XXXXXXXX ' 00433000
MGXCPID DC CL8'OP' CP OPERATOR USERID 00434000
SPACE 00435000
MGXMSGEL DC AL1(0),X'B1' ELMNT LENGTH, COMMAND CODE 00436000
MGXMSGRC DC X'00' MESSAGE ROUTING CODE 00437000
MGXMSGSC DC X'00' MESSAGE SEVERITY CODE 00438000
EJECT 00439000
COPY SVECTORS 00440000
EJECT 00441000
COPY LINKTABL 00442000
EJECT 00443000
COPY RSSEQU 00444000
END 00445000