TRC TITLE 'DMKTRC (CP) VM/370 - RELEASE 6' 00001000
ISEQ 73,80 VALIDATE SEQUENCING OF SOURCE 00002000
*. 00003000
* MODULE NAME - 00004000
* 00005000
* DMKTRC 00006000
* 00007000
* FUNCTION - 00008000
* 00009000
* TO PROVIDE A VIRTUAL MACHINE WITH THE FACILITY TO TRACE 00010000
* SVC INSTRUCTIONS, PROGRAM INTERRUPTS, EXTERNAL INTERRUPTS, 00011000
* PRIVILEGED INSTRUCTIONS, SUCCESSFUL BRANCHES, 00012100
* OR ALL INSTRUCTIONS, WITH OUTPUT ON THE PRINTER, TERMINAL, 00013000
* OR BOTH. 00014000
* 00015000
* ATTRIBUTES - 00016000
* 00017000
* REENTRANT, PAGEABLE, CALLED VIA SVC 00018000
* 00019000
* ENTRY POINTS - 00020000
* 00021000
* DMKTRCEX - PROCESS AN EXTERNAL INTERRUPT 00022000
* DMKTRCIO - PROCESS AN I/O INTERRUPT 00023000
* DMKTRCPG - PROCESS A PROGRAM INTERRUPT 00024000
* DMKTRCPV - PROCESS A PRIVILEGED INSTRUCTION 00025000
* DMKTRCSW - TRACE VIRTUAL AND REAL CSWS 00027000
* DMKTRCSV - PROCESS AN SVC, BRANCH, OR FULL INSTRUCTION TRACE 00028000
* DMKTRCPB - PUT BACK USER INSTRUCTIONS ALTERED BY TRACING 00030000
* DMKTRCIT - SET NEEDED "SVC B2" FOR INSTRUCTION TRACING 00031000
* DMKTRCND - FORCIBLY TERMINATE TRACING 00032000
EJECT 00033000
* ENTRY CONDITIONS - 00034000
* 00035000
* FOR ALL ENTRY POINTS: 00036000
* 00037000
* GPR 11 = ADDRESS OF VIRTUAL MACHINE VMBLOK 00038000
* GPR 12 = ENTRY POINT ADDRESSABILITY 00039000
* GPR 13 = ADDRESS OF STANDARD SAVE AREA 00040000
* 00041000
* FOR DMKTRCEX (EXTERNAL INTERRUPT) ENTRY POINT: 00042000
* 00043000
* GPR 0-1 = VIRTUAL EXTERNAL OLD PSW 00044000
* GPR 2-3 = VIRTUAL EXTERNAL NEW PSW 00045000
* GPR 4 = INTERRUPT CODE 00046000
* 00047000
* FOR DMKTRCIO (I/O INTERRRUPT) ENTRY POINT 00048000
* 00049000
* GPR 0-1 = VIRTUAL I/O OLD PSW 00050000
* GPR 2-3 = VIRTUAL I/O NEW PSW 00051000
* GPR 4 = VIRTUAL ADDRESS OF INTERRUPTING DEVICE 00052000
* GPR 5 = VIRTUAL CSW+4/CSW+5 BYTES (IN BITS 16-31) 00053000
* GPR 8 = ADDRESS OF VDEVBLOK 00054000
* 00055000
* FOR DMKTRCSW (CSW TRACING) ENTRY POINT 00056000
* 00057000
* GPR 8 = ADDRESS OF VDEVBLOK 00058000
* GPR 10 = ADDRESS OF IOBLOK 00059000
* 00060000
* FOR DMKTRCPG (PROGRAM INTERRUPT) ENTRY POINT: 00061000
* 00062000
* GPR 0-1 = VIRTUAL PROGRAM OLD PSW 00063000
* GPR 2-3 = VIRTUAL PROGRAM NEW PSW 00064000
* GPR 4 = INTERRUPT LENGTH & CODE 00065000
* 00066000
* FOR DMKTRCPV (PRIVILEGED) ENTRY POINT: 00067000
* 00068000
* GPR 1 = VIRTUAL ADDRESS OF PRIVILEGED INSTRUCTION (OR 'EX') 00069000
* 00070000
* FOR DMKTRCPB, AND DMKTRCND ENTRY POINTS: 00078100
* 00079000
* (NO SPECIAL REGISTER REQUIREMENTS OTHER THAN GPR11-13) 00080000
* 00081000
* FOR DMKTRCIT ENTRY POINT: 00082000
* 00083000
* GPR 1 = VIRTUAL ADDRESS AT WHICH TO INITIATE TRACING 00084000
EJECT 00085000
* ENTRY CONDITIONS (CONTINUED): 00086000
* 00087000
* FOR DMKTRCSV (SVC, BRANCH, OR INSTRUCTION TRACE) ENTRY POINT: 00088000
* 00089000
* GPR 0-1 = SVC OLD PSW 00090000
* GPR 2 = INTERRUPT LENGTH ONLY 00091000
* GPR 4 = INTERRUPT LENGTH & CODE 00092000
* GPR 10 = ADDRESS OF SVC (OR EX-SVC) INSTRUCTION 00093000
* 00094000
* EXIT CONDITIONS - 00095000
* 00096000
* FOR DMKTRCSV ENTRY POINT ONLY: 00097000
* 00098000
* CC = ZERO: GO TO DMKDSPCH = REGULAR "DISPATCH" ENTRY POINT 00099000
* CC = NONZERO: GO TO DMKDSPB (TO CHECK OUT NEW PSW) 00100000
* 00101000
* APPROPRIATE OUTPUT MESSAGES HAVE BEEN GIVEN ON THE USER'S 00102000
* TERMINAL AND/OR VIRTUAL PRINTER; FOR THE DMKTRCSV ENTRY 00103000
* POINT, THE STATE OF HIS VIRTUAL MACHINE HAS BEEN SAVED AS 00104000
* WOULD HAVE BEEN DONE IN DMKPSASV; IN ANY EVENT, THE USER'S 00105000
* VIRTUAL MACHINE IS IN THE SAME RUNNABLE (OR NON-RUNNABLE) 00106000
* STATE AS IT WOULD BE IF TRACING WERE NOT IN EFFECT. 00107000
* 00108000
* CALLS TO OTHER ROUTINES - 00109000
* 00110000
* DMKQCNWT - WRITE A MESSAGE TO USER TERMINAL 00111000
* DMKVSPRT - WRITE A MESSAGE ON PRINTER 00112000
* DMKCVTBH - CONVERT BINARY FIELDS TO HEXADECIMAL 00113000
* DMKDSPCH - TO DISPATCH USER 00118000
* DMKNEMOP - TO GET MNEMONIC EQUIVALENT OF A 370 OP CODE 00119000
* DMKFREE - TO GET FREE STORAGE FOR TRACE CONTROL BLOCK 00120000
* DMKFRET - TO RETURN TRACE CONTROL BLOCK TO FREE STORAGE 00121000
* DMKCFMBK - TO INITIATE A READ FROM A TERMINAL 00122000
* DMKPTRAN - TO BRING A USER PAGE INTO MEMORY WHEN NEEDED 00123000
* DMKPSARX = TO GET VIRTUAL ADDRESS FROM AN RX INSTRUCTION 00124000
* DMKPSARS = TO GET VIRTUAL ADDRESS FROM AN RS INSTRUCTION 00125000
* DMKPSARR = TO GET VIRTUAL ADDRESS FROM AN RR INSTRUCTION 00126000
* DMKPSASC - TO TEST IF SVC BYTE TARGETED FOR A SHARED PAGE 00129000
* DMKATSCF - UNSHARE A NAMED SHARED SYSTEM PRIOR TO SVC INSERT 00130100
* DMKVATRN - TO PERFORM VIRTUAL ADDRESS TRANSLATION AS NEEDED 00131000
* DMKPSASP - TO CHECK FOR STORAGE PROTECTION 00132000
* 00133000
* EXTERNAL REFERENCES - 00134000
* 00135000
* NONE 00136000
* 00137000
* TABLES / WORK AREAS - 00138000
* 00139000
* TRACE CONTROL BLOCK 00140000
EJECT 00141000
* REGISTER USAGE - 00142000
* 00143000
* GPR 9 = ADDRESS OF TRACE CONTROL BLOCK 00144000
* GPR 10 = ADDRESS OF IOBLOK (WHERE APPLICABLE) 00145000
* GPR 12 - BASE REGISTER 00146000
* GPR 13 - ADDRESS OF STANDARD SAVE AREA 00147000
* 00148000
* OTHER REGISTERS = WORK REGISTERS 00149000
* 00150000
* NOTES - 00151000
* 00152000
* SEE "RESTRICTIONS" (PRECEDING "ERROR MESSAGES") 00153000
* 00154000
* VARIOUS TRACE OPTIONS CAN BE SET CUMULATIVELY BY ISSUING 00155000
* SUCCESSIVE TRACE COMMANDS; FOR EXAMPLE TO HAVE BRANCH 00156000
* TRACING ON THE TERMINAL (WITH RUN ON) AND FULL INSTRUCTION 00157000
* TRACING ON THE PRINTER THE FOLLOWING COULD BE ISSUED 00158000
* (ASSUMING THE USER IS IN CP MODE): 00159000
* 00160000
* TRACE BRANCH TERMINAL RUN 00161000
* TRACE INSTRUCT PRINTER 00162000
* BEGIN (OR SIMILAR CP COMMAND) 00163000
* 00164000
* FOR FULL INSTRUCTION OR BRANCH TRACING, ANY INSTRUCTION 00165000
* WHICH MODIFIES THE NEXT BYTE IN STORAGE (FOLLOWING THE 00166000
* INSTRUCTION) WILL CAUSE ERRONEOUS RESULTS, USUALLY 00167000
* RESULTING IN TRACING BEING TERMINATED UNTIL AN INTERRUPT 00168000
* OCCURS. 00169000
* 00170000
* SIMILARLY, AN INSTRUCTION WHICH EXAMINES EITHER (OR BOTH) 00171000
* OF THE NEXT TWO BYTES FOLLOWING THE INSTRUCTION (WHEN 00172000
* RUNNING WITH FULL INSTRUCTION OR BRANCH TRACING) WILL 00173000
* OBTAIN ERRONEOUS DATA. 00174000
* 00175000
* AN INSTRUCTION WHICH EXECUTES THE NEXT INSTRUCTION IN 00176000
* SEQUENCE, ON THE OTHER HAND, WILL BE HANDLED SATISFACTORILY, 00177000
* EXCEPT THAT ONLY THE FIRST EXECUTION OF THE INSTRUCTION WILL 00178000
* WILL BE TRACED. (IF NO TRANSFER OCCURS, THE 'EX' DROPS THRU, 00179000
* AND THE INSTRUCTION IS DONE AGAIN IN LINE, IT WILL NOT 00180000
* BE TRACED THE SECOND TIME. TRACING WILL THEN RESUME WITH 00181000
* THE NEXT INSTRUCTION FOLLOWING THE EXECUTED INSTRUCTION.) 00182000
* 00183000
* WHEN SEVERAL TRACE OPTIONS ARE IN EFFECT, THE SAME 00184000
* INSTRUCTION CAN APPEAR IN THE TRACE OUTPUT MORE THAN 00185000
* ONCE. FOR EXAMPLE, IF FULL INSTRUCTION TRACING WERE 00186000
* IN EFFECT, A START I/O (SIO) INSTRUCTION WOULD BE TRACED 00187000
* BEFORE IT IS EXECUTED; SUBSEQUENTLY, WHEN THE SIO HAS 00188000
* BEEN HANDLED BY CP, AND THE CONDITION CODE IS READY 00189000
* TO BE REFLECTED TO THE USER, THE SIO WOULD BE TRACED 00190000
* AGAIN WITH THE USUAL PERTINENT INFORMATION GIVEN FOR 00191000
* THE TRACING OF I/O OPERATIONS (SEE RESPONSES). 00192000
EJECT 00193000
* OPERATION - 00194000
* 00195000
* NOTE: DMKTRACE - INITIALIZE, MODIFY, OR TERMINATE THE TRACE 00196000
* FUNCTION - IS LOCATED IN "DMKTRA" (A SEPARATE MODULE). 00197000
* 00198000
* 1. DMKTRCEX - PROCESS AN EXTERNAL INTERRUPT 00199000
* 00200000
* A TRACE OUTPUT LINE IS CONSTRUCTED CONTAINING THE 00201000
* PERTINENT INFORMATION FOR AN EXTERNAL INTERRUPT, 00202000
* AND IS PRESENTED TO THE USER IN THE USUAL WAY ON 00203000
* THE TERMINAL, PRINTER, OR BOTH, JUST BEFORE THE EXTERNAL 00204000
* INTERRUPT IS REFFLECTED TO THE USER'S VIRTUAL MACHINE. 00205000
* 00206000
* 2. DMKTRCIO - PROCESS AN I/O INTERRUPT 00207000
* 00208000
* A TRACE OUTPUT LINE IS CONSTRUCTED CONTAINING THE 00209000
* PERTINENT INFORMATION FOR AN I/O INTERRUPT, AND 00210000
* IS PRESENTED TO THE USER IN THE USUAL WAY, JUST BEFORE THE 00211000
* I/O INTERRUPT IS REFLECTED TO THE USER'S VIRTUAL MACHINE. 00212000
* 00213000
* 3. DMKTRCPG - PROCESS A PROGRAM INTERRUPT 00214000
* 00215000
* A TRACE OUTPUT LINE IS CONSTRUCTED CONTAINING THE 00216000
* PERTINENT INFORMATION FOR A PROGRAM INTERRUPT, AND 00217000
* IS PRESENTED TO THE USER IN THE USUAL WAY, JUST BEFORE THE 00218000
* PROGRAM INTERRUPT IS REFLECTED TO THE USER'S VIRTUAL MACHINE. 00219000
* 00220000
* 4. DMKTRCPV - PROCESS A PRIVILEGED INSTRUCTION 00221000
* 00222000
* A TRACE OUTPUT LINE IS CONSTRUCTED CONTAINING THE 00223000
* PERTINENT INFORMATION FOR A PRIVILEGED INSTRUCTION 00224000
* (OTHER THAN SIO, TIO, HIO, OR TCH), AND IS PRESENTED TO 00225000
* THE USER IN THE USUAL WAY, JUST BEFORE THE PRIVILEGED 00226000
* INSTRUCTION IS SIMULATED OR OTHERWISE HANDLED BY CP. 00227000
* 00228000
* 5. DMKTRCSW - TRACE VIRTUAL AND REAL CSWS 00250100
* 00251000
* IF CSW WAS SPECIFIED, WHEN A VIRTUAL CSW AND REAL CSW ARE 00252000
* AVAILABLE, THEY ARE DISPLAYED TO THE USER IN THE USUAL WAY. 00253000
* THE I/O INTERRUPT THEN NORMALLY FOLLOWS IMMEDIATELY (UNLESS 00254000
* THE INTERRUPT IS DRAINED BY A 'TIO' INSTEAD). 00255000
* 00256000
EJECT 00257100
* OPERATION (CONTINUED) - 00257200
* 00257300
* 6. DMKTRCSV - PROCESS AN SVC, BRANCH, OR FULL INSTRUCTION TRACE 00257400
* 00258000
* FOR AN SVC INTERRUPT, THE STATUS OF THE VIRTUAL MACHINE (ILC, 00259000
* CC, SVC INTERRUPT CODE AND OLD PSW) IS SAVED AS IF BY THE 00260000
* DMKPSASV INTERRUPT HANDLER, AND AN OUTPUT LINE IS CONSTRUCTED 00261000
* CONTAINING THE INFORMATION PERTAINING TO AN SVC INTERRUPT. 00262000
* THIS IS THEN PRESENTED TO THE USER IN THE USUAL WAY PRIOR 00263000
* TO REFLECTING THE SVC INTERRUPT TO THE USER'S VIRTUAL MACHINE. 00264000
* 00265000
* BRANCH AND/OR FULL INSTRUCTION TRACING ARE ACCOMPLISHED BY 00266000
* REPLACING THE FIRST TWO BYTES OF THE NEXT SEQUENTIAL 00267000
* VIRTUAL INSTRUCTION BY AN 'SVC B1', REMEMBERING IN THE TRACE 00268000
* EXTENSION BLOCK (TREXT) THE VIRTUAL ADDRESS AND REAL FIRST 00269000
* TWO BYTES OF THE INSTRUCTION WHICH WAS REPLACED. FOR A 00270000
* CONDITIONAL (OR UNCONDITIONAL) CONTROL TRANSFER, AN 'SVC B2' 00271000
* SIMILARLY REPLACES THE FIRST TWO BYTES OF THE VIRTUAL ADDRESS 00272000
* TO WHICH CONTROL MAY (OR WILL) BE TRANSFERRED. 00273000
* 00274000
* WHEN THE 'SVC B1' OR 'SVC B2' IS EXECUTED AND FIELDED BY THE 00275000
* DMKPSASV SVC INTERRUPT HANDLER, CONTROL IS PASSED TO THE 00276000
* DMKTRCSV ENTRY POINT. HERE, APPROPRIATE STEPS ARE TAKEN 00277000
* TO PRINT OR TYPE THE INSTRUCTION, WHETHER OR NOT A TRANSFER 00278000
* OF CONTROL HAS OCCURRED, REPLACE THE ALTERED INSTRUCTION(S), 00279000
* AND SET A NEW 'SVC B1' AND/OR 'SVC B2' FOR THE NEXT TIME. 00280000
* 00281000
* APPROPRIATE SIMILAR MEASURES ARE ALSO TAKEN FOR THE OTHER 00282000
* ENTRY POINTS, IF BRANCH AND/OR FULL INSTRUCTION TRACING IS 00283000
* IN EFFECT. 00284000
* 00285000
* NOTE: WHEN PRINTING TRACE OUTPUT LINES, IF A SEVERE ERROR 00286000
* (R2 = 8 - FOR SPOOLING SPACE FULL) IS RETURNED BY DMKVSPRT, 00287000
* THEN A FORCED 'TRACE END' IS TRIGGERED TO TERMINATE TRACING. 00288000
EJECT 00289000
* RESPONSES - 00290000
* 00291000
* TERMINAL RESPONSES FOR VARIOUS TRACING SITUATIONS: 00292000
* (SEE KEYS BELOW) 00293000
* 00294000
* 1. I/O INSTRUCTION - SIO/SIOF, TIO, HIO/HDV, OR TCH: 00294100
* 00294200
* SEE DMKTRD 00294300
* 00294400
* 2. CCW ("IDAL" OR "SEEK" LINES INCLUDED ONLY IF APPLICABLE): 00309000
* 00310000
* CCW VVVVVV XXXXXXXX XXXXXXXX RRRRRR YYYYYYYY YYYYYYYY 00311000
* " IDAL VVVVVVVV VVVVVVVV IDAL 00RRRRRR 00RRRRRR 00312000
* " SEEK XXXXXXXX XXXXXX SEEK YYYYYYYY YYYY 00313000
* 00314000
* 3. INSTRUCTION TRACING: 00315000
* 00316000
* A. PRIVILEGED INSTRUCTIONS: 00317000
* 00318000
* ::: VVVVVV SSM XXXXXXXX SS (NORMAL SSM) 00319000
* ::: VVVVVV SSM XXXXXXXX SS TTTTTT (SWITCH TO/FROM TRANSLATE MODE) 00320000
* ::: VVVVVV STOSM XXXXXXXX NS (NORMAL STOSM) 00321000
* ::: VVVVVV STOSM XXXXXXXX NS TTTTTT (SWITCH TO TRANSLATE MODE) 00322000
* ::: VVVVVV STNSM XXXXXXXX NS (NORMAL STNSM) 00323000
* ::: VVVVVV STNSM XXXXXXXX NS TTTTTT (SWITCH FROM TRANSLATE MODE) 00324000
* ::: VVVVVV LPSW XXXXXXXX TTTTTTTT TTTTTTTT (IF WAIT BIT ON) 00325000
* ::: VVVVVV LPSW XXXXXXXX ==> TTTTTTTT TTTTTTTT (WAIT BIT NOT ON) 00326000
* ::: VVVVVV MNEM XXXXXXXX (ALL OTHERS) 00327000
* 00328000
* B. EXECUTED INSTRUCTIONS: 00329000
* 00330000
* VVVVVV EX XXXXXXXX ZZ VVVVVV MNEM XXXXXXXXXXXX 00331000
* 00332000
* C. ALL OTHER INSTRUCTIONS: 00333000
* 00334000
* VVVVVV MNEM XXXXXXXXXXXX 00335000
* 00336000
* 4. SUCCESSFUL BRANCH: 00337000
* 00338000
* VVVVVV MNEM XXXXXXXX ==> TTTTTT 00339000
EJECT 00340000
* RESPONSES (CONTINUED) - 00341000
* 00342000
* 5. INTERRUPT (SVC, PROGRAM, OR EXTERNAL): 00343000
* 00344000
* *** VVVVVV INT CODE ==> TTTTTT 00345000
* 00346000
* 6. I/O INTERRUPT (FIRST LINE GIVEN ONLY IF "CSW" WAS SPECIFIED): 00347000
* 00348000
* CSW V VADD XXXXXXXX XXXXXXXX R RADD YYYYYYYY YYYYYYYY 00349000
* *** VVVVVV I/O VADD ==> TTTTTT CSW XXXX 00350000
* 00351000
* KEYS TO MNEMONICS USED IN THE ABOVE RESPONSES: 00352000
* 00353000
* VVVVVV = VIRTUAL ADDRESS 00354000
* TTTTTT = VIRTUAL TRANSFER ADDRESS OR NEW PSW ADDRESS 00355000
* RRRRRR = REAL ADDRESS 00356000
* XXXXXXXX = VIRTUAL INSTRUCTION, COMMAND, ETC. 00357000
* YYYYYYYY = REAL INSTRUCTION, COMMAND, ETC. 00358000
* SS = ARGUMENT BYTE (SSM-BYTE) FOR "SSM" INSTRUCTION 00359000
* NS = NEW SYSTEM-MASK AFTER EXECUTION OF STOSM/STNSM 00360000
* ZZ = LOW-ORDER BYTE OF "R1" REGISTER IN AN EXECUTE INSTR 00361000
* (NOT SHOWN IF "R1" REGISTER IS REGISTER 0) 00362000
* TYPE = VIRTUAL OR REAL DEVICE NAME (DASD, TAPE, ETC.) 00363000
* VADD = VIRTUAL DEVICE ADDRESS 00364000
* RADD = REAL DEVICE ADDRESS 00365000
* MNEM = MNEMONIC FOR INSTRUCTION, ETC. 00366000
* INT = INTERRUPT TYPE (SVC, PROG, EXT, I/O) 00367000
* CODE = INTERRUPT CODE NUMBER (IN HEX) 00368000
* N = CONDITION-CODE NUMBER (0, 1, 2, OR 3) 00369000
* 00370000
* NOTE: FOR AN EXECUTED INSTRUCTION, WHERE "ZZ" (SEE ABOVE) IS 00371000
* NONZERO, THE MNEMONIC FOR THE EXECUTED INSTRUCTION IS GIVEN 00372000
* AS IF THE "ZZ" BYTE HAD BEEN OR'D INTO THE INSTRUCTION. 00373000
* 00374000
* RESTRICTIONS - 00375000
* 00376000
* INSTRUCTION OR BRANCH TRACING (I.E. ARGUMENT OF 'INSTRUCT', 00377000
* 'BRANCH', OR 'ALL' ON THE 'TRACE' COMMAND) IS NOT 00378000
* PERMISSIBLE WHERE THE USER IS RUNNING A SHARED SYSTEM 00379000
* (SEE DMKTRA181E ERROR MESSAGE IN "TRACE" COMMAND). 00380000
* 00381000
* ERROR MESSAGES - 00382000
* 00383000
* NONE 00384000
*. 00385000
SPACE 2 00386000
* REVISED "RELOC" MACRO - USES HALFWORDS (TO SAVE SPACE): 00387000
MACRO 00388000
&NAME RELOC 00389000
ENTRY &NAME 00390000
&NAME DS 0H 00391000
USING *,R12 00392000
ENTER 00393000
SH R12,=AL2(&NAME-&SYSECT) 00394000
USING &SYSECT,R12 00395000
MEND 00396000
EJECT 00397000
COPY OPTIONS 00398000
COPY LOCAL 00399000
EJECT 00400000
DMKTRC CSECT LOADER CONTROL 00401000
SPACE 00402000
DC CL8'DMKTRC' MODULE IDENTIFIER 00403000
SPACE 00404000
USING PSA,R0 00405000
USING TREXT,R9 00406000
USING VMBLOK,R11 00407000
USING DMKTRC,R12 00408000
USING SAVEAREA,R13 00409000
* 00410000
EXTRN DMKCVTBH 00411000
EXTRN DMKSYSRM @VA03162 00412000
EXTRN DMKVSPRT 00414000
EXTRN DMKATSCF,DMKPSASC @V60BC11 00415100
EXTRN DMKCFMBK 00416000
EXTRN DMKNEMOP 00417000
EXTRN DMKPSARX,DMKPSARS,DMKPSARR 00418000
EXTRN DMKLOCKQ,DMKLOCKD @V200820 00419000
EXTRN DMKPTRUL @V408246 00419100
EXTRN DMKVATRN 00421000
EXTRN DMKPSASP CHECK FOR STORAGE PROTECTION @V202232 00422000
* 00423000
* 00426000
* VARIOUS ENTRY POINTS REACHED WHEN A TRACING CONDITIONS OCCURS: 00427000
* 00428000
DMKTRCEX RELOC PROCESS AN EXTERNAL INTERRUPT @V200820 00429000
BAL R14,TRAINIT CALL INITIALIZER SUBROUTINE 00430000
MVC TRLNINT2(3),CLEXT SET EXTERNAL INTERRUPT CODE 00431000
LTR R4,R4 SYSTEM RESTART? @VA09019 00431100
BNM *+10 NO - GO ON @VA09019 00431200
MVC TRLNINT2(10),CLRST SET SYSTEM RESTART CODE @VA09019 00431300
LA R5,VMTREX SIGNAL IN R5 - DMKTRCEX ENTRY 00432000
B TRAJOINT JOIN COMMON CODE TO HANDLE INTERRUPTS 00433000
SPACE 00434000
DMKTRCIO RELOC PROCESS AN I/O INTERRUPT 00435000
BAL R14,TRAINIT CALL INITIALIZER SUBROUTINE 00436000
MVC TRLNINT2(3),CLIO SET I/O INTERRUPT CODE 00437000
LA R5,VMTRIO SIGNAL IN R5 - DMKTRCIO ENTRY 00438000
B TRAJOINT JOIN COMMON CODE TO HANDLE INTERRUPTS 00439000
SPACE 00440000
DMKTRCPG RELOC PROCESS A PROGRAM INTERRUPT 00441000
BAL R14,TRAINIT CALL INITIALIZER SUBROUTINE 00442000
MVC TRLNINT2(4),CLPROG SET PROG INTERRUPT CODE 00443000
LA R5,VMTRPRG SIGNAL IN R5 - DMKTRCPG ENTRY 00444000
TM VMPEND,VMPERPND VIRTUAL "PER" PENDING ? 00445000
BZ TRAJOINT NOPE - R4 (SEE ENTRY CONDITIONS) IS OK 00446000
TM VMTRCTL,VMTRPER WAS CP USING PER PER001 00446100
BO TRAJOINT YES, DONT OR IN PER PER001 00446200
AH R4,HX80 YES - ADD X'0080' TO R4 (INT. CODE) 00447000
TRAJOINT EQU * PRELIMINARY HANDLING OF INTERRUPTS: 00448000
LR R1,R3 TRANSFER-TO-ADDRESS INTO R1, 00449000
CALL DMKCVTBH BINARY TO HEX PLEASE 00450000
STH R0,TRLNINT5 STORE IN OUTPUT LINE 00451000
ST R1,TRLNINT5+2 ... 00452000
L R1,SAVER1 NOW RESTORE R1 = OLD PSW ADDRESS, AND 00453000
B TRAJOIN1 NOW JOIN COMMON CODE. 00454000
SPACE 00455000
DMKTRCSV RELOC PROCESS AN SVC, BRANCH, OR INSTRUCTION 00467000
BAL R14,TRAINIT CALL INITIALIZER SUBROUTINE 00468000
TM VMTRCTL,VMTRBRIN TRACING BRANCHES OR ALL INSTR ? 00469000
BZ TRA40 IF NOT, FORGET IT. 00470000
CL R10,TREXIN1 DOES R10 (FROM DMKPSA) MATCH A SVC B1 ? 00471000
BE TRA50 YES - WE'RE TRACING A FAKE SVC 00472000
CL R10,TREXIN2 OR A SVC B2 ? 00473000
BE TRA50 YES - WE'RE TRACING A FAKE SVC. 00474000
TRA40 MVC TRLNINT2(3),CLSVC TRACING A REAL SVC - SET CODE 00475000
LA R5,VMTRSVC SIGNAL IN R5 - DMKTRCSV ENTRY 00476000
SL R1,F2 BACK UP THE SVC ADDR @VA09034 00476100
TRAJOIN1 MVC TRLNINT,PFXINTRP SET "INTERRUPT" PREFIX 00477000
TRAJOIN2 STC R5,SAVEWRK1+2 STORE INPUT FLAG BITS 00478000
SR R15,R15 SET TO ZERO @VA07715 00479100
IC R15,TREXCTL1 GET CONTROL FLAG @VA07715 00479200
NR R5,R15 DOES IT MATCH CONTROL FLAG @VA07715 00479300
BNZ TRAJOIN3 IF YES WE HAVE NO PROBLEMS. 00480000
MVC SAVEWRK1+3(1),TREXCTL2 IF NOT, THEN SET BRANCH AND/OR 00481000
NI SAVEWRK1+3,(TREXBRAN+TREXINST) INSTRUCT CONTROL BITS 00482000
TRAJOIN3 EQU * @VA09034 00482600
CALL DMKCVTBH @VA08161 00483100
STH R0,TRLNINT1 STORE 6-BYTE HEX ADDRESS 00484000
STCM R1,B'1111',TRLNINT1+2 @VA07715 00485100
MVC TRLNINT4,PFXARROW PUT ==> PRIOR TO BRANCH-TO ADDRESS 00488000
LTR R1,R4 INTERUPT CODE INTO R1 @VA09019 00489100
BM TRAREST IF SYSTEM RESTART GO ON @VA09019 00489200
CALL DMKCVTBH TO HEX PLEASE 00490000
STCM R1,B'1111',TRLNINT3 STORE IN OUTPUT LINE @VA07715 00491100
TRAREST EQU * @VA09019 00491600
TM SAVEWRK1+2,VMTREX+VMTRIO+VMTRPRG ANY OF THESE ? 00492000
BNZ TRA99 TRF IF YES. 00493000
LA R1,SVCOPSW POINT TO USER'S SVC OLD PSW 00494000
BAL R14,TRANBRNG GET ADDR OF SAME & OTHER STUFF IN PAGE 0 00495000
L R1,SVCNPSW+4-SVCOPSW(,R2) GET TRANSFER TO ADDRESS 00496000
CALL DMKCVTBH BINARY TO HEX PLEASE 00497000
STH R0,TRLNINT5 STORE IN OUTPUT LINE 00498000
ST R1,TRLNINT5+2 ... 00499000
* NOW DO ALL NECESSARY STUFF TO "SAVE THE USER'S VIRTUAL MACHINE": 00500000
ICM R4,12,SAVER0+2 CC/PROGRAM MASK INTO LEFT END OF R4, 00501000
L R5,SAVER1 AND 2ND HALF OF PSW INTO R5 00502000
L R6,SAVER4 AND ILC/INT CODE WORD INTO R6 00503000
ST R5,4(,R2) STORE 2ND HALF OF OLD PSW 00504000
TM VMESTAT,VMEXTCM IS VM IN EXTENDED MODE NOW ? 00505000
BZ TRA86 IF NOT, MAKE A "PLAIN" OLD PSW. 00506000
ST R6,INTSVCL-SVCOPSW(,R2) STORE ILC/INT-CODE WORD 00507000
STCM R4,12,2(R2) STORE CC/PROGRAM MASK, 00508000
L R6,VMPSW GET OLD VMPSW, 00509000
STCM R6,12,0(R2) STORE IN 1ST 2 BYTES OF OLD PSW 00510000
B TRA88 GO HANDLE NEW PSW AND FINISH UP. 00511000
TRA86 L R14,SAVER2 ILC ONLY INTO R14, 00512000
SLR R15,R15 CLEAR R15 00513000
SRDL R14,3 NOW INTO FIRST TWO BITS OF R15 00514000
OR R4,R15 'OR' CORRECT ILC WITH CC-PROGRAM MASK 00515000
STCM R4,8,4(R2) STORE ILC/CC/PROGRAM MASK WITH THE ADDR 00516000
ICM R6,12,VMPSW GET VMPSW 1ST TWO BYTES WITH INT-CODE, 00517000
ST R6,0(,R2) AND STORE FIRST HALF OF OLD PSW 00518000
* 00519000
TRA88 LM R4,R5,SVCNPSW-SVCOPSW(R2) GET CORRECT NEW PSW, 00520000
STM R4,R5,VMPSW AND STORE AS VIRTUAL MACHINE PSW 00521000
OI SAVEWRK8,SETCC AND SET FLAG FOR DMKPSASV 00522000
* 00523000
* TRANSFERRING TO A NEW PLACE VIA AN INTERRUPT: 00524000
* R4/R5 = NEW PSW 00525000
* R6 = 1ST WORD OF OLD PSW 00526000
TRA89 TM VMTRCTL,VMTRBRIN TRACING BRANCHES OR ALL INSTR ? 00527000
BZ TRA90 IF NOT, FORGET IT. 00528000
BAL R3,PUTBACK PUT BACK THE OLD USER INSTRUCTIONS 00529000
LA R15,1 MAKE SURE THE ADDRESS IS AN EVEN NO. 00530000
NR R15,R5 ... 00531000
BNZ TRA90 DON'T SET A "SVC B2" IF NO GOOD. 00532000
LA R7,0(,R5) VIRTUAL TRANSFER-TO ADDRESS INTO R7 00533000
LRA R5,0(,R7) IS IT A VALID ADDRESS ? @V304635 00534000
BC 8+2,TRA89A1 CONTINUE IF IT'S NOT A SEG @V408246 00535100
* EXECPTION 00535200
LR R1,R7 GET VIRTUAL ADDRESS IN CORRECT @V408246 00535300
* REG 00535400
CALL DMKPTRAN,PARM=DEFER OTHERWISE LET PTRAN HANDLE @V408246 00535500
BC 2,TRA90 ADDRESSING ERROR @V408246 00535600
TRA89A1 DS 0H @V408246 00535700
L R5,TRANMASK MASK OF BITS WHICH MUST MATCH OLD PSW 00536000
NR R4,R5 ISOLATE CRUCIAL BITS OF NEW PSW, 00537000
NR R6,R5 AND DITTO FOR OLD PSW 00538000
CLR R4,R6 POSSIBLY EXACTLY THE SAME ? 00539000
BE TRA89C IF YES, THAT MAKES IT EASY. 00540000
ST R6,SAVEWRK3 OLD PSW BITS WHERE WE CAN LOOK AT THEM 00541000
ST R4,SAVEWRK4 DITTO FOR THE NEW PSW BITS 00542000
TM SAVEWRK4+1,EXTMODE WILL THIS PUT USER IN EXTENDED MODE ? 00543000
BZ TRA89A NOPE - SO FAR SO GOOD. 00544000
TM VMPSTAT,VMV370R IS EXTENDED MODE LEGAL FOR THIS GUY ? 00545000
BZ TRA90 NOPE - IT WILL PROGRAM CHECK LATER. 00546000
TRA89A TM SAVEWRK3+1,EXTMODE IS HE IN BC OR EXTENDED MODE NOW ? 00547000
BZ TRA89B BC - SEE IF GOING INTO EXTENDED & TRANS 00548000
TM SAVEWRK3,TRANMODE EXTENDED - IN TRANSLATE MODE NOW ? 00549000
BO TRA90 IF YES WE KNOW IT WILL BE SWITCHING. 00550000
TRA89B CLR R4,R5 GOING INTO EXTENDED & TRANSLATE ? 00551000
BE TRA90 IF YES WE KNOW IT WILL BE SWITCHING. 00552000
TRA89C LR R1,R7 OK TO SET A NEW "SVC B2" WHERE 00553000
BAL R3,SETNEWB4 THE SVC (OR OTHER INTERRUPT) WILL GO 00554000
TRA90 BAL R3,TROUSUB NOW GIVE THE OUTPUT MESSAGE 00555000
* 00556000
TRA92 DS 0H HERE WHEN WE'RE "ALL FINISHED" 00557000
LH R15,TREXTERM PICK UP THE TERMINAL FLAGS @VA09939 00558110
N R15,SAVEWRK1 SHOULD WE STOP? @VA09939 00558120
BZ TRA94 NOPE, AIM FOR EXIT W/O STOP. @VA00782 00560000
LH R15,TREXRUNF PICK UP STOP/RUN FLAG BITS 00561000
N R15,SAVEWRK1 SHOULD WE STOP OR KEEP RUNNING ? 00562000
BZ TRA96 IF "NORUN", GO CALL DMKCFMBK "BREAK" RTN 00563000
TRA94 CLI SAVEWRK8+3,00 FOR "RUN", ANY ERRORS FROM DMKQCNWT ? 00564000
BE TRA97 IF NOT (NO ATTN HIT BY USER), GO EXIT. 00565000
* 00566000
* TRIGGER A STOP AFTER TRACING THIS EVENT, EITHER BECAUSE 'RUN' FLAG 00567000
* IS NOT SET, OR BECAUSE THE USER HIT ATTENTION DURING TERMINAL OUTPUT: 00568000
TRA96 CLI SAVEWRK2,X'83' IS IT A DIAG ?? 00569000
BNE TRA961 NO, OK 00570000
CLC SAVEWRK2+2(2),F8+2 IS DIAG CONSOLE FUNCTION 00571000
BE TRA97 YES, DONT CALL DMKCFMBK, DIAG WILL DO IT 00572000
TRA961 CALL DMKCFMBK ENTER CONSOLE FUNCTION MODE 00573000
OI SAVEWRK7,VMCFWAIT REMEMBER THAT DMKCFMBK SET VMCFWAIT 00574000
TRA97 EQU * UNLOCK USER'S TREXT BLOCK @V200820 00575000
ST R9,TRALOCK+4 SETUP LOCK "NAME" @V200820 00576000
LA R1,TRALOCK POINT TO IT FOR DMKLOC @V200820 00577000
CALL DMKLOCKD UNLOCK - TRACING FINISHED @V200820 00578000
DROP R9 00579000
TRAEXIT DS 0H RESTORE VMRSTAT FLAGBITS (AS NEEDED) BEFORE EXIT: 00580000
OI SAVEWRK7,255-(VMEXWAIT+VMCFWAIT) PRESERVE ALL OTHER BITS 00581000
NC VMRSTAT(1),SAVEWRK7 RESTORE VMEXWAIT|VMCFWAIT AS NEEDED 00582000
TRAEXITR LCTL C1,C1,VMSEG BE SURE CONTROL REG 1 IS CORRECTLY SET, 00583000
TM SAVEWRK8,SETCC SET COND CODE 0 OR NONZERO 00584000
EXIT AND REALLY EXIT. 00585000
EJECT 00586000
* HANDLE EXTERNAL, PROGRAM, OR I/O INTERRUPT: 00587000
USING TREXT,R9 00588000
TRA99 LM R4,R5,SAVER2 NEW PSW INTO R4-R5, 00589000
L R6,SAVER0 1ST WORD OF OLD PSW INTO R6, 00590000
TM SAVEWRK1+2,VMTRIO NOW WAS THAT AN I/O INTERRUPT ? 00591000
BZ TRA89 NO - GIVE MESSAGE AND FINISH UP. 00592000
MVC TRLNINT6,CLCSW FILL IN 'CSW' 00593000
LH R1,SAVER5+2 GET CSW+4/CSW+5 BYTES (THERE FROM CALLER) 00594000
CALL DMKCVTBH BINARY TO HEX PLEASE, 00595000
STCM R1,B'1111',TRLNINT7 STORE IN MESSAGE @VA07715 00596100
B TRA89 GO GIVE I/O INTERRUPT LINE 00597000
SPACE 3 00598000
DMKTRCPV RELOC PROCESS A PRIVILEGED INSTRUCTION: 00599000
BAL R14,TRAINIT CALL INITIALIZER SUBROUTINE 00600000
MVC TRLNINT,PFXPRV USE PRIVILEGED-INSTRUCTION PREFIX 00601000
MVI SAVEWRK1+2,VMTRPRV SIGNAL: DMKTRCPV ENTRY 00602000
LR R10,R1 LET R10 = ADDRESS OF PRIVILEGED INSTR, 00603000
TM TREXCTL1,VMTRPRV "PRIV" CONTROL-BIT SET ? 00604000
BO TRA62 YES - LET INSTRUCTION TRACING DO THE WORK 00605000
MVC SAVEWRK1+3(1),TREXCTL2 IF NOT, THEN SET BRANCH AND/OR 00606000
NI SAVEWRK1+3,(TREXBRAN+TREXINST) INSTRUCT CONTROL BITS, 00607000
TM TREXCTL2,TREXBRAN BRANCH TRACING ON ? 00608000
BZ TRA62 NOPE - GO TO IT. 00609000
B TRA52 YES - USE BRANCH-TRACING CODE. 00610000
EJECT 00611000
USING VDEVBLOK,R8 NEEDED FOR DMKTRCSW ENTRY POINT 00914000
USING IOBLOK,R10 ... 00915000
SPACE 00916000
DMKTRCSW RELOC ENTRY TO TRACE VIRTUAL & REAL CSWS 00917000
BAL R14,TRAINIT CALL INITIALIZER SUBROUTINE 00918000
MVI SAVEWRK1+3,TREXCSW INDICATE TRACING CSWS 00919000
MVC TRLNCSW,PFXCSW PREFIX INTO 1ST 3 BYTES OF OUTPUT MESSAGE 00920000
MVI TRLNCSWV,C'V' 'V' WHERE NEEDED 00921000
LH R1,IOBVADD GET VIRTUAL DEVICE ADDRESS (FROM IOBLOK) 00922000
CALL DMKCVTBH BINARY TO HEX PLEASE 00923000
STCM R1,B'1111',TRLNCSW1 STORE IN OUTPUT MSG @VA07715 00924100
LM R1,R2,VDEVCSW NOW GET VIRTUAL CSW (FROM VDEVBLOK) 00925000
ICM R15,15,IOBCSW CAUTION - 1ST HALF OF CSW = 0 ? @VA00865 00926000
BNZ VCSWOK NOPE - VDEVCSW IS OK. @VA00865 00927000
LM R1,R2,IOBCSW IF YES, USE IOBCSW INSTEAD. @VA00865 00928000
VCSWOK EQU * REAL/VIRTUAL CSW TO HEX: @VA00865 00929000
CALL DMKCVTBH 1ST HALF BINARY TO HEX PLEASE 00930000
STCM R0,B'1111',TRLNCSW2 STORE INTO OUTPUT MSG @VA07715 00931100
STCM R1,B'1111',TRLNCSW2+4 STORE INTO OUTPUT MSG @VA07715 00931200
LR R1,R2 SECOND HALF BINARY TO HEX NOW 00932000
CALL DMKCVTBH ... 00933000
STM R0,R1,TRLNCSW3 STORE IN OUTPUT MSG 00934000
MVI TRLNCSWR,C'R' 'R' WHERE NEEDED 00935000
LH R1,IOBRADD GET REAL DEVICE ADDRESS, 00936000
CALL DMKCVTBH BINARY TO HEX PLEASE 00937000
ST R1,TRLNCSW4 STORE IN OUTPUT MSG 00938000
LM R1,R2,IOBCSW GET REAL CSW 00939000
CALL DMKCVTBH 1ST HALF BINARY TO HEX PLEASE 00940000
STCM R0,B'1111',TRLNCSW5 STORE IN OUTPUT MSG @VA07715 00941100
STCM R1,B'1111',TRLNCSW5+4 STORE INTO MSG @VA07715 00941200
LR R1,R2 SECOND HALF OF REAL CSW 00942000
CALL DMKCVTBH BINARY TO HEX PLEASE 00943000
STCM R0,B'1111',TRLNCSW6 STORE INTO OUTPUT MSG @VA07715 00944100
STCM R1,B'1111',TRLNCSW6+4 STORE INTO MESSAGE @VA07715 00944200
B TRA90 GO GIVE MESSAGE AND FINISH UP. 00945000
SPACE 00946000
DROP R8,R10 00947000
EJECT 00952000
* TRAINIT = SUBROUTINE TO INITIALIZE VARIOUS STUFF AT ENTRY: 00953000
* R14 = RETURN REGISTER 00954000
* 00955000
TRAINIT MVC SAVEWRK7(1),VMRSTAT SAVE VMRSTAT FLAG STATUS AT ENTRY 00956000
OI VMRSTAT,VMEXWAIT+VMCFWAIT ENSURE THAT USER IS NOT RUN 00957000
ICM R9,B'1111',VMTREXT POINT TO TRACE EXT BLOCK @V408246 00958100
BZ TRAEXIT IF NOT, GO AWAY QUIETLY. 00960000
SLR R15,R15 CLEAR SAVEWRK1 FLAG 00961000
ST R15,SAVEWRK1 ... 00962000
ST R15,SAVEWRK8 AND SAVEWRK8 FLAGS & "ERROR CODE" 00963000
ST R9,TRALOCK+4 SETUP LOCK "NAME" @V200820 00964000
LA R1,TRALOCK POINT TO IT FOR DMKLOC @V200820 00965000
LR R9,R14 SAVE INTERNAL RETURN ADDRESS @V200820 00966000
CALL DMKLOCKQ ENQUEUE FOR TRACING @V200820 00967000
TM VMTRCTL,255-VMTRPER ANY TRACING IN EFFECT NOW? PER001 00968000
BE TRAEXIT NO -- EXIT QUIETLY @V200820 00969000
LR R14,R9 RESTORE RETURN REGISTER @V200820 00970000
L R9,VMTREXT GR9 = VIRTUAL MACHINE TRACE BLOCK@V200820 00971000
NI TREXFLAG,255-TREXNDSP RESET DSP INTERLOCK @VA04044 00971500
LM R0,R1,SAVER0 RESTORE REGS @VM08544 00972000
BLANKBUF MVC TREXBUFF(8),BLANKS BLANK THE OUTPUT BUFFER 00973000
MVC TREXBUFF+8(72),TREXBUFF ... 00974000
BR R14 AND RETURN. 00975000
SPACE 2 00976000
DMKTRCPB RELOC ENTRY TO CALL "PUTBACK" ROUTINE 00977000
L R9,VMTREXT POINT TO TREXT CONTROL BLOCK 00978000
BAL R3,PUTBACK DO IT 00979000
MVI TREXNSI,00 ALSO CLEAR 1ST BYTE OF "TREXNSI" 00980000
* RESET 'CALL DMKVAT' BIT AND THE DSP INTERLOCK BIT 00981000
NI TREXFLAG,255-(TREXVAT+TREXNDSP) @VA04044 00982000
B TRAEXITR AND GO EXIT. 00983000
SPACE 2 00984000
DMKTRCIT RELOC ENTRY TO SET "SVC B2" FOR TRACING: 00985000
L R9,VMTREXT POINT TO TREXT CONTROL BLOCK 00986000
LA R7,0(,R1) VIRTUAL ADDRESS WITHOUT HIGH BYTE INTO R7 00987000
LR R1,R7 (AND IN R1 ALSO, PLEASE) 00988000
BAL R3,SETNEWB4 INITIALIZE TRACING AND/OR INSTR 00989000
B TRAEXITR AND GO EXIT. 00990000
EJECT 00991000
* SUBROUTINE TO PUT BACK ANY INSTRUCTIONS WHICH WERE ALTERED: 00992000
* R3 = RETURN REGISTER 00993000
PUTBACK L R0,FFS X'FFFFFFFF' INTO R0 00994000
ST R0,TREXANSI STORE IN TREXANSI (UNTIL SET OTHERWISE) 00995000
L R1,TREXIN1 GET ADDRESS OF 1ST REPLACED INSTRUCTION 00996000
CLR R1,R0 ANYTHING THERE TO PUT BACK ? 00997000
BE PUTBACK2 NO. 00998000
ST R0,TREXIN1 SET ADDR AT TREXIN1 BACK TO X'FFFFFFFF' 00999000
BAL R14,TRANPTBK GET REAL ADDRESS OF 1ST INSTRUCTION 01000000
BNZ PUTBACK2 IF CAN'T GET IT, GIVE UP (SADLY). 01001000
LH R15,TREXSVC1 GET FIRST TWO BYTES OF REAL INSTRUCTION 01002000
CLI 0(R2),X'0A' IS THE SVC STILL THERE ? 01003000
BNE PUTBACK1 IF NOT LEAVE FIRST BYTE ALONE 01004000
STCM R15,2,0(R2) OK - PUT BACK FIRST BYTE OF REAL INSTR 01005000
PUTBACK1 CLI 1(R2),X'B1' IS THE "B1" STILL THERE ? 01006000
BNE PUTBACK2 IF NOT LEAVE THE SECOND BYTE ALONE 01007000
STC R15,1(,R2) OK, PUT BACK 2ND BYTE OF INSTR 01008000
* 01009000
PUTBACK2 L R1,TREXIN2 GET ADDRESS OF 2ND REPLACED INSTRUCTION 01010000
CLR R1,R0 ANYTHING THERE TO PUT BACK ? 01011000
BCR 8,R3 <BE> NO - EXIT. 01012000
ST R0,TREXIN2 SET ADDR AT TREXIN2 BACK TO X'FFFFFFFF' 01013000
BAL R14,TRANPTBK GET REAL ADDRESS OF 2ND INSTRUCTION 01014000
BCR 7,R3 <BNZ> IF CAN'T GET IT, GIVE UP (SADLY). 01015000
CLC 0(2,R2),HSVCB2+2 IS THE "SVC B2" STILL THERE ? 01016000
BCR 7,R3 <BNE> NO (STRANGE) - LEAVE WELL ENOUGH ALONE. 01017000
MVC 0(2,R2),TREXSVC2 PUT BACK 1ST 2 BYTES OF REAL INSTR 01018000
BR R3 AND EXIT. 01019000
EJECT 01020000
* HANDLE TRACING BRANCHES AND/OR INSTRUCTIONS: 01021000
* 01022000
* NOTE: CAN TRACE ANY OF THE FOLLOWING: 01023000
* (1) BRANCHES - ON PRINTER AND/OR TERMINAL 01024000
* (2) INSTRUCTIONS - ON PRINTER AND/OR TERMINAL 01025000
* (3) BRANCHES ON ONE DEVICE (E.G. TERMINAL) AND 01026000
* INSTRUCTIONS ON THE OTHER DEVICE (E.G. PRINTER) 01027000
* 01028000
* R10 = VIRTUAL ADDRESS OF USER INSTRUCTION 01029000
* 01030000
TRA50 NI VMPEND,255-VMPERPND RESET "VMPERPND" TO AVOID PROBLEMS 01031000
LR R1,R10 ADDRESS OF ACTUAL INSTRUCTION INTO R1 01032000
STH R0,VMPSW+2 STORE VMPSW+2 (HARMLESS IF IN BC MODE) 01033000
TM VMESTAT,VMEXTCM IN EXTENDED CONTROL MODE NOW ? 01034000
BO TRA51 YES 01035000
ICM R1,8,SAVER0+2 BC MODE - GET CC & PROGRAM MASK 01036000
TRA51 ST R1,VMPSW+4 STORE VMPSW+4 01037000
TM TREXCTL2,TREXBRAN ARE WE TRACING BRANCHES ? 01038000
BZ TRA60 NO - JUST INSTRUCTIONS THIS TIME. 01039000
* 01040000
* HANDLE TRACING BRANCHES: 01041000
* 01042000
TRA52 OI SAVEWRK8,NOSTOP+NOTRAMSG SET NEEDED FLAG BITS 01043000
CL R10,TREXIN2 ARE WE AT A BRANCH (SVC B2) PLACE ? 01044000
BNE TRA56 NOPE - NOT THIS TIME. 01045000
* (USE A PREFIX OF BLANKS) 01046000
ICM R4,B'1111',TREXANSI GET ORIGIN @V408246 01047100
BM TRA56 NOPE - FORGET IT. 01049000
LA R2,TREXNSI YES - POINT TO THE INSTRUCTION THERE 01050000
* (NOTE - SVC B2 IS STILL REALLY THERE) 01051000
BAL R3,TRASET COMPUTE WHERE WE WOULD HAVE GONE 01052000
CLI TREXNSI,X'05' IS IT A BALR INSTRUCTION @VA02397 01053000
BNE CKADDR NO @VA02397 01054000
TM TREXNSI+1,X'0F' IS BRANCH-TO REG ZERO @VA02397 01055000
BZ CKADDR YES @VA02397 01056000
SLR R1,R1 CLEAR A WORK REG @VA02397 01057000
IC R1,TREXNSI+1 SEE IF THE TWO REGS IN THE BALR @VA02397 01058000
LR R3,R1 INSTRUCTION ARE THE SAME REG @VA02397 01059000
N R1,F15 ISOLATE 2ND REG IN R1 @VA02397 01060000
SRL R3,4 SET UP 1ST REG IN R3 @VA02397 01061000
CLR R1,R3 ARE THE TWO REGS THE SAME @VA02397 01062000
BNE CKADDR NO @VA02397 01063000
LR R1,R10 PUT BRANCHED-TO INST IN R1 @VA02397 01064000
BAL R3,TRANADDR PUT ADDRESS INTO MESSAGE @VA02397 01065000
B CKARROW FINISH MESSAGE @VA02397 01066000
CKADDR CLR R7,R10 IS THAT WHERE WE ARE NOW ? @VA02397 01067000
BNE TRA56 NO, FORGET IT - MUST BE VIA AN INTERRUPT 01068000
* (WHICH WE WOULD HAVE JUST DISPLAYED) 01069000
BAL R3,TRAGETBR BRANCH-TO ADDRESS INTO MESSAGE 01070000
CKARROW CLI 1(R15),C' ' SOMETHING ALREADY THERE? @VA02397 01071000
BNE TRA55 YES (NON-BLANK) LEAVE WELL ENOUGH ALONE 01072000
MVC 0(3,R15),PFXARROW PUT IN AN ARROW: ==> NEW ADDR 01073000
TRA55 BAL R3,TRAGET14 FILL IN THE FIELDS PRECEDING THIS 01074000
MVI SAVEWRK1+3,TREXBRAN SET/RESET NEEDED FLAGBITS 01075000
NI SAVEWRK8,255-NOSTOP ... 01076000
BAL R3,TROUSUB AND OUTPUT THE "BRANCH" LINE. 01077000
* 01078000
TRA56 TM TREXCTL2,TREXINST TRACING INSTRUCTIONS ALSO ? 01079000
BZ TRA62 NOPE - JUST BRANCHES THIS TIME. 01080000
BAL R14,BLANKBUF YES - RESET THE OUTPUT BUFFER, 01081000
NI SAVEWRK8,255-(NOSTOP+NOTRAMSG) RESET THESE FLAG BITS 01082000
* CONTINUE - HANDLE TRACING INSTRUCTIONS: 01083000
EJECT 01084000
* HANDLE TRACING INSTRUCTIONS: 01085000
* 01086000
TRA60 OI SAVEWRK1+3,TREXINST SET TO GIVE INSTRUCTION OUTPUT 01087000
* (USE A PREFIX OF BLANKS) 01088000
CL R10,TREXIN1 DID WE TRANSFER CONTROL ? 01089000
BE TRA62 NOPE - THE PREFIX IS OK. 01090000
MVC TRLNINT,PFXBRNCH SHOW WE'RE AT A NEW PLACE 01091000
TRA62 BAL R3,PUTBACK PUT BACK THE REAL INSTRUCTION(S) 01092000
LR R4,R10 POINT TO THE INSTRUCTION WE WILL NOW DO 01093000
BAL R3,TRAGET14 FILL IN THE PRELIMINARY FIELDS 01094000
BAL R3,TRASET2 SET FOR NEXT INSTRUCTION ETC. 01095000
TM SAVEWRK5+2,X'FF' IS IT SOME KIND OF BRANCH ? 01096000
BZ TRA64 NOPE - LEAVE WELL ENOUGH ALONE 01097000
BO TRA63 MODE-SWITCHING BRANCH - SHOW THE ADDRESS 01098000
ST R4,TREXANSI REMEMBER WHERE ARE NOW 01099000
MVC TREXNSI(6),SAVEWRK2 REMEMBER THE INSTRUCTION ALSO 01100000
TRA63 BAL R3,TRAGETBR BRANCH-TO ADDR INTO MESSAGE 01101000
TRA64 TM VMTRCTL,VMTRBRIN TRACING BRANCHES OR ALL INSTRUCTIONS ? 01102000
BZ TRA90 NO (MUST BE PRIV ENTRY) - JUST GIVE MSG 01103000
BAL R3,SETNEWB2 SET NEW B2 PLACE 01104000
BAL R3,SETNEWB1 AND NEW B1 PLACE 01105000
TM SAVEWRK8,NOSTOP+NOTRAMSG CHECK FLAG BITS 01106000
BM TRA92 MIXED - IT'S JUST NOTRAMSG. 01107000
BO TRA97 BOTH SET - NO MESSAGE AND DO NOT STOP. 01108000
TM SAVEWRK1+3,TREXBRAN DID WE TRACE A BRANCH ABOVE ? 01109000
BZ TRA90 NOPE - GO GIVE MESSAGE AS USUAL. 01110000
NI SAVEWRK1+3,255-(TREXBRAN) YES, RESET FLAGBIT FOR TROUSUB 01111000
BAL R3,TROUSUB OUTPUT THE "INSTRUCTION" LINE 01112000
ICM R15,B'0011',TREXTERM TERM FLAGS @V408246 01112100
BZ TRA94 NO..CONTINUE..... @VA04211 01112300
TM TREXRUNF+1,TREXBRAN+TREXINST BOTH FLAGBITS SAY "RUN" ? 01113000
BO TRA94 YES - "RUN" (UNLESS ATTN HIT BY USER) 01114000
B TRA96 NO - THEN CALL DMKCFMBK ETC. 01115000
SPACE 2 01116000
* SUBROUTINE TO FILL IN VIRTUAL TRANSFER-TO ADDRESS (IF ANY) 01117000
* AT ENTRY: 01118000
* R3 = RETURN REGISTER 01119000
* R7 = BRANCH-TO ADDRESS - IF ANY (X'FFFFFFFF' IF NONE) 01120000
* ACTUAL INSTRUCTION IS IN TREXNSI 01121000
SPACE 01122000
TRAGETBR LTR R1,R7 BRANCH-TO-ADDRESS (IF ANY) INTO R1 01123000
BCR 4,R3 <BM> IF MINUS (X'FFFFFFFF') EXIT FORTHWITH 01124000
TRANADDR CALL DMKCVTBH BINARY TO HEX PLEASE @VA02397 01125000
LA R15,TRLNINS6-4 WHERE TO PUT ARROW & BRANCH-TO ADDRESS 01126000
CLI TREXNSI,X'44' WAS THE INSTRUCTION AN EXECUTE ? 01127000
BNE TRA69 NOPE - WE'RE ALL SET. 01128000
LA R15,TRLNINS9-4 WHERE TO PUT BRANCH-TO ADDR FOR EX-BRANCH 01129000
TRA69 CLI 4(R15),C' ' FIELD ALREADY FILLED IN (LPSW OR EX-LPSW) 01130000
BCR 7,R3 <BNE> IF YES (NON-BLANK), JUST EXIT. 01131000
STH R0,4(,R15) OTHERWISE, STORE BRANCH-TO ADDRESS 01132000
ST R1,6(,R15) ... 01133000
BR R3 EXIT (NOTE: R15 = WHERE-TO-PUT ARROW) 01134000
EJECT 01135000
* SUBROUTINE TO OBTAIN USER INSTRUCTION FROM VIRTUAL MEMORY AND 01136000
* PUT IN A SAVE-AREA FOR GENERAL USE, ALSO FILLING IN OUTPUT LINE 01137000
* 01138000
* AT ENTRY: 01139000
* R1 = VIRTUAL ADDRESS OF USER INSTRUCTION 01140000
* R3 = RETURN REGISTER 01141000
* R8 = ADDRESS OF SAVE AREA (E.G. SAVEWRK2 OR SAVEWRK4) 01142000
* AT EXIT: 01143000
* VIRTUAL INSTRUCTION (IF VALID) IS IN SAVE AREA 01144000
* AND FIELDS TRLNINT1 & TRLNINS2-5 HAVE BEEN FILLED IN 01145000
* 01146000
TRAGET14 LR R1,R4 ENTER HERE IF VIRTUAL ADDRESS IS IN R4 01147000
LA R8,SAVEWRK2 LET SAVEWRK2 (6 BYTES) BE THE SAVE-AREA 01148000
* 01149000
TRAGET MVC 0(6,R8),ZEROES CLEAR 6 BYTES AT THE SAVE AREA 01150000
LR R2,R1 REMEMBER VIRTUAL ADDRESS IN R2 01151000
CALL DMKCVTBH CONVERT TO PRINTABLE HEX 01152000
STH R0,TRLNINT1 STORE IN MESSAGE 01153000
STCM R1,B'1111',TRLNINT1+2 @VA07715 01154100
LA R15,1 MAKE SURE THE ADDRESS = AN EVEN NUMBER 01155000
NR R15,R2 ... 01156000
BCR 7,R3 <BNZ> IF ODD GIVE UP; IT WILL PROGRAM INTERRUPT 01157000
LR R1,R2 ADDRESS BACK IN R1 NOW PLEASE 01158000
BAL R14,TRANVIRT GET 1ST 2 BYTES OF INSTRUCTION 01159000
BCR 7,R3 <BNZ> (BEWARE ADDRESSING ERROR) 01160000
MVC 0(2,R8),0(R2) SAVE THE FIRST TWO BYTES 01161000
LA R2,2(,R1) GET VIRT. ADDR. OF THE NEXT TWO BYTES 01162000
LH R0,0(,R8) OP-CODE INTO R0 01163000
LA R1,TRLNINS2 POINT TO WHERE THE MNEMONIC SHOULD GO 01164000
CALL DMKNEMOP GO MNEMONIC SUBROUTINE GO 01165000
BZ TRAGET1 IF COND CODE = 0, NOT A PRIV. INSTRUCTION 01166000
L R15,VMTREXT MAKE SURE WE REFERENCE TREXT BLOCK 01167000
USING TREXT,R15 (R9 CAN BE FUDGED IF EXECUTED INSTR) 01168000
CLI TRLNINT,C' ' ANY PREFIX ALREADY THERE ? 01169000
BNE TRAGET1 YES (NON-BLANK) LEAVE IT ALONE. 01170000
MVC TRLNINT(3),PFXPRV NO, USE PRIVILEGED-INSTRUCTION PREFIX 01171000
DROP R15 01172000
TRAGET1 LH R1,0(,R8) 1ST TWO BYTES INTO R1, 01173000
CALL DMKCVTBH BINARY TO HEX PLEASE 01174000
STCM R1,B'1111',TRLNINS3 STORE IN MESSAGE @VA07715 01175100
CLI 0(R8),X'40' RR INSTRUCTION ? 01176000
BCR 4,R3 <BL> YES - RETURN TO CALLER. 01177000
LR R1,R2 ADDR OF NEXT TWO BYTES INTO R1 01178000
BAL R14,TRANVIRT GO GET EM 01179000
BCR 7,R3 <BNZ> (BEWARE ADDRESSING ERROR) 01180000
MVC 2(2,R8),0(R2) SAVE THE 3RD & 4TH BYTES 01181000
LA R2,2(,R1) REMEMBER WHERE THE LAST TWO BYTES WILL BE 01182000
LH R1,2(,R8) 3RD & 4TH BYTES BINARY TO HEX 01183000
CALL DMKCVTBH ... 01184000
STCM R1,B'1111',TRLNINS4 STORE IN MESSAGE @VA07715 01185100
CLI 0(R8),X'C0' RS, RS, OR SI INSTRUCTION ? 01186000
BCR 4,R3 <BL> YES - RETURN TO CALLER. 01187000
LR R1,R2 ADDR OF LAST TWO BYTES INTO R1 01188000
BAL R14,TRANVIRT GO GET EM 01189000
BCR 7,R3 <BNZ> (BEWARE ADDRESSING ERROR) 01190000
MVC 4(2,R8),0(R2) SAVE THE LAST TWO BYTES 01191000
LH R1,4(,R8) LAST TWO BYTES BINARY TO HEX 01192000
CALL DMKCVTBH ... 01193000
STCM R1,B'1111',TRLNINS5 STORE IN MESSAGE @VA07715 01194100
BR R3 AND RETURN TO CALLER. 01195000
EJECT 01196000
* MAIN ROUTINE TO COMPUTE ADDRESSES FOR "NEXT SEQUENTIAL INSTRUCTION" 01197000
* AND ADDRESSES AT WHICH TO PLACE "SVC B1" AND/OR "SVC B2" FOR BRANCHES 01198000
* 01199000
* AT ENTRY: 01200000
* R4 = VIRTUAL ADDRESS OF "THIS" OR "PREVIOUS" INSTRUCTION 01201000
* R2 = REAL ADDRESS OF SAID INSTRUCTION (WHICH MUST BE AVAILABLE 01202000
* SOMEWHERE, E.G. IN VMINST, TREXNSI, OR SAVEWRK2/SAVEWRK4) 01203000
* R3 = RETURN REGISTER 01204000
* 01205000
* AT EXIT: 01206000
* R5 = ADDRESS OF "NEXT" INSTRUCTION (= R4 + 2, 4, OR 6) 01207000
* R6 = ADDRESS AT WHICH TO PLACE "SVC B1" INSTRUCTION 01208000
* (VALUE OF X'FFFFFFFF' = DO NOT SET "SVC B1") 01209000
* R7 = ADDRESS AT WHICH TO PLACE "SVC B2" INSTRUCTION 01210000
* (VALUE OF X'FFFFFFFF' = DO NOT SET "SVC B2") 01211000
* 01212000
* NOTE - IF "THIS INSTRUCTION" IS AN EXECUTE (X'44'), ALSO 01213000
* FILLS IN APPROPRIATE LINES OF THE OUTPUT MESSAGE FOR SAME 01214000
* 01215000
TRASET2 LA R2,SAVEWRK2 ENTER HERE TO SET R2 = A(SAVEWRK2) 01216000
MVI TREXNSI,00 CLEAR 1ST BYTE OF "TREXNSI" 01217000
* 01218000
TRASET LM R6,R7,FFS INITIALIZE R6 & R7 = X'FFFFFFFF' 01219000
MVC SAVEWRK4(8),ZEROES CLEAR SAVEWRK4 & SAVEWRK5 ... 01220000
* SAVEWRK4 = 00 MEANS NOT EXECUTED INSTRUCTION 01221000
* SAVEWRK5+2 = 00 MEANS NOT A BRANCH 01222000
CLI 0(R2),X'40' IS IT 'RR' - LESS THAN 40 ? 01223000
BL TRASMALL YES - GO SEE IF RR-TYPE BRANCH. 01224000
CLI 0(R2),X'C0' IS IT 'SS' - C0 UP ? 01225000
BNL TRALARGE YES - IT'S NOT BRANCH, EITHER. 01226000
LA R5,4(,R4) IF 40 TO BF, IT'S A 4-BYTE INSTRUCTION 01227000
CLI 0(R2),X'44' CHECK FOR EXECUTE (44) 01228000
BH TRAGT44 TRF IF > 44 01229000
BL TRANEXT IF < 44 WE KNOW IT'S NOT A BRANCH. 01230000
* IF = 44 (EXECUTE), GET THE EXECUTED INSTRUCTION: 01231000
SLR R8,R8 PICK UP THE "R1" FIELD OF THE EX 01232000
IC R8,1(,R2) INSTRUCTION, 01233000
SRL R8,4 SHIFT TO ISOLATE IT, & REMEMBER IT IN R8 01234000
CALL DMKPSARX GET VIRTUAL ADDRESS OF EXECUTED INST. 01235000
ST R1,SAVEWRK6 REMEMBER VIRT ADDR OF EXECUTED INSTR 01236000
STH R8,SAVEWRK2+6 REMEMBER R8 01237000
LR R5,R3 REMEMBER R3 01238000
LA R9,TRLNBUMP(,R9) BUMP R9 FOR PARALLEL MSG FIELDS 01239000
LA R8,SAVEWRK4 PUT THE EXECUTED INSTRUCTION AT SAVEWRK4 01240000
BAL R3,TRAGET GET THE EXECUTED INSTRUCTION ETC. 01241000
L R9,VMTREXT RESTORE R9 QUICK 01242000
LH R8,SAVEWRK2+6 RESTORE R8 01243000
LR R3,R5 RESTORE R3 01244000
LA R5,4(,R4) RESTORE R5 = R4+4 01245000
AR R8,R8 DOUBLE THE "R1" FIELD FROM THE EX INSTR 01246000
BZ TRA44B IF = 0, THE "R1" FIELD WAS NONEXISTENT 01247000
AR R8,R8 NOW WE HAVE IT TIMES 4, 01248000
L R1,VMGPRS(R8) NOW GET THE REAL "R1" REG. FROM VMBLOK, 01249000
IC R15,SAVEWRK4+1 PICK UP THE 2ND BYTE OF THE EXECUTED INST 01250000
OR R15,R1 OR THE TWO BYTES TOGETHER LIKE 'EX' DOES 01251000
STC R15,SAVEWRK4+1 AND STORE IN THE EXECUTED INSTRUCTION 01252000
CALL DMKCVTBH EX "R1" REGISTER BINARY TO HEX PLEASE 01253000
STH R1,TRLNINS7 AND STORE IN THE EXECUTE OUTPUT MSG 01254000
LH R0,SAVEWRK4 GET 1ST TWO BYTES OF EXECUTED-INSTRUCTION 01255000
LA R1,TRLNINSM POINT TO MNEMONIC FOR SAME, 01256000
CALL DMKNEMOP GET MNEMONIC FOR THE EXECUTED-INSTRUCTION 01257000
TRA44B LA R2,SAVEWRK4 NOW LET R2 POINT AT THE EXECUTED INSTR. 01258000
CL R5,SAVEWRK6 IS EXECUTED INSTRUCTION DIRECTLY IN LINE? 01259000
BNE TRA44D NOPE - NO PROBLEMS. 01260000
LA R5,2(,R5) POINT TO END OF POSSIBLE RR INSTR 01261000
CLI 0(R2),X'40' IS IT AN RR ? 01262000
BL TRA44C YES. 01263000
LA R5,2(,R5) POINT TO END OF POSSIBLE RX, RS, SI INSTR 01264000
CLI 0(R2),X'C0' IS IT ONE OF THESE ? 01265000
BL TRA44C YES. 01266000
LA R5,2(,R5) POINT TO END OF SS INSTR IF NONE OF ABOVE 01267000
TRA44C DS 0H R5 SET TO PUT SVC B1 AFTER EXECUTED INSTR 01268000
* 01269000
TRA44D CLI 0(R2),X'44' NOW TEST FOR EXECUTE OF AN EXECUTE INSTR 01270000
BL TRASMAL2 IF < 44 GO SEE IF AN RR-TYPE BRANCH 01271000
BCR 8,R3 <BE> IF = EX, IT WILL PROGRAM INTERRUPT. 01272000
* > 44, CONTINUE AS A NORMAL INSTR. > 44: 01273000
SPACE 01274000
TRAGT44 DS 0H INSTRUCTION IS KNOWN TO BE > 44 (EX): 01275000
CLI 0(R2),X'87' CHECK FOR BXLE = 87 01276000
BH CHKSTXSM IF > 87, CHECK FOR STNSM OR STOSM (AC/AD) 01277000
CLI 0(R2),X'86' CHECK FOR BXLE OR BXH = 86 01278000
BNL TRABXH IF EITHER BXH OR BXLE GO HANDLE. 01279000
CLI 0(R2),X'47' IF < 86, CHECK FOR BC = 47 01280000
BH TRAGT47 IF > 47 JUST ONE MORE CHECK, FELLAS. 01281000
CALL DMKPSARX IF 45 - 47, GET VIRTUAL ADDRESS 01282000
CLI 0(R2),X'46' OK, NOW WHICH ONE IS IT ? 01283000
B TRABTEST TEST FOR BAL (45), BCT (46), OR BC (47) 01284000
* 01285000
TRAGT47 DS 0H INSTRUCTION IS KNOWN TO BE > 47 & < 86: 01286000
CLI 0(R2),X'82' IS IT LPSW ? 01287000
BE TRALPSW YES - LPSW. 01288000
CLI 0(R2),X'80' IS IT SSM ? 01289000
BNE TRANEXT NO - NOT A BRANCH. 01290000
* SAVEWRK5+3 = 00 MEANS IT'S AN SSM ... 01291000
TRASSM1 DS 0H HANDLE SSM, STNSM, OR STOSM: 01292000
CALL DMKPSARS GET (SINGLE-INDEXED) ADDRESS OF S1 FIELD 01293000
BAL R14,TRANVIRT GET THE ACTUAL SSM-BYTE 01294000
BCR 7,R3 <BNZ> IF WE COULDN'T GET IT, FORGET IT. 01295000
CLI SAVEWRK5+3,00 NOW WAS THAT AN SSM ? 01296000
BE TRASSM2 YES. 01297000
CALL DMKPSASP NO (STNSM/STOSM) CHECK @V202232 01298000
* PROTECTION VIOL. 01299000
BCR 7,R3 <BNZ> PROTECTION VIOLATION IF CC NONZERO. 01300000
LR R1,R8 STNSM/STOSM BYTE INTO R1 01301000
IC R2,VMPSW OLD VMPSW BYTE INTO R2 01302000
CLI SAVEWRK5+3,X'AC' NOW WHICH ONE WAS IT (I'VE FORGOTTEN) 01303000
BE TRASTNSM OH YES - STNSM. 01304000
OR R2,R1 STOSM - 'OR' THEM TOGETHER 01305000
B TRASSM3 AND PREPARE TO CONVER TO HEX ETC. 01306000
TRASTNSM NR R2,R1 STNSM - 'AND' THEM TOGETHER 01307000
B TRASSM3 AND PREPARE TO CONVERT TO HEX ETC. 01308000
* 01309000
TRASSM2 IC R2,0(,R2) GET (& REMEMBER) ACTUAL SSM-BYTE 01310000
* 01311000
TRASSM3 LR R1,R2 PLACE "SSM-BYTE" IN R1 FOR CONVERT TO HEX 01312000
LA R8,TRLNINS7 WHERE TO PUT SSM-BYTE (UNLESS EXECUTED) 01313000
CLI SAVEWRK4,00 WAS THIS AN EXECUTED SSM (OR EQUIV.) 01314000
BE TRASSM4 NOPE - CONTINUE BELOW. 01315000
LA R8,TRLNBUMP(,R8) BUMP R8 FOR EXECUTED INSTRUCTIONS 01316000
TRASSM4 CALL DMKCVTBH "SSM BYTE" BINARY TO HEX 01317000
STH R1,0(,R8) STORE IN MESSAGE LINE 01318000
CLI SAVEWRK5+3,00 NOW WAS THAT AN SSM OR SOME OTHER ? 01319000
BNE TRASSM5 OTHER - MUST BE STNSM OR STOSM. 01320000
TM VMPSTAT,VMV370R IS IT AN EC-MODE MACHINE ? 01321000
BO CHKVCR0 YES. 01322000
TM VMVCR0,X'40' NO, IS BIT 1, CR0 = 1 ? 01323000
BZ TRANEXT NO - NORMAL SSM 01324000
BR R3 YES - EXIT (WILL PROGRAM-CHECK). 01325000
* 01326000
CHKVCR0 L R15,VMECEXT POINT TO EXTENSION BLOCK 01327000
USING ECBLOK,R15 01328000
TM EXTCR0,X'40' IS BIT 1, CR0 = 1 ? 01329000
BCR 1,R3 <BO> YES - EXIT (WILL PROGRAM-CHECK). 01330000
DROP R15 01331000
TRASSM5 TM VMESTAT,VMEXTCM IN EXTENDED MODE NOW ? 01332000
BZ TRANEXT NOPE - NO PROBLEM - SET FOR NEXT INSTR. 01333000
* NOTE: R2 HOLDS "NEW" SYSTEM-MASK ... 01334000
LA R0,255-(PERMODE+TRANMODE+IOMASK+EXTMASK) ILLEGAL BITS 01335000
NR R0,R2 ANY ILLEGAL BITS IN THE NEW SYSTEM-MASK ? 01336000
BCR 7,R3 <BNZ> YES (TUT TUT) - EXIT (WILL PROGRAM CHECK) 01337000
LA R0,TRANMODE SET TO EXAMINE 'TRANMODE' BIT IN SSM-BYTE 01338000
IC R15,VMPSW SIMILAR BYTE FROM OLD V.M. PSW 01339000
NR R2,R0 ISOLATE JUST THE BIT WE WANT 01340000
NR R15,R0 DITTO 01341000
CLR R2,R15 DO THEY MATCH ? 01342000
BE TRANEXT YES - NO TRANSLATE-MODE CHANGE. 01343000
LR R7,R5 NO - SET R7 FOR "UNCONDITIONAL BRANCH", 01344000
MVI SAVEWRK5+2,X'FF' BUT SIGNAL DON'T SET AN "SVC B2" 01345000
B ECBCRUN @VA05533 01346100
SPACE 01347000
CHKSTXSM CLI 0(R2),X'AD' 'STORE THEN OR SYSTEM MASK' (STOSM) ? 01348000
BH TRANEXT NOT THIS TIME. 01349000
CLI 0(R2),X'AC' OR 'STORE THEN AND SYSTEM MASK' (STNSM) ? 01350000
BL TRANEXT SOME OTHER TIME, PERHAPS. 01351000
MVC SAVEWRK5+3(1),0(R2) REMEMBER WHAT WE'VE GOT HERE 01352000
IC R8,1(,R2) REMEMBER THE STNSM/STOSM BYTE IN R8 01353000
B TRASSM1 AND JOIN COMMON 'SSM' CODE. 01354000
SPACE 01355000
TRALPSW DS 0H LPSW 01356000
CALL DMKPSARS GET (SINGLE-INDEXED) ADDRESS OF S1 FIELD 01357000
LA R15,7 MAKE SURE DBL-WORD ALIGNED 01358000
NR R15,R1 ... 01359000
BCR 7,R3 <BNZ> IF NOT, IT WILL PROGRAM INTERRUPT. 01360000
BAL R14,TRANVIRT GET ADDRESS OF USER'S ACTUAL PSW 01361000
BCR 7,R3 <BNZ> (BEWARE ADDRESSING ERROR) 01362000
LA R8,TRLNINS6-4 WHERE TO PUT ARROW AND LPSW DBL-WORD 01363000
CLI SAVEWRK4,X'82' WAS THIS AN EXECUTED LPSW ? 01364000
BNE TRALPSW1 NOPE - NOT THIS TIME. 01365000
LA R8,TRLNINS9-4 YES, SET R8 CORRECTLY AS NEEDED BELOW. 01366000
TRALPSW1 TM 1(R2),WAIT IS THE WAIT BIT ON ? 01367000
BO TRALPSW6 IF YES, DON'T SET R7. 01368000
TM 7(R2),X'01' IS THE ADDRESS AN ODD NUMBER ? 01369000
BO TRALPSW6 IF YES, IT WILL PROGRAM-CHECK. 01370000
TM 1(R2),EXTMODE USER GOING TO ECMODE? @VA02609 01371000
BZ TRALPSW7 NO @VA02609 01372000
TM VMPSTAT,VMV370R YES - IS HE ALLOWED? @VA02609 01373000
BZ TRALPSW6 NO - PGM CHK WILL FOLLOW @VA02609 01374000
TRALPSW7 EQU * @VA02609 01375000
L R1,4(,R2) GET ADDR HE WILL GO TO @VA02609 01376000
LA R1,0(,R1) MINUS THE HIGH ORDER BYTE @VA02609 01377000
TM VMPSTAT,VMV370R POSSIBLY ECMODE ?? @VA02609 01378000
BZ TRALPSW8 NO @VA02609 01379000
* IF USER ENTERING TRANLATE MODE, 'TO' ADDR MAY BE > VMSIZE 01380000
TM 0(R2),TRANMODE ENTERING TRANSLATE MODE? @VA02609 01381000
BO TRALPSW2 YES - CHKS DONE LATER @VA02609 01382000
TRALPSW8 EQU * @VA02609 01383000
LRA R0,0(,R1) IS IT A VALID ADDRESS ? @V304635 01384000
BC 8+2,TRALPSW2 CONTINUE IF IT'S NOT A SEG @V408246 01385100
* EXCEPTION 01385300
CALL DMKPTRLK TEMP. FIX PAGE @V408246 01385310
LR R0,R2 SAVE R2 @V408246 01385320
CALL DMKPTRAN,PARM=DEFER OTHERWISE LET PTRAN HANDLE @V408246 01385500
LR R2,R0 RESTORE R2 @V408246 01385510
BALR R0,R0 SAVE C.C. @V408246 01385520
CALL DMKPTRUL UNFIX PAGE @V408246 01385530
SPM R0 RESTORE C.C. @V408246 01385540
BC 2,TRALPSW6 ADDRESSING ERROR @V408246 01385700
TRALPSW2 MVC 0(3,R8),PFXARROW OK - PUT IN AN ARROW: ==> NEW ADDR 01386000
LR R7,R1 SET LPSW-TO ADDRESS IN R7 01387000
MVI SAVEWRK5+2,X'FF' BUT ASSUME CAN'T SET "SVC B2" 01388000
CLI TREXNSI,00 TREXNSI ALREADY NONZERO (X'44' OR '82') ? 01389000
BNE TRALPSW3 YES (NONZERO) - LEAVE WELL ENOUGH ALONE 01390000
MVI TREXNSI,X'82' NO - INDICATE AN LPSW HANDLED BY DMKTRC 01391000
TRALPSW3 L R0,TRANMASK MASK OF BITS WHICH MUST MATCH OLD PSW 01392000
LR R14,R0 FOR IT TO BE SAFE TO SET "SVC B2" NOW 01393000
N R0,0(,R2) GET CRUCIAL BITS FROM NEW PSW 01394000
N R14,VMPSW AND CRUCIAL BITS FROM OLD PSW 01395000
CLR R0,R14 POSSIBLY EXACTLY THE SAME ? 01396000
BE TRALPSW5 IF YES THAT MAKES IT EASY. 01397000
TM VMPSW+1,EXTMODE IN BC OR EXTENDED MODE RIGHT NOW ? 01398000
BZ TRALPSW4 BC - SEE IF GOING INTO EXTENDED & TRANS 01399000
TM VMPSW,TRANMODE EXTENDED - IN TRANSLATE MODE NOW ? 01400000
BO TRALPSW6 IF YES WE KNOW IT WILL BE SWITCHING. 01401000
TRALPSW4 CL R0,TRANMASK GOING INTO EXTENDED & TRANSLATE ? 01402000
BE TRALPSW6 IF YES WE KNOW IT WILL BE SWITCHING. 01403000
TRALPSW5 MVI SAVEWRK5+2,X'0F' OK TO SET "SVC B2" ADDRESS AFTER ALL 01404000
TRALPSW6 LM R1,R2,0(R2) ACTUAL LPSW INTO R1-R2 01405000
CALL DMKCVTBH 1ST HALF OF LPSW DBL-WORD INTO HEX, 01406000
STM R0,R1,4(R8) STORE IN OUTPUT LINE 01407000
LR R1,R2 SECOND HALF 01408000
CALL DMKCVTBH BINARY TO HEX 01409000
STM R0,R1,13(R8) AND STORE IN OUTPUT LINE 01410000
CLI SAVEWRK5+2,X'0F' WILL SVC B2 ADDR BE SET? @VA04044 01410100
BER R3 YES - NO NEED TO WARN DSP @VA04044 01410200
ECBCRUN TM TREXCTL2,TREXINST TRACING ALL INSTRUCTIONS? @VA05533 01410300
BNO FORCEPRV NO, WARN DISPATCH @VA05533 01410400
TM TREXRUNF,TREXINST IS IT INSTRUCTIONS RUN? @VA05533 01410500
BOR R3 YES, THEN WE'RE OK @VA05533 01410600
FORCEPRV OI TREXFLAG,TREXNDSP HAVE DISPATCH CALL DMKTRCIT @VA05533 01410700
BR R3 AND RETURN TO CALLER. 01411000
* 01412000
TRABXH DS 0H BXH (86) OR BXLE (87) 01413000
CALL DMKPSARS GET (SINGLE-INDEXED) VIRTUAL ADDRESS 01414000
* 01415000
* INSTRUCTION IS A CONDITIONAL BRANCH ... 01416000
TRACOND LR R6,R5 SET R6 ADDRESS FOR NEXT SEQUENTIAL INSTR. 01417000
LR R7,R1 SET R7 ADDRESS FOR TRANSFER-TO ADDRESS 01418000
MVI SAVEWRK5+2,X'F0' SIGNAL: CONDITIONAL BRANCH 01419000
BR R3 AND RETURN TO CALLER. 01420000
SPACE 01421000
* INSTRUCTION (NOT EXECUTED) IS AN "RR" INSTRUCTION: 01422000
TRASMALL LA R5,2(,R4) FOR "RR" ADD 2 FOR NEXT INSTRUCTION 01423000
* 01424000
TRASMAL2 CLI 0(R2),X'07' CHECK FOR BCR = 07 01425000
BH TRASVC IF > 7, CHECK IF IT'S AN SVC 01426000
CLI 0(R2),X'05' IF < 7, CHECK FOR BALR = 05. 01427000
BL TRANEXT IF < 5, IT'S NOT A BRANCH. 01428000
CALL DMKPSARR 05-07, OBTAIN & CHECK "R2" REGISTER 01429000
BZ TRANEXT IF NONEXISTENT IT'S NOT A BRANCH. 01430000
CLI 0(R2),X'06' WAS IT BALR (05), BCTR (06), OR BCR (07) 01431000
* 01432000
TRABTEST BL TRABRNCH BALR | BAL - AN UNCONDITIONAL BRANCH 01433000
BE TRACOND BCTR | BCT - A CONDITIONAL BRANCH 01434000
* 01435000
TRABCTST TM 1(R2),X'F0' TEST "M" FIELD OF BCR OR BC INSTRUCTION 01436000
BM TRACOND IF 1 TO 14, IT'S A CONDITIONAL BRANCH 01437000
BZ TRANEXT IF = 0 IT'S A NO-OP (WON'T BRANCH) 01438000
* INSTRUCTION IS AN UNCONDITIONAL BRANCH ... 01439000
TRABRNCH LR R7,R1 SET R7 ADDRESS FOR TRANSFER-TO ADDRESS 01440000
LR R6,R5 GET NEXT SEQUENTIAL INSTR @VA08753 01440100
MVI SAVEWRK5+2,X'0F' SIGNAL: VANILLA-TYPE UNCOND. BRANCH 01441000
BR R3 AND RETURN TO CALLER. 01442000
SPACE 2 01443000
TRALARGE LA R5,6(,R4) FOR "SS" INSTRUCTIONS ADD 6 TO GET ADDR 01444000
* 01445000
TRANEXT LR R6,R5 SET R6 ADDRESS FOR NEXT SEQUENTIAL INSTR. 01446000
BR R3 AND RETURN TO CALLER. 01447000
* 01448000
TRASVC CLI 0(R2),X'0A' IS IT AN SVC ? 01449000
BNE TRANEXT NO - SET R6 FOR NEXT SEQUENT. INSTRUCTION 01450000
OI TREXFLAG,TREXNDSP TELL DSP HANDS OFF @VA04044 01450500
BR R3 YES (COULD BE ADSTOP) - LEAVE ALONE. 01451000
EJECT 01452000
* SETNEWB2 = SUBROUTINE TO SET "SVC B2" AT BRANCH-TO-ADDRESS 01453000
* 01454000
* AT ENTRY: 01455000
* R7 = VIRTUAL ADDRESS TO WHICH CONTROL WILL/MAY BRANCH 01456000
* R3 = RETURN REGISTER 01457000
* R4 = ADDRESS OF "THIS INSTRUCTION" 01458000
SETNEWB2 CLR R7,R4 IS VIRT ADDRESS SAME AS THIS INSTRUCTION? 01459000
BCR 8,R3 <BE> IF YES (E.G. "B *") LEAVE IT ALONE. 01460000
LTR R1,R7 IF NOT, SET R1 (AND CHECK SIGN) 01461000
BCR 4,R3 <BM> IF MINUS (X'FFFFFFFF') EXIT FORTHWITH. 01462000
CLI SAVEWRK5+2,X'FF' FLAG SET = CANNOT SET SVC B2 NOW ? 01463000
BCR 8,R3 <BE> YES - DISPATCH WILL HAVE TO SET LATER. 01464000
SETNEWB4 BAL R14,TRANVIRT GET REAL ADDRESS OF BRANCH-TO PLACE 01465000
BCR 7,R3 <BNZ> (BEWARE ADDRESSING ERROR) 01466000
ST R7,TREXIN2 STORE VIRTUAL ADDRESS OF REPLACED INSTR 01467000
MVC TREXSVC2(2),0(R2) SAVE THE INSTRUCTION THERE, AND 01468000
HSVCB2 LA R15,SVCB2 REPLACE IT BY "SVC B2" 01469000
B SETNEWB5 AND REMEMBER VIRTUAL ADDRESS LEVEL. 01470000
SPACE 2 01471000
* SETNEWB1 = SUBROUTINE TO SET "SVC B1" AT NEXT SEQUENTIAL INSTR 01472000
* R6 = ADDRESS AT WHICH TO SET THE "SVC B1" 01473000
* R3 = RETURN REGISTER 01474000
SETNEWB1 CL R6,TREXIN2 SAME AS BRANCH-TO-ADDRESS ALREADY SET ? 01475000
BCR 8,R3 <BE> IF YES (E.G. "B *+4") LEAVE IT ALONE 01476000
SETNEWB3 LTR R1,R6 IF NOT, SET R1 (AND CHECK SIGN) 01477000
BCR 4,R3 <BM> IF MINUS (X'FFFFFFFF') EXIT FORTHWITH. 01478000
BAL R14,TRANVIRT TRY TO GET REAL ADDR OF NEXT INSTRUCTION 01479000
BCR 7,R3 <BNZ> (BEWARE INVALID ADDRESS) 01480000
ST R6,TREXIN1 STORE VIRTUAL ADDRESS OF REPLACED INSTR 01481000
MVC TREXSVC1(2),0(R2) SAVE THE INSTRUCTION THERE, AND 01482000
LA R15,SVCB1 REPLACE IT BY "SVC B1" 01483000
SETNEWB5 ST R15,SAVEWRK3 SAVE SVC (B1/B2) @V304735 01484000
RECHECK SLR R0,R0 INDICATE ABLE TO STORE ANYWHERE @V304735 01485000
CALL DMKPSASC GOING TO STORE INTO SHARED PAGE? @V304735 01486000
BZ SVCBYTE NO - PUT SVC IN STORAGE @V304735 01487000
LR R2,R1 GET VITURAL ADDRESS @VA12533 01487200
CALL DMKATSCF BUILD NON-SHARED PAGE TABLES @V60BC11 01488100
BAL R14,TRANVIRT GET THE REAL ADDRESS AGAIN @V304735 01490000
B RECHECK CHECK AGAIN FOR SHARED PAGE @V304735 01491000
SVCBYTE DS 0H @V408246 01492100
MVC 0(2,R2),SAVEWRK3+2 RESTORE SVC INDICATOR @V408246 01493100
NI TREXFLAG,255-TREXVAT RESET TREXVAT FLAGBIT TO 0 01494000
TM VMESTAT,VMEXTCM IN EC-MODE NOW ? 01495000
BCR 8,R3 <BZ> NO - JUST EXIT. 01496000
TM VMPSW+1,EXTMODE PSW STILL SAY ECMODE? @VA04044 01496300
BCR 8,R3 <BZ> NO - JUST RETURN @VA04044 01496600
TM VMPSW,TRANMODE IN EC-MODE, IN TRANSLATE MODE ALSO ? 01497000
BCR 8,R3 <BZ> NO - JUST EXIT. 01498000
OI TREXFLAG,TREXVAT YES - REMEMBER TO CALL "TRANVAT" LATER, 01499000
BR R3 AND EXIT. 01500000
EJECT 01501000
* SUBROUTINE TO OUTPUT A TRACE LINE ON THE PRINTER AND/OR TERMINAL 01502000
* R3 = RETURN REGISTER 01503000
* TREXBUFF IS FILLED IN TO APPROPRIATE DATA 01504000
* SAVEWRK1 ANDED WITH TREXPRNT SIGNALS OUTPUT ON PRINTER 01505000
* SAVEWRK1 ANDED WITH TREXTERM SIGNALS OUTPUT ON TERMINAL 01506000
* SAVEWRK8+2=HIGHEST ERROR-CODE "SO FAR" FROM DMKQCNWT/DMKDSPCH 01507000
* I.E. 04 = SINGLE ATTENTION HIT BY USER 01508000
* 08 = MORE THAN ONE ATTENTION HIT BY USER 01509000
* 12 = USER'S TERMINAL HAS BEEN TURNED OFF 01510000
* SAVEWRK9 = USED TO SAVE/RESTORE RETURN-REGISTER 01511000
* R2 IS USED FOR SCRATCH (NOT PRESERVED) 01512000
SPACE 01513000
TROUSUB DS 0H OUTPUT LINE ON PRINTER AND/OR TERMINAL: 01514000
LA R0,80 LENGTH = 80 BYTES 01515000
LA R1,TREXBUFF ADDRESS = TREXBUFF 01516000
SLR R2,R2 R2=0 FOR USE BY DMKVSPRT & DMKQCNWT 01517000
LH R15,TREXPRNT GET PRINTER FLAG-BITS 01518000
N R15,SAVEWRK1 OUTPUT ON PRINTER FOR THIS ONE ? 01519000
BZ TROUSUB4 NOPE - MUST BE JUST THE TERMINAL. 01520000
LH R0,TREXLCNT GET CURRENT LINE COUNT @V408246 01521100
LTR R0,R0 NEED PAGE EJECT? @V408246 01521200
BP TROUSUB2 NOPE - RESTORE R0 = 80 & PRINT. 01523000
CALL DMKVSPRT YES - GIVE A PAGE EJECT (R0 = 0) 01524000
TROUSUB2 LA R0,80 NOW RESTORE R0 = 80, 01525000
CALL DMKVSPRT AND PRINT THE OUTPUT LINE 01526000
CL R2,F8 *** SEVERE ERROR FROM DMKVSPRT ? *** 01527000
BE TRAEND1 *** YES - FORCE A TRACE END. *** 01528000
LH R14,TREXLCNT GET THE CURRENT LINE COUNT, 01529000
LA R14,1(,R14) ADD ONE, 01530000
CL R14,F60 CHECK AGAINST 60 LINES PER PAGE 01531000
BL TROUSUB3 IF < 60 WE'RE OK 01532000
SLR R14,R14 RESET TO 0 WHEN WE HIT 60 01533000
TROUSUB3 STH R14,TREXLCNT STORE UPDATED LINE COUNT 01534000
LH R15,TREXTERM GET TERMINAL FLAG-BITS 01535000
N R15,SAVEWRK1 OUTPUT ALSO ON TERMINAL ? 01536000
BCR 8,R3 <BZ> NOPE - EXIT FORTHWITH. 01537000
TROUSUB4 DS 0H OUTPUT WILL <ALSO> BE ON THE TERMINAL: 01538000
CLI SAVEWRK8+3,04 HAS MORE THAN ONE ATTENTION BEEN HIT ? 01539000
BCR 2,R3 <BH> YES - EXIT (DON'T TYPE THE LINE) 01540000
* (DMKQCNWT WILL REMOVE TRAILING BLANKS FROM COUNT) 01541000
TROUSUB6 DS 0H NOW READY TO CALL DMKQCNWT: 01542000
SLR R2,R2 R2=0 FOR PARM=0 FOR DMKQCNWT, AND ... 01543000
CALL DMKQCNWT WRITE MESSAGE TO TERMINAL 01544000
* 01545000
TROUSUB7 TM VMTRCTL,255-VMTRPER TRACING IN EFFECT NOW? PER001 01546000
BE TRAEXIT NO, GET OUT 01547000
CH R2,SAVEWRK8+2 CHECK ERROR-CODE AGAINST "HIGHEST SO FAR" 01548000
BCR 13,R3 <BNH> EXIT IF NO NEW ERROR RETURN CODE 01549000
STH R2,SAVEWRK8+2 STORE NEW VALUE OF RETURN CODE 01550000
BR R3 AND EXIT TO CALLER. 01551000
SPACE 3 01552000
DMKTRCND RELOC ENTER HERE TO FORCIBLY TERMINATE TRACING 01553000
MVC SAVEWRK7(1),VMRSTAT SAVE VMRSTAT FLAG STATUS AT ENTRY 01554000
OI VMRSTAT,VMEXWAIT+VMCFWAIT ENSURE THAT USER IS NOT RUN 01555000
L R9,VMTREXT POINT TO TREXT CONTROL BLOCK 01556000
* CONTINUE ... 01557000
SPACE 01558000
* NECESSARY TO TERMINATE TRACING: 01559000
TRAEND1 BAL R3,PUTBACK PUT BACK ANY INSTRUCTIONS WE ALTERED 01560000
ST R9,TRALOCK+4 SETUP LOCK "NAME" @V200820 01561000
LA R1,TRALOCK POINT TO THE NAME FIELD @V200820 01562000
TRAEND2 EQU * DEQUEUE ALL PENDING REQUESTS @V200820 01563000
CALL DMKLOCKD DEQUEUE THE TRACING LOCK @V200820 01564000
BZ TRAEND2 CONTINUE UNTIL NOT LOCKED @V200820 01565000
LA R0,TREXSIZE SIZE OF TREX BLOCK 01566000
LTR R1,R9 AND IT'S ADDRESS, IF THERE. @VA12401 01567100
BZ TRAEND2A NO...BYPASS @VA12401 01567200
SLR R15,R15 BEFORE CALLING DMKFRET, 01568000
ST R15,VMTREXT CLEAR "VMTREXT" AND 01569000
NI VMTRCTL,VMTRPER CLEAR TRACING FLAGS. PER001 01570000
CALL DMKFRET GIVE IT BACK TO FREE STORAGE 01571000
TRAEND2A EQU * @VA12401 01571100
TM VMRSTAT,VMLOGOFF IN LOGOFF PROCESS ? @V200820 01572000
BO TRAEXIT YES - SKIP THE MESSAGE @V200820 01573000
MSG 'TRACE ENDED' 'TRACE ENDED' MESSAGE TO THE USER 01574000
CALL DMKQCNWT,PARM=NORET ... 01575000
B TRAEXIT AND GO EXIT. 01576000
EJECT 01577000
* SUBROUTINES TO PERFORM A "TRANS - BRING/DEFER" OR 01578000
* A CALL TO DMKVATRN (IF NECESSARY) TO GET A REAL EQUIVALENT (IF 01579000
* FEASIBLE) OF A VIRTUAL ADDRESS: 01580000
* 01581000
* AT ENTRY: 01582000
* R1 = VIRTUAL ADDRESS TO BE TRANSLATED 01583000
* R14 = RETURN REGISTER 01584000
* 01585000
* AT EXIT: 01586000
* R1 = VIRTUAL ADDRESS 01587000
* R2 = REAL ADDRESS 01588000
* CONDITION-CODE SET FROM LRA, DMKPTRLK, OR DMKPTRAN 01589000
* (CC = 0 IF VIRTUAL ADDRESS WAS LEGITIMATE, AND PAGE IS 01590000
* IN CORE, OR HAS BEEN BROUGHT INTO CORE WITHOUT ERROR) 01591000
* 01592000
* ENTER AT "TRANVIRT" TO PERFORM VIRTUAL/VIRTUAL "TRANS", 01593000
* OR AT "TRANBRNG" FOR SIMPLE ("VANILLA") TRANSLATIONS 01594000
* (E.G. USER'S PAGE 0 STUFF, ETC.) 01595000
SPACE 01596000
TRANVIRT TM VMESTAT,VMEXTCM IN EC-MODE NOW ? 01597000
BZ TRANBRNG NO - IT'S "VANILLA" - THAT'S EASY. 01598000
TM VMPSW+1,EXTMODE STAYING IN EC-MODE? @VA04044 01598300
BZ TRANBRNG NOPE - USE OUR CREG 1 @VA04044 01598600
TM VMPSW,TRANMODE IN EC-MODE, IN TRANSLATE MODE ALSO ? 01599000
BO TRANVAT YES - THAT'S A WORTHY CHALLENGE. 01600000
* 01601000
TRANBRNG LCTL C1,C1,VMSEG VANILLA - GET SEGMENT TABLE ORIGIN 01602000
LRA R2,0(,R1) ATTEMPT TO GET REAL ADDRESS 01603000
BCR 8,R14 EXIT FORTHWITH IF THE PAGE WAS IN 01604000
LA R2,(BRING+DEFER) IF NOT, SET "BRING/DEFER" OPTIONS 01605000
L R15,APTRAN SET R15 TO CALL "DMKPTRAN" 01606000
TRANCALL ST R14,SAVEWRK9 SAVE R14 = RETURN-REGISTER, 01607000
CALL 15 ATTEMPT TO BRING IN THE PAGE 01608000
L R14,SAVEWRK9 RESTORE R14 RETURN REGISTER, 01609000
BR R14 RETURN TO CALLER WITH CC FROM DMKPTRAN. 01610000
EJECT 01611000
* ENTER AT "TRANPTBK" TO INVOKE "TRANBRNG" OR "TRANVAT" 01612000
* DEPENDING ON WHETHER "TRANBRNG" OR "TRANVAT" WAS 01613000
* INVOKED TO REPLACE THE USER INSTRUCTION 01614000
* (THIS BEING REMEMBERED IN "TREXVAT" FLAGBIT IN "TREXFLAG") 01615000
SPACE 01616000
TRANPTBK TM TREXFLAG,TREXVAT DID WE SET IT VIA "TRANVAT" ? 01617000
BZ TRANBRNG NO - INVOKE "TRANBRNG". 01618000
* YES - CONTINUE ... 01619000
SPACE 01620000
* IN EC-MODE & TRANSLATE MODE ALSO: 01621000
TRANVAT L R15,VMECEXT GET THE USER'S CONTROL REGISTERS 01622000
USING ECBLOK,R15 01623000
TM VMESTAT,VMINVPAG TABLES VALID? @VM08636 01624000
BNZ INTERLD PTR AT WORK... @VM01060 01625000
PTBKLRA EQU * @VM08636 01626000
LCTL C0,C1,EXTSHCR0 POINT TO THE SHADOW TABLES 01627000
DROP R15 01628000
LRA R2,0(,R1) MAKE THE ATTEMPT FIRST 01629000
LCTL C0,C0,CPCREG0 RESTORE STAND C-REGS BEFORE 01630000
LCTL C1,C1,VMSEG WE GO ANYPLACE 01631000
BCR 8,R14 IF "LRA" SUCCEEDED, RETURN TO CALLER. 01632000
INTERLD EQU * @VM08636 01633000
L R15,=A(INTERVAT) SET R15 TO CALL INTERFACE TO DMKVATRN 01634000
B TRANCALL GO SAVE R14 AND DO THE CALL. 01635000
SPACE 2 01636000
* INTERFACE ROUTINE TO CALL DMKVATRN: 01637000
USING INTERVAT,R12 FOR THIS INTERFACE ROUTINE ONLY. 01638000
INTERVAT ENTER ENTER HERE (SEE "TRANCALL" ABOVE) 01639000
LR R3,R1 SET R3 AS NEEDED FOR DMKVAT 01640000
CALL DMKVATRN ATTEMPT TO GET THE NEEDED ADDRESS 01641000
LTR R0,R0 SET CC FROM RETURN INDICATOR FROM DMKVAT 01642000
ST R2,SAVER2 RETURN R2 TO CALLER (IN CASE GOOD) 01643000
EXIT RETURN TO DMKTRC (WITH COND CODE SET). 01644000
SPACE 01645000
USING DMKTRC,R12 RESTORE STANDARD ADDRESSABILITY. 01646000
EJECT 01647000
* CONSTANTS: 01648000
HX80 DC X'0080' ADD TO INTERRUPT CODE IF VIRTUAL "PER" SET 01649000
DS 0F FULL-WORD ALIGNED CONSTANTS: 01650000
TRANMASK DC AL1(TRANMODE),AL1(EXTMODE),AL2(0) TO TEST CRUCIAL BITS 01651000
TRALOCK DC C'TREX',A(*-*) LOCK "NAME" FOR TRACING @V200820 01654000
SPACE 01655000
* MISCELLANEOUS FLAGBITS DEFINED IN FIRST BYTE OF SAVEWRK8: 01656000
SETCC EQU X'80' MUST SET CONDITION-CODE NONZERO AT EXIT 01657000
NOSTOP EQU X'40' NO MSG TO BE GIVEN, AND DO NOT STOP. 01658000
NOTRAMSG EQU X'20' NO TRACE MSG WANTED (ALREADY GIVEN) 01659000
SPACE 01660000
* NOTE: BYTE AT SAVEWRK8+1 IS AVAILABLE FOR FLAG IF NEEDED 01661000
* HALFWORD AT SAVEWRK8+2 IS USED FOR ERROR RETURNS FROM DMKQCNWT 01662000
SPACE 2 01663000
SVCB1 EQU X'0AB1' = SVC X'B1' TO TRACE NEXT SEQUENTIAL INSTRUCTION 01664000
SVCB2 EQU X'0AB2' = SVC X'B2' TO TRACE BRANCHES 01665000
SPACE 01666000
LTORG 01667000
EJECT 01668000
* CONSTANTS (CONTINUED): 01669000
* 01670000
CLSVC DC C'SVC' 01672000
CLIO DC C'I/O' 01673000
CLPROG DC C'PROG' 01674000
CLEXT DC C'EXT' 01675000
CLRST DC CL10'RESTART' @VA09019 01675100
CLCCW DC C'CCW' 01676000
CLCSW DC C'CSW' 01678000
* 01679000
* PREFIXES FOR THE VARIOUS RESPONSES: 01680000
* (THESE MAY READILY BE REVISED PER INSTALLATION REQUIREMENTS) 01681000
SPACE 01682000
PFXINTRP DC CL3'***' SVC I/O PROGRAM EXTERNAL INTERRUPTS 01683000
PFXPRV DC CL3':::' PRIVILEGED INSTRUCTION 01684000
PFXBRNCH DC CL3'==>' TO SHOW WE ARE AT A NEW LOCATION 01691000
PFXARROW EQU PFXBRNCH TO SHOW WE ARE GOING TO A NEW LOCATION 01692000
*PFXINST DC CL3' ' INSTRUCTION TRACING 01693000
PFXCSW EQU CLCSW CSW 01694000
EJECT 01695000
COPY VMBLOK 01696000
VMTRALL EQU VMTRINT+VMTRSIO+VMTRBRIN FOR TRACE 'ALL' 01697000
COPY TREXT 01698000
ORG TREXBUFF OUTPUT LINE FOR TCH/TIO/HIO/SIO: 01699000
SPACE 01700000
TRLNSIO DC CL3'I/O' PREFIX FOR I/O INSTR (SET FROM PFXIO) 01701000
DC C' ' 01702000
TRLNSIO1 DS XL6'00' VIRT ADDR OF I/O INSTR (= TRLNINT1) 01703000
DC C' ' 01704000
TRLNSIO5 DS CL5' ' MNEMONIC OF IO INSTRUCTION 01705000
DC C' ' 01706000
TRLNSIO4 DS XL8'00' SIO, TIO, HIO, OR TCH INSTRUCTION (HEX) 01707000
DC CL2' ' 01708000
TRLNSIO2 DS CL4'DEV' MNEMONIC "NAME" OF VIRTUAL DEVICE 01709000
DC C' ' 01710000
TRLNSIO3 DS XL4'00' VADD (HEX) 01711000
DC CL2' ' 01712000
TRLNSIOB DC CL2'CC' CC 01713000
DC C' ' 01714000
TRLNSIOC DS AL1(0) CC NUMBER 01715000
DC CL2' ' 01716000
TRLNSIOD DS CL4'DEV ' REAL TYPE 01717000
DC C' ' 01718000
TRLNSIOE DS XL4'00' RADD (HEX) 01719000
DC CL2' ' 01720000
TRLNSIOF DC CL3'CSW' CSW 01721000
DC C' ' 01722000
TRLNSIOG DS XL4'00' CSW+4/CSW+5 BYTES 01723000
DC CL2' ' 01724000
TRLNSIO9 DC CL3'CAW' CAW (FOR SIO ONLY, CC = 0 OR 1) 01725000
DC C' ' (FOR SIO ONLY, CC = 0 OR 1) 01726000
DS XL8'00' VIRTUAL CAW (FOR SIO ONLY, CC = 0 OR 1) 01727000
EJECT 01728000
ORG TREXBUFF OUTPUT LINE FOR CCW: 01729000
SPACE 01730000
TRLNCCW DC CL3'CCW' PREFIX 01731000
DC C' ' 01732000
TRLNCCW1 DS XL6'00' VIRTUAL ADDRESS OF CCW 01733000
DC C' ' 01734000
TRLNCCW2 DS XL8'00' VIRTUAL CCW 1ST HALF 01735000
DC C' ' 01736000
TRLNCCW3 DS XL8'00' VIRTUAL CCW 2ND HALF 01737000
DC CL2' ' 01738000
TRLNCCW4 DS XL6'00' REAL ADDRESS OF CCW 01739000
DC C' ' 01740000
TRLNCCW5 DS XL8'00' REAL CCW 1ST HALF 01741000
DC C' ' 01742000
TRLNCCW6 DS XL8'00' REAL CCW 2ND HALF 01743000
SPACE 01744000
ORG TREXBUFF OUTPUT LINE FOR "IDAL" LINE OF CCW: 01745000
TRLNIDAL DC CL3' " ' PREFIX (IF ANY) 01746000
DC CL2' ' 01747000
TRLNIDA1 DC CL4'IDAL' VIRTUAL IDAL 01748000
DC CL2' ' 01749000
TRLNIDA2 DS XL8'00' FIRST VIRTUAL IDAW 01750000
DC C' ' 01751000
TRLNIDA3 DS XL8'00' SECOND VIRTUAL IDAW 01752000
DC CL3' ' 01753000
TRLNIDA4 DC CL4'IDAL' REAL IDAL 01754000
DC CL2' ' 01755000
TRLNIDA5 DS XL8'00' FIRST REAL IDAW 01756000
DC C' ' 01757000
TRLNIDA6 DS XL8'00' SECOND REAL IDAW 01758000
SPACE 01759000
ORG TREXBUFF OUTPUT LINE FOR "SEEK" LINE OF CCW: 01760000
TRLNSEEK DC CL3' " ' PREFIX (IF ANY) 01761000
DC CL2' ' 01762000
TRLNSK1 DC CL4'SEEK' VIRTUAL SEEK 01763000
DC CL2' ' 01764000
TRLNSK2 DS XL8'00' VIRTUAL SEEK ARG (1ST 4 BYTES) 01765000
DC C' ' 01766000
TRLNSK3 DS XL6'00' VIRTUAL SEEK ARG ETC. (NEXT 3 BYTES) 01767000
DC CL5' ' 01768000
TRLNSK4 DC CL4'SEEK' REAL SEEK 01769000
DC CL2' ' 01770000
TRLNSK5 DS XL8'00' REAL SEEK ARG (1ST 4 BYTES) 01771000
DC C' ' 01772000
TRLNSK6 DS XL4'00' REAL SEEK ARG (LAST 2 BYTES) 01773000
EJECT 01774000
ORG TREXBUFF OUTPUT LINE FOR INTERRUPT TRACING: 01775000
SPACE 01776000
TRLNINT DC CL3' ' PREFIX (IF ANY) 01777000
DC C' ' 01778000
TRLNINT1 DS XL6'00' VIRTUAL ADDRESS OF INSTRUCTION 01779000
DC C' ' 01780000
TRLNINT2 DS CL4' ' TYPE (SVC, PROG, EXT, OR I/O) 01781000
DC CL2' ' 01782000
TRLNINT3 DS XL4'00' INTERRUPT CODE OR VIRTUAL DEVICE ADDRESS 01783000
DC C' ' 01784000
TRLNINT4 DS C'==>' PFXARROW GOES IN HERE 01785000
DC C' ' 01786000
TRLNINT5 DS XL6'00' VIRTUAL TRANSFER-TO ADDRESS (FROM NEW PSW) 01787000
DC CL2' ' 01788000
TRLNINT6 DC CL3'CSW' CSW (FOR I/O INTERRUPTS ONLY) 01789000
DC C' ' 01790000
TRLNINT7 DS XL4'00' CSW+4/CSW+5 BYTES ONLY 01791000
SPACE 1 01792000
ORG TRLNINT2 RE-DEFINITION FOR INSTRUCTION TRACING 01793000
TRLNINS2 DS CL5' ' MNEMONIC OF INSTRUCTION 01794000
DC C' ' 01795000
TRLNINS3 DS XL4'00' FIRST TWO BYTES OF INSTRUCTION 01796000
TRLNINS4 DS XL4'00' NEXT TWO BYTES OF INSTRUCTION (IF ANY) 01797000
TRLNINS5 DS XL4'00' LAST TWO BYTES OF INSTRUCTION (IF ANY) 01798000
DC C' ' 01799000
TRLNINS6 DS XL6'00' VIRTUAL XFER-TO-ADDRESS OR PSW (IF ANY) 01800000
SPACE 2 01801000
ORG TRLNINS5+1 RE-DEFINITION FOR EXECUTED INSTRUCTIONS 01802000
* 01803000
* NOTE: KEEP TRLNINS8 UP TO TRLNINS9 AT SAME RELATIVE DISPLACEMENTS 01804000
* AS TRLNINT1 AND TRLNINS2 TO TRLNINS6 01805000
* (BECAUSE FILLED IN BY INDEXED CODE). 01806000
* 01807000
TRLNINS7 DS XL2'00' LOW-ORDER BYTE OF EX "R1" REGISTER (IF ANY) 01808000
* (OR SSM-BYTE FOR SSM, STNSM, OR STOSM) 01809000
DC CL2' ' 01810000
TRLNINS8 DS XL6'00' VIRTUAL ADDRESS OF EXECUTED INSTRUCTION 01811000
DC C' ' 01812000
TRLNINSM DS CL5' ' MNEMONIC OF EXECUTED INSTRUCTION 01813000
DC C' ' 01814000
DS XL12'00' TWO TO SIX BYTES OF EXECUTED INSTRUCTION 01815000
DC C' ' 01816000
TRLNINS9 DS XL6'00' TRANSFER-TO ADDRESS FOR EXECUTED BRANCH 01817000
* 01818000
DS XL11'00' WORST CASE (SPACE-WISE) = EXECUTED LPSW 01819000
WORSCASE EQU *-TRLNINT LENGTH OF OUTPUT LINE FOR WORST CASE. 01820000
SPACE 01821000
TRLNBUMP EQU TRLNINS8-TRLNINT1 DISP. OF TRLNINS8 MSG FROM TRLNINT1 01822000
EJECT 01823000
ORG TREXBUFF OUTPUT LINE FOR CSW: 01824000
SPACE 01825000
TRLNCSW DC CL3'CSW' PREFIX 01826000
DC C' ' 01827000
TRLNCSWV DC C'V' 'V' 01828000
DC C' ' 01829000
TRLNCSW1 DS XL4'00' VADD 01830000
DC C' ' 01831000
TRLNCSW2 DS XL8'00' VIRTUAL CSW (1ST HALF) 01832000
DC C' ' 01833000
TRLNCSW3 DS XL8'00' VIRTUAL CSW (2ND HALF) 01834000
DC CL2' ' 01835000
TRLNCSWR DC C'R' 'R' 01836000
DC C' ' 01837000
TRLNCSW4 DS XL4'00' RADD 01838000
DC C' ' 01839000
TRLNCSW5 DS XL8'00' REAL CSW (1ST HALF) 01840000
DC C' ' 01841000
TRLNCSW6 DS XL8'00' REAL CSW (2ND HALF) 01842000
EJECT 01843000
PSA 01844000
COPY SAVE 01845000
COPY CORE @V304735 01846000
COPY EQU 01847000
COPY IOBLOKS 01848000
COPY VBLOKS 01849000
COPY DEVTYPES 01850000
END DMKTRC 01851000