Table of Contents

DMKTRA Source

References

Source Listing

DMKTRA.ASSEMBLE.txt
  1. TRA TITLE 'DMKTRA (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF SOURCE 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMKTRA 00006000
  7. * 00007000
  8. * FUNCTION - 00008000
  9. * 00009000
  10. * TO PROVIDE A VIRTUAL MACHINE WITH THE FACILITY TO TRACE 00010000
  11. * SVC INSTRUCTIONS, PROGRAM INTERRUPTS, EXTERNAL INTERRUPTS, 00011000
  12. * PRIVILEGED INSTRUCTIONS, I/O OPERATIONS, SUCCESSFUL BRANCHES, 00012000
  13. * OR ALL INSTRUCTIONS, WITH OUTPUT ON THE PRINTER, TERMINAL, 00013000
  14. * OR BOTH. 00014000
  15. * 00015000
  16. * COMMAND LINE FORMAT - 00016000
  17. * 00017000
  18. * +---------+---------------------------------------+ 00018000
  19. * | | | 00019000
  20. * | TRACE | SVC < PRINTER > | 00020000
  21. * | TR | I/O | 00021000
  22. * | | PROGRAM < TERMINAL < RUN >> | 00022000
  23. * | | EXTERNAL < TERMINAL < NORUN >> | 00023000
  24. * | | PRIV | 00024000
  25. * | | SIO < BOTH < RUN >> | 00025000
  26. * | | CCW < BOTH < NORUN >> | 00026000
  27. * | | BRANCH | 00027000
  28. * | | INSTRUCT < OFF > | 00028000
  29. * | | CSW | 00029000
  30. * | | ALL | 00030000
  31. * | | | 00031000
  32. * | | END | 00032000
  33. * | | | 00033000
  34. * +---------+---------------------------------------+ 00034000
  35. * 00035000
  36. * ATTRIBUTES - 00036000
  37. * 00037000
  38. * REENTRANT, PAGEABLE, CALLED VIA SVC 00038000
  39. * 00039000
  40. * ENTRY POINTS - 00040000
  41. * 00041000
  42. * DMKTRACE - INITIALIZE, MODIFY, OR TERMINATE THE TRACE FUNCTION 00042000
  43. EJECT 00043000
  44. * ENTRY CONDITIONS - 00044000
  45. * 00045000
  46. * GPR 9 = ADDRESS OF COMMAND BUFFER 00046000
  47. * GPR 11 = ADDRESS OF VIRTUAL MACHINE VMBLOK 00047000
  48. * GPR 12 = ENTRY POINT ADDRESSABILITY 00048000
  49. * GPR 13 = ADDRESS OF STANDARD SAVE AREA 00049000
  50. * 00050000
  51. * EXIT CONDITIONS - 00051000
  52. * 00052000
  53. * TRACE CONTROL BLOCK HAS BEEN OBTAINED IF NECESSARY, 00053000
  54. * INITIALIZED OR MODIFIED AS NEEDED, OR RETURNED TO 00054000
  55. * FREE STORAGE IF "TRACE END" HAS BEEN EFFECTED. 00055000
  56. * 00056000
  57. * TRACE CONTROL FLAGS IN THE USER'S VMBLOK HAVE SIMILARLY 00057000
  58. * BEEN SET, MODIFIED, OR RESET, AS APPROPRIATE. 00058000
  59. * 00059000
  60. * CALLS TO OTHER ROUTINES - 00060000
  61. * 00061000
  62. * DMKSCNFD - TO PICK UP PARAMETERS FROM COMMAND LINE 00062000
  63. * DMKQCNWT - WRITE A MESSAGE TO USER TERMINAL 00063000
  64. * DMKERMSG - TO TYPE ERROR MESSAGES TO USER 00064000
  65. * DMKFREE - TO GET FREE STORAGE FOR TRACE CONTROL BLOCK 00065000
  66. * DMKFRET - TO RETURN TRACE CONTROL BLOCK TO FREE STORAGE 00066000
  67. * DMKTRCPB - TO PUT BACK USER INSTRUCTIONS ALTERED BY TRACING 00067000
  68. * DMKTRCIT - TO SET NEEDED "SVC B2" FOR INSTRUCTION TRACING 00068000
  69. * DMKSTKCP - TO STACK A CP REQUEST BLOCK IF NECESSARY 00069000
  70. * 00070000
  71. * EXTERNAL REFERENCES - 00071000
  72. * 00072000
  73. * NONE 00073000
  74. * 00074000
  75. * TABLES / WORK AREAS - 00075000
  76. * 00076000
  77. * TRACE CONTROL BLOCK 00077000
  78. EJECT 00078000
  79. * REGISTER USAGE - 00079000
  80. * 00080000
  81. * GPR 9 = ADDRESS OF COMMAND BUFFER (FOR DMKTRACE ENTRY) 00081000
  82. * OR 00082000
  83. * ADDRESS OF TRACE CONTROL BLOCK 00083000
  84. * GPR 12 - BASE REGISTER 00084000
  85. * GPR 13 - ADDRESS OF STANDARD SAVE AREA 00085000
  86. * 00086000
  87. * OTHER REGISTERS = WORK REGISTERS 00087000
  88. * 00088000
  89. * NOTES - 00089000
  90. * 00090000
  91. * SEE "RESTRICTIONS" (PRECEDING "ERROR MESSAGES") 00091000
  92. * 00092000
  93. * VARIOUS TRACE OPTIONS CAN BE SET CUMULATIVELY BY ISSUING 00093000
  94. * SUCCESSIVE TRACE COMMANDS; FOR EXAMPLE TO HAVE BRANCH 00094000
  95. * TRACING ON THE TERMINAL (WITH RUN ON) AND FULL INSTRUCTION 00095000
  96. * TRACING ON THE PRINTER THE FOLLOWING COULD BE ISSUED 00096000
  97. * (ASSUMING THE USER IS IN CP MODE): 00097000
  98. * 00098000
  99. * TRACE BRANCH TERMINAL RUN 00099000
  100. * TRACE INSTRUCT PRINTER 00100000
  101. * BEGIN (OR SIMILAR CP COMMAND) 00101000
  102. * 00102000
  103. * FOR FULL INSTRUCTION OR BRANCH TRACING, ANY INSTRUCTION 00103000
  104. * WHICH MODIFIES THE NEXT BYTE IN STORAGE (FOLLOWING THE 00104000
  105. * INSTRUCTION) WILL CAUSE ERRONEOUS RESULTS, USUALLY 00105000
  106. * RESULTING IN TRACING BEING TERMINATED UNTIL AN INTERRUPT 00106000
  107. * OCCURS. 00107000
  108. * 00108000
  109. * SIMILARLY, AN INSTRUCTION WHICH EXAMINES EITHER (OR BOTH) 00109000
  110. * OF THE NEXT TWO BYTES FOLLOWING THE INSTRUCTION (WHEN 00110000
  111. * RUNNING WITH FULL INSTRUCTION OR BRANCH TRACING) WILL 00111000
  112. * OBTAIN ERRONEOUS DATA. 00112000
  113. * 00113000
  114. * AN INSTRUCTION WHICH EXECUTES THE NEXT INSTRUCTION IN 00114000
  115. * SEQUENCE, ON THE OTHER HAND, WILL BE HANDLED SATISFACTORILY, 00115000
  116. * EXCEPT THAT ONLY THE FIRST EXECUTION OF THE INSTRUCTION WILL 00116000
  117. * WILL BE TRACED. (IF NO TRANSFER OCCURS, THE 'EX' DROPS THRU, 00117000
  118. * AND THE INSTRUCTION IS DONE AGAIN IN LINE, IT WILL NOT 00118000
  119. * BE TRACED THE SECOND TIME. TRACING WILL THEN RESUME WITH 00119000
  120. * THE NEXT INSTRUCTION FOLLOWING THE EXECUTED INSTRUCTION.) 00120000
  121. * 00121000
  122. * WHEN SEVERAL TRACE OPTIONS ARE IN EFFECT, THE SAME 00122000
  123. * INSTRUCTION CAN APPEAR IN THE TRACE OUTPUT MORE THAN 00123000
  124. * ONCE. FOR EXAMPLE, IF FULL INSTRUCTION TRACING WERE 00124000
  125. * IN EFFECT, A START I/O (SIO) INSTRUCTION WOULD BE TRACED 00125000
  126. * BEFORE IT IS EXECUTED; SUBSEQUENTLY, WHEN THE SIO HAS 00126000
  127. * BEEN HANDLED BY CP, AND THE CONDITION CODE IS READY 00127000
  128. * TO BE REFLECTED TO THE USER, THE SIO WOULD BE TRACED 00128000
  129. * AGAIN WITH THE USUAL PERTINENT INFORMATION GIVEN FOR 00129000
  130. * THE TRACING OF I/O OPERATIONS (SEE RESPONSES). 00130000
  131. EJECT 00131000
  132. * OPERATION - 00132000
  133. * 00133000
  134. * DMKTRACE - INITIALIZE, MODIFY, OR TERMINATE THE TRACE FUNCTION 00134000
  135. * 00135000
  136. * THE COMMAND LINE IS CHECKED FOR VALID OPERANDS (E.G. 00136000
  137. * SVC, SIO, OR I/O) - OF WHICH AT LEAST ONE MUST BE 00137000
  138. * PRESENT; AND FOR ANY VALID OPTIONS (E.G. PRINTER). 00138000
  139. * AN ERROR MESSAGE IS GIVEN IF NO OPERAND IS PRESENT, 00139000
  140. * OR IF INVALID, CONFLICTING, OR MUTUALLY EXCLUSIVE 00140000
  141. * OPTIONS ARE FOUND. IF ALL OPERAND(S) AND OPTION(S) 00141000
  142. * ARE VALID, THEN TRACING IS INITIATED (IF IT WAS NOT 00142000
  143. * IN EFFECT) OR MODIFIED (IF ALREADY IN EFFECT) TO CAUSE 00143000
  144. * SPECIFIED TRACING TO BE IMPLEMENTED ON THE TERMINAL, 00144000
  145. * PRINTER, OR BOTH. IF TRACING IS ON THE TERMINAL 00145000
  146. * (WHETHER OR NOT ALSO ON THE PRINTER), THE USER MAY 00146000
  147. * SPECIFY EITHER 'RUN' IF HE WISHES HIS VIRTUAL MACHINE TO 00147000
  148. * KEEP RUNNING WHILE TRACE OUTPUT IS OCCURRING, OR 'NORUN' 00148000
  149. * IF HE WISHES HIS VIRTUAL MACHINE TO PAUSE FOR INPUT 00149000
  150. * FROM THE TERMINAL AFTER EACH TRACED EVENT. IF USER IS TRACING 00150000
  151. * SVC, PRIV, BRANCH, INSTRUCT, OR ALL, VM ASSIST IS TURNED OFF. 00151000
  152. * 00152000
  153. * 'TERMINAL' AND 'NORUN' ARE THE DEFAULTS. 00153000
  154. * 00154000
  155. * 'TRACE END' WILL TERMINATE ALL TRACING. IN ADDITION, IF VM 00155000
  156. * ASSIST HAD BEEN TURNED OFF FOR TRACING AND THE USER WANTS IT 00156000
  157. * ON, VM ASSIST IS TURNED BACK ON. 00157000
  158. * 00158000
  159. * 'TRACE OPERAND OFF' WILL TERMINATE TRACING FOR THAT 00159000
  160. * FUNCTION. FOR EXAMPLE, IF SIO AND CCW TRACING WERE 00160000
  161. * IN EFFECT, 'TRACE CCW OFF' WOULD RESET CCW TRACING 00161000
  162. * BUT RETAIN SIO TRACING. IF ALL TRACING HAS BECOME 00162000
  163. * RESET, THEN THIS IS HANDLED LIKE 'TRACE END'. 00163000
  164. * 00164000
  165. * IF 'TRACE OPERAND OFF' OR 'TRACE END' IS GIVEN AND 00165000
  166. * TRACING IS NOT IN EFFECT, AN ERROR MESSAGE IS GIVEN. 00166000
  167. * 00167000
  168. * CERTAIN OPERANDS AUTOMATCIALLY IMPLY OTHERS: FOR EXAMPLE 00168000
  169. * CCW IMPLIES SIO; AND CSW IMPLIES I/O. THEY MAY BE 00169000
  170. * SPECIFIED SEPARATELY, HOWEVER, FOR EXAMPLE: 00170000
  171. * TRACE SIO BOTH RUN 00171000
  172. * TRACE CCW PRINTER 00172000
  173. * 00173000
  174. * RESPONSES - 00174000
  175. * 00175000
  176. * TRACING INITIATED: 00176000
  177. * 00177000
  178. * 'TRACE STARTED' 00178000
  179. * 00179000
  180. * TRACING MODIFIED BY AN ADDITIONAL 'TRACE' COMMAND: 00180000
  181. * 00181000
  182. * (NONE) 00182000
  183. * 00183000
  184. * TRACING ENDED: 00184000
  185. * 00185000
  186. * 'TRACE ENDED' 00186000
  187. EJECT 00187000
  188. * RESTRICTIONS - 00188000
  189. * 00189000
  190. * NONE - 00190000
  191. * 00191000
  192. * ERROR MESSAGES - 00192000
  193. * 00193000
  194. * DMKTRA002E INVALID OPERAND - OPERAND 00194000
  195. * DMKTRA003E INVALID OPTION - OPTION 00195000
  196. * DMKTRA013E CONFLICTING OPERAND - OPERAND 00196000
  197. * DMKTRA026E OPERAND MISSING OR INVALID 00197000
  198. * DMKTRA180W TRACE NOT IN EFFECT 00198000
  199. * DMKTRA182E "PER" TRACE IS ACTIVE 00199000
  200. *. 00200000
  201. EJECT 00201000
  202. * MACRO TO SET UP FLAG-BITS ETC. FOR ARGUMENTS & OPTIONS: 00202000
  203. * &NAME = ARGUMENT OR OPTION - E.G. SVC OR PRINTER 00203000
  204. * &COUNT = MINIMUM NUMBER OF BYTES FOR SHORT-FORM ABBREVIATION 00204000
  205. * &FLAG1 = FLAG-BITS CORRESPONDING TO VMTREXT = TREXCTL1 00205000
  206. * &FLAG2 = FLAG-BITS CORRESPONDING TO TREXCTL2 00206000
  207. SPACE 00207000
  208. MACRO 00208000
  209. &LABEL ARGMAC &NAME,&COUNT,&FLAG1,&FLAG2 00209000
  210. &LABEL DC CL8'&NAME' 00210000
  211. DC AL1(&COUNT) 00211000
  212. DC AL1(&FLAG1),AL1(&FLAG2) 00212000
  213. MEND 00213000
  214. SPACE 00214000
  215. COPY OPTIONS 00215000
  216. COPY LOCAL 00216000
  217. EJECT 00217000
  218. DMKTRA CSECT LOADER CONTROL 00218000
  219. SPACE 00219000
  220. DC CL8'DMKTRA' MODULE IDENTIFIER 00220000
  221. SPACE 00221000
  222. USING PSA,R0 00222000
  223. USING VMBLOK,R11 00223000
  224. USING DMKTRA,R12 00224000
  225. USING SAVEAREA,R13 00225000
  226. * 00226000
  227. EXTRN DMKSCNFD 00227000
  228. EXTRN DMKERMSG 00228000
  229. EXTRN DMKTRCPB 00229000
  230. EXTRN DMKTRCIT 00230000
  231. EXTRN DMKLOCKD @V200820 00231000
  232. EXTRN DMKLOCKQ @VA03505 00232000
  233. * 00233000
  234. ENTRY DMKTRACE 00234000
  235. DMKTRACE ENTER "TRACE" INITIALIZER ENTRY POINT 00235000
  236. SL R12,F8 SUBTRACT 8 A LA 'RELOC' FOR 1ST ENTRY 00236000
  237. MVC SAVEWRK7(1),VMRSTAT SAVE VMRSTAT FLAG STATUS AT ENTRY 00237000
  238. OI VMRSTAT,VMEXWAIT+VMCFWAIT ENSURE THAT USER IS NOT RUN 00238000
  239. SLR R0,R0 CLEAR SAVEWRK2 AND SAVEWRK1 FLAGS 00241000
  240. ST R0,SAVEWRK2 SAVEWRK2+2 USED FOR OPTION FLAG-BITS 00242000
  241. ST R0,SAVEWRK1 SAVEWRK1+2 USED FOR ARGUMENT FLAG-BITS 00243000
  242. CALL DMKSCNFD PICK UP FIRST ARGUMENT 00244000
  243. BNZ ARGMISS TUT-TUT IF NOTHING THERE AT ALL. 00245000
  244. CL R0,F3 3 BYTES ? 00246000
  245. BNE TRA02 NOPE. 00247000
  246. CLC CLEND(3),0(R1) IS IT 'END' ? 00248000
  247. BE TRAEND YES. 00249000
  248. * 00250000
  249. TRA02 LA R3,ARGFIRST SET R3-R4-R5 FOR BXLE LOOP 00251000
  250. LA R4,11 ... 00252000
  251. LA R5,ARGLAST ... 00253000
  252. LR R15,R0 BYTE-COUNT INTO R15 00254000
  253. CL R15,F8 MORE THAN 8 BYTES ? 00255000
  254. BH ARGINV INVALID IF YES. 00256000
  255. BCTR R15,0 LESS 1 FOR EX-CLC 00257000
  256. * 00258000
  257. TRA04 EX R15,EXCLC LOOK FOR MATCH IN TABLE OF ARGUMENTS 00259000
  258. BE TRA18 TRF IF PROBABLE MATCH. 00260000
  259. BXLE R3,R4,TRA04 ITERATE THRU ARGUMENT TABLE. 00261000
  260. * 00262000
  261. TM SAVEWRK2+2,ARGFOUND DID WE FIND AT LEAST ONE ARGUMENT ? 00263000
  262. BZ ARGINV IF NOT, CONSIDER COMMAND INVALID. 00264000
  263. * 00265000
  264. CL R0,F3 WAS BYTE-COUNT 3 00266000
  265. BNE TRA06 NOPE. 00267000
  266. CLC CLOFF,0(R1) IF YES, WAS 'OFF' SPECIFIED ? 00268000
  267. BE TRAOFF YES 00269000
  268. TRA06 LA R3,OPTFIRST SET R3 FOR BXLE LOOP 00270000
  269. LA R5,OPTLAST DITTO R5 (R4 STILL = 11) 00271000
  270. LR R15,R0 BYTE-COUNT INTO R15 00272000
  271. CL R15,F8 MORE THAN 8 BYTES ? 00273000
  272. BH OPTINV INVALID IF YES. 00274000
  273. BCTR R15,0 LESS 1 FOR EX-CLC 00275000
  274. * 00276000
  275. TRA08 EX R15,EXCLC LOOK FOR MATCH IN TABLE OF OPTIONS 00277000
  276. BE TRA10 TRF IF PROBABLE MATCH 00278000
  277. BXLE R3,R4,TRA08 ITERATE THRU OPTION TABLE. 00279000
  278. B OPTINV INVALID OPTION IF NOT IN TABLE. 00280000
  279. * 00281000
  280. * APPARENT MATCH FOUND WHEN CHECKING THE OPTIONS: 00282000
  281. TRA10 CLM R0,1,8(R3) IF MATCH, DO WE HAVE ENOUGH BYTES ? 00283000
  282. BL OPTINV INVALID IF TOO FEW. 00284000
  283. ICM R15,3,9(R3) PICK UP HALFWORD OF FLAGS, 00285000
  284. O R15,SAVEWRK2 OR INTO SAVEWRK2 FLAG 00286000
  285. ST R15,SAVEWRK2 AND REPLACE ACCUMULATED FLAGS 00287000
  286. CALL DMKSCNFD ANY MORE OPTIONS THERE ? 00288000
  287. BZ TRA06 IF YES, GO CHECK THEM. 00289000
  288. TM SAVEWRK2+2,JRUN+JNORUN CHECK RUN/NORUN FLAGBITS 00290000
  289. BO RUNNORUN INVALID IF 'NORUN' SET ALONG WITH 'RUN' 00291000
  290. TM SAVEWRK2+2,JBOTH TERMINAL & PRINTER BOTH SPECIFIED ? 00292000
  291. BO TRA14 YES - CHECK FOR RUN OR NORUN. 00293000
  292. BZ TRA12 IF NEITHER, DEFAULT TO TERMINAL. 00294000
  293. TM SAVEWRK2+2,JTERM IF ONE OR THE OTHER, WHICH ? 00295000
  294. BO TRA14 TRF IF IT WAS THE TERMINAL. 00296000
  295. TM SAVEWRK2+2,JRUN+JNORUN IF PRT ONLY, WAS RUN/ @VA00782 00297000
  296. * NORUN SPECIFIED? 00298000
  297. BNZ PRTNORUN INVALID IF SO @VA00782 00299000
  298. B TRA22 AND GO FINISH UP. 00300000
  299. * 00301000
  300. TRA12 OI SAVEWRK2+2,JTERM DEFAULT TO TERMINAL 00302000
  301. * 00303000
  302. TRA14 TM SAVEWRK2+2,JRUN TERMINAL OR BOTH, CHECK FOR 'RUN' 00304000
  303. BO TRA22 OK IF RUN WAS SPECIFIED. 00305000
  304. B TRA20 NO, MAKE SURE 'NORUN' SET & FINISH UP. 00306000
  305. * 00307000
  306. * APPARENT MATCH FOUND WHEN CHECKING PRIMARY ARGUMENTS: 00308000
  307. TRA18 CLM R0,1,8(R3) IF MATCH, DO WE HAVE ENOUGH BYTES ? 00309000
  308. BL ARGINV INVALID IF TOO FEW BYTES. 00310000
  309. ICM R15,3,9(R3) PICK UP HALFWORD OF FLAGS @V304735 00311000
  310. O R15,SAVEWRK1 'OR' IN WITH FLAGS ACCUMULATED SO FAR, 00312000
  311. ST R15,SAVEWRK1 AND REPLACE 00313000
  312. OI SAVEWRK2+2,ARGFOUND SIGNAL AT LEAST ONE ARGUMENT FOUND 00314000
  313. CALL DMKSCNFD ANY MORE FIELDS ON INPUT LINE ? 00315000
  314. BZ TRA02 IF YES, SEE IF THEY ARE ARGUMENTS. 00316000
  315. * NO OPTIONS IN COMMAND LINE - JUST PRIMARY ARGUMENTS: 00317000
  316. TRA20 OI SAVEWRK2+2,JTERM+JNORUN SET FOR TERMINAL + NORUN 00318000
  317. * 00319000
  318. * ALL OPTIONS LOOK OK - COMPLETE THE INITIALIZATION PROCESS: 00320000
  319. TRA22 DS 0H NOW FINISH UP: 00321000
  320. TM SAVEWRK1+3,TREXBRAN+TREXINST BRANCH & INSTRUCT BOTH SET 00322000
  321. BO BRINCOMP THAT'S INVALID FOR ONE TRACE CALL. 00323000
  322. L R9,VMTREXT GET POINTER TO TRACE CONTROL BLOCK 00324000
  323. LTR R9,R9 (IF ANY) 00325000
  324. BNZ TRA24 IT'S ALREADY THERE. 00326000
  325. MSG 'TRACE STARTED' MIGHT AS WELL GIVE MESSAGE NOW 00327000
  326. CALL DMKQCNWT,PARM=NORET ... 00328000
  327. LA R0,TREXSIZE GET A TRACE CONTROL BLOCK 00329000
  328. CALL DMKFREE ... 00330000
  329. ST R1,VMTREXT STORE ADDRESS IN VMBLOK, 00331000
  330. LR R9,R1 INTO R9 THE ADDRESS SHALL GO 00332000
  331. USING TREXT,R9 AND REFERENCE SAME 00333000
  332. XC TREXT(TREXSIZE*8),TREXT CLEAR THE WHOLE BLOCK 00334000
  333. MVC TREXIN1(8),FFS SET TREXIN1 & TREXIN2 TO X'FFFFFFFF' 00335000
  334. MVC TREXANSI(4),FFS DITTO TREXANSI 00336000
  335. * 00337000
  336. TRA24 DS 0H NOW ADJUST FLAG-BITS IF/AS NEEDED: 00338000
  337. L R0,XRIGHT16 X'0000FFFF' INTO R0 @VA00782 00339000
  338. ICM R1,2,VMTRCTL LOAD FIRST BYTE OF CONTROL. PER001 00340000
  339. IC R1,TREXCTL+1 LOAD THE SECOND BYTE. PER001 00340500
  340. LH R2,TREXPRNT OLD TREXPRNT INTO R2 (RIGHT END) 00341000
  341. LH R3,TREXTERM OLD TREXTERM INTO R3 (RIGHT END) 00342000
  342. LH R4,TREXRUNF OLD TREXRUNF INTO R4 (RIGHT END) 00343000
  343. L R5,SAVEWRK1 NEW FLAG-BITS INTO R5 (RIGHT END) 00344000
  344. XR R0,R5 GET "EXCLUSIVE OR" OF NEW FLAG BITS 00345000
  345. NR R2,R0 RESET OLD PRINTER BITS (IF ANY) 00346000
  346. NR R3,R0 RESET OLD TERMINAL BITS (IF ANY) 00347000
  347. NR R4,R0 RESET OLD RUN BITS (IF ANY) 00348000
  348. TM SAVEWRK2+2,JPRINT WAS PRINTER WANTED ? 00349000
  349. BZ TRA28 NOPE - MUST BE JUST THE TERMINAL. 00350000
  350. OR R2,R5 YES - SET NEW PRINTER FLAG BITS 00351000
  351. TM SAVEWRK2+2,JTERM TERMINAL ALSO WANTED ? 00352000
  352. BZ TRA30 NOPE, GO SET UP FLAG BITS. @VA00782 00353000
  353. TRA28 OR R3,R5 SET NEW TERMINAL FLAG-BITS 00354000
  354. TM SAVEWRK2+2,JRUN "RUN" WANTED ? 00355000
  355. BZ TRA30 NOPE. 00356000
  356. TRA29 OR R4,R5 SET NEW "RUN" FLAG-BITS 00357000
  357. TRA30 OR R1,R5 "OR" NEW FLAG-BITS INTO TREXCTL FLAGS 00358000
  358. STH R1,TREXCTL STORE NEW TREXCTL1/TREXCTL2 00359000
  359. STCM R1,2,VMTRCTL AND 1ST BYTE OF SAME INTO VMBLOK FLAGBYTE 00360000
  360. STH R2,TREXPRNT NEW TREXPRNT, 00361000
  361. STH R3,TREXTERM NEW TREXTERM, 00362000
  362. STH R4,TREXRUNF AND NEW TREXRUNF 00363000
  363. LA R1,TREXPRNT GET 1ST FIELD TO CHECK @VA00782 00364000
  364. LA R2,3 COUNT OF TIMES TO DO THIS TRICK @VA00782 00365000
  365. NEXTBITS TM 1(R1),TREXCCW CCW'S BEING TRACED HERE? @VA00782 00366000
  366. BZ *+12 NOPE, SKIP AROUND @VA00782 00367000
  367. OI 0(R1),VMTRSIO INSURE SIO IS ON TOO. @VA00782 00368000
  368. OI VMTRCTL,VMTRSIO SET IT ON IN THE VMBLOK TOO @VA00782 00369000
  369. TM 1(R1),TREXCSW CCW'S BEING TRACED HERE? @VA00782 00370000
  370. BZ *+12 NOPE, SKIP AROUND @VA00782 00371000
  371. OI 0(R1),VMTRIO INSURE I/O IS ON TOO @VA00782 00372000
  372. OI VMTRCTL,VMTRIO SET I/O ON IN THE VMBLOK @VA00782 00373000
  373. LA R1,2(R1) GET NEXT FIELD TO CHECK @VA00782 00374000
  374. BCT R2,NEXTBITS & GO CHECK IT (MAYBE) @VA00782 00375000
  375. TM VMTRCTL,VMTREX TRACE EXTERNAL REQUESTED ? @V3M4026 00375150
  376. BZ NOTEXTS IF YES, MAKE SURE TO DISABLE THE @V3M4035 00375300
  377. NI VMMCR6,X'FF'-VMMVTMR VIRTUAL TIMER ASSIST @V3M4026 00375450
  378. * (IF NOT, MIGHT LOSE TIMER INTS.) 00375600
  379. NOTEXTS EQU * @V3M4035 00375750
  380. TM SAVEWRK1+3,TREXBRAN+TREXINST BRANCH OR FULL TRACE WANTED 00376000
  381. BZ TRAEXIT IF NOT, GO EXIT (WE'RE ALL SET). 00377000
  382. CALL DMKTRCPB RESET ANY POSSIBLE OLD SVCB1/SVCB2 00378000
  383. TM VMPSW+1,WAIT IS USER IN WAIT STATE ? 00379000
  384. BO TRAEXIT YES - IT WILL HAVE TO BE SET LATER. 00380000
  385. L R1,VMPSW+4 NO - WHERE WE'LL BE GOING INTO R1 00381000
  386. CALL DMKTRCIT INITIALIZE TRACING BRANCHES AND/OR INSTR 00382000
  387. B TRAEXIT WHEN ALL THRU, GO EXIT. 00383000
  388. EJECT 00384000
  389. TRAOFF DS 0H "OFF" WAS SPECIFIED: 00385000
  390. BAL R14,GETR9 GET R9 = POINTER TO TRACE CONTROL BLOCK 00386000
  391. * (GOES TO "TRACENOT" IF NONEXISTENT) 00387000
  392. USING TREXT,R9 00388000
  393. TM SAVEWRK1+2,VMTRSIO SIO TRACING TO BE TURNED OFF ? 00389000
  394. BZ TRA32 NOPE. 00390000
  395. OI SAVEWRK1+3,TREXCCW YES, ENSURE TURN OFF CCW BIT ALSO 00391000
  396. TRA32 TM SAVEWRK1+2,VMTRIO I/O INTERRUPTS TO BE TURNED OFF ? 00392000
  397. BZ TRA33 NO. 00393000
  398. OI SAVEWRK1+3,TREXCSW YES, ENSURE TURN OFF CSW BIT ALSO 00394000
  399. TRA33 LH R4,TREXCTL GET OLD CONTROL BITS 00395000
  400. NI TREXCTL,255-VMTRPER CLEAR THE P.E.R. BIT. PER001 00395500
  401. L R3,SAVEWRK1 GET NEW ARGUMENT FLAG-BITS 00396000
  402. X R3,XRIGHT16 EXCLUSIVE OR VS. 0000FFFF TO INVERT 00397000
  403. NR R4,R3 NOW TURN OFF SPECIFIED BITS 00398000
  404. LR R0,R4 PREPARE TO CLEAR P.E.R BIT. PER001 00398100
  405. N R0,=A(X'7FFF') CLEAR ALL BUT THE P.E.R. PER001 00398200
  406. BZ TRAEND1 IF FLAG ALL CLEAR, TREAT AS "TRACE END" 00399000
  407. LA R15,TREXBRAN+TREXINST BRANCH OR INSTRUCTION TRACING 00400000
  408. NR R15,R4 STILL ON ? 00401000
  409. BZ TRA34 NOPE - REPLACE POSSIBLE ALTERED INSTRUCT. 00402000
  410. LA R15,(VMTRBRIN)*256 YES - SET VMTRBRIN FLAG-BIT AGAIN 00403000
  411. OR R4,R15 ... 00404000
  412. B TRA35 DON'T RESET ALTERED INSTRUCTIONS. 00405000
  413. TRA34 CALL DMKTRCPB PUT BACK POSSIBLE ALTERED INSTRUCTIONS 00406000
  414. TRA35 STH R4,TREXCTL NOW STORE REVISED FLAG 00407000
  415. NI TREXCTL,255-VMTRPER CLEAR P.E.R. TRACING. PER001 00407500
  416. STCM R4,2,VMTRCTL ALSO IN VMBLOK FLAG 00408000
  417. TM VMTRCTL,VMTREX IS USER STILL TRACING EXTERNAL ? @V3M4026 00408300
  418. BZ TRATMRCK NO, GO TRY TO USE TIMER ASSIST. @V3M4026 00408600
  419. B TRAEXIT AND GO EXIT. 00409000
  420. SPACE 00410000
  421. TRAEND DS 0H "END" WAS SPECIFIED: 00411000
  422. BAL R14,GETR9 GET R9 = POINTER TO TRACE CONTROL BLOCK 00412000
  423. * (GOES TO "TRACENOT" IF NONEXISTENT) 00413000
  424. USING TREXT,R9 00414000
  425. ST R9,TRALOCK+4 PUT TREXT ADDR DOWN FOR LOCK @VA03505 00415000
  426. LA R1,TRALOCK POINT TO THE LOCK NAME @VA03505 00416000
  427. CALL DMKLOCKQ MAKE SURE PREVIOUS TRACE IS DONE @VA03505 00417000
  428. TRAEND1 CALL DMKTRCPB PUT BACK ANY INSTRUCTIONS WHICH WE ALTERED 00418000
  429. ST R9,TRALOCK+4 PUT TREXT ADDRESS DOWN FOR LOCK @V200820 00419000
  430. LA R1,TRALOCK POINT TO THE LOCK "NAME" @V200820 00420000
  431. TRAEND2 EQU * @V200820 00421000
  432. CALL DMKLOCKD DEQUEUE ANY TRACE LOCKS @V200820 00422000
  433. BZ TRAEND2 CONTINUE UNTIL NOT LOCKED @V200820 00423000
  434. LA R0,TREXSIZE SIZE OF TREX BLOCK, 00424000
  435. LR R1,R9 AND ITS ADDRESS 00425000
  436. SLR R15,R15 BEFORE CALLING DMKFRET, 00426000
  437. ST R15,VMTREXT CLEAR "VMTREXT" AND 00427000
  438. NI VMTRCTL,VMTRPER RESET ALL TRACING. PER001 00428000
  439. CALL DMKFRET GIVE IT BACK TO FREE STORAGE 00429000
  440. LA R1,TRENDED 'TRACE ENDED' MESSAGE TO THE USER 00430000
  441. LA R0,L'TRENDED+L'CLEND ... 00431000
  442. CALL DMKQCNWT,PARM=NORET ... 00432000
  443. SPACE 00432050
  444. TRATMRCK EQU * HERE TO TRY TIMER ASSIST ENABLE @V3M4026 00432100
  445. TM VMFSTAT,VMFVTMR IS IT TO BE USED ? @V3M4026 00432150
  446. BZ TRAEXIT NO, ALL SET. @V3M4026 00432200
  447. TM VMTLEVEL,VMRON+VMTON IS THE TIMER RUNNING ? @V3M4026 00432250
  448. BZ TRAEXIT NO, GET OUT. @V3M4026 00432300
  449. ICM R1,B'0111',VMMADDR NEED TO HAVE VM ASSIST ON. @V3M4026 00432350
  450. BZ TRAEXIT IF NOT, CAN'T USE TIMER ASSIST @V3M4026 00432400
  451. USING MICBLOK,R1 VMA POINTER LIST ADDRESSABILITY @V3M4026 00432450
  452. LCTL C1,C1,VMSEG GET USER'S ADDRESS SPACE @V3M4026 00432500
  453. LRA R15,TIMER-PSA VIRTUAL LOC. 80 TIMER RESIDENT ? @V3M4026 00432550
  454. BZ STMCVTMR YES, PUT THIS ADDR IN MICBLOK @V3M4035 00432600
  455. LA R15,VMTIMER POINT TO VALUE IN VMBLOK @VA06289 00432650
  456. STMCVTMR ST R15,MICVTMR THIS ADDRESS WILL BE DECREMENTED @V3M4035 00432700
  457. OI VMMCR6,VMMVTMR SET THE TIMER ASSIST ENABLE FLAG @V3M4026 00432750
  458. SPACE 00432800
  459. TRAEXIT DS 0H RESTORE VMRSTAT FLAGBITS (AS NEEDED) BEFORE EXIT: 00433000
  460. OI SAVEWRK7,255-(VMEXWAIT+VMCFWAIT) PRESERVE ALL OTHER BITS 00434000
  461. NC VMRSTAT(1),SAVEWRK7 RESTORE VMEXWAIT|VMCFWAIT AS NEEDED 00435000
  462. TRAEXITR LCTL C1,C1,VMSEG BE SURE CONTROL REG 1 IS CORRECTLY SET, 00436000
  463. EXIT AND REALLY EXIT. 00437000
  464. EJECT 00438000
  465. * TABLES FOR CHECKING TRACE ARGUMENTS AND OPTIONS: 00439000
  466. * (SEE "ARGMAC" MACRO) 00440000
  467. * 00441000
  468. EXCLC CLC 0(*-*,R1),0(R3) EXECUTED CLC TO FIND ARGUMENTS 00442000
  469. * 00443000
  470. * KEEP THE NEXT TWO IN ORDER: 00444000
  471. TRENDED DC C'TRACE ' 00445000
  472. CLEND DC C'ENDED' 00446000
  473. * 00447000
  474. CLOFF DC CL3'OFF' 00448000
  475. CLTRA EQU DMKTRA+3 (= CL3'TRA') 00449000
  476. SPACE 00450000
  477. DS 0F WORD BOUNDARY ALIGNMENT @VA01382 00451000
  478. TRALOCK DC C'TREX',A(*-*) LOCK NAME FOR DMKLOC @V200820 00452000
  479. PRINT NOGEN @V200820 00453000
  480. * 00454000
  481. ARGFIRST ARGMAC INSTRUCT,4,VMTRBRIN,TREXINST INSTRUCT 00455000
  482. CLSVC ARGMAC SVC,3,VMTRSVC,0 SVC 00456000
  483. CLIO ARGMAC I/O,3,VMTRIO,0 I/O 00457000
  484. CLPROG ARGMAC PROGRAM,3,VMTRPRG,0 PROGRAM 00458000
  485. CLEXT ARGMAC EXTERNAL,3,VMTREX,0 EXTERNAL 00459000
  486. ARGMAC PRIV,4,VMTRPRV,0 PRIV 00460000
  487. ARGMAC SIO,3,VMTRSIO,0 SIO 00461000
  488. CLCCW ARGMAC CCW,3,0,TREXCCW CCW 00462000
  489. CLCC EQU CLCCW (= CL2'CC') 00463000
  490. CHARW EQU CLCCW+2 (= C'W') 00464000
  491. CLCSW ARGMAC CSW,3,0,TREXCSW CSW 00465000
  492. CLBRANCH ARGMAC BRANCH,2,VMTRBRIN,TREXBRAN BRANCH 00466000
  493. ARGLAST ARGMAC ALL,3,VMTRALL,TREXCCW+TREXCSW+TREXINST ALL 00467000
  494. EJECT 00468000
  495. * OPTIONS: 00469000
  496. * 00470000
  497. OPTFIRST ARGMAC PRINTER,1,JPRINT,0 PRINTER 00471000
  498. ARGMAC TERMINAL,4,JTERM,0 TERMINAL 00472000
  499. ARGMAC BOTH,4,JBOTH,0 BOTH 00473000
  500. ARGMAC RUN,3,JRUN,0 RUN 00474000
  501. OPTLAST ARGMAC NORUN,3,JNORUN,0 NORUN 00475000
  502. SPACE 00476000
  503. CLNORUN EQU OPTLAST = C'NORUN' 00477000
  504. SPACE 2 00478000
  505. * FLAG-BITS USED IN SAVEWRK2+2 (LOW HALFWORD OF SAVEWRK2): 00479000
  506. ARGFOUND EQU X'40' 00480000
  507. JPRINT EQU X'20' 00481000
  508. JTERM EQU X'10' 00482000
  509. JBOTH EQU JPRINT+JTERM 00483000
  510. JRUN EQU X'04' 00484000
  511. JNORUN EQU X'02' 00485000
  512. SPACE 2 00486000
  513. * ADDITIONAL FLAGBIT(S) DEFINED IN SAVEWRK1+3: 00487000
  514. * 00488000
  515. NOSTOP EQU X'02' NO MSG TO BE GIVEN, AND DO NOT STOP. 00489000
  516. NOTRAMSG EQU X'01' NO TRACE MSG WANTED (ALREADY GIVEN) 00490000
  517. PRINT GEN @V200820 00491000
  518. EJECT 00492000
  519. * ERROR RETURNS: 00493000
  520. * 00494000
  521. * INCOMPATIBLE COMBINATION OF 'BRANCH' & 'INSTRUCT' 00495000
  522. * (THE ONLY COMPATIBLE COMBINATION IS BRANCH ON ONE DEVICE 00496000
  523. * AND INSTRUCT ON THE OTHER - E.G. BRANCH ON TERMINAL, 00497000
  524. * INSTRUCT ON THE PRINTER) 00498000
  525. * 00499000
  526. BRINCOMP LA R1,CLBRANCH 'BRANCH' AND 'INSTRUCT' 00500000
  527. LA R0,6 USE 'BRANCH' FOR THE MESSAGE 00501000
  528. B INCOMPAT ... 00502000
  529. SPACE 00503000
  530. * 'PRINTER' AND 'NORUN' WERE SPECIFIED (NOT VALID COMBINATION): 00504000
  531. * 00505000
  532. PRTNORUN DS 0H 'RUN/NORUN PRINTER' IS INCOMPATA @VA00782 00506000
  533. LA R1,=C'RUN/NORUN PRINTER' SET UP FOR THE @VA00782 00507000
  534. LA R0,17 DIRTY MESSAGE... @VA00782 00508000
  535. B INCOMPAT AND LET HIM HAVE IT. @VA00782 00509000
  536. * CONTINUE ... 00510000
  537. SPACE 00511000
  538. * 'NORUN' AND 'RUN' WERE BOTH SPECIFIED (NOT VALID COMBINATION): 00512000
  539. * 00513000
  540. RUNNORUN LA R1,CLNORUN 'RUN & NORUN' INCOMPATIBLE 00514000
  541. LA R0,5 USE 'NORUN' FOR THE MESSAGE 00515000
  542. * 00516000
  543. INCOMPAT LA R2,13 CONFLICTING OPERAND = ERROR 13 00517000
  544. B ERRJOIN2 00518000
  545. * 00519000
  546. OPTINV LA R2,3 R2=3 FOR INVALID OPTION - OPTION 00520000
  547. B ERRJOIN2 00521000
  548. SPACE 00522000
  549. * OPERAND (OR POSSIBLY OPTION) WAS INVALID (R0/R1 POINT TO IT): 00523000
  550. * 00524000
  551. ARGINV LA R2,2 R2=2 FOR INVALID OPERAND - OPERAND 00525000
  552. B ERRJOIN2 AND JOIN ERROR HANDLING BELOW. 00526000
  553. SPACE 00527000
  554. * NO ARGUMENTS WERE THERE ON THE COMMAND LINE AT ALL: 00528000
  555. * 00529000
  556. ARGMISS LA R2,26 THAT IS ERROR NUMBER 26 00530000
  557. * 00531000
  558. ERRJOIN SLR R1,R1 R1=0 MEANS NO DATA FOR DMKERMSG 00532000
  559. * 00533000
  560. ERRJOIN2 ST R2,SAVER2 RETURN THE ERROR CODE TO THE CALLER 00534000
  561. ERRJOIN3 ICM R0,B'1110',CLTRA 'TRA' INTO HIGH 3 BYTES OF R0 00535000
  562. ICM R2,B'1000',HIGHX80 SIGNAL: RETURN TO ME, PLEASE 00536000
  563. CALL DMKERMSG CALL ERROR MESSAGE HANDLER 00537000
  564. B TRAEXIT AND GET OUT OF HERE, MAN. 00538000
  565. SPACE 00539000
  566. GETR9 L R9,VMTREXT GET POINTER TO TRACE CONTROL BLOCK 00540000
  567. LTR R9,R9 IT SHOULD EXIST - DOES IT ? 00541000
  568. BCR 7,R14 <BNZ> YES - RETURN TO TRACE END OR TRACE OFF. 00542000
  569. * NO - "GO DIRECTLY TO JAIL" ETC ... 00543000
  570. * 'TRACE' NOT IN EFFECT FOR 'TRACE OPERAND OFF' OR 'TRACE END' 00544000
  571. * 00545000
  572. TRACENOT LA R2,180 MAKE THIS ONE ERROR NUMBER 180 00546000
  573. ST R2,SAVER2 RETURN IT TO THE USER 00547000
  574. SETWMSG ICM R2,B'0100',CHARW SET FOR A 'W' MESSAGE PLEASE 00548000
  575. SLR R1,R1 NO DATA TO PASS TO DMKERMSG 00549000
  576. B ERRJOIN3 AND JOIN COMMON LOGIC. 00550000
  577. EJECT 00556000
  578. * EQUATES: 00557000
  579. * 00558000
  580. SVCB1 EQU X'0AB1' = SVC X'B1' TO TRACE NEXT SEQUENTIAL INSTRUCTION 00559000
  581. SVCB2 EQU X'0AB2' = SVC X'B2' TO TRACE BRANCHES 00560000
  582. SPACE 00561000
  583. LTORG 00562000
  584. HIGHX80 DC X'80' FOR USE WHEN CALLING DMKERMSG 00563000
  585. EJECT 00564000
  586. COPY VMBLOK 00565000
  587. VMTRALL EQU VMTRINT+VMTRSIO+VMTRBRIN FOR TRACE 'ALL' 00566000
  588. COPY TREXT 00567000
  589. PSA 00568000
  590. COPY SAVE 00569000
  591. COPY EQU 00570000
  592. COPY MICBLOK @V3M4026 00571000
  593. END DMKTRA @V3M4026 00572000