Table of Contents

DMSITS Source

References

Source Listing

DMSITS.ASSEMBLE.txt
  1. ITS TITLE 'DMSITS (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00003000
  4. * MODULE NAME - 00004000
  5. * 00005000
  6. * DMSITS (INTSVC) 00006000
  7. * 00007000
  8. * FUNCTION - 00008000
  9. * 00009000
  10. * HANDLE SVC INTERRUPTS. 00010000
  11. * 00011000
  12. * ATTRIBUTES - 00012000
  13. * 00013000
  14. * NUCLEUS RESIDENT, RE-ENTRANT 00014000
  15. * 00015000
  16. * ENTRY POINTS - 00016000
  17. * 00017000
  18. * DMSITS (OLD NAME: INTSVC) -- 'BALR' ENTRY TO INTSVC, 00018000
  19. * TO AVOID CP OVERHEAD DUE TO SVC CALL. 00019000
  20. * 00020000
  21. * DMSITS1 (OLD NAME: SVCINT) -- ADDRESS POINTED TO BY THE CMS 00021000
  22. * SVC NEW PSW. THIS POINT IS ENTERED WHENEVER AN SVC 00022000
  23. * INTERRUPT OCCURS. 00023000
  24. * 00024000
  25. * DMSITSCR (OLD NAME: CMSRET) -- RETURN POINT TO WHICH THE 00025000
  26. * 'CALLEE' OF A CMS SVC RETURNS WHEN FINISHED PROCESSING. 00026000
  27. * 00027000
  28. * DMSITSOF (OLD NAME: OSRET) -- RETURN POINT TO WHICH THE 00028000
  29. * 'CALLEE' OF AN OS SVC CALL RETURNS WHEN FINISHED 00029000
  30. * PROCESSING. 00030000
  31. * 00031000
  32. * DMSITSK -- SVC 'CALLEE' FOR THE DMSKEY MACRO. 00032000
  33. * 00033000
  34. * DMSITSXS -- SVC 'CALLEE' FOR THE DMSEXS MACRO. 00034000
  35. * 00035000
  36. * DMSITSR -- DMSITS RECOVERY AND RE-INITIALIZATION ROUTINE, 00036000
  37. * CALLED BY DMSABN, THE ABEND RECOVERY ROUTINE. 00037000
  38. * 00038000
  39. * ENTRY CONDITIONS - 00039000
  40. * 00040000
  41. * ENTRY CONDITIONS DEPEND ON THE PARTICULAR SVC CALL, BUT THE 00041000
  42. * FOLLOWING GENERAL CONDITIONS APPLY: 00042000
  43. * 00043000
  44. * SVC 202: REGISTER 1 POINTS TO A PLIST, THE FIRST EIGHT BYTES 00044000
  45. * OF WHICH CONTAIN THE NAME OF THE ROUTINE BEING CALLED. 00045000
  46. * 00046000
  47. * SVC 203: THE SVC CALL IS FOLLOWED INLINE BY A HALFWORD CODE, 00047000
  48. * WHOSE VALUE INDICATES THE ROUTINE BEING CALLED. 00048000
  49. * 00049000
  50. * OS MACRO SIMULATION SVC'S: EACH OS MACRO WILL SET UP THE 00050000
  51. * REGISTERS PROPERLY. 00051000
  52. * 00052000
  53. * EXIT CONDITIONS - 00053000
  54. * 00054000
  55. * NORMAL - 00055000
  56. * 00056000
  57. * SVC 202: REGISTERS ARE UNCHANGED, EXCEPT FOR REGISTER 15, 00057000
  58. * WHICH IS SET TO ZERO. 00058000
  59. * 00059000
  60. * SVC 203: REGISTERS ARE UNCHANGED (UNLESS 'R01' FLAG IS SET 00060000
  61. * FOR THIS CODE IN DMSFNC TABLE), EXCEPT FOR REGISTER 15, 00061000
  62. * WHICH IS SET TO ZERO. 00062000
  63. * 00063000
  64. * OS MACRO SIMULATION SVC'S: REGISTERS ARE UNCHANGED. HOWEVER, 00064000
  65. * THE OS MACRO SIMULATION ROUTINE MAY MODIFY DMSITS'S SYSTEM 00065000
  66. * SAVE AREA, SO THAT DIFFERENT VALUES WILL BE RETURN TO THE 00066000
  67. * CALLER. 00067000
  68. * 00068000
  69. * ERROR - 00069000
  70. * 00070000
  71. * SVC 202: THE 'CALLEE' INDICATES, BY MEANS OF A NON-ZERO 00071000
  72. * CODE IN REGISTER 15, THAT AN ERROR RETURN. THE 'CALLER' 00072000
  73. * INDICATES, BY MEANS OF 'DC AL4(ADDRESS)' FOLLOWING THE 00073000
  74. * SVC CALL INLINE, THAT HE WISHES TO CONTINUE PROCESSING WHEN 00074000
  75. * SUCH AN ERROR RETURN IS MADE. IN THIS CASE, CONTROL IS 00075000
  76. * PASSED TO THE SPECIFIED "ADDRESS", WITH THE ERROR CODE IN 00076000
  77. * REGISTER 15. 00077000
  78. * 00078000
  79. * SVC 203: THE 'CALLEE' INDICATES, BY MEANS OF A NON-ZERO 00079000
  80. * CODE IN REGISTER 15, THAT AN ERROR RETURN IS BEING MADE. 00080000
  81. * THE 'CALLER' INDICATES, BY MEANS OF A NEGATIVE HALFWORD CODE, 00081000
  82. * THAT HE WISHES TO CONTINUE PROCESSING WHEN SUCH AN ERROR 00082000
  83. * RETURN IS MADE. IN THIS CASE, CONTROL IS PASSED TO THE 00083000
  84. * INSTRUCTION FOLLOWING THE HALFWORD CODE, WITH THE ERROR 00084000
  85. * RETURN IN REGISTER 15. 00085000
  86. * 00086000
  87. * NOTE: IN THE CASE OF SVC 202 OR 203, IF AN ERROR RETURN IS 00087000
  88. * MADE BY THE CALLEE, AND THE CALLER HAS NOT INDICATED THAT 00088000
  89. * HE WISHES TO CONTINUE PROCESSING WHEN AN ERROR OCCURS, 00089000
  90. * THEN AN ERROR MESSAGE IS TYPED, AND CMS ABENDS. 00090000
  91. * 00091000
  92. * OS MACRO SIMULATION SVC'S: DMSITS DOES NOT RECOGNIZE ANY 00092000
  93. * ERROR RETURNS IN THE CASE OF THESE SVC'S. HOWEVER, THE 00093000
  94. * MACRO SIMULATION ROUTINE MAY, ITSELF, ABEND, IF NECESSARY. 00094000
  95. * 00095000
  96. * CALLS TO OTHER ROUTINES - 00096000
  97. * 00097000
  98. * DMSMOD -- TO 'LOADMOD' A COMMAND, IF NECESSARY. 00098000
  99. * 00099000
  100. * DMSERR (CALLED BY 'DMSERR' MACRO) -- TO TYPE OUT ERROR 00100000
  101. * MESSAGES 00101000
  102. * 00102000
  103. * DMSFREB (CALLED BY 'DMSFREE' AND 'DMSFRET' MACROS) -- TO 00103000
  104. * ALLOCATE AND RELEASE SAVE AREAS. 00104000
  105. * 00105000
  106. * DMSABNGO -- TO ABEND, WHEN PROCESSING CANNOT CONTINUE. 00106000
  107. * 00107000
  108. * SVC 'CALLEE' ROUTINES: MANY, MANY NUCLEUS ROUTINES AND 00108000
  109. * COMMANDS CAN BE CALLED BY DMSITS, DEPENDING UPON THE TYPE 00109000
  110. * OF SVC CALL. 00110000
  111. * 00111000
  112. * EXTERNAL REFERENCES - 00112000
  113. * 00113000
  114. * DMSINA (ABBREV) -- ABBREVIATION TABLE. 00114000
  115. * 00115000
  116. * DMSFNC -- TABLE OF NUCLEUS-RESIDENT ROUTINES WHICH MAY BE 00116000
  117. * CALLED BY SVC 202. 00117000
  118. * 00118000
  119. * DMSFNC3 -- TABLE OF LEGAL CODES WHICH CAN BE USED IN 00119000
  120. * CONJUNCTION WITH SVC 203. 00120000
  121. * 00121000
  122. * TRANSAR -- ADDRESS OF TRANSIENT AREA, TO WHICH CONTROL IS 00122000
  123. * PASSED, WHEN A TRANSIENT AREA COMMAND IS INVOKED. 00123000
  124. * 00124000
  125. * DMSSVT -- ROUTINE TO DETERMINE WHICH, IF ANY, 00125000
  126. * OS SVC SIMULATION IS TO BE PROCESSED. THIS ROUTINE 00126000
  127. * MAY BE EITHER IN THE CMSSEG DCSS OR IN THE USER'S 00127000
  128. * PROGRAM AREA AS CLOSE TO THE LOADER TABLES AS 00128000
  129. * POSSIBLE. 00129000
  130. * 00130000
  131. * DMSABW -- DMSABN WORKSPACE -- PSW AND REGISTERS ARE SET UP 00131000
  132. * BEFORE CONTROL IS PASSED TO DMSABNGO. 00132000
  133. * 00133000
  134. * TABLES / WORKAREAS - 00134000
  135. * 00135000
  136. * SVCSECT 00136000
  137. * 00137000
  138. * SYSTEM AND USER SAVE AREAS (SSAVE AND USAVE) 00138000
  139. * 00139000
  140. * ALSO, SEE UNDER 'EXTERNAL REFERENCES'. 00140000
  141. * 00141000
  142. * REGISTER USAGE - 00142000
  143. * 00143000
  144. * R2: POINTER TO PLIST FOR SVC 202 (COPIED FROM R1) 00144000
  145. * R3: INTERNAL SUBROUTINE RETURN REGISTER 00145000
  146. * R4: POINTER TO SYSTEM SAVE AREA 00146000
  147. * R5: FIRST BASE REGISTER 00147000
  148. * R6: SECOND BASE REGISTER 00148000
  149. * R7: POINTER TO FVSECT 00149000
  150. * R8: SCRATCH REGISTER 00150000
  151. * R12: POINTER TO SVCSECT 00151000
  152. * 00152000
  153. * NOTES - 00153000
  154. * 00154000
  155. * NONE 00155000
  156. * 00156000
  157. * OPERATION - 00157000
  158. * 00158000
  159. * DMSITS -- WHEN CONTROL COMES HERE BY 'BALR' LINKAGE, THEN 00159000
  160. * THE DOUBLE WORD RESERVED FOR THE SVC OLD PSW IS SET UP IN LOW 00160000
  161. * CORE AS IF SVC 202 LINKAGE HAD OCCURRED, AND CONTROL DROPS 00161000
  162. * THROUGH TO DMSITS1. 00162000
  163. * 00163000
  164. * DMSITS1 -- A SAVE AREA IS ALLOCATED, THE OLDPSW IS SAVED, 00164000
  165. * AND ALL REGISTERS ARE SAVED. THE EXACT SVC TYPE IS 00165000
  166. * DETERMINED, AND THE NAME OF THE APPROPRIATE NUCLEUS OR 00166000
  167. * OR DISK-RESIDENT ROUTINE IS DETERMINED. (THE EXACT 00167000
  168. * METHOD FOR DOING THIS IS DESCRIBED IN 'SVC HANDLING' SECTION 00168000
  169. * OF THE CMS PROGRAM LOGIC MANUAL.) 00169000
  170. * 00170000
  171. * CONTROL IS PASSED TO THE 'CALLEE' ROUTINE. 00171000
  172. * 00172000
  173. * WHEN CONTROL RETURNS FROM THE APPROPRIATE 'CALLEE' ROUTINE, 00173000
  174. * THEN REGISTERS ARE RESTORED TO THEIR VALUES WHEN THE ORIGINAL 00174000
  175. * CALL WAS MADE (EXCEPT FOR REG 15 IN THE CASE OF CMS SVC 00175000
  176. * CALLS). 00176000
  177. * 00177000
  178. * MODIFICATIONS TO THE ABOVE PROCEDURE MAY OCCUR. 00178000
  179. * HERE ARE SOME OF THE WAYS THAT THAT CAN HAPPEN: 00179000
  180. * 00180000
  181. * IF A CALLEE FOR A CMS SVC GIVES AN ERROR RETURN, THE USER 00181000
  182. * MUST BE EXPECTING ONE. IF HE IS NOT, THEN DMSITS CALLS 00182000
  183. * DMSABN TO ABEND. 00183000
  184. * 00184000
  185. * IF SVCTRACE IS IN EFFECT, THEN DMSITS WILL CALL THE TRACE 00185000
  186. * ROUTINE. 00186000
  187. * 00187000
  188. * 00188000
  189. * DMSITSR -- RE-INITIALIZES THE SVC HANDLER WHEN ABEND RECOVERY 00189000
  190. * OCCURS. THIS ROUTINE FREES ALL SAVE AREAS, AND INITIALIZES 00190000
  191. * ALL POINTERS TO ZERO. 00191000
  192. * 00192000
  193. * DMSITSK -- THIS ROUTINE PERFORMS PROCESSING SPECIFIED BY THE 00193000
  194. * 'DMSKEY' MACRO. IF 'NUCLEUS' IS SPECIFIED, THEN A KEY OF 00194000
  195. * 0 IS INSERTED INTO THE OLDPSW. IF 'USER' IS SPECIFIED, THEN 00195000
  196. * THEN A KEY OF X'E' IS INSERTED INTO THE OLDPSW. 00196000
  197. * 00197000
  198. * THERE IS A KEY STACK ASSOCIATED WITH EACH SYSTEM SAVE AREA, 00198000
  199. * AND WHEN 'USER' OR 'NUCLEUS' ARE SPECIFIED, THEN THE OLD KEY 00199000
  200. * IS SAVED IN THE KEY STACK. HOWEVER, THIS PROCESSING CAN 00200000
  201. * BE AVOIDED BY SPECIFYING 'NOSTACK'. WHEN 'RESET' IS 00201000
  202. * SPECIFIED, THEN THE TOP KEY FROM THE KEY STACK IS RE-INSERTED 00202000
  203. * INTO THE OLDPSW. 00203000
  204. * 00204000
  205. * DMSITSXS -- PROCESSING ASSOCIATED WITH THE 'DMSEXS' MACRO. 00205000
  206. * THE SPECIFIED INSTRUCTION IS EXECUTED WITH A ZERO PROTECTION 00206000
  207. * KEY. 00207000
  208. *. 00208000
  209. EJECT 00209000
  210. DMSITS CSECT P3071 00210000
  211. REGEQU 00211000
  212. SPACE 5 00212000
  213. PR EQU R2 SVC 202 PLIST POINTER (COPIED *00213000
  214. FROM R1) 00214000
  215. RR EQU R3 INTERNAL SUBR RETURN REGISTER 00215000
  216. SR EQU R4 INTSVC SAVE AREA POINTER 00216000
  217. BR EQU R5 INTERNAL BASE REGISTER 00217000
  218. BR2 EQU R6 SECOND BASE REGISTER 00218000
  219. FVR EQU R7 POINTER TO FVSECT 00219000
  220. XR EQU R8 SCRATCH REGISTER 00220000
  221. SVCR EQU R12 MUST EQUAL R12; -> SVCSECT 00221000
  222. SPACE 5 00222000
  223. USING SVCSECT,SVCR 00223000
  224. USING DMSITS,BR,BR2 BASE REGISTERS 00224000
  225. USING NUCON,R0 00225000
  226. USE SSAVE,SR 00226000
  227. USING FVSECT,FVR 00227000
  228. * THE FOLLOWING NAME CHANGES WERE MADE IN GOING FROM CMS-67 TO 00228000
  229. * CMS-370. 00229000
  230. SPACE 00230000
  231. * OLD NAME NEW NAME 00231000
  232. * -------------- --------------- 00232000
  233. * INTSVC DMSITS 00233000
  234. * SVCINT DMSITS1 00234000
  235. * OSRET DMSITSOR 00235000
  236. * CMSRET DMSITSCR 00236000
  237. SPACE 5 00237000
  238. ENTRY DMSITS,DMSITS1,DMSITSOR,DMSITSCR 00238000
  239. ENTRY INTSVC,SVCINT,OSRET,CMSRET ***** REMOVE ****** 00239000
  240. ENTRY DMSITSK DMSKEY ENTRY 00240000
  241. ENTRY DMSITSXS DMSEXS ENTRY 00241000
  242. ENTRY DMSITSR DMSITS RE-INITIALIZATION ROUTINE 00242000
  243. * 'INTSVC' ENTERS HERE 00243000
  244. INTSVC EQU * 00244000
  245. ST R15,SVCOPSW+4 CONSTRUCT 2ND HALF OF "VIRTUAL" *00245000
  246. OLD PSW 00246000
  247. BALR R15,0 ESTABLISH ADDRESSABILITY 00247000
  248. USING *,R15 00248000
  249. MVC SVCOPSW(4),=AL1(0,MCKM,0,202) SET MACHINE CHECK BIT, AND*00249000
  250. X'CA' = 202 INTERRUPT CODE 00250000
  251. DROP R15 00251000
  252. EJECT 00252000
  253. * THE SVC NEW PSW CONTAINS THE ADDRESS OF SVCINT. 00253000
  254. DMSITS1 EQU * 00254000
  255. SVCINT EQU * 00255000
  256. STM R11,R13,RET SAVE REGS IN LOW CORE 00256000
  257. BALR R13,0 ESTABLISH ADDRESSABILITY 00257000
  258. USING *,R13 00258000
  259. SPACE 00259000
  260. * THE FOLLOWING CODE IMPLEMENTS A BIT OF A KLUDGE. THERE ARE TIMES 00260000
  261. * WHEN THIS ROUTINE (DMSITS) MUST OBTAIN A ZERO SYSTEM MASK AND A ZERO 00261000
  262. * PROTECT KEY IN THE PSW. (IT WILL NEED THIS WHEN A RETURN IS MADE 00262000
  263. * FROM THE ROUTINE CALLED BY INTSVC.) THE EASIEST WAY TO DO THIS IS 00263000
  264. * TO DO AN SVC. THUS, THE FOLLOWING CODE CHECKS TO SEE IF THE SVC WAS 00264000
  265. * ISSUED FROM THIS ROUTINE. IF IT WAS, THEN WE SIMPLY FIX UP THE SVC 00265000
  266. * NEW PSW THE WAY WE WANT IT, AND RETURN TO THE POINT WHERE THE SVC 00266000
  267. * WAS ISSUED. 00267000
  268. CLI SVCOPSW+3,201 IS IT SVC 201? 00268000
  269. BNE SVC2 DOESN'T COUNT IF NOT 00269000
  270. CLC SVCOPSW+5(3),=AL3(DMSITS) CALLED BEFOR DMSITS? @VA13996 00270000
  271. BL SVC2 GO IF SO -- CAN'T BE FROM DMSITS 00271000
  272. CLC SVCOPSW+5(3),=AL3(ENDITS) CALLED AFTER DMSITS? @VA13996 00272000
  273. BH SVC2 GO IF SO -- CAN'T BE FROM DMSITS 00273000
  274. SPACE 00274000
  275. * OTHERWISE, THE SVC WAS ISSUED IN DMSITS. 00275000
  276. L R11,SVCOPSW+4 GET RETURN ADDRESS 00276000
  277. BR R11 AND RETURN TO CALLER 00277000
  278. SPACE 3 00278000
  279. * OTHERWISE, THIS IS A GENUINE SVC CALL. 00279000
  280. SVC2 EQU * 00280000
  281. L SVCR,ASVCSECT POINT TO SVCSECT 00281000
  282. USING SVCSECT,SVCR 00282000
  283. STM R0,R15,EGPRS-SSAVE+NRMSAV SAVE REGISTERS 00283000
  284. LM BR,BR2,=A(DMSITS,DMSITS+4096) SET BASE REGISTERS 00284000
  285. DROP R13 AND DROP TEMPORARY ONE. 00285000
  286. MVC EGPR11-SSAVE+NRMSAV(3*4),RET SAVE R11-R13 CORRECTLY 00286000
  287. LA SR,NRMSAV POINT TO DEFAULT SAVEAREA 00287000
  288. MVI TYPFLAG,TPFNS NO SAVE AREA ALLOCATED YET 00288000
  289. SPACE 00289000
  290. * MAINTAIN SVC COUNT 00290000
  291. L XR,SVCOUNT GET CURRENT COUNT 00291000
  292. LA XR,1(,XR) INCREMENT IT 00292000
  293. ST XR,SVCOUNT 00293000
  294. * THE FLAG ITSBIT IN UFDBUSY IS USED TO TEST FOR ILLEGAL RE-ENTRIES. 00297000
  295. * IT IS USED MAINLY FOR SYSTEM DEBUGGING. 00298000
  296. * DMSITS HAS TO MAKE SEVERAL CALLS TO OTHER ROUTINES (SUCH AS LOADMOD). 00299000
  297. * IF THESE ROUTINES THEMSELVES DO AN SVC, THEN DMSITS'S SAVE AREA 00300000
  298. * WILL BE CLOBBERED. SO WE TEST FOR THIS CONDITION, AND ABEND IF 00301000
  299. * IT HAPPENS. 00302000
  300. SPACE 00303000
  301. * THE UFDBUSY BYTE OF FVS IS ALSO USED TO PREVENT A 'KX' FROM OCCURRING 00304000
  302. * AT THE WRONG. AS LONG AS ANY BIT (SUCH AS ITSBIT) IS SET IN 00305000
  303. * UFDBUSY, THEN A 'KX' WILL SIMPLY BE LEFT IN A PENDING STATUS. 00306000
  304. L FVR,AFVS POINT TO FVSECT 00307000
  305. TM UFDBUSY,ITSBIT ARE WE RE-ENTERING DMSITS? 00308000
  306. BO ERREN YES -- BAD SYSTEM ERROR 00309000
  307. OI UFDBUSY,ITSBIT TURN ON BIT 00310000
  308. SPACE 00311000
  309. MVI SFLAG,0 INITIALIZE SFLAG 00312000
  310. SPACE 00313000
  311. * FOR THE TIME BEING, WE USE THE 'NRMSAV' AREA IN SVCSECT AS A 00314000
  312. * SUPER SAVE-AREA, CONTAINING ALL INFORMATION CONCERNING THIS SVC CALL. 00315000
  313. * LATER, WE WILL CALL DMSFREE TO ALLOCATE A SAVE AREA SPACE JUST FOR 00316000
  314. * THIS CALL, AND WE WILL COPY THE INFO FROM NRMSAV INTO THE NEW AREA. 00317000
  315. LR PR,R1 COPY PLIST PTR (SVC 202 ONLY) 00318000
  316. SPACE 00319000
  317. * INCREMENT NESTED SVC DEPTH COUNTER 00320000
  318. L XR,DEPTH GET LAST DEPTH 00321000
  319. LA XR,1(,XR) INCREMENT IT 00322000
  320. ST XR,DEPTH 00323000
  321. CH XR,=AL2(MAXDEEP) EXCEED SYSTEM MAX? 00324000
  322. BH ERDEEP ERROR IF SO 00325000
  323. SPACE 00326000
  324. ERDEEPRT EQU * RETURN HERE TO CONTINUE PROCESS 00327000
  325. CLI SVCOPSW+3,202 IS THIS SVC 202? 00328000
  326. BE SVC202 IF SO, GO HANDLE IT 00329000
  327. CLI SVCOPSW+3,203 IS THIS SVC 203 00330000
  328. BE SVC203 IF SO, GO HANDLE IT 00331000
  329. B OSSVC OTHERWISE, IT'S AN OS SVC CALL. 00332000
  330. SVC203 EQU * 00333000
  331. SPACE 00334000
  332. * IN THIS CASE, THE SVC IS FOLLOWED IN THE IN-LINE CODE BY A 00335000
  333. * HALFWORD CODE WHICH INDICATES THE EXACT NATURE OF THE REQUEST. 00336000
  334. L R15,SVCOPSW+4 GET ADDRESS OF HALFWORD CODE 00337000
  335. LH XR,0(,R15) GET HALFWORD CODE 00338000
  336. STH XR,NRMSAV+CODE-SSAVE AND SAVE IT IN SUPER SAVE AREA 00339000
  337. AH R15,=H'2' POINT TO TRUE RETURN ADDRESS 00340000
  338. ST R15,SVCOPSW+4 AND STORE IT IN SVC OLD PSW 00341000
  339. SPACE 00342000
  340. * THE HALFWORD CODE MAY BE EITHER POSITIVE OR NEGATIVE. A NEGATIVE 00343000
  341. * CODE SPECIFIES THE SAME ROUTINE AS A POSITIVE CODE, BUT THERE IS 00344000
  342. * THE FOLLOWING DIFFERENCE: IF THE CALLED ROUTINE GIVES AN ERROR 00345000
  343. * RETURN (NON-ZERO REGISTER 15), THEN A POSITIVE CODE WILL CAUSE 00346000
  344. * DMSITS TO ABEND, WHILE A NEGATIVE CODE WILL CAUSE DMSITS TO RETURN 00347000
  345. * TO THE POINT WHERE THE SVC WAS INVOKED. 00348000
  346. LTR XR,XR IS THE CODE NEGATIVE 00349000
  347. BP *+8 SKIP IF POSITIVE 00350000
  348. OI NRMSAV+TYPFLAG-SSAVE,TPFERT SET ERROR RETURN FLAG 00351000
  349. LPR R15,XR GET ABSOLUTE VALUE OF CODE 00352000
  350. SPACE 00353000
  351. * THE ROUTINE NAME IS DETERMINED BY THE SECOND BYTE OF THE HALFWORD 00354000
  352. * CODE. THIS LEAVES SEVEN BITS OF THE FIRST BYTE WHICH MAY BE USED 00355000
  353. * TO PASS INFORMATION TO THE SVC ROUTINE BY THE CALLER. 00356000
  354. N R15,=A(X'FF') GET ROUTINE CODE 00357000
  355. BZ NO203 ZERO CODE IS ILLEGAL 00358000
  356. L R14,=V(DMSFNC3) POINT TO SVC 203 FUNCTION TABLE 00359000
  357. C R15,0(,R14) DOES THIS EXCEED MAXIMUM CODE? 00360000
  358. BH NO203 ILLEGAL IF IT DOES 00361000
  359. SPACE 00362000
  360. * EACH ENTRY IN THE FUNCTION TABLE IS TWELVE BYTES LONG. THE 00363000
  361. * FIRST EIGHT BYTES CONTAIN THE ROUTINE NAME OR MACRO NAME ASSOCIATED 00364000
  362. * WITH THE SVC 203 CODE. THIS NAME CAN BE EITHER THE FILENAME OF A 00365000
  363. * TRANSIENT MODULE, OR IT CAN BE USED SIMPLY FOR DEBUGGING PURPOSES, 00366000
  364. * SUCH AS IN SVCTRACE. THE NINTH BYTE IS A FLAG BYTE, TO BE DESCRIBED. 00367000
  365. * AND THE LAST THREE BYTES CONTAIN THE ADDRESS OF THE ROUTINE BEING 00368000
  366. * CALLED, IF IT'S IN THE NUCLEUS. (IF THE ROUTINE IS TRANSIENT, THEN 00369000
  367. * THIS ADDRESS IS ZERO.) 00370000
  368. BCTR R15,0 COMPUTE LOCATION OF BLOCK 00371000
  369. MH R15,=H'12' 00372000
  370. LA XR,4(R14,R15) 00373000
  371. SPACE 00374000
  372. * XR NOW POINTS TO 12 BYTE CONTROL BLOCK DESCRIBED JUST ABOVE. 00375000
  373. CLC CODE,MIN3 IS THIS CMSSVT 203? @V305665 00376000
  374. BE OSSVC BRANCH IF YES @V305665 00377000
  375. SPACE 00378000
  376. * WE CHECK FLAG BYTE FOR TWO FLAGS. 00379000
  377. * IF R01 IS SET, THEN THE VALUES OF REG 0 AND 1 RETURNED BY THE CALLEE 00380000
  378. * SHOULD BE PASSED BACK TO THE CALLER. 00381000
  379. * IF NSF IS SET, THEN THE CALLEE IS NOT GOING TO DO ANY SVC'S, AND SO 00382000
  380. * THERE IS NO NEED TO ALLOCATE A NEW SAVE AREA. 00383000
  381. TM FLAGS(XR),R01 R01 FLAG SET? 00384000
  382. BZ *+8 SKIP IF NOT 00385000
  383. OI NRMSAV-SSAVE+TYPFLAG,TPFR01 SET NRMSAV FLAG VALUE 00386000
  384. SPACE 00387000
  385. TM FLAGS(XR),NSF NO SAVE AREA FLAG SET? 00388000
  386. BO *+8 SKIP IF SO 00389000
  387. NI TYPFLAG,X'FF'-TPFNS WE WANT A REAL SAVE AREA IF NOT 00390000
  388. SPACE 00391000
  389. BAL RR,GETSAVE GET SAVE AREA AND INITIALIZE 00392000
  390. SPACE 00393000
  391. MVC ERRET,OLDPSW+4 SET ERROR RETURN ADDRESS 00394000
  392. MVC NRMRET,OLDPSW+4 SET NORMAL RETURN ADDRESS 00395000
  393. MVC CALLEE,NAME(XR) COPY ROUTINE/MACRO NAME 00396000
  394. MVC CODE203,CODE PUT CODE INTO NUCON FOR CALLEE 00397000
  395. L R15,ADDR(,XR) GET ADDRESS OF CALLEE 00398000
  396. LA R15,0(,R15) CLEAR HIGH BYTE 00399000
  397. LTR R15,R15 IS IT IN THE NUCLEUS? 00400000
  398. BNZ NUC GO TO IT IF SO 00401000
  399. L R15,EGPR15 GET USER SUPPLIED R15 @VM03048 00402000
  400. LA R15,0(,R15) CLEAR HIGH BYTE @VM03048 00403000
  401. CLC CODE,MIN16 IS THIS SPECIAL SVC 203 ? @VM03048 00404000
  402. BE NUC GO TO IT IF SO @VM03048 00405000
  403. SPACE 00406000
  404. * IF IT IS NOT IN THE NUCLEUS, THEN WE USE THE ROUTINE NAME IN THE 00407000
  405. * CONTROL BLOCK AS A NAME, AND PROCEED AS IN SVC 202. WE NOW 00408000
  406. * PASS CONTROL TO THE SVC 203 ENTRY TO SVC 202 CODE. 00409000
  407. B S2EN 00410000
  408. SVC202 EQU * 00411000
  409. NI TYPFLAG,X'FF'-TPFNS WE ARE ABOUT TO GET A SAVEAREA 00412000
  410. L R1,SVCOPSW+4 GET SVC RETURN ADDRESS 00413000
  411. SPACE 00414000
  412. * IF THE SVC CALL IS FOLLOWED, IN LINE, BY A BYTE OF ZERO, THEN IT IS 00415000
  413. * ASSUMED THAT THIS IS THE FIRST BYTE OF A CONSTANT OF THE FORM 00416000
  414. * AL4(ADDRESS). THIS ADDRESS SPECIFIES WHERE CONTROL IS TO IF THERE 00417000
  415. * IS AN ERROR RETURN FROM THE CALLED SVC ROUTINE. IF THE BYTE 00418000
  416. * FOLLOWING IS NON-ZERO, THEN DMSITS WILL ABEND IF THERE IS AN ERROR 00419000
  417. * RETURN. 00420000
  418. * (AN ERROR RETURN IS INDICATED BY A NON-ZERO VALUE RETURNED IN REG 15 00421000
  419. * FROM THE CALLED ROUTINE.) 00422000
  420. ST R1,NRMRET-SSAVE+NRMSAV STORE NORMAL RETURN ADDRESS, *00423000
  421. ASSUMING NO AL4(ADDRESS). 00424000
  422. ST R1,ERRET ALSO STORE AS ERROR RETURN 00425000
  423. CLI 0(R1),0 IS THE BYTE FOLLOWING A ZERO? 00426000
  424. BNE S2A GO IF HE WANTS ABEND ON ERROR 00427000
  425. OI TYPFLAG-SSAVE+NRMSAV,TPFERT SET ERROR RETURN FLAG 00428000
  426. MVC ERRET-SSAVE+NRMSAV,0(R1) COP ERROR RETURN ADDRESS FROM *00429000
  427. THE AL4(ADDRESS) 00430000
  428. LA R1,4(,R1) SKIP OVER THE 4-BYTE CONSTANT 00431000
  429. ST R1,NRMRET-SSAVE+NRMSAV AND STORE AS NORMAL RETURN ADDR 00432000
  430. SPACE 00433000
  431. S2A EQU * 00434000
  432. SPACE 00435000
  433. * IN THE CASE OF SVC 202, REGISTER 1 (WHICH HAS BEEN COPIED INTO 00436000
  434. * REGISTER PR) POINTS TO A PLIST (PARAMETER LIST). THE FIRST EIGHT 00437000
  435. * BYTES OF THIS PLIST CONTAIN THE NAME OF THE ROUTINE BEING CALLED. 00438000
  436. * HOWEVER, IF THE FIRST BYTE OF THE ROUTINE NAME IS A DOT, THEN THE 00439000
  437. * ROUTINE IS AN SVCTRACE OVERRIDE ROUTINE. 00440000
  438. MVC CALLEE+NRMSAV-SSAVE,0(PR) COPY CALLEE NAME INTO SAVE 00441000
  439. SPACE 00442000
  440. BAL RR,GETSAVE ALLOCATE A SAVE AREA 00443000
  441. MVC CALLEE,CALLEE-SSAVE+NRMSAV COPY CALLEE NAME INTO AREA 00444000
  442. MVC NRMRET(8),NRMRET-SSAVE+NRMSAV COPY NRMRET AND ERRET 00445000
  443. SPACE 00446000
  444. * THE FOLLOWING IS THE ENTRY POINT TO SVC 202 CODE WHEN AN SVC 203 IS 00447000
  445. * MADE, REQUIRING AN SVC 202 LOOKUP. 00448000
  446. S2EN EQU * 00449000
  447. LM R0,R1,CALLEE GET NAME OF CALLEE 00450000
  448. BAL RR,CHKTRANS SEE IF IT'S IN TRANSIENT AREA 00451000
  449. BE TRANS GO IF IT IS 00452000
  450. BAL RR,SRCFNC SEARCH DMSFNC FUNCTION TABLE 00453000
  451. LTR R15,R15 ANY LUCK? 00454000
  452. BNZ NUC GO IF FOUND -- ADDR IN R15 00455000
  453. STM R0,R1,DUMCOM FORM 'LOADMOD' PLIST 00456000
  454. BAL RR,LODMODIT AND TRY TO LOADMOD THE ROUTINE 00457000
  455. BZ LMOK GO IF LOADMOD IS OK 00458000
  456. CH R15,=H'28' WAS 'FILE NOT FOUND'? P3065 00459000
  457. BNE BADMOD BAD MODULE IF NOT P3065 00460000
  458. L R15,=V(ABBREV) LOAD ADDR OF ABBREVIATION ROUT 00461000
  459. LTR R15,R15 IS THERE SUCH A ROUTINE? 00462000
  460. BZ GIVUP GIVE TRYING, IF THERE ISN'T 00463000
  461. LM R0,R1,CALLEE LOAD NAME OF ROUTINE 00464000
  462. BALR R14,R15 CALL ABBREVIATION ROUTINE 00465000
  463. LTR R15,R15 WAS AN UN-ABBREVIATION FOUND? 00466000
  464. BNZ GIVUP GIVE UP TRYING, IF NOT 00467000
  465. BAL RR,CHKTRANS SEE IF NEW NAME IS IN TRANSIENT *00468000
  466. AREA 00469000
  467. BE TRANS GO IF IT IS 00470000
  468. BAL RR,SRCFNC SEARCH DMSFNC FUNCTION TABLE FOR*00471000
  469. NEW NAME 00472000
  470. LTR R15,R15 WAS IT FOUND? 00473000
  471. BNZ NUC GO IF IT WAS -- ADDR IN REG 15 00474000
  472. STM R0,R1,DUMCOM STORE NAME IN LOADMOD PLIST 00475000
  473. BAL RR,LODMODIT GO LOADMOD IT 00476000
  474. BZ LMOK GO IF LOADMOD IS OK 00477000
  475. CH R15,=H'28' WAS 'FILE NOT FOUND'? P3065 00478000
  476. BNE BADMOD BAD MODULE IF NOT P3065 00479000
  477. SPACE 3 00480000
  478. * THE NAME PASSED IN THE PLIST CAN'T BE FOUND ANYWHERE. IN THIS CASE, 00481000
  479. * WE GIVE THE USER A RETURN CODE OF -3. 00482000
  480. GIVUP EQU * 00483000
  481. LA R15,RETM3 GO TO 'RETM3' P3065 00484000
  482. B NUC AS NUCLEUS ROUTINE P3065 00485000
  483. SPACE 1 00486000
  484. * COME HERE IF AN ERROR RETURN FROM 'LOADMOD' IS OTHER THAN 'FILE 00487000
  485. * NOT FOUND.' WE DISTINGUISH GETWEEN TWO CASES: 1. WE ARE IN 00488000
  486. * SUBSET MODE, AND THE MODULE GOES INTO THE USER AREA (LOADMOD 00489000
  487. * ERROR CODE 32) AND 2. THE LOAD MODULE IS BAD (OTHER LOADMOD 00490000
  488. * ERROR CODE). THE RETURN CODES WILL BE -2 AND -4, RESPECTIVELY, 00491000
  489. * FOR THESE CASES| AND THIS WILL BE USED BYY DMSINT TO DETERMINE 00492000
  490. * THE ERROR MESSAGE OR FURTHER ACTION TO BE TAKEN. 00493000
  491. * 00494000
  492. * ALSO: FOR ERROR CODE 40 FROM DMSMOD (DOS/OS "MISMATCH"), 00495000
  493. * GIVE A RETURN CODE OF MINUS 5. 00496000
  494. * 00497000
  495. BADMOD EQU * P3065 00498000
  496. LR XR,R15 SAVE LOADMOD RETURN CODE P3065 00499000
  497. LA R15,RETM5 SET FOR -5 = DOS/OS MISMATCH @V305032 00500000
  498. CH XR,=H'40' ERROR CODE = 40 ? @V305032 00501000
  499. BE NUC YES (HANDLE AS NUCLEUS CALL). @V305032 00502000
  500. LA R15,RETM2 SET FOR -2 = SUBSET ERROR @V305032 00503000
  501. CH XR,=H'32' ERROR CODE = 32 ? @V305032 00504000
  502. BE NUC YES (HANDLE AS NUCLEUS CALL). @V305032 00505000
  503. LA R15,RETM4 SET -4 FOR OTHER LOADMOD ERRORS @V305032 00506000
  504. B NUC AND HANDLE AS NUCLEUS CALL. @V305032 00507000
  505. EJECT 00508000
  506. * THE LOADMOD WAS SUCCESSFUL. GO START UP. 00509000
  507. LMOK EQU * 00510000
  508. LM R0,R1,DUMCOM LOAD NAME OF LOADMODED ROUTINE 00511000
  509. BAL RR,CHKTRANS IS IT IN THE TRANSIENT AREA? 00512000
  510. BE TRANS GO HANDLE IT THERE 00513000
  511. SPACE 00514000
  512. * OTHERWISE, THE PROGRAM IS IN THE USER PROGRAM AREA, BEGINNING AT 00515000
  513. * X'20000'. 00516000
  514. USER EQU * 00517000
  515. OI TYPFLAG,TPFUSR SET 'USER ROUTINE' FLAG 00518000
  516. TM PROTFLAG,PRFUSYS USER PROGRAM IS SYSTEM? 00519000
  517. BZ *+8 SKIP IF IT IS NOT 00520000
  518. OI SFLAG,SFSYS SET SYSTEM FLAG 00521000
  519. L R15,STRTADDR LOAD R15 WITH STARTING ADDRESS 00522000
  520. B START AND GO TO START UP 00523000
  521. SPACE 2 00524000
  522. * THE ROUTINE IS IN THE TRANSIENT AREA. 00525000
  523. TRANS EQU * 00526000
  524. OI TYPFLAG,TPFUSR SET 'USER ROUTINE' FLAG FOR *00527000
  525. TRANSIENT AREA ROUTINE 00528000
  526. OI SFLAG,SFTRN SET TRANSIENT FLAG 00529000
  527. TM PROTFLAG,PRFTSYS IS SYSTEM FLAG SET? 00530000
  528. BZ *+8 SKIP IF NOT 00531000
  529. OI SFLAG,SFSYS SET SYSTEM FLAG 00532000
  530. L R15,=V(TRANSAR) LOAD ADDRESS OF TRANSIEMT AREA 00533000
  531. B START AND GO TO START UP 00534000
  532. * COME HERE IF THE ROUTINE IS IN THE NUCLEUS. 00535000
  533. NUC EQU * 00536000
  534. OI SFLAG,SFSYS+SFNUC SET SYSTEM AND NUCLEUS FLAGS 00537000
  535. SPACE 3 00538000
  536. * COME HERE TO START UP THE SVC ROUTINE. THE ROUTINE IS IN CORE SOME- 00539000
  537. * WHERE, WHETHER IN THE NUCLEUS, THE TRANSIENT AREA, OR THE USER AREA. 00540000
  538. * REGISTER 15 CONTAINS THE ADDRESS TO WHICH WE'RE SUPPOSED TO TRANSFER 00541000
  539. * CONTROL. ALL WE HAVE TO DO IS CONSTRUCT A PSW AND LOAD IT. 00542000
  540. START EQU * 00543000
  541. L R13,USAVEPTR 00544000
  542. USING USAVE,R13 ADDRESS SAVE AREA @VA06029 00545000
  543. XC USAVE(USAVESZ*8),USAVE CLEAR THE SAVE AREA @VA06029 00546000
  544. DROP R13 FREE THE REGISTER @VA06029 00547000
  545. ST R15,RET+4 USE LOWCORE AREA FOR CONSTRUCTON 00548000
  546. MVC RET(2),=AL1(ON,0) SET SYSTEM MASK ON 00549000
  547. TM SFLAG,SFTRN+SFNUC TRANSIENT OR NUCLEUS ROUTINE? 00550000
  548. BZ *+8 SKIP IF NOT 00551000
  549. MVI RET,OFF TURN OFF SYSTEM MASK 00552000
  550. TM SFLAG,SFSYS SYSTEM FLAG ON? 00553000
  551. BO *+8 SKIP IF YES 00554000
  552. OI RET+1,USERKEY PROTECT NUCLEUS STORAGE IF NOT 00555000
  553. TM PROTFLAG,PRFPOFF STORAGE PROTECTION ON? 00556000
  554. BZ *+8 SKIP IF SO 00557000
  555. NI RET+1,X'0F' RESTORE NUCLEUS KEY 00558000
  556. TM OVSTAT,OVSON SVCTRACE IN EFFECT? 00559000
  557. BZ *+12 SKIP IF NOT 00560000
  558. LR XR,R15 SAVE R15 TEMPORARILY 00561000
  559. BAL RR,BOVR CALL OVERRIDE ROUTINE 00562000
  560. LR R15,XR RESTORE REG 15 00563000
  561. LM R0,R1,EGPRS RESTORE CALLER'S R0 AND R1 00564000
  562. LM R9,R10,CALLEE A SCREWY REQUIREMENT OF SOME *00565000
  563. ROUTINES 00566000
  564. LR R12,R15 EXTRA BASE REG FOR ROUTINES 00567000
  565. LA R14,CMSRET RETURN ADDRESS PASSED TO CALLER 00568000
  566. ST R14,ITS14 PASS IN REGISTER 14 00569000
  567. ST R15,ITS15 WHAT TO PASS IN REG 15 00570000
  568. LA R14,LPSW POINT TO LPSW ROUTINE 00571000
  569. BR R14 GO TO IT 00572000
  570. * CONTROL COMES HERE TO GIVE ONE OF THE SPECIAL DMSITS RETURN 00573000
  571. * CODES, -2, -3 OR -4. 00574000
  572. RETM2 EQU * P3065 00575000
  573. OI MISFLAGS,NEGITS SET FLAG FOR INT @VA02241 00576000
  574. LH R15,=H'-2' LOAD RETURN CODE -2 P3065 00577000
  575. B CMSRET AND RETURN IT P3065 00578000
  576. SPACE 1 00579000
  577. RETM3 EQU * P3065 00580000
  578. OI MISFLAGS,NEGITS SET FLAG FOR INT @VA02241 00581000
  579. LH R15,=H'-3' LOAD RETURN CODE -3 P3065 00582000
  580. B CMSRET AND RETURN IT P3065 00583000
  581. SPACE 1 00584000
  582. RETM4 EQU * P3065 00585000
  583. OI MISFLAGS,NEGITS SET FLAG FOR INT @VA02241 00586000
  584. LH R15,=H'-4' LOAD RETURN CODE -4 P3065 00587000
  585. B CMSRET AND RETURN IT P3065 00588000
  586. SPACE 00589000
  587. RETM5 EQU * @V305032 00590000
  588. OI MISFLAGS,NEGITS SET FLAG FOR INT @V305032 00591000
  589. LH R15,=H'-5' LOAD RETURN CODE OF -5, @V305032 00592000
  590. B CMSRET AND GO RETURN IT. @V305032 00593000
  591. * CHECK TO SEE IF SPECIFIED NAME IS CURRENTLY LOADED INTO THE TRANSIENT 00594000
  592. * AREA. 00595000
  593. CHKTRANS EQU * 00596000
  594. CL R0,LASTTMOD FIRST FOUR BYTES MATCH? 00597000
  595. BCR 7,RR (BNE 0(RR)) ERROR RETURN IF NOT 00598000
  596. CL R1,LASTTMOD+4 SECOND FOUR BYTES MATCH? 00599000
  597. BR RR RETURN WITH COND CODE SET 00600000
  598. EJECT 00601000
  599. * SEARCH DMSFNC FUNCTION TABLE FOR NAME IN R0-R1 00602000
  600. SRCFNC EQU * 00603000
  601. LR R14,R0 COPY NAME 00604000
  602. SRL R14,24 GET FIRST LETTER OF COMMAND 00605000
  603. SH R14,=AL2(C'A') SUBTRACT LETTER A 00606000
  604. BM SFER ERROR IF RESULT IS NEGATIVE 00607000
  605. CH R14,=AL2(C'Z'-C'A') WAS IT GREATER THAN Z? 00608000
  606. BH SFER ERROR IF IT WAS 00609000
  607. AR R14,R14 MULTIPLY BY 2 00610000
  608. L R15,=V(DMSFNC) POINT TO LETTER DISPLACEMENT TAB 00611000
  609. LH XR,0(R14,R15) GET DISPLACEMENT OF FIRST TABLE *00612000
  610. ENTRY FOR THIS LETTER 00613000
  611. AR XR,R15 XR -> FIRST TABLE ENTRY 00614000
  612. AH R15,2(R14,R15) R15 -> FIRST ENTRY FOR NEXT LET 00615000
  613. LA R14,12 LENGTH OF TABLE ENTRY 00616000
  614. SPACE 00617000
  615. SFLOOP EQU * 00618000
  616. CL R0,NAME(,XR) DO FIRST FOUR BYTES MATCH? 00619000
  617. BNE SFBXLE THIS ISN'T IT IF NOT 00620000
  618. CL R1,NAME+4(,XR) DO SECOND FOUR BYTES MATCH? 00621000
  619. BE SFFND NAME FOUND IN THE TABLE 00622000
  620. SPACE 00623000
  621. SFBXLE EQU * 00624000
  622. SPACE 00625000
  623. * HERE'S WHAT THE FOLLOWING BXLE DOES (IN CASE YOU DON'T REMEMBER): 00626000
  624. SPACE 00627000
  625. * XR <- C(XR) + C(R14) = ADDRESS OF NEXT TABLE ENTRY 00628000
  626. * IF C(XR) <= C(R15) -- I.E., IF WE HAVE NOT YET REACHED THE 00629000
  627. * LAST ENTRY FOR THIS LETTER -- THEN GO TO LOOP BACK AGAIN 00630000
  628. BXLE XR,R14,SFLOOP 00631000
  629. SPACE 00632000
  630. * COME HERE WHEN SEARCH HAS FAILED. 00633000
  631. SFER EQU * 00634000
  632. SR R15,R15 WE HAVE NO ADDRESS TO PASS BACK 00635000
  633. BR RR RETURN TO CALLER 00636000
  634. SPACE 00637000
  635. * COME HERE IF THE NAME WAS FOUND. 00638000
  636. SFFND EQU * 00639000
  637. L R15,ADDR(,XR) GET BRANNCH ADDRESS 00640000
  638. BR RR RETURN TO CALLER WITH ADDR IN *00641000
  639. REGISTER 15 00642000
  640. EJECT 00643000
  641. * ALLOCATE A SAVE AREA FOR THE CALLED ROUTINE'S REGISTERS 00644000
  642. GETSAVE EQU * 00645000
  643. SR R1,R1 CLEAR REGISTER 1 @VA04752 00646000
  644. LA SR,NRMSAV POINT TO DEFAULT SAVE AREA 00647000
  645. TM TYPFLAG,TPFNS SAVE AREA ALLOCATION WANTED? 00648000
  646. BO GETSAVEN GO IF NOT -- USE NRMSAV 00649000
  647. L SR,CURRALOC GET ADDRESS OF PREV SAVE AREA 00650000
  648. LTR SR,SR WAS THERE ANY? 00651000
  649. BZ GETSAVEF SKIP TO ALLOCATE IF NOT 00652000
  650. L SR,SSAVENXT POINT TO NEXT ONE 00653000
  651. LTR SR,SR IS THERE A NEXT ONE ALREADY *00654000
  652. ALLOCATED? 00655000
  653. BNZ GETSAVEG GOT ONE IF SO 00656000
  654. SPACE 00657000
  655. * ALLOCATE A NEW SYSTEM SAVE AREA AND NEW USER SAVE AREA. 00658000
  656. GETSAVEF EQU * 00659000
  657. DMSFREE DWORDS=SSAVESZ,TYPCALL=BALR,TYPE=NUCLEUS, *00660000
  658. ERR=FREEER 00661000
  659. L SR,CURRALOC GET PREVIOUS SAVE AREA 00662000
  660. LTR SR,SR IS THERE ANY? 00663000
  661. BZ *+8 SKIP IF NOT 00664000
  662. ST R1,SSAVENXT STORE NEXT POINTER 00665000
  663. ST SR,SSAVEPRV-SSAVE(,R1) SET PREVIOUS PTR OF NEW CURRENT 00666000
  664. LR SR,R1 POINT TO NEW SYSTEM SAVE AREA 00667000
  665. SR R15,R15 ZERO A REGISTER @VA04752 00668000
  666. ST R15,SSAVENXT AND ZERO NEXT POINTER @VA04752 00669000
  667. ST R15,USAVEPTR AND SAVE AREA POINTER @VA04752 00670000
  668. ST SR,LASTALOC SET LAST ALLOCATION PTR 00671000
  669. SPACE 00672000
  670. * COME HERE WHEN SAVE AREAS ARE ALLOCATED. 00673000
  671. GETSAVEG EQU * 00674000
  672. SPACE 00675000
  673. * COPY SEVERAL FIELDS FROM NRMSAV 00676000
  674. MVC SSAVE(4),NRMSAV COPY FIRST FOUR BYTES 00677000
  675. MVC EGPRS(4*16),EGPRS-SSAVE+NRMSAV COPY ENTRY GPRS 00678000
  676. ST SR,CURRALOC SET CURRENT ALLOCATION PTR 00679000
  677. B GETSAVEC GO TO COMMON CODE 00680000
  678. SPACE 00681000
  679. * COME HERE IF SR -> NRMSAV, AND THIS IS TO BE THE SAVE AREA PASSED 00682000
  680. * TO THE CALLED ROUTINE. (THIS WILL HAPPEN WITH OVERRIDE ROUTINES, AND 00683000
  681. * WITH CERTAIN ROUTINES FOR SVC 203.) 00684000
  682. GETSAVEN EQU * 00685000
  683. LA R15,NRMUSAV NRMUSAV IS USER SAVE AREA 00686000
  684. ST R15,USAVEPTR 00687000
  685. MVC SSAVEPRV,CURRSAVE SET PREVIOUS SAVE AREA POINTER 00688000
  686. SPACE 00689000
  687. * COMMON SAVE AREA HANDLING CODE 00690000
  688. GETSAVEC EQU * 00691000
  689. MVC CHKWRD1,=C'ABCD' SET FIRST CHECK WORD 00692000
  690. MVC CHKWRD2,=C'EFGH' SET THE SECOND 00693000
  691. MVI KEYP,0 INITIALIZE KEY STACK 00694000
  692. ST SR,CURRSAVE SAVE ADDRESS OF CURRENT SAVEAREA 00695000
  693. STDM F0,F6,EFPRS SAVE FLOATING POINT REGISTERS 00696000
  694. LTR R1,R1 WAS A SAVE AREA GOTTEN? @VA04752 00697000
  695. BZ MOVPSW BRANCH IF NOT @VA04752 00698000
  696. DMSFREE DWORDS=USAVESZ,TYPCALL=BALR,TYPE=USER, *00699000
  697. ERR=FREEER ALLOCATE A USER SAVE AREA @VA04752 00700000
  698. ST R1,USAVEPTR STORE SAVE AREA POINTER @VA04752 00701000
  699. MOVPSW EQU * @VA04752 00702000
  700. MVC OLDPSW,SVCOPSW COPY SVC OLD PSW INTO AREA 00703000
  701. L R15,SVCOPSW+4 ADDRESS IN SVC OLD PSW 00704000
  702. LA R15,0(,R15) CLEAR HIGH BYTE OF R15 00705000
  703. TM SVCOPSW+4,X'80' EXECUTE (4-BYTE) INSTRCTN? @VM01537 00706000
  704. BZ DECK2 NO, 2-BYTE SVC, BACK UP 2 @VM01537 00707000
  705. BCTR R15,0 YES, DECREMENT ADDITIONAL @VM01537 00708000
  706. BCTR R15,0 TWO BYTES @VM01537 00709000
  707. DECK2 EQU * @VM01537 00710000
  708. BCTR R15,0 DECREMENT BY TWO TO 00711000
  709. BCTR R15,0 COMPUTE CALLER'S ADDRESS 00712000
  710. ST R15,CALLER AND STORE IN SAVE AREA 00713000
  711. BR RR 00714000
  712. EJECT 00715000
  713. * LODMODIT SUBROUTINE. R1 POINTS TO A LOADMOD SUBROUTINE. 00716000
  714. LODMODIT EQU * 00717000
  715. LA R1,MODLIST POINT TO LOADMOD "P-LIST" @V305032 00718000
  716. * (WILL PUT IN HIGH-ORDER BYTE OF CALLER'S R1 SHORTLY) 00719000
  717. SPACE 00720000
  718. * WE GRAB A SAVE AREA IN SVCSECT, BECAUSE LOADMOD WILL DESTROY ALL 00721000
  719. * OUR REGISTERS. 00722000
  720. STM R0,R14,SVCSAVE 00723000
  721. ICM R1,8,SVCSAVE+8 INSERT HIGH BYTE OF CALLER'S R1 @V305032 00724000
  722. * (STILL AVAILABLE IN R2 & NOW IN SVCSAVE+8) 00725000
  723. L R15,=V(DMSMOD) ADDRESS OF LOADMOD ROUTINE 00726000
  724. SPACE 00727000
  725. * AND IF THAT WEREN'T ENOUGH, WE MUST POINT TO A SAVE AREA, ANYWAY. 00728000
  726. L R13,USAVEPTR 00729000
  727. BALR R14,R15 CALL LOADMOD 00730000
  728. SPACE 00731000
  729. * CONDITION CODE IS SET ON RETURN FROM LOADMOD. IT SHOULD BE PRESERVED 00732000
  730. * THROUGH EXIT FROM THIS SUBROUTINE. 00733000
  731. L SVCR,ASVCSECT 00734000
  732. LM R0,R14,SVCSAVE REGAIN REGISTERS 00735000
  733. BR RR RETURN TO SUBROUTINE CALLER 00736000
  734. * COME HERE IF THE SVC VALUE IS NOT 202 OR 203. THIS MEANS THAT IT 00737000
  735. * IS AN OS SIMULATION SVC CALL. 00738000
  736. OSSVC EQU * 00739000
  737. NI TYPFLAG,X'FF'-TPFNS WE WILL WANT A REAL SAVEAREA 00740000
  738. BAL RR,GETSAVE ALLOCATE A SAVE AREA 00741000
  739. OI TYPFLAG,TPFSVO SET OS SVC FLAG 00742000
  740. L XR,SVCOPSW+4 GET OLD PSW RETURN ADDR 00743000
  741. LA XR,0(,XR) ZERO OUT HIGH BYTE 00744000
  742. ST XR,ERRET THAT'S THE ERROR RETURN 00745000
  743. ST XR,NRMRET AS WELL AS THE NORMAL RETURN 00746000
  744. * AS CALLEE NAME, USE 'SVC NNN' IN EBCDIC. 00747000
  745. SR XR,XR 00748000
  746. IC XR,SVCOPSW+3 GET SVC NUMBER 00749000
  747. CVD XR,TEMP02 CONVERT SVC NUMBER TO DECIMAL 00750000
  748. MVC CALLEE,TEXT01 MOVE IN EDIT STRING 00751000
  749. ED CALLEE+3(4),TEMP02+6 CONVERT TO CHARACTER STRING 00752000
  750. SPACE 00753000
  751. SPACE 1 00754000
  752. * WE MUST NOW SEARCH FOR THE ROUTINE CORRESPONDING TO THE OS SVC. 00755000
  753. * THERE ARE TWO TABLES WHICH MUST BE SEARCHED. FIRST, IF THE USER HAS 00756000
  754. * SPECIFIED ANY SVC HANDLERS, THEN WE MUST SEARCH HIS TABLE. SECOND, 00757000
  755. * IF THAT SEARCH FAILS, THEN WE MUST SEARCH THE SYSTEM TABLE OF OS 00758000
  756. * SVC ROUTINES. 00759000
  757. OSS0 LA R14,4 TABLE ENTRY SIZE @V305001 00760000
  758. L R1,JFIRST POINT TO FIRST USER ENTRY 00761000
  759. L R15,JLAST POINT TO LAST USER ENTRY 00762000
  760. LTR R1,R1 ARE THERE ANY USER ENTRIES? 00763000
  761. BZ OSSEARCH SKIP SEARCH IF NOT @V305665 00764000
  762. BAL RR,OSSUB SEARCH THE TABLE 00765000
  763. B UOSFOUND GO IF SEARCH WAS SUCCESSFUL 00766000
  764. B OSSEARCH GO IF SEARCH WAS UNSUCCESSFUL@V305665 00767000
  765. EJECT 00768000
  766. * OSSUB SUBROUTINE. THIS SUBROUTINE SEARCHES A TABLE FOR THE GIVEN 00769000
  767. * SVC NUMBER. 00770000
  768. OSSUB EQU * 00771000
  769. EX XR,OSCLI IS THIS THE CORRECT ENTRY 00772000
  770. BCR 8,RR (BE 0(RR)) RETURN TO CALLER IF FOUND 00773000
  771. BXLE R1,R14,OSSUB GO NEXT TABLE ENTRY, AND LOOP 00774000
  772. B 4(,RR) ERROR RETURN TO CALLER 00775000
  773. SPACE 00776000
  774. OSCLI CLI 0(R1),*-* 00777000
  775. EJECT 00778000
  776. * COME HERE IF THE TABLE ENTRY FOR THE OS SVC HAS BEEN FOUND. 00779000
  777. UOSFOUND EQU * 00780000
  778. OI TYPFLAG,TPFUSR SET 'USER-ROUTINE' FLAG 00781000
  779. L R15,0(,R1) GET TABLE ENTRY FOR SVC NUMBER 00782000
  780. LA R14,0(,R15) CLEAR HIGH BYTE TO GET ADDRESS 00783000
  781. B OSF2 @V305665 00784000
  782. SPACE 2 00785000
  783. * CHECK IF THE DOSSVC FLAG IS ON. IF ON, GET THE ADDRESS OF 00786000
  784. * THE CMSDOS SEGMENT IN R15 AND GO TO COMMON OS/DOS CODE 00787000
  785. * IF THE DCSS IS AVAILABLE, THEN USE IT. IF NOT, THEN GO 00788000
  786. * CHECK FOR TEXT DECK FORMAT. 00789000
  787. OSSEARCH EQU * @V305665 00790000
  788. TM DOSFLAGS,DOSSVC IS DOS SVC FLAG ON @VA06031 00791000
  789. BNO NOTDOS NO, HANDLE AS OS @VA06031 00792000
  790. L R15,ADOSDCSS GET DOS SEGMENT ADDR @VA06031 00793000
  791. B OSF2 BRANCH TO COMMON CODE @VA06031 00794000
  792. NOTDOS EQU * @VA06031 00795000
  793. SLL XR,THREEBYT SHIFT SVC NUMBER @V305665 00796000
  794. TM DCSSFLAG,DCSSAVAL IS DCSS AVAILABLE? @V305665 00797000
  795. BZ CHKMODUL BRANCH IF NOT @V305665 00798000
  796. TM DCSSFLAG,DCSSLDED HAS IT BEEN LOADED? @V305665 00799000
  797. BO OSF1 BRANCH IF YES @V305665 00800000
  798. B LOADSYS OTHERWISE GO LOAD IT @V305665 00801000
  799. CHKMODUL EQU * @V305665 00802000
  800. L R15,AOSMODL GET ADDRESS OF MODULE @V305665 00803000
  801. TM DCSSFLAG,DCSSVTLD HAS IT BEEN LOADED? @V305665 00804000
  802. BO OSF11 BRANCH IF YES @V305665 00805000
  803. B NOOS IF NOT, IT SHOULD HAVE BEEN @V305614 00806000
  804. SPACE 1 00807000
  805. * IF THE DCSS IS AVAILABLE, THEN ISSUE A LOADSYS FOR 00808000
  806. * THE DCSS. 00809000
  807. LOADSYS EQU * @V305665 00810000
  808. L R1,ASYSNAMS POINT TO SYSNAMES TABLE @V305665 00811000
  809. USING SYSNAMES,R1 @V305665 00812000
  810. LA R1,CMSSEG GET ADDRESS OF NAMED SYSTEM @V305665 00813000
  811. DROP R1 @V305665 00814000
  812. SR R2,R2 CLEAR R2 @V305665 00815000
  813. DC X'83120064' ISSUE LOADSYS DIAGNOSE @V305665 00816000
  814. BNZ PAGERR BRANCH IF PAGING ERROR @V305665 00817000
  815. ST R1,ACMSSEG SAVE LOADED ADDRESS @V305665 00818000
  816. OI DCSSFLAG,DCSSLDED INDICATE LOADED @V305665 00819000
  817. SPACE 2 00820000
  818. OSF1 EQU * @V305665 00821000
  819. L R15,ACMSSEG GET ADDRESS OF DCSS @V305665 00822000
  820. L R15,0(,R15) GET ADDRESS OF SVT @V305665 00823000
  821. OSF11 EQU * @V305665 00824000
  822. AR R15,XR ADD SVC NUMBER @V305665 00825000
  823. OI SFLAG,SFSYS SET SYSTEM FLAG @V305665 00826000
  824. SPACE 00827000
  825. * WHEN CONTROL REACHES THIS POINT, R15 CONTAINS THE SVC NUMBER IN THE 00828000
  826. * HIGH BYTE OF REGISTER 15, AND THE LOW-ORDER BYTES CONTAIN THE ADDRESS 00829000
  827. * OF THE ROUTINE TO BE BRANCHED, WHETHER IT IS IN THE TRANSIENT AREA, 00830000
  828. * OR NUCLEUS RESIDENT. 00831000
  829. OSF2 EQU * 00832000
  830. XC ITSPSW(8),ITSPSW START WITH ZERO PSW 00833000
  831. LR XR,R15 SAVE STARTING ADDR IN XR 00834000
  832. LA R15,0(,R15) CLEAR HIGH-ORDER BYTE 00835000
  833. ST R15,ITSPSW+4 AND STORE ADDR IN STARTUP PSW 00836000
  834. TM TYPFLAG,TPFUSR IS THIS A 'USER' ROUTINE? 00837000
  835. BZ OSF3 SKIP IF NOT 00838000
  836. MVI ITSPSW,ON TURN ON SYSTEM MASK 00839000
  837. TM PROTFLAG,PRFPOFF NUCLEUS PROTECTION TURNED OFF? 00840000
  838. BO OSF3 SKIP IF IT WAS 00841000
  839. OI ITSPSW+1,USERKEY TURN ON USER KEY 00842000
  840. SPACE 00843000
  841. OSF3 EQU * 00844000
  842. TM OVSTAT,OVSON SVCTRACE IN EFFECT? 00845000
  843. BZ *+8 SKIP IF NOT 00846000
  844. BAL RR,BOVR CALL OVERRIDE ROUTINE 00847000
  845. LR R12,XR R12 = BASE REGISTER FOR CALLEE 00848000
  846. LA R14,OSRET POINT TO RETURN ADDRESS FOR USER 00849000
  847. CLI SVCOPSW+3,S203 IS THIS AN SVC 203? @V305665 00850000
  848. BNE NOSVC203 BRANCH IF NOT @V305665 00851000
  849. LA R14,CMSRET SET RETURN ADDRESS @V305665 00852000
  850. NOSVC203 EQU * @V305665 00853000
  851. ST R14,ITS14 AND PASS THAT IN REG 14 00854000
  852. MVC ITS15(4),EGPR15 PASS CALLER'S 15 IN REG 15 00855000
  853. LA R14,LPSW POINT TO STARTUP ROUTINE 00856000
  854. L R13,USAVEPTR POINT TO USER SAVE AREA 00857000
  855. LM R0,R11,EGPRS RESTORE CALLER'S REG 0-11 00858000
  856. BR R14 TRANSFER TO STARTUP ROUTINE 00859000
  857. SPACE 00860000
  858. * WE HAVE TRANSFERRED WITH THE REGISTERS AS FOLLOWS: 00861000
  859. * R0-R11, R15 ARE THOSE OF THE CALLER 00862000
  860. * R12 = AL1(SVC-NUMBER),AL3(ADDR OF CALLEE) 00863000
  861. * R13 = ADDRESS OF USER SAVE AREA 00864000
  862. * R14 = RETURN ADDRESS TO DMSITS 00865000
  863. *********************************************************************** 00866000
  864. * 00867000
  865. * COMING BACK FROM OS SVC ROUTINE. 00868000
  866. * 00869000
  867. *********************************************************************** 00870000
  868. * 00871000
  869. DMSITSOR EQU * 00872000
  870. OSRET EQU * 00873000
  871. SPACE 00874000
  872. * THE FOLLOWING SVC CALL WILL BE RECOGNIZED ABOVE AT THE DMSITS ENTRY 00875000
  873. * AS BEING WITHIN THIS ROUTINE, AND WILL CAUSE THE PSW TO BE RESET 00876000
  874. * TO HAVE SYSTEM MASK OFF, PROBLEM BIT OFF, AND ZERO STORAGE 00877000
  875. * PROTECTION KEY. 00878000
  876. * ALSO, AT RETURN, REGS 11-13 WILL BE AT LOCATION RET 00879000
  877. SVC 201 00880000
  878. BALR R13,0 ESTABLISH ADDRESSABILITY 00881000
  879. USING *,R13 00882000
  880. L SVCR,ASVCSECT NOTE SVCR = R12 00883000
  881. STM R0,R15,RGPRS SAVE REGS IN SVCSECT 00884000
  882. MVC RGPR11(4*3),RET COPY REGS FROM LOW CORE 00885000
  883. LM BR,BR2,=A(DMSITS,DMSITS+4096) SET UP REAL BASE REGS 00886000
  884. DROP R13 AND DROP THE TEMPORARY ONE 00887000
  885. L SR,CURRSAVE GET THE CURRENT SAVE AREA 00888000
  886. L FVR,AFVS POINT TO FVSECT 00889000
  887. OI UFDBUSY,ITSBIT INDICATE SVC HANDLER IS BUSY 00890000
  888. SPACE 00891000
  889. * THE FIRST TWO WORDS OF SVCSAVE WILL CONTAIN THE PSW USED TO RETURN 00892000
  890. * TO THE GUY WHO CALLED THE SVC IN THE FIRST PLACE. 00893000
  891. MVC SVCSAVE(8),OLDPSW SET RETURN PSW 00894000
  892. MVC RET(8),SVCSAVE COPY RETURN PSW INTO LOW CORE 00895000
  893. TM PROTFLAG,PRFPOFF NUCLEUS PROTECTION TURNED OFF? 00896000
  894. BZ OSCMSRET SKIP IF NOT @VA06037 00897000
  895. NI RET+1,X'0F' FORCE PSW KEY TO 0 00898000
  896. B OSCMSRET @VA06037 00899000
  897. EJECT 00900000
  898. * RETURN FROM SVC 202 OR SVC 203 00901000
  899. DMSITSCR EQU * 00902000
  900. CMSRET EQU * 00903000
  901. SPACE 00904000
  902. * SEE THE NOTE AT OSRET FOR THE MEANING OF THE FOLLOWING SVC 201. 00905000
  903. SVC 201 GET ZERO PROTECT KEY 00906000
  904. BALR R13,0 ESTABLISH ADDRESSABILITY 00907000
  905. USING *,R13 00908000
  906. L SVCR,ASVCSECT NOTE SVCR=R12 00909000
  907. STM R0,R15,RGPRS STORE REGS IN SVCSECT 00910000
  908. MVC RGPR11(4*3),RET COPY REGS FROM LOW CORE 00911000
  909. LM BR,BR2,=A(DMSITS,DMSITS+4096) SET REAL BASE REGS 00912000
  910. DROP R13 AND DROP THE TEMPORARY ONE 00913000
  911. L SR,CURRSAVE POINT TO CURRENT SAVE AREA 00914000
  912. L FVR,AFVS POINT TO FVSECT 00915000
  913. OI UFDBUSY,ITSBIT INDICATE SVC HANDLER IS BUSY 00916000
  914. SPACE 00917000
  915. * IF THE R01 FLAG HAS BEEN SET IN THE SAVE AREA, THEN THIS 00918000
  916. * SVC CALL CHANGES REGISTERS 0 AND 1 TO THE VALUES RETURNED BY THE 00919000
  917. * CALLEE. 00920000
  918. TM TYPFLAG,TPFR01 RETURN CALLEE'S R0-R1? 00921000
  919. BZ *+8 SKIP IF NOT 00922000
  920. STM R0,R1,EGPRS STORE IN RETURN AREA 00923000
  921. SPACE 00924000
  922. ST R15,EGPR15 STORE R15 IN RETURN AREA 00925000
  923. SPACE 00926000
  924. * THE FIRST TWO WORDS OF SVCSAVE WILL CONTAIN THE RETURN PSW. 00927000
  925. * WE MUST SET THE ADDRESS FIELD, DEPENDING ON WHETHER THERE WAS 00928000
  926. * AN ERROR OR NORMAL RETURN FROM THE SVC HANDLER. 00929000
  927. MVC SVCSAVE(8),OLDPSW SET FIRST TO OLDPSW 00930000
  928. MVC SVCSAVE+5(3),NRMRET+1 SET TO NORMAL RETURN ADDR 00931000
  929. TM PROTFLAG,PRFPOFF NUCLEUS PROTECTION TURNED OFF? 00932000
  930. BZ *+8 SKIP IF NOT 00933000
  931. NI SVCSAVE+1,X'0F' FORCE PSW KEY TO ZERO 00934000
  932. LTR R15,R15 BUT WAS THERE AN ERROR RETURN? 00935000
  933. BZ CRN GO IF THERE WAS NOT 00936000
  934. TM TYPFLAG,TPFERT WAS HE EXPECTING AN ERROR RET? 00937000
  935. BNZ *+8 SKIP IF SO 00938000
  936. BAL RR,UNEXERR NOPE -- DUMP HIM OFF 00939000
  937. MVC SVCSAVE+5(3),ERRET+1 COPY ERROR RETURN TO PSW 00940000
  938. SPACE 00941000
  939. CRN EQU * 00942000
  940. MVC RET(8),SVCSAVE COPY RETURN PSW TO LOW CORE 00943000
  941. OSCMSRET EQU * @VA06037 00944000
  942. TM OVSTAT,OVSON SVCTRACE IN EFFECT ? @VA06037 00945000
  943. BZ *+8 SKIP IF NOT @VA06037 00946000
  944. BAL RR,AOVR CALL OVERRIDE ROUTINE @VA06037 00947000
  945. MVC GPRLOG(4*16),EGPRS MOVE REGS TO A SAFE PLACE @VA06037 00948000
  946. BAL RR,UNSTACK UNSTACK SAVE AREA 00949000
  947. SPACE 00950000
  948. * FOR RETURN FROM A CMS SVC, WE SET REGS R0 THRU R14 TO THEIR VALUES 00951000
  949. * AT ENTRY, BUT WE SET REG 15 TO THE VALUE RETURNED BY THE SVC HANDLER. 00952000
  950. MVC ITS14(8),GPRLOG+4*14 COPY CORRECT REG 14 & 15 @VA06037 00953000
  951. LA R14,LPSW POINT TO STARTUP ROUTINE @VA06037 00954000
  952. LM R0,R13,GPRLOG RESTORE REGS 0-13 @VA06037 00955000
  953. BR R14 BRANCH TO STARTUP ROUTINE 00956000
  954. * UNSTACK SUBROUTINE -- UNSTACK A SAVE AREA 00957000
  955. UNSTACK EQU * 00958000
  956. SPACE 00959000
  957. * FIRST, CHECK TO SEE IF THE SYSTEM SAVE AREA WAS CLOBBERED. 00960000
  958. CLC CHKWRD1,=C'ABCD' 00961000
  959. BNE ERCLOB 00962000
  960. CLC CHKWRD2,=C'EFGH' 00963000
  961. BNE ERCLOB 00964000
  962. SPACE 00965000
  963. * CHECK TO SEE WHETHER KEY STACK IS EMPTY 00966000
  964. CLI KEYP,0 ANYTHING IN KEY STACK? 00967000
  965. BNE KEYNR ERROR IF THERE IS 00968000
  966. KEYNRRET EQU * 00969000
  967. SPACE 00970000
  968. L R1,DEPTH DECREMENT SVC DEPTH 00971000
  969. BCTR R1,0 00972000
  970. ST R1,DEPTH AND STORE NEW VALUE 00973000
  971. LDM F0,F6,EFPRS RESTORE FLOAT REGS 00974000
  972. TM TYPFLAG,TPFNS NO SAVE AREA ALLOCATED? 00975000
  973. BO UNSTACKN GO HANDLE THIS CASE 00976000
  974. SPACE 00977000
  975. MVC CURRSAVE,SSAVEPRV COPY ADDR OF PREVIOUS SAVE AREA 00978000
  976. MVC CURRALOC,CURRSAVE AND ALSO TO CURRENT ALLOC 00979000
  977. LTR R1,R1 DOES DEPTH = 0? 00980000
  978. BCR 7,RR (BNZ 0(RR)) RETURN IF NOT 00981000
  979. SPACE 00982000
  980. * OTHERWISE, FREE ALL SAVE AREAS 00983000
  981. ST SR,CURRALOC SAVE SR TEMPORARILY 00984000
  982. L SR,LASTALOC GET LAST ALLOCATED SAVE AREA 00985000
  983. SPACE 00986000
  984. * COME HERE TO FREE FIRST (NEXT) SAVE AREA. 00987000
  985. UNSLOOP EQU * 00988000
  986. L R1,USAVEPTR POINT TO USER SAVE AREA 00989000
  987. LTR R1,R1 IS THERE A USER SAVE AREA? @VA04752 00990000
  988. BZ NOUSR BRANCH IF NOT @VA04752 00991000
  989. DMSFRET DWORDS=USAVESZ,LOC=(1),TYPCALL=BALR,ERR=ERCLOB 00992000
  990. NOUSR EQU * @VA04752 00993000
  991. LR R1,SR POINT TO SYSTEM SAVE AREA 00994000
  992. L SR,SSAVEPRV SR -> PRECEDING AREA IN CHAIN 00995000
  993. DMSFRET DWORDS=SSAVESZ,LOC=(1),ERR=ERCLOB,TYPCALL=BALR 00996000
  994. LTR SR,SR IS THERE A PREVIOUS ONE? 00997000
  995. BNZ UNSLOOP LOOP BACK IF THERE IS 00998000
  996. L SR,CURRALOC RESET SR 00999000
  997. SR R1,R1 01000000
  998. ST R1,CURRALOC ZERO OUT CURRALOC 01001000
  999. ST R1,CURRSAVE ZERO OUT CURRSAVE 01002000
  1000. ST R1,LASTALOC ZERO OUT LASTALOC 01003000
  1001. BR RR RETURN TO CALLER 01004000
  1002. SPACE 01005000
  1003. * SOME SVC CALLS USE 'NRMSAV' AS THE SAVE AREA TO SAVE TIME. 01006000
  1004. * COME HERE TO HANDLE THEM. 01007000
  1005. UNSTACKN EQU * 01008000
  1006. MVC CURRSAVE,CURRALOC COPY CURRENT ALLOCATION TO *01009000
  1007. CURRENT SAVE AREA 01010000
  1008. NI TYPFLAG,X'FF'-TPFNS TURN OFF FLAG 01011000
  1009. BR RR RETURN TO CALLER 01012000
  1010. * LPSW ROUTINE. WHEN CONTROL TRANSFERS HERE, THE FOLLOWING IS SET: 01013000
  1011. * ITSPSW CONTAINS THE PSW WHICH WE ARE ABOUT TO LOAD 01014000
  1012. * REGS 0-13 CONTAIN THE VALUES TO BE PASSED 01015000
  1013. * ITS14, ITS15 CONTAIN REGS 14-15 TO BE PASSED 01016000
  1014. * REG 14 CONTAINS ADDRESS OF 'LPSW' ROUTINE 01017000
  1015. SPACE 01018000
  1016. * NOTE: POINT OF CONFUSION: THE SYMBOL 'RET' AND 'ITSPSW' REFER TO 01019000
  1017. * THE SAME AREA OF LOW CORE. SOME DAY, SOMEONE SHOULD GO THROUGH 01020000
  1018. * AND REMOVE ALL REFERENCES TO 'RET'. 01021000
  1019. SPACE 01022000
  1020. LPSW EQU * 01023000
  1021. USING *,R14 01024000
  1022. L R15,ASVCSECT POINT TO SVCSECT 01025000
  1023. USING SVCSECT,R15 01026000
  1024. LH R15,SVCAB GET ABEND CODE, IF ANY 01027000
  1025. LTR R15,R15 ANY ABEND CODE? 01028000
  1026. BNZ LPSWAB GO ABEND, IF SO 01029000
  1027. L R15,CURRSAVE POINT TO CURRENT SAVE AREA 01030000
  1028. USING SSAVE,R15 01031000
  1029. LTR R15,R15 DO WE HAVE A CURRENT SAVE AREA? @VA12351 01031300
  1030. BZ LPSWHX NO - GO TEST KX @VA12351 01031600
  1031. TM TYPFLAG,TPFNS USING NORMAL SAVE AREA? 01032000
  1032. BO LPSWGO DON'T TEST 'KX' IF SO 01033000
  1033. LPSWHX EQU * @VA12351 01033300
  1034. DROP R15 @VA12351 01033600
  1035. L R15,AFVS POINT TO FVSECT 01034000
  1036. USING FVSECT,R15 01035000
  1037. NI KXFLAG,X'FF'-KXWSVC TURN OFF 'WAIT FOR SVC' FLAG, *01036000
  1038. IF IT'S ON 01037000
  1039. NI UFDBUSY,X'FF'-ITSBIT CLEAR DMSITS HOLD BIT 01038000
  1040. BNZ LPSWGO IF NON-ZERO, THEN NO 'KX' 01039000
  1041. CLI KXFLAG,KXWANT DO WE WANT A KX? 01040000
  1042. BNE LPSWGO GO IF NOT 01041000
  1043. SPACE 01042000
  1044. * OTHERWISE, WE HAVE A 'KX'. WE MUST ABEND, WITH CODE X'222'. 01043000
  1045. LA R15,X'222' ABEND CODE 01044000
  1046. TM TSOFLAGS,TSOATCNL WAS READ CANCELLED BY ATTN? @VA02650 01045000
  1047. BZ LPSWAB NO @VA02650 01046000
  1048. NI TSOFLAGS,255-TSOATCNL RESET READ CANCELLED FLAG @VA02650 01047000
  1049. SPACE 01048000
  1050. LPSWAB EQU * 01049000
  1051. STH R15,ITSPSW+2 STORE ABEND CODE INTO PSW 01050000
  1052. L R15,AFVS POINT TO FVSECT 01051000
  1053. USING FVSECT,R15 01052000
  1054. NI UFDBUSY,X'FF'-ITSBIT TURN OFF DMSITS BUSY BIT 01053000
  1055. L R15,=V(DMSABW) POINT TO DMSABN WORK AREA 01054000
  1056. USING ABWSECT,R15 01055000
  1057. MVC ABNPSW,ITSPSW COPY OVER PSW TO DMSABN AREA 01056000
  1058. STM R0,R13,ABNREGS STORE REGISTERS IN DMSABN AREA 01057000
  1059. MVC ABNREGS+4*R14(8),ITS14 SET REGS 14 AND 15 01058000
  1060. LH R0,ABNPSW+2 RECOVER ABEND CODE 01059000
  1061. L SVCR,ASVCSECT POINT TO SVCSECT 01060000
  1062. XC SVCAB,SVCAB TURN OFF ABEND CODE 01061000
  1063. L R15,=V(DMSABNGO) POINT TO DMSABN ENTRY 01062000
  1064. BR R15 AND GO THERE 01063000
  1065. SPACE 01064000
  1066. * START THE USER UP 01065000
  1067. LPSWGO EQU * 01066000
  1068. CLI SVCOPSW+3,201 V0211 01067000
  1069. BE NOSHORT V0211 01068000
  1070. CLC ITSPSW(2),=X'0000' V0211 01069000
  1071. LM R14,R15,ITS14 SET REGS 14 15 V0211 01070000
  1072. BCR 8,R12 V0211 01071000
  1073. NOSHORT LM R14,R15,ITS14 SET REGS V0211 01072000
  1074. LPSW ITSPSW LOAD STARTUP PSW 01073000
  1075. DROP R14,R15 01074000
  1076. SPACE 1 01075000
  1077. LTORG @V305665 01076000
  1078. DS 0H @V305665 01077000
  1079. * ROUTINE TO ABEND WHILE IN SVC ENTRY CODE. 01078000
  1080. EABEND EQU * 01079000
  1081. L R15,=V(DMSABW) POINT TO DMSABN WORK AREA 01080000
  1082. USING ABWSECT,R15 01081000
  1083. MVC ABNPSW,SVCOPSW COPY OLD PSW INTO WORK AREA 01082000
  1084. STH R0,ABNPSW+2 PUT ABEND CODE INTO PSW 01083000
  1085. MVC ABNREGS(4*16),EGPRS COPY ENTRY REGISTERS 01084000
  1086. LTR R4,R4 IS THERE A SYSTEM SAVE AREA? @VA04752 01085000
  1087. BZ NOSAVE BRANCH IF NOT @VA04752 01086000
  1088. LR XR,R0 SAVE ABEND CODE 01087000
  1089. BAL RR,UNSTACK UNSTACK SAVE AREA, IF ALLOCATED 01088000
  1090. LR R0,XR PUT ABEND CODE INTO R0 01089000
  1091. NOSAVE EQU * @VA04752 01090000
  1092. NI UFDBUSY,X'FF'-ITSBIT TURN OFF DMSITS BUSY BIT 01091000
  1093. L R15,=V(DMSABNGO) POINT TO DMSABN ENTRY 01092000
  1094. BR R15 AND GO THERE 01093000
  1095. DROP R15 01094000
  1096. * HANDLE 'BEFORE' OVERRIDES 01095000
  1097. BOVR EQU * 01096000
  1098. NI OVSTAT,X'FF'-OVSAFT TURN OFF 'AFTER' FLAG, FOR BEFOR 01097000
  1099. B OVRC GO TO COMMON CODE 01098000
  1100. SPACE 01099000
  1101. * HANDLE 'AFTER' OVERRIDES 01100000
  1102. AOVR EQU * 01101000
  1103. OI OVSTAT,OVSAFT TURN ON 'AFTER' FLAG 01102000
  1104. SPACE 2 01103000
  1105. * COMMON OVERRIDE HANDLING CODE 01104000
  1106. OVRC EQU * 01105000
  1107. L R15,ADMSOVS GET ADDRESS OF OVERRIDE SUBR 01106000
  1108. LTR R15,R15 IS THERE ANY? 01107000
  1109. BNZ OVRGO GO CALL ROUTINE IF NOT 01108000
  1110. NI OVSTAT,X'FF'-OVSON TURN OFF OVERRIDE FLAG 01109000
  1111. BR RR RETURN TO CALLER 01110000
  1112. SPACE 01111000
  1113. USING OVSECT,R15 01112000
  1114. SPACE 01113000
  1115. * NOTE -- OVSECT IS A MACRO DESCRIBING THE FIRST FEW WORDS OF THE 01114000
  1116. * DMSOVS ROUTINE. 01115000
  1117. OVRGO EQU * 01116000
  1118. MVC AERR,=V(DMSERR) PASS ADDRESS OF DMSERR 01117000
  1119. MVC AWAIT,=V(DMSCWT) PASS ADDRESS OF CONWAIT 01118000
  1120. BALR R14,R15 CALL OVERRIDE ROUTINE 01119000
  1121. DROP R15 01120000
  1122. BR RR RETURN TO CALLER 01121000
  1123. SPACE 01122000
  1124. * FOR 'JUMP' RETURN -- 4(R14) -- WE RELEASE THE OVERRIDE ROUTINE. 01123000
  1125. DC H'0' HALFWORD PAD 01124000
  1126. STM R0,R1,SVCSAVE+32 SAVE REGS 0-1 TEMPORARILY 01125000
  1127. L R1,ADMSOVS POINT TO OVERRIDE ROUTINE 01126000
  1128. USING OVSECT,R1 01127000
  1129. L R0,LENOVS GET LENGTH OF OVERRIDE ROUTINE 01128000
  1130. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR RELEASE STORAGE 01129000
  1131. DROP R1 01130000
  1132. MVC ADMSOVS,=F'0' ZERO OUT THE ROUTINE POINTER 01131000
  1133. LM R0,R1,SVCSAVE+32 RESTORE REGS 0-1 01132000
  1134. BR RR RETURN TO CALLER 01133000
  1135. * DMSITS RE-INITIALIZATION ROUTINE. THIS ROUTINE IS CALLED BY 01134000
  1136. * DMSABN, THE ABEND RECOVERY ROUTINE, TO CLEAR ALL PENDING SVC CALLS 01135000
  1137. * SO THAT OPERATION OF CMS CAN CONTINUE WITH A CLEAN SLATE. 01136000
  1138. USING *,R15 01137000
  1139. DMSITSR EQU * 01138000
  1140. SPACE 01139000
  1141. * DMSABN WILL NOT ASSUME ANYTHING ABOUT THE REGISTERS WE RETURN. 01140000
  1142. * THUS, WE NEEDN'T SAVE THEM ANYWHERE. 01141000
  1143. LR XR,R14 SAVE RETURN REGISTER 01142000
  1144. LM BR,BR2,=A(DMSITS,DMSITS+4096) SET BASE REGS 01143000
  1145. DROP R15 01144000
  1146. L SVCR,ASVCSECT 01145000
  1147. NI SFLAG,X'FF'-SFREN TURN OFF RE-ENTRY FLAG 01146000
  1148. XC DEPTH,DEPTH ZERO OUT DEPTH FIELD 01147000
  1149. L SR,LASTALOC GET POINTER TO LAST ALLOCATED *01148000
  1150. SYSTEM SAVE AREA 01149000
  1151. XC CURRALOC,CURRALOC ZERO OUT POINTER 01150000
  1152. XC CURRSAVE,CURRSAVE NO MORE CURRENT SAVE AREA 01151000
  1153. XC NRMSAV(4),NRMSAV ZERO OUT FLAG BYTES IN NRMSAV 01152000
  1154. SPACE 01153000
  1155. * ZERO OUT USER-HANDLED SVC TABLE POINTERS 01154000
  1156. XC JNUMB,JNUMB 01155000
  1157. XC JFIRST,JFIRST 01156000
  1158. XC JLAST,JLAST 01157000
  1159. SPACE 01158000
  1160. * THE FOLLOWING LOOP RELEASES ALL THE SYSTEM SAVE AREAS. 01159000
  1161. * NOTE THAT THE CORRESPONDING USER SAVE AREAS WILL BE FREED 01160000
  1162. * AUTOMATICALLY WHEN DMSABN FREES ALL USER STORAGE. 01161000
  1163. RECLOOP EQU * 01162000
  1164. LTR R1,SR IS THERE A(NOTHER) SAVE AREA? 01163000
  1165. BZ RECRET GO IF NOT 01164000
  1166. L SR,SSAVEPRV SAVE POINTER TO PREVIOUS SAVE *01165000
  1167. AREA 01166000
  1168. DMSFRET DWORDS=SSAVESZ,LOC=(1),TYPCALL=BALR RELEASE THIS ONE 01167000
  1169. B RECLOOP LOOP BACK FOR NEXT 01168000
  1170. SPACE 01169000
  1171. RECRET EQU * 01170000
  1172. LR R14,XR RESTORE ADDR OF CALLER 01171000
  1173. BR R14 AND RETURN TO HIM 01172000
  1174. DMSITSK EQU * 01173000
  1175. * THE ONLY REGISTER WE HAVE TO SET IS: R12 = SVCR 01174000
  1176. L SVCR,ASVCSECT 01175000
  1177. SPACE 01176000
  1178. * WE MUST DECIDE WHICH 'DMSKEY' OPTION WAS SPECIFIED. 01177000
  1179. TM CODE203,KFN NUCLEUS? 01178000
  1180. BO KN GO IF YES 01179000
  1181. TM CODE203,KFR RESET? 01180000
  1182. BO KR 01181000
  1183. TM CODE203,KFU USER? 01182000
  1184. BO KU 01183000
  1185. TM CODE203,KFL LASTUSER? 01184000
  1186. BO KL 01185000
  1187. B NO203 GO TYPE ERROR MESSAGE 01186000
  1188. SPACE 3 01187000
  1189. * DMSKEY NUCLEUS 01188000
  1190. KN EQU * 01189000
  1191. TM CODE203,KFNS 'NOSTACK' SPECIFIED? 01190000
  1192. BO *+8 SKIP IF YES 01191000
  1193. BAL RR,KSTACK OTHERWISE, GO STACK CURRENT KEY 01192000
  1194. NI OLDPSW+1,X'0F' FORCE ZERO PROTECT KEY 01193000
  1195. SR R15,R15 ZERO RETURN CODE 01194000
  1196. B CMSRET RETURN TO CALLER 01195000
  1197. SPACE 3 01196000
  1198. * DMSKEY USER 01197000
  1199. KU EQU * 01198000
  1200. TM CODE203,KFNS 'NOSTACK' SPECIFIED? 01199000
  1201. BO *+8 SKIP IF YES 01200000
  1202. BAL RR,KSTACK OTHERWISE, GO STACK PROTECT KEY 01201000
  1203. NI OLDPSW+1,X'0F' ZERO OUT PSW KEY FIELD 01202000
  1204. OI OLDPSW+1,USERKEY INSERT USER KEY 01203000
  1205. SR R15,R15 ZERO RETURN CODE 01204000
  1206. B CMSRET RETURN TO CALLER 01205000
  1207. SPACE 3 01206000
  1208. * DMSKEY LASTUSER 01207000
  1209. KL EQU * 01208000
  1210. TM CODE203,KFNS 'NOSTACK' OPTION SPECIFIED? 01209000
  1211. BO *+8 SKIP IF YES 01210000
  1212. BAL RR,KSTACK OTHERWISE, GO STACK PROTECT KEY 01211000
  1213. LA R0,USERKEY DEFAULT VALUE OF KEY 01212000
  1214. L R1,CURRALOC POINT TO LAST ALLOCATED SAVEAREA 01213000
  1215. USE SSAVE,R1 USE R1 AS SSAVE POINTER 01214000
  1216. SPACE 01215000
  1217. * LOOP BACK HERE TO CHECK WHETHER NEXT SAVE AREA WAS FOR A 'USER' 01216000
  1218. * ROUTINE. 01217000
  1219. KLL EQU * 01218000
  1220. L R1,SSAVEPRV POINT TO PREVIOUS SAVE AREA 01219000
  1221. LTR R1,R1 WAS THERE ONE? 01220000
  1222. BZ KLF USE DEFAULT IF NOT 01221000
  1223. TM TYPFLAG,TPFUSR IS THIS A USER SAVE AREA 01222000
  1224. BZ KLL LOOP BACK IF NOT 01223000
  1225. SPACE 01224000
  1226. * OTHERWISE, WE HAVE FOUND THE LAST SVC CALL CALLED FROM A USER 01225000
  1227. * ROUTINE. WE LOOK AT THE PROTECT KEY IN THE OLDPSW OF THE FOLLOWING 01226000
  1228. * SSAVE AREA. 01227000
  1229. L R1,SSAVENXT POINT TO NEXT SAVE AREA 01228000
  1230. IC R0,OLDPSW+1 GET THE PROTECT KEY 01229000
  1231. SPACE 01230000
  1232. USE SSAVE,SR WE'RE THROUGH WITH R1 01231000
  1233. SPACE 01232000
  1234. * AT THIS POINT, R0 CONTAINS THE CORRECT PROTECT KEY. 01233000
  1235. KLF EQU * 01234000
  1236. NI OLDPSW+1,X'0F' ZERO OUT PROTECTION KEY 01235000
  1237. N R0,=AL1(0,0,0,X'F0') ZERO OUT SECOND NIBBLE 01236000
  1238. IC R1,OLDPSW+1 GET CORRECT SECOND NIBBLE 01237000
  1239. OR R0,R1 OR THE NIBBLES INTO A BYTE 01238000
  1240. STC R0,OLDPSW+1 AND STORE IN RETURN PSW 01239000
  1241. SR R15,R15 ZERO RETURN CODE 01240000
  1242. B CMSRET 01241000
  1243. SPACE 3 01242000
  1244. * DMSKEY RESET 01243000
  1245. KR EQU * 01244000
  1246. L R15,CURRALOC POINT TO LAST ALLOCATED SAVEAREA 01245000
  1247. USE SSAVE,R15 01246000
  1248. LTR R15,R15 ANY SAVE AREA ALLOCATED? 01247000
  1249. BZ KRR SIMPLY RETURN IF NOT 01248000
  1250. CLI KEYP,0 IS THE STACK EMPTY? 01249000
  1251. BE KEYUNDER UNDERFLOW IF IT IS 01250000
  1252. SLR R1,R1 01251000
  1253. IC R1,KEYP GET STACK SIZE 01252000
  1254. IC R0,KEYS(R1) GET TOP OF STACK 01253000
  1255. BCTR R1,0 DECREMENT STACK SIZE 01254000
  1256. STC R1,KEYP AND STORE 01255000
  1257. SPACE 01256000
  1258. USE SSAVE,SR USING SR AGAIN 01257000
  1259. STC R0,OLDPSW+1 RESET RETURN PSW 01258000
  1260. SPACE 01259000
  1261. * RETURN 01260000
  1262. KRR EQU * 01261000
  1263. SR R15,R15 ZERO RETURN CODE 01262000
  1264. B CMSRET RETURN TO CALLER 01263000
  1265. SPACE 3 01264000
  1266. * SUBROUTINE TO PUT ONE PSW KEY ONTO THE STACK. 01265000
  1267. KSTACK EQU * 01266000
  1268. L R1,CURRALOC GET LAST ALLOCATED SAVE AREA 01267000
  1269. USE SSAVE,R1 USE R1 TEMPORARILY 01268000
  1270. LTR R1,R1 ANY SAVE AREA ALLOCATED? 01269000
  1271. BCR 8,RR (BZ 0(,RR)) SIMPLY RETURN IF NOT 01270000
  1272. CLI KEYP,KEYMAX IS THE STACK FULL ALREADY? 01271000
  1273. BNL KEYOVER ERROR IF SO 01272000
  1274. SR XR,XR 01273000
  1275. IC XR,KEYP GET STACK DEPTH 01274000
  1276. LA XR,1(,XR) INCREMENT 01275000
  1277. STC XR,KEYP 01276000
  1278. IC R0,SVCOPSW+1 GET OLD VALUE OF KEY 01277000
  1279. STC R0,KEYS(XR) SAVE IN STACK 01278000
  1280. BR RR RETURN TO CALLER 01279000
  1281. USE SSAVE,SR 01280000
  1282. SPACE 3 01281000
  1283. * CODE203 FLAG VALUES ASSOCIATED WITH 'DMSKEY'. 01282000
  1284. KFN EQU X'01' DMSKEY NUCLEUS 01283000
  1285. KFR EQU X'02' DMSKEY RESET 01284000
  1286. KFU EQU X'04' DMSKEY USER 01285000
  1287. KFL EQU X'08' DMSKEY LASTUSER 01286000
  1288. KFNS EQU X'40' DMSKEY XXX,NOSTACK 01287000
  1289. SPACE 01288000
  1290. USERKEY EQU X'E0' VALUE OF USER STORAGE KEY 01289000
  1291. * DMSEXS MACRO ENTRY POINT 01290000
  1292. DMSITSXS EQU * 01291000
  1293. MVC RET(2),=H'0' FORM PSW AT LOCATION RET 01292000
  1294. ST R1,RET+4 STORE BRANCH ADDRESS IN PSW 01293000
  1295. LA R1,CMSRET WHERE USER IS TO RETURN 01294000
  1296. L R0,EGPR0 RESTORE USER'S REG 0 01295000
  1297. LM R2,R15,EGPR2 RESTORE USER'S REGS 2-15 01296000
  1298. LPSW RET GO EXECUTION THE INSTRUCTION 01297000
  1299. FREEER EQU * 01298000
  1300. DMSERR NUM=154,LET=T,TYPCALL=BALR, *01299000
  1301. SUB=(HEXA,SVCOPSW+4), *01300000
  1302. TEXT='SAVE AREA FOR SVC CALL FROM ...... CANNOT BE ALLOC*01301000
  1303. ATED' 01302000
  1304. LA R0,X'0F0' LOAD ABEND CODE INTO R0 01303000
  1305. LTR R4,R4 IS THERE A SYSTEM SAVE AREA? @VA04752 01304000
  1306. BZ EABEND BRANCH IF NOT @VA04752 01305000
  1307. OI TYPFLAG,TPFNS SAVE AREA NOT ALLOCATED 01306000
  1308. B EABEND GO ABEND 01307000
  1309. SPACE 5 01308000
  1310. PAGERR EQU * @V305665 01309000
  1311. DMSERR LET=S,NUM=143,TYPCALL=BALR, @V305665X01310000
  1312. TEXT='UNABLE TO LOAD SAVED SYSTEM OR LOAD MODULE' 01311000
  1313. LA R0,HEXF9 @V305666 01312000
  1314. B EABEND @V305665 01313000
  1315. SPACE 5 01314000
  1316. * UNSUPPORTED SVC CALL 01315000
  1317. NOOS EQU * 01316000
  1318. DMSERR NUM=098,LET=S,TYPCALL=BALR,TEXT='CMS OS SIMULATION NOT X01317000
  1319. AVAILABLE' @VM03024 01318000
  1320. LA R0,X'0F9' SET ABEND CODE @VM03024 01319000
  1321. B EABEND AND PREPARE TO ABEND @VM03024 01320000
  1322. SPACE 5 01321000
  1323. * UNSUPPORTED SVC 203 CODE 01322000
  1324. NO203 EQU * 01323000
  1325. LH XR,NRMSAV+CODE-SSAVE GET SVC 203 HALFWORD CODE 01324000
  1326. DMSERR NUM=134,LET=S,TYPCALL=BALR, *01325000
  1327. MF=(E,'SYS'), *01326000
  1328. TEXT='UNSUPPORTED SVC 203 CODE ....., CALLED FROM ......*01327000
  1329. ', *01328000
  1330. SUB=(DEC,(XR),HEXA,SVCOPSW+4) 01329000
  1331. LA R0,X'0F1' LOAD ABEND CODE 01330000
  1332. B EABEND GO ABEND HIM 01331000
  1333. SPACE 5 01332000
  1334. * MAXIMUM DEPTH OF SVC CALLS WAS EXCEEDED. 01333000
  1335. ERDEEP EQU * 01334000
  1336. DMSERR NUM=135,LET=S,TYPCALL=BALR, *01335000
  1337. MF=(E,'SYS'), *01336000
  1338. TEXT='MAXIMUM SVC DEPTH .... HAS BEEN EXCEEDED WITH CALL*01337000
  1339. AT ......', *01338000
  1340. SUB=(DEC,MAXDEEP,HEXA,SVCOPSW+4) 01339000
  1341. LA R0,X'0F2' LOAD ABEND CODE 01340000
  1342. STH R0,SVCAB STORE IN WORK AREA 01341000
  1343. B ERDEEPRT AND CONTINUE PROCESSING 01342000
  1344. SPACE 01343000
  1345. SPACE 5 01344000
  1346. * UNEXPECTED ERROR RETURN FROM SVC CALL. 01345000
  1347. UNEXERR EQU * 01346000
  1348. LR XR,R15 COPY OVER ERROR RETURN CODE 01347000
  1349. DMSERR NUM=122,LET=S,TYPCALL=BALR, *01348000
  1350. MF=(E,'SYS'), *01349000
  1351. TEXT='ERROR IN CALL TO ........ FROM ......, ERROR CODE *01350000
  1352. .......... (HEX ........)', *01351000
  1353. SUB=(CHARA,CALLEE,HEXA,CALLER, *01352000
  1354. DEC,(XR),HEX,(XR)) 01353000
  1355. CLC SVCAB,=H'0' ARE WE ALREADY ABENDING? 01354000
  1356. BCR 7,RR (BNE 0(RR)) DON'T CHANGE ABEND CODE IF SO 01355000
  1357. LA R0,X'0F3' LOAD ABEND CODE 01356000
  1358. STH R0,SVCAB STORE IN WORK AREA 01357000
  1359. BR RR CONTINUE PROCESSING 01358000
  1360. SPACE 5 01359000
  1361. * ILLEGAL RE-ENTRY INTO INTSVC 01360000
  1362. ERREN EQU * 01361000
  1363. DMSERR NUM=136,LET=T,TYPCALL=BALR, *01362000
  1364. HALT=YES, *01363000
  1365. SUB=(HEXA,SVCOPSW+4), *01364000
  1366. TEXT='SVC CALL FROM ...... ILLEGALLY RE-ENTERS INTSVC. R*01365000
  1367. E-IPL CMS' 01366000
  1368. B ERREN IF HE TRIES TO RESTART 01367000
  1369. SPACE 5 01368000
  1370. * SVC ROUTINE CLOBBERED SYSTEM SAVE AREA 01369000
  1371. ERCLOB EQU * 01370000
  1372. DMSERR NUM=137,LET=T,TYPCALL=BALR, *01371000
  1373. MF=(E,'SYS'), *01372000
  1374. HALT=YES, *01373000
  1375. SUB=(CHARA,CALLEE,HEXA,OLDPSW+4), *01374000
  1376. TEXT='CALL TO ........ FROM ...... DESTROYED SYSTEM SAVE*01375000
  1377. AREA. RE-IPL CMS.' 01376000
  1378. B ERCLOB IF HE TRIES TO RESTART 01377000
  1379. SPACE 3 01378000
  1380. KEYOVER EQU * 01379000
  1381. DMSERR NUM=138,LET=T,TYPCALL=BALR, *01380000
  1382. MF=(E,'SYS'), *01381000
  1383. TEXT='''DMSKEY'' CALL FROM ...... OVERFLOWS KEY STACK, W*01382000
  1384. ITH MAX DEPTH ......', *01383000
  1385. SUB=(HEXA,SVCOPSW+4,DEC,KEYMAX) 01384000
  1386. LA R0,X'0F4' LOAD ABEND CODE 01385000
  1387. B EABEND GO ABEND HIM 01386000
  1388. SPACE 3 01387000
  1389. KEYUNDER EQU * 01388000
  1390. DMSERR NUM=139,LET=T,TYPCALL=BALR, *01389000
  1391. MF=(E,'SYS'), *01390000
  1392. TEXT='''DMSKEY RESET'' FROM ...... UNDERFLOWS KEY STACK'*01391000
  1393. ,SUB=(HEXA,SVCOPSW+4) 01392000
  1394. LA R0,X'0F5' LOAD ABEND CODE 01393000
  1395. B EABEND GO ABEND HIM 01394000
  1396. SPACE 3 01395000
  1397. KEYNR EQU * 01396000
  1398. DMSERR NUM=140,LET=T,TYPCALL=BALR, *01397000
  1399. MF=(E,'SYS'), *01398000
  1400. TEXT='........ ROUTINE CALLED FROM ...... DID DMSKEY WIT*01399000
  1401. H NO RESET', *01400000
  1402. SUB=(CHARA,CALLEE,HEXA,CALLER) 01401000
  1403. LA R0,X'0F6' LOAD ABEND CODE 01402000
  1404. STH R0,SVCAB STORE IN WORK AREA 01403000
  1405. B KEYNRRET AND CONTINUE PROCESSING 01404000
  1406. ********************************************************************* 01405000
  1407. * 01406000
  1408. * CONSTANTS & EQUATES 01407000
  1409. * 01408000
  1410. ********************************************************************* 01409000
  1411. TEXT01 DC C'SVC',X'4020212040' (FOR EDITING OS-SVC CALLEE)@VA14550 01410000
  1412. * 01411000
  1413. * 01412000
  1414. S203 EQU 203 @V305665 01413000
  1415. HEXF9 EQU X'F9' @V305666 01414000
  1416. OFF EQU X'00' SYSTEM MASK OFF = NO INTERRUPTS 01415000
  1417. ON EQU X'FF' SYSTEM MASK ON = ALL INTERRUPTS 01416000
  1418. ADDR EQU 8 ADDRESS-VECTOR IN FUNCTAB 01417000
  1419. FLAGS EQU 8 FLAG BYTE 01418000
  1420. NSF EQU X'80' NO SAVE AREA FLAG 01419000
  1421. R01 EQU X'40' RETURN REG 0-1 TO CALLER 01420000
  1422. NAME EQU 0 8-BYTE NAME OF CALLED-ROUTINE 01421000
  1423. SPACE 01422000
  1424. * KEEP THESE IN ORDER 01423000
  1425. ITSPSW EQU 0 STARTUP PSW 01424000
  1426. ITS14 EQU 8 STARTUP REG 14 01425000
  1427. ITS15 EQU 12 STARTUP REG 15 01426000
  1428. SPACE 01427000
  1429. * SOMEONE MUST GO THROUGH THE CODE SOME DAY AND REMOVE ALL REFERENCES 01428000
  1430. * TO RET. IN ADDITION, THE THREE ABOVE SYMBOLS OUGHT TO GO ELSEWHERE 01429000
  1431. * IN NUCON. 01430000
  1432. RET EQU ITSPSW 01431000
  1433. SPACE 01432000
  1434. MAXDEEP EQU 20 MAXIMUM SVC DEPTH 01433000
  1435. THREEBYT EQU 24 @V305665 01434000
  1436. MIN3 DC H'-3' @V305665 01435000
  1437. MIN16 DC H'-16' SVC 203 CODE FOR SPECIAL CALL @VM03048 01436000
  1438. EJECT 01437000
  1439. LTORG 01438000
  1440. ENDITS EQU * 01439000
  1441. EJECT 01440000
  1442. SVCSECT GENERATE DSECT 01441000
  1443. OVSECT 01442000
  1444. FSTB @V305665 01443000
  1445. SYSNAMES @V305665 01444000
  1446. FVS 01445000
  1447. NUCON 01446000
  1448. SVCSAVE 01447000
  1449. EQUATES 01448000
  1450. SPACE 1 01449000
  1451. DMSABW 01450000
  1452. END 01451000