User Tools

Site Tools


ibm:vm370-lib:cms:dmserr.assemble_src

DMSERR Source

References

Source Listing

DMSERR.ASSEMBLE.txt
  1. ERR TITLE 'DMSERR (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00003000
  4. * 00004000
  5. * 00005000
  6. * 00006000
  7. * 00007000
  8. * MODULE NAME - 00008000
  9. * 00009000
  10. * DMSERR 00010000
  11. * 00011000
  12. * FUNCTION - 00012000
  13. * 00013000
  14. * HANDLE CALLS PRODUCED BY 'DMSERR' AND 'LINEDIT' 00014000
  15. * MACROS. 00015000
  16. * 00016000
  17. * ATTRIBUTES - 00017000
  18. * 00018000
  19. * NUCLEUS RESIDENT, RE-ENTRANT 00019000
  20. * 00020000
  21. * ENTRY POINTS - 00021000
  22. * 00022000
  23. * DMSERR 00023000
  24. * 00024000
  25. * ENTRY CONDITIONS - 00025000
  26. * 00026000
  27. * R1 POINTS TO THE PLIST GENERATED BY THE 'DMSERR' OR 'LINEDIT' 00027000
  28. * MACRO. THIS PLIST IS HIGHLY VARIABLE IN FORMAT. IN ADDITION, 00028000
  29. * IF ONLY ONE SUBSTITUTION HAS BEEN SPECIFIED, THEN R0 WILL 00029000
  30. * CONTAIN THE SUBSTITUTION PARAMETER. 00030000
  31. * 00031000
  32. * EXIT CONDITIONS - 00032000
  33. * 00033000
  34. * NORMAL - 00034000
  35. * ALL REGISTERS RESTORED TO VALUE AT ENTRY, EXCEPT THAT R15=0. 00035000
  36. * 00036000
  37. * ERROR - 00037000
  38. * ERRORS CAN OCCUR ONLY IN 'DISP=CPCOMM' OPTION, AND, IN THIS 00038000
  39. * CASE, R15 CONTAINS THE CODE RETURNED BY DMSCPF. 00039000
  40. * 00040000
  41. * CALLS TO OTHER ROUTINES - 00041000
  42. * 00042000
  43. * DMSCWR (TYPLIN) -- TO TYPE OUT THE MESSAGE. 00043000
  44. * 00044000
  45. * DMSCPF (CPFUNC) -- TO PERFORM PROCESSING ASSOCIATED WITH 00045000
  46. * 'DISP=CPCOMM' OPTION 00046000
  47. * 00047000
  48. * DMSCWT (CONWAIT) -- TO WAIT FOR CONSOLE OUTPUT TO BE 00048000
  49. * COMPLETED, IN CASE 'DIE=YES' WAS SPECIFIED. 00049000
  50. * 00050000
  51. * PRINTR -- TO PRINT A LINE, IN CASE 00051000
  52. * 'DISP=PRINT' WAS SPECIFIED. 00052000
  53. * 00053000
  54. * EXTERNAL REFERENCES - 00054000
  55. * 00055000
  56. * DMSERT -- ADDRESS OF DMSERR WORK AREA. 00056000
  57. * 00057000
  58. * SEE 'CALLS TO OTHER ROUTINES' FOR OTHER EXTERNAL REFERENCES. 00058000
  59. * 00059000
  60. * TABLES / WORKAREAS - 00060000
  61. * 00061000
  62. * DMSERT -- DMSERR WORK AREA 00062000
  63. * 00063000
  64. * REGISTER USAGE - 00064000
  65. * 00065000
  66. * R3 -> DMSERT (WORK AREA) 00066000
  67. * R4 = 'FROM' POINTER FOR MESSAGE TEXT PROCESSING. 00067000
  68. * R5 = 'END' POINTER FOR MESSAGE TEXT PROCESSING. 00068000
  69. * R6 = 'TO' POINTER FOR MESSAGE TEXT PROCESSING. 00069000
  70. * R7 IS USED TO COUNT THE NUMBER OF DOTS IN THE MESSAGE TEXT. 00070000
  71. * R8 = LENGTH OF SUBSTITUTION. 00071000
  72. * R9 = SCRATCH REGISTER 00072000
  73. * R10 = INTERNAL SUBROUTINE RETURN REGISTER 00073000
  74. * R12 = BASE REGSITER 00074000
  75. * 00075000
  76. * NOTES - 00076000
  77. * 00077000
  78. * NONE 00078000
  79. * 00079000
  80. * OPERATION - 00080000
  81. * 00081000
  82. * AT ENTRY, THE PLIST IS DECODED AND EXPANDED INSIDE THE WORK 00082000
  83. * AREA, SO THAT IT WILL BE POSSIBLE TO EASILY ACCESS ALL ITS 00083000
  84. * FIELDS. 00084000
  85. * 00085000
  86. * NEXT, THE MESSAGE HEADER IS CONSTRUCTED, IF 'DMSERR' (RATHER 00086000
  87. * THAN 'LINEDIT') WAS SPECIFIED. 00087000
  88. * 00088000
  89. * THEN, THE MESSAGE TEXT IS SCANNED, BYTE BY BYTE. WHENEVER TWO 00089000
  90. * OR MORE CONSECUTIVE DOTS ARE FOUND IN THE MESSAGE TEXT, AN 00090000
  91. * ARGUMENT IS TAKEN FROM THE 'SUBS' PARAMETER LIST, THE 00091000
  92. * APPROPRIATE CONVERSION IS PERFORMED, AND THE RESULT IS 00092000
  93. * SUBSTITUTED FOR THE DOTS INTO THE MESSAGE TEXT. 00093000
  94. * 00094000
  95. * NEXT, IF A 'BUFFA' BUFFER ADDRESS WAS SPECIFIED, THEN THE 00095000
  96. * RESULTING MESSAGE TEXT IS COPIED INTO THE SPECIFIED BUFFER. 00096000
  97. * 00097000
  98. * NEXT, THE 'DISP' FIELD IS EXAMINED, AND APPROPRIATE ACTION 00098000
  99. * IS TAKEN. FOR DISP=TYPE, DMSCWR IS CALLED. FOR 'DISP=PRINT', 00099000
  100. * PRINTR IS CALLED. FOR 'DISP=SIO', THE ROUTINE DOES ITS 00100000
  101. * OWN SIO TO THE CONSOLE. FOR 'DISP=CPCOMM', DMSCPF IS 00101000
  102. * CALLED. FOR 'DISP=NONE', NO ACTION IS PERFORMED. 00102000
  103. * 00103000
  104. * FINALLY, THE 'DIE' OPTION IS EXAMINED. IF 'DIE=YES' WAS 00104000
  105. * SPECIFIED, THEN A DISABLED WAIT STATE PSW IS CREATED, CON- 00105000
  106. * TAINING THE RETURN ADDRESS TO THE POINT WHERE DMSERR WAS 00106000
  107. * CALLED. ALL REGISTERS ARE RESTORED, AND THE DISABLED WAIT 00107000
  108. * STATE PSW IS LOADED. 00108000
  109. * 00109000
  110. * IF 'DIE=NO' (THE DEFAULT) WAS SPECIFIED, 00110000
  111. * THEN A NORMAL RETURN IS MADE. 00111000
  112. * P3071 00112000
  113. *. P3071 00113000
  114. EJECT P3071 00114000
  115. DMSERR CSECT P3071 00115000
  116. PUNCH ' LIBRARY *(DMSCWR,DMSCWRE,PRINTR,DMSCWT)' 00116000
  117. * REGEQU 00117000
  118. R0 EQU 0 00118000
  119. R1 EQU 1 00119000
  120. R2 EQU 2 00120000
  121. R3 EQU 3 00121000
  122. R4 EQU 4 00122000
  123. R5 EQU 5 00123000
  124. R6 EQU 6 00124000
  125. R7 EQU 7 00125000
  126. R8 EQU 8 00126000
  127. R9 EQU 9 00127000
  128. R10 EQU 10 00128000
  129. R11 EQU 11 00129000
  130. R12 EQU 12 00130000
  131. R13 EQU 13 00131000
  132. R14 EQU 14 00132000
  133. R15 EQU 15 00133000
  134. SPACE 5 00134000
  135. TR EQU R3 POINTER TO DMSERS (ERDSECT) 00135000
  136. IR EQU R4 'FROM' POINTER FOR TEXT 00136000
  137. ER EQU R5 'END' POINTER FOR TEXT 00137000
  138. OR EQU R6 'TO' PTR FOR TEXT 00138000
  139. DR EQU R7 COUNT # DOTS IN SUBSTITUTE FIELD 00139000
  140. LR EQU R8 COUNT LENGTH OF SUBSTITUTION 00140000
  141. XR EQU R9 SCRATCH REGISTER 00141000
  142. RR EQU R10 INTERNAL SUBR RETURN REG 00142000
  143. BR EQU R12 BASE REGISTER 00143000
  144. SPACE 5 00144000
  145. USING DMSERR,BR 00145000
  146. USING ERDSECT,TR 00146000
  147. USING NUCON,R0 00147000
  148. DMSERR CSECT 00148000
  149. USING *,R15 00149000
  150. L R15,=V(DMSERT) GET ADDRESS OF WORK AREA 00150000
  151. USING ERDSECT,R15 00151000
  152. STM R0,R14,ERSAVE SAVE REGISTERS IN WORK AREA 00152000
  153. LR TR,R15 TR IS NORMAL WORK AREA PTR 00153000
  154. BALR R15,0 GET ADDRESSABILITY 00154000
  155. USING *,R15 00155000
  156. L BR,=A(DMSERR) LOAD NORMAL BASE REGISTER 00156000
  157. DROP R15 00157000
  158. MVC ERSAVE+4*R15(4),=F'0' SET RETURN CODE TO 0 00158000
  159. * IN THE PLIST PASSED TO THIS ROUTINE, EVERYTHING IS PACKED TOGETHER, 00159000
  160. * AND, IN FACT, ANYTHING COULD BE ALMOST ANYWHERE. 00160000
  161. * IN THE FOLLOWING CODE WE RECONSTRUCT THE PLIST IN THE WORK AREA SO 00161000
  162. * THAT LATER WE WILL BE ABLE TO GET AT EVERYTHING EASILY. 00162000
  163. * AT THIS POINT, R1 POINTS TO THE PASSED PLIST. 00163000
  164. RP EQU * 00164000
  165. SPACE 00165000
  166. * IF THE PASSED PLIST BEGINS WITH 'DMSERR', THEN WE SKIP OVER THAT. 00166000
  167. CLC =CL8'DMSERR',0(R1) BEGINS WITH DMSERR? 00167000
  168. BNE *+8 SKIP IF NOT 00168000
  169. LA R1,8(,R1) SKIP OVER IT IF SO 00169000
  170. MVC ERPF1(2),0(R1) COPY TWO FLAG BYTES 00170000
  171. LA R1,2(,R1) AND SKIP OVER THEM 00171000
  172. SPACE 00172000
  173. TM ERPF1,ERF1TX IS TEXT ADDRESS IN PLIST? 00173000
  174. BNO RPTX GO IF NOT 00174000
  175. MVC ERPTXA+1(3),0(R1) COPY TEXT ADDRESS INTO WORK AREA 00175000
  176. LA R1,3(,R1) AND SKIP OVER IN PASSED PLIST 00176000
  177. RPTX EQU * 00177000
  178. SPACE 00178000
  179. TM ERPF1,ERF1HD IS HEADER IN PLIST? 00179000
  180. BNO RPHD GO IF NOT 00180000
  181. MVC ERPHDR,0(R1) COPY HEADER INTO WORK AREA 00181000
  182. LA R1,6(,R1) SKIP OVER IT IN PASSED PLIST 00182000
  183. RPHD EQU * 00183000
  184. SPACE 00184000
  185. TM ERPF1,ERF1BF 'BUFFA' BUFFER ADDR IN PLIST? 00185000
  186. BNO RPBF GO IF NOT 00186000
  187. MVC ERPBFA+1(3),0(R1) COPY BUFFER ADDRESS INTO WORK 00187000
  188. LA R1,3(,R1) AND SKIP OVER IT IN PASSED PLIST 00188000
  189. RPBF EQU * 00189000
  190. SPACE 00190000
  191. * AT THIS POINT, R1 POINTS TO THE FIRST (OR ONLY) SUBSTITUTION OPTION 00191000
  192. * BYTE. 00192000
  193. ST R1,ERPSBA POINTER TO FIRST SUB FLAG BYTE 00193000
  194. SPACE 2 00194000
  195. * IF THE TEXT WAS PART OF AN MF=I PLIST, THEN IT FOLLOWS THE END OF THE 00195000
  196. * PLIST SO FAR. WE MUST LOOP THROUGH ALL THE SUBSTITUTION PARAMETERS 00196000
  197. * UNTIL WE GET TO THE END OF THEM. THAT IS WHERE THE TEXT IS. 00197000
  198. * AT THIS POINT, R1 POINTS TO THE FIRST SUBSTITUTION OPTION BYTE, IF 00198000
  199. * ANY. 00199000
  200. TM ERPF1,ERF1TX WAS TEXT ADDR IN PLIST? 00200000
  201. BO RPTE NOTHING TO DO -- ALREADY SET 00201000
  202. SPACE 00202000
  203. * IF THERE ARE NO SUBSTITUTIONS AT ALL, THEN R1 ALREADY POINTS TO THE 00203000
  204. * TEXT. 00204000
  205. TM ERPF1,ERF1SB1+ERF1SBN ANY SUBS? 00205000
  206. BZ RPTFF GO IF SO -- TEXT ADDR IS IN R1 00206000
  207. SPACE 00207000
  208. * IF THERE IS ONLY ONE SUBSTITUTION, THEN WE MUST ONLY SKIP ONE BYTE. 00208000
  209. TM ERPF1,ERF1SBN MULTIPLE SUBSTITUTIONS? 00209000
  210. BO RPTF GO IF YES 00210000
  211. LA R1,1(,R1) SKIP OVER LONE OPTION BYTE 00211000
  212. B RPTFF R1 -> TEXT 00212000
  213. SPACE 00213000
  214. * MULTIPLE SUBSTITUTIONS -- WE MUST SKIP OVER THEM. 00214000
  215. RPTF EQU * 00215000
  216. LR R15,R1 SAVE ADDRESS OF SUB OPTION BYTE 00216000
  217. LA R1,5(,R1) AND MAKE MOST PROBABLE SKIP 00217000
  218. SPACE 00218000
  219. * CUTE TRICK -- THE GROUP IS FOUR BYTES LONG IF THE FOLLOWING TEST 00219000
  220. * GIVES 'MIXED' -- ELSE IT'S FIVE BYTES. 00220000
  221. TM 0(R15),ERSFA+ERSFL TEST 'ADDR' AND 'LEN' FLAGS 00221000
  222. BNM *+6 SKIP IF 5 BYTES 00222000
  223. BCTR R1,0 DECREMENT TO SKIP ONLY 4 00223000
  224. TM 0(R15),ERSFLST WAS THIS THE LAST SUB? 00224000
  225. BNO RPTF LOOP BACK IF NOT 00225000
  226. SPACE 00226000
  227. * R1 PROBABLY NOW POINTS TO THE TEXT -- BUT IF MF=I AND RENT=NO WERE 00227000
  228. * SPECIFIED ALONG WITH MULTIPLE SUBSTITUTIONS, THEN THE PLIST MAY 00228000
  229. * BE PADDED WITH SOME ZEROES. WE SKIP OVER THESE. 00229000
  230. RPTFF EQU * 00230000
  231. CLI 0(R1),0 ARE WE POINTING TO A ZERO? 00231000
  232. LA R1,1(,R1) INCREMENT TO NEXT BYTE 00232000
  233. BE *-8 LOOP BACK 2 IF WE ARE 00233000
  234. BCTR R1,0 DECREMENT TO FIRST REAL BYTE 00234000
  235. SPACE 00235000
  236. * AT THIS POINT, R1 POINTS TO THE TEXT. 00236000
  237. ST R1,ERPTXA 00237000
  238. RPTE EQU * 00238000
  239. * THE MESSAGE HEADER HAS THE FORMAT: 'DMSXXXNNNL', WHERE XXX IS THE 00239000
  240. * CSECT NAME, NNN IS THE MESSAGE NUMBER, AND L IS THE MESSAGE LEVEL 00240000
  241. * LETTER. IF THE DMSERR (RATHER THAN THE LINEDIT) MACRO WAS USED, THEN 00241000
  242. * THE PASSED PLIST CONTAINS THE NECESSARY HEADER INFORMATION. 00242000
  243. TM ERPF1,ERF1HD WAS A MESSAGE HEADER PASSED? 00243000
  244. BNO HDX NOTHING TO DO IF NOT 00244000
  245. SPACE 00245000
  246. * CREATE ERROR MESSAGE HEADER 00246000
  247. SPACE 00247000
  248. * FIRST, CONVERT ERROR MESSAGE NUMBER TO BCD. 00248000
  249. MVC ERNUM-1(4),=X'F0202120' STORE EDIT PATTERN 00249000
  250. LH R1,ERPNUM GET ERROR MESSAGE NUMBER 00250000
  251. CVD R1,ERT1 CONVERT TO DECIMAL 00251000
  252. ED ERNUM-1(4),ERT1+6 CONVERT TO BCD 00252000
  253. SPACE 00253000
  254. MVC ERMESS,=C'DMS' FIRST 3 LETTERS ARE DMS 00254000
  255. MVC ERSECT,ERPCS COPY CSECT NAME 00255000
  256. MVC ERLET,ERPLET COPY MESSAGE LEVEL LETTER 00256000
  257. MVI ERBL,C' ' SET BLANK FIELD 00257000
  258. HDX EQU * 00258000
  259. * WE COPY THE UNSCANNED MESSAGE TEXT INTO OUR MESSAGE AREA. 00259000
  260. L R1,ERPTXA GET ADDRESS OF MESSAGE TEXT 00260000
  261. SR ER,ER 00261000
  262. IC ER,0(R1) ER <- LENGTH OF MESSAGE TEXT 00262000
  263. CH ER,=AL2(ERTSIZE) COMPARE WITH SIZE OF OUR TEXT *00263000
  264. BUFFER 00264000
  265. BL *+8 SKIP IF LOWER 00265000
  266. LA ER,ERTSIZE TRUNCATE IF TOO LARGE 00266000
  267. BCTR ER,0 ER <- (TEXT LENGTH)-1 00267000
  268. LTR ER,ER ANYTHING LEFT? 00268000
  269. BNM *+6 SKIP IF YES 00269000
  270. SR ER,ER OTHERWISE USE 1 CHAR 00270000
  271. SPACE 00271000
  272. B *+10 SKIP OVER MVC 00272000
  273. MVC ERTEXT(0),1(R1) LENGTH FILLED IN BY EX 00273000
  274. EX ER,*-6 COPY TEXT 00274000
  275. SPACE 00275000
  276. * INITIALIZE SCAN POINTERS 00276000
  277. LA ER,ERTEXT(ER) ER -> LAST BYTE OF TEXT 00277000
  278. LA OR,ERTEXT-1 'TO' POINTER 00278000
  279. LR IR,OR 'FROM' POINTER 00279000
  280. SPACE 00280000
  281. * THE REGISTER DR CONTAINS THE LENGTH OF THE FIELD BEING SUBBED 00281000
  282. * INTO. WE MAKE IT NEGATIVE NOW. 00282000
  283. SR DR,DR 00283000
  284. BCTR DR,0 DR <- -1 00284000
  285. * WHEN CONTROL REACHES THIS POINT, THE REGISTERS ARE SET AS FOLLOWS: 00285000
  286. SPACE 00286000
  287. * OR POINTS TO THE PLACE WHERE THE LAST MESSAGE CHARACTER WAS 00287000
  288. * COPIED TO. 00288000
  289. * IR POINTS TO THE PLACE WHERE THE LAST MESSAGE CHARACTER WAS 00289000
  290. * COPIED FROM. 00290000
  291. SPACE 00291000
  292. * INITIALLY, BOTH IR AND OR (INPUT REGISTER AND OUTPUT REGISTER) 00292000
  293. * POINT TO THE SAME PLACE. THE BASIC LOOP MOVES 1 CHARACTER AT A TIME 00293000
  294. * FROM THE INPUT TO THE OUTPUT. BUT INITIALLY, THESE ARE IN THE SAME 00294000
  295. * PLACE, SO THAT THE MOVE HAS NO EFFECT. IN FACT, IF THE MESSAGE 00295000
  296. * CONTAINS NO MULTIPLE BLANKS, AND NO SUBSTITUTIONS, THEN THIS SCAN 00296000
  297. * WILL HAVE NO EFFECT WHATSOEVER. 00297000
  298. * HOWEVER, IF MULTIPLE BLANKS ARE DISCOVERED, THEN THOSE AFTER THE 00298000
  299. * FIRST WILL NOT BE COPIED, SO THAT IR WILL START TO MOVE AHEAD OF 00299000
  300. * OR, AND GENUINE DATA MOVEMENT WILL TAKE PLACE. 00300000
  301. SPACE 00301000
  302. * WHEN CONSECUTIVE DOTS ARE DISCOVERED IN THE MESSAGE TEXT, AND A 00302000
  303. * SUBSTITUTION CAN BE MADE, IT PROCEEDS AS FOLLOWS: 00303000
  304. * THE SUBSTITUTION IS MADE, OVERLAYING THE DOTS IN THE INPUT AREA. 00304000
  305. * THEN, AFTER THE SUBSTITUTION HAS BEEN MADE, THE BASIC LOOP (AT ERLUP) 00305000
  306. * IS RE-ENTERED, WITH IR AND OR UNCHANGED. THIS WILL CAUSE THE 00306000
  307. * NEWLY SUBSTITUTED FIELD TO BE COPIED FROM THE INPUT AREA TO THE 00307000
  308. * OUTPUT AREA, WITH BLANKS ELIMINATED. 00308000
  309. SPACE 00309000
  310. * THE REGISTER DR IS USED TO PREVENT A RECURSION LOOP. THAT IS, 00310000
  311. * IF THE 'CHAR' OPTION IS USED IN A SUBSTITUTION, THERE IS NOTHING 00311000
  312. * TO PREVENT THE SUBSTITUTED STRING FROM CONTAINING DOTS. THIS 00312000
  313. * WOULD MEAN THAT ANOTHER SUBSTITUTION WOULD BE MADE INTO THE 00313000
  314. * SUBSTITUTED FIELD. WE PREVENT THIS AS FOLLOWS: 00314000
  315. * WHEN A SUBSTITUTION IS MADE, REGISTER DR IS SET TO THE LENGTH OF 00315000
  316. * THE DOT FIELD, LESS 1. THAT NUMBER IS LEFT IN THERE WHEN CONTROL 00316000
  317. * IS RETURNED TO ERLUP. THUS, AS EACH CHARACTER IN THE INPUT FIELD 00317000
  318. * IS SCANNED, WE REDUCE REGISTER DR BY 1. IF CONSECUTIVE DOTS 00318000
  319. * ARE FOUND, THEY WILL BE IGNORED IF REGISTER DR IS NONNEGATIVE. 00319000
  320. * (FOR THIS REASON, DR IS INITIALIZED TO -1, ABOVE.) 00320000
  321. SPACE 00321000
  322. * FINALLY, WE NOTE HERE THAT REGISTER ER HAS BEEN SET TO THE LAST 00322000
  323. * CHARACTER OF THE INPUT AREA, SO THAT IT WILL BE POSSIBLE TO KNOW 00323000
  324. * WHEN TO STOP. 00324000
  325. TM ERPF2,ERF2CM IS BLANK COMPRESSION WANTED? @VA02528 00325000
  326. BZ ERLUP YES @VA02528 00326000
  327. TM ERPF2,ERF2PR PRINT OPTION ON? @VA02528 00327000
  328. BZ ERLUP NO @VA02528 00328000
  329. TM ERPF2,X'01' ARE YOU SURE? @VA02528 00329000
  330. BO ERLUP NOPE, NOT ON @VA02528 00330000
  331. LA IR,1(,IR) SKIP TO CARRIAGE CONTROL @VA02528 00331000
  332. CLI 0(IR),C'.' IS IT A DOT? @VA02528 00332000
  333. BE DECRE YES, CONTINUE NORMALLY @VA02528 00333000
  334. LA OR,1(,OR) SKIP TO CARRIAGE CONTROL @VA02528 00334000
  335. ERLUPX LA IR,1(,IR) INCREMENT FOR CHECK @VA02528 00335000
  336. CLI 0(IR),X'40' IS IT BLANK? @VA02528 00336000
  337. BE ERLUPX YES, CHECK NEXT POSITION @VA02528 00337000
  338. DECRE BCTR IR,0 GET PREVIOUS POSITION @VA02528 00338000
  339. SPACE 2 00339000
  340. ERLUP EQU * 00340000
  341. CR IR,ER END OF STRING? 00341000
  342. BNL ND END OF SCAN -- GO TYPE 00342000
  343. LA IR,1(,IR) INCREMENT INPUT POINTER 00343000
  344. BCTR DR,0 DECREMENT SCANNED FIELD LENGTH 00344000
  345. CLI 0(IR),C' ' IS THE INPUT CHAR A BLANK? 00345000
  346. BNE ERLUP1 SKIP CHECK IF NOT 00346000
  347. TM ERPF2,ERF2CM IS BLANK COMPRESSION WANTED? 00347000
  348. BZ ERLUP2 SIMPLY COPY THE BLANK IF NOT 00348000
  349. * WE MUST BE CAREFUL TO OMIT THE TERMINATING BLANKS OF A 00349000
  350. * SUBSTITUTION FIELD. DR CONTAINS THE NUMBER OF CHARACTERS AFTER 00350000
  351. * THIS ONE, REMAINING IN THE LAST SUBSTITUTION FIELD. 00351000
  352. LTR DR,DR ARE WE IN SUBSTITUTION FIELD? 00352000
  353. BZ ERLUP SKIP BLK IF AT END OF SUB FIELD 00353000
  354. BM BL1 GO IF NOT INSIDE SUB FIELD 00354000
  355. CLI 1(IR),C' ' IS NEXT CHAR IN SUB FIELD ALSO *00355000
  356. A BLANK? 00356000
  357. BNE ERLUP2 COPY BLANK IF NOT 00357000
  358. B ERLUP SKIP THIS BLANK IF SO 00358000
  359. SPACE 00359000
  360. * COME HERE IF WE ARE NOT INSIDE A SUBSTITUTION FIELD. 00360000
  361. BL1 EQU * 00361000
  362. CLI 0(OR),C' ' WAS LAST OUTPUT CHARACTER BLANK? 00362000
  363. BE ERLUP SKIP THIS BLANK IF SO 00363000
  364. B ERLUP2 COPY BLANK IF NOT 00364000
  365. SPACE 00365000
  366. ERLUP1 EQU * 00366000
  367. CLI 0(IR),C'.' IS INPUT CHAR A DOT? 00367000
  368. BNE ERLUP2 GO COPY IF NOT 00368000
  369. CR IR,ER IS IT LAST CHAR OF LINE? 00369000
  370. BE ERLUP2 COPY DOT IF SO 00370000
  371. LTR DR,DR ARE WE RE-SCANNING INPUT FIELD? 00371000
  372. BNM ERLUP2 COPY DOT IF WE ARE 00372000
  373. TM ERPF1,ERF1SB1+ERF1SBN ANY SUB PARMS (LEFT)? 00373000
  374. BZ ERLUP2 COPY DOT IF NOT 00374000
  375. CLI 1(IR),C'.' IS NEXT CHAR ALSO A DOT? 00375000
  376. BNE ERLUP2 COPY DOT IF NOT 00376000
  377. BCTR IR,0 POINT TO CHAR PRECEDING DOTS 00377000
  378. B ERDOTS GO PERFORM SUBSTITUTION 00378000
  379. SPACE 00379000
  380. * WHEN CONTROL REACHES THIS POINT, WE HAVE NOTHING TO DO BUT COPY OVER 00380000
  381. * THE CHARACTER AND RETURN TO THE MAIN LOOP. 00381000
  382. ERLUP2 EQU * 00382000
  383. LA OR,1(,OR) INCREMENT OUTPUT POINTER 00383000
  384. MVC 0(1,OR),0(IR) COPY OVER THE CHARACTER 00384000
  385. B ERLUP RETURN TO MAIN LOOP 00385000
  386. * AT THIS POINT, REGISTER IR, THE 'INPUT' REGISTER, POINTS TO THE 00386000
  387. * CHARACTER PRECEDING THE FIELD OF DOTS. 00387000
  388. ERDOTS EQU * 00388000
  389. SR DR,DR NUMBER OF DOTS SO FAR 00389000
  390. LR R1,IR R1 -> CHAR PRECEDING DOTS 00390000
  391. SPACE 00391000
  392. * IN THE FOLLOWING LOOP, WE COUNT THE NUMBER OF DOTS IN THE FIELD, 00392000
  393. * AND, AT THE SAME TIME, WE CHANGE EACH DOT TO A BLANK. 00393000
  394. ERDT1 EQU * 00394000
  395. LA R1,1(,R1) INCREASE TEXT POINTER 00395000
  396. CLI 0(R1),C'.' IS IT A DOT? 00396000
  397. BNE ERDT2 NO -- WE'RE THROUGH COUNTING 00397000
  398. CR R1,ER HAVE WE REACHED END OF TEXT? 00398000
  399. BH ERDT2 YES -- WE'RE THROUGH COUNTING 00399000
  400. SPACE 00400000
  401. MVI 0(R1),C' ' OTHERWISE, CHANGE DOT TO BLANK 00401000
  402. LA DR,1(,DR) INCREASE DOT COUNT 00402000
  403. B ERDT1 AND LOOP BACK TO CONTINUE COUNT 00403000
  404. SPACE 00404000
  405. * COME HERE AT END OF DOTS 00405000
  406. ERDT2 EQU * 00406000
  407. BCTR DR,0 00407000
  408. SPACE 00408000
  409. * REGISTERS AT THIS POINT ARE: 00409000
  410. * IR POINTS TO THE CHARACTER PRECEDING THE SUBSTITUTION FIELD. 00410000
  411. * DR CONTAINS (THE LENGTH OF THE FIELD)-1. 00411000
  412. SPACE 00412000
  413. ST DR,ERSSZ SAVE SUBSTITUTION FIELD SIZE 00413000
  414. SPACE 00414000
  415. TM ERPF1,ERF1SBN ONE SUBSTITUTION? 00415000
  416. BO SM GO HANDLE MULTIPLE SUB SITUATION 00416000
  417. SPACE 00417000
  418. * OTHERWISE, THERE IS ONLY ONE SUBSTITUTION, AND THE DATA IS IN REG 0. 00418000
  419. MVC ERSBD,ERSAVE+4*R0 COPY R0 FROM SAVE AREA 00419000
  420. L R1,ERPSBA POINT TO OPTION BYTE IN PLIST 00420000
  421. MVC ERSBF,0(R1) COPY OPTION BYTE INTO WORK AREA 00421000
  422. MVC ERSBL,ERSBD COPY LENGTH BYTE PASSED, IF ANY 00422000
  423. B SSC GO HANDLE SUBSTITUTION 00423000
  424. SPACE 00424000
  425. * COME HERE IF THIS IS ONE OF MULTIPLE SUBSTITUTIONS. THE SUBSTITUTION 00425000
  426. * INFORMATION IS PACKED TOGETHER AT THE END OF THE PLIST, AND ERPSBA IN 00426000
  427. * OUR WORK AREA POINTS TO THE INFORMATION FOR THE CURRENT ONE. 00427000
  428. * THIS INFORMATION AREA CAN HAVE THREE FORMATS, INDICATED BY THE OPTION 00428000
  429. * BYTE, WHICH IS ALWAYS THE FIRST BYTE OF THE GROUP (FOR THE FLAG 00429000
  430. * DEFINITIONS FOR THIS OPTION BYTE, SEE FLAGS DEFINITIONS UNDER ERSBF 00430000
  431. * IN WORK AREA). 00431000
  432. SPACE 00432000
  433. * THE FORMATS ARE AS FOLLOWS: 00433000
  434. SPACE 00434000
  435. * IF NEITHER ERSFA NOR ERSFL IS ON, THEN WE ARE BEING PASSED FOUR BYTES 00435000
  436. * OF DATA IN THE FORM, 00436000
  437. * (1 BYTE OPTION BYTE) (4 BYTES OF DATA) 00437000
  438. SPACE 00438000
  439. * IF JUST ERSFA IS ON, THEN WE ARE BEING PASSED THE ADDRESS OF 00439000
  440. * THE DATA, WITH NO LENGTH SPECIFIED, IN THE FOLLOWING FORMAT: 00440000
  441. * (1 BYTE OPTION BYTE) (3 BYTE ADDRESS) 00441000
  442. SPACE 00442000
  443. * IF BOTH ERSFA AND ERSFL ARE ON, THEN WE ARE BEING PASSED AN ADDRESS 00443000
  444. * AND LENGTH, IN THE FOLLOWING FORMAT: 00444000
  445. * (1 BYTE OPTION BYTE) (1 BYTE LENGTH FIELD) (3 BYTE ADDRESS) 00445000
  446. SPACE 00446000
  447. * IT IS IMPOSSIBLE FOR ERSFL TO BE ON WITH ERSFA OFF. 00447000
  448. SPACE 00448000
  449. * IN ORDER TO SIMPLIFY THINGS, WE COPY THE INFORMATION INTO FIELDS OF 00449000
  450. * OUR WORK AREA, SO THAT THE INDIVIDUAL SUBSTITUTION ROUTINES WILL 00450000
  451. * NOT HAVE ANY TROUBLE FINDING THINGS. 00451000
  452. SM EQU * 00452000
  453. L R1,ERPSBA POINT TO SUBSTITUTION PARMS 00453000
  454. MVC ERSBF,0(R1) COPY OPTION BYTE TO WORK AREA 00454000
  455. MVC ERSBD,1(R1) COPY DATA VALUE OR ADDRESS 00455000
  456. MVC ERSBL,1(R1) COPY LENGTH FIELD, IF ANY 00456000
  457. TM ERSBF,ERSFA+ERSFL TEST BOTH FLAGS SIMULTANEOUSLY 00457000
  458. SPACE 00458000
  459. * IF 'MIXED', THEN WE HAVE THE ONLY POSSIBLE CASE OF A FOUR-BYTE FIELD 00459000
  460. * (OTHER CASES HAVE 5-BYTE FIELDS). 00460000
  461. BNM *+12 SKIP 2 INSTRUCTIONS IF NOT MIXED 00461000
  462. MVC ERSBD,0(R1) COPY DATA ADDRESS CORRECTLY 00462000
  463. BCTR R1,0 DECREMENT SO SKIP ONLY FOUR 00463000
  464. LA R1,5(,R1) SKIP FIVE BYTES 00464000
  465. ST R1,ERPSBA POINTER TO NEXT SUBSTITUTION FLD 00465000
  466. SPACE 00466000
  467. * WHEN CONTROL REACHES THIS POINT, THE SUBSTITUTION INFORMATION HAS 00467000
  468. * BEEN COPIED INTO THE VARIOUS FIELDS OF THE WORK AREA, AND WE CAN GO 00468000
  469. * TO WORK. 00469000
  470. SSC EQU * 00470000
  471. TM ERSBF,ERSFLST IS THIS THE LAST SUBSTITUTION *00471000
  472. PARAMETER FIELD? 00472000
  473. BNO *+8 SKIP IF NOT 00473000
  474. NI ERPF1,X'FF'-(ERF1SB1+ERF1SBN) TURN OFF SUBSTITUTIONS *00474000
  475. FLAGS, TO PREVENT FURTHER ONES 00475000
  476. SPACE 00476000
  477. * SO ALL POINTERS ARE NOW SET UP, AND THE REGISTERS ARE AS FOLLOWS: 00477000
  478. * IR -> CHARACTER PRECEDING THE SUBSTITUTION FIELD 00478000
  479. * DR CONTAINS THE (LENGTH OF THE SUBSTITUTION FIELD) - 1, WHICH EQUALS 00479000
  480. * THE (NUMBER OF DOTS IN THE FIELD) - 1. 00480000
  481. IC R1,ERSBF GET OPTION BYTE FROM WORK AREA 00481000
  482. N R1,=AL1(0,0,0,7) GET LAST THREE BITS 00482000
  483. AR R1,R1 MULTIPLY BY FOUR 00483000
  484. AR R1,R1 00484000
  485. B *+4(R1) BRANCH BASED ON OPTION 00485000
  486. B SH HEX OR HEXA 00486000
  487. B SD DEC OR DECA 00487000
  488. B SC CHARA 00488000
  489. B SH4 HEX4A 00489000
  490. B SC8 CHAR8A 00490000
  491. B SSTAR ILLEGAL 00491000
  492. B SSTAR ILLEGAL 00492000
  493. B SSTAR ILLEGAL 00493000
  494. SPACE 3 00494000
  495. * ILLEGAL ARGUMENT -- JUST PUT TWO DOTS INTO FIELD. 00495000
  496. SSTAR EQU * 00496000
  497. MVC 0(2,IR),=C'**' 00497000
  498. B SEND GO FINISH UP SUBSTITUTION 00498000
  499. EJECT 00499000
  500. * CHAR OPTION -- MAKE A CHARACTER SUBSTITUTION. 00500000
  501. SC EQU * 00501000
  502. SR R1,R1 00502000
  503. IC R1,ERSBL GET SPECIFIED LENGTH, IF ANY 00503000
  504. BCTR R1,0 DECREMENT BY 1 00504000
  505. TM ERSBF,ERSFL WAS A LENGTH SPECIFIED? 00505000
  506. BO *+6 SKIP IF SO 00506000
  507. LR R1,DR OTHERWISE, USE NUMBER OF DOTS 00507000
  508. SPACE 00508000
  509. * AT THIS POINT, R1 CONTAINS EITHER THE LENGTH SPECIFIED BY THE USER 00509000
  510. * (MINUS 1) OR, IF NONE WAS SPECIFIED, THE CONTENTS OF DR, WHICH 00510000
  511. * CONTAINS ONE LESS THAN THE NUMBER OF DOTS IN THE FIELD. 00511000
  512. * WE NOW TAKE THE MINIMUM OF DR AND R1, AND THAT IS THE LENGTH OF THE 00512000
  513. * SUBSTITUTION TO BE MADE. 00513000
  514. LTR R1,R1 WAS SPECIFIED LENGTH = 0? 00514000
  515. BM SEND NOTHING TO DO IF IT WAS 00515000
  516. CLR R1,DR TAKE MINIMUM 00516000
  517. BNL *+6 SKIP IF SPECIFIED LEN HIGHER 00517000
  518. LR DR,R1 IF LESS, USE SPECIFIED LENGTH 00518000
  519. SPACE 00519000
  520. * DR NOW CONTAINS ONE LESS THAN THE NUMBER OF CHARACTERS TO BE COPIED 00520000
  521. * OVER. 00521000
  522. L R1,ERSBD GET DATA POINTER 00522000
  523. B *+10 SKIP OVER MVC 00523000
  524. MVC 1(,IR),0(R1) LENGTH FILLED IN BY EX 00524000
  525. EX DR,*-6 MOVE DATA INTO MESSAGE AREA 00525000
  526. B SEND GO FINISH UP SUBSTITUTION 00526000
  527. EJECT 00527000
  528. * CHAR8 OPTION -- MAKE A CHARACTER SUBSTITUTION, BUT STORE A BLANK 00528000
  529. * AFTER EVERY EIGHTH CHARACTER. 00529000
  530. SC8 EQU * 00530000
  531. TM ERSBF,ERSFL WAS A LENGTH SPECIFIED? 00531000
  532. BNO SC8A SKIP COMPUTATION IF NOT 00532000
  533. SPACE 00533000
  534. * OTHERWISE, THE MACRO SPECIFIED A LENGTH, IN BYTES, OF THE INPUT FIELD 00534000
  535. * TO BE COPIED. WE MUST DETERMINE HOW MANY BYTES THE SPECIFIED LENGTH 00535000
  536. * WILL REQUIRE IN THE MESSAGE TEXT. IT WILL BE APPROXIMATELY 9/8 AS 00536000
  537. * BIG TO ACCOMODATE THE BLANK AT THE END OF EACH EIGHTH CHARACTER. 00537000
  538. * THE EXACT FORMULA IS: 00538000
  539. * REQUIRED LENGTH = (L-1)/8*9 + MOD(L-1,8) + 1, 00539000
  540. * WHERE L IS THE LENGTH SPECIFIED BY THE USER. 00540000
  541. * WE PERFORM THIS COMPUTATION BELOW, EXCEPT THAT WE DO NOT BOTHER TO 00541000
  542. * ADD IN THE '+1' OF THE FORMULA, SINCE WE WANT THE (LENGTH - 1), 00542000
  543. * ANYWAY. 00543000
  544. SLR R0,R0 00544000
  545. SLR R1,R1 00545000
  546. IC R1,ERSBL GET LENGTH SPECIFIED BY MACRO 00546000
  547. BCTR R1,0 TAKE (L-1) 00547000
  548. LTR R1,R1 IS IT NEGATIVE? 00548000
  549. BM SEND HE SPECIFIED 0 LENGTH -- THAT *00549000
  550. MEANS NOTHING TO DO 00550000
  551. SPACE 00551000
  552. * THE R0-R1 REGISTER PAIR CONTAINS (L-1). WE DIVIDE BY 8, TO PUT 00552000
  553. * (L-1)/8 INTO REGISTER 1, AND MOD (L-1,8) INTO R0. 00553000
  554. D R0,=F'8' DIVIDE BY 8 00554000
  555. MH R1,=H'9' COMPUTE (L-1)/8*9 00555000
  556. AR R1,R0 (L-1)/8*9 + MOD(L-1,8) 00556000
  557. SPACE 00557000
  558. * REGISTER 1 NOW CONTAINS ONE LESS THAN THE NUMBER OF BYTES NECESSARY 00558000
  559. * TO COMPLY WITH THE USER'S LENGTH REQUEST. DR CONTAINS ONE LESS THAN 00559000
  560. * THE AVAILABLE FIELD SIZE (NUMBER OF DOTS). WE COMPARE THE TWO, AND 00560000
  561. * TAKE THE MINIMUM. 00561000
  562. CLR R1,DR COMPARE THE TWO 00562000
  563. BNL *+6 00563000
  564. LR DR,R1 TAKE THE MINIMUM 00564000
  565. SPACE 00565000
  566. * WE NOW PERFORM A LOOP WHICH COPIES 8 CHARACTERS AT A TIME, PUTTING 00566000
  567. * A SPACE AFTER EACH ONE, UNTIL THE FIELD IS EXHAUSTED. 00567000
  568. SC8A EQU * 00568000
  569. LA XR,1(,DR) XR <- EXACT FIELD LENGTH 00569000
  570. LR R14,IR R14 -> TARGET AREA 00570000
  571. L R15,ERSBD R15 -> SOURCE DATA AREA 00571000
  572. SPACE 00572000
  573. * LOOP BACK TO THIS POINT TO COPY THE NEXT EIGHT CHARACTERS. 00573000
  574. SC8B EQU * 00574000
  575. LR R1,XR COPY LENGTH REMAINING 00575000
  576. CH R1,=H'8' AT LEAST 8 CHARS LEFT? 00576000
  577. BL *+8 SKIP IF NOT 00577000
  578. LA R1,8 IF SO, COPY ONLY 8 CHARACTERS 00578000
  579. BCTR R1,0 DECREMENT FOR EX 00579000
  580. B *+10 SKIP OVER MVC 00580000
  581. MVC 1(,R14),0(R15) LENGTH FILLED IN BY EX 00581000
  582. EX R1,*-6 MOVE UP TO EIGHT BYTES OF DATA 00582000
  583. LA R14,9(,R14) INCREMENT TARGET POINTER, *00583000
  584. SKIPPING OVER AN EXTRA BLANK 00584000
  585. LA R15,8(,R15) SKIP OVER SOURCE 00585000
  586. SH XR,=H'9' COMPUTE REMAINING TARGET AREA 00586000
  587. BP SC8B LOOP BACK IF ANYTHING LEFT 00587000
  588. B SEND GO FINISH UP SUBSTITUTION 00588000
  589. EJECT 00589000
  590. * HEX AND HEXA OPTIONS -- PERFORM A HEXADECIMAL SUBSTITUTION. 00590000
  591. SPACE 00591000
  592. * SEE DISCUSSION BELOW UNDER 'HEX4A' OPTION FOR EXPLANATION OF WHY 00592000
  593. * A LENGTH IS NOT ALLOWED WITH THE 'HEXA' OPTION. 00593000
  594. SH EQU * 00594000
  595. TM ERSBF,ERSFA WAS AN ADDRESS SPECIFIED? 00595000
  596. L R1,ERSBD LOAD THIS ADDRESS, IF SO 00596000
  597. BZ *+10 SKIP IF DATA VALUE WAS SPECIFIED 00597000
  598. MVC ERSBD,0(R1) COPY DATA INTO ERSBD 00598000
  599. SPACE 00599000
  600. * IN EITHER CASE, ERSBD NOW CONTAINS THE FOUR BYTES OF DATA. 00600000
  601. CH DR,=H'7' MAXIMUM LENGTH IS 8 00601000
  602. BL *+8 LONGER THAN 8? 00602000
  603. LA DR,7 ALLOW ONLY 8 CHARS 00603000
  604. SPACE 00604000
  605. * CONVERT NUMBER TO BCD HEX 00605000
  606. UNPK ERT2(9),ERSBD(5) UNPACK IT 00606000
  607. TR ERT2(8),TRTBL TRANSLATE IT 00607000
  608. SPACE 00608000
  609. * COPY ONLY THE LAST K CHARACTERS, WHERE K IS THE LENGTH OF THE FIELD. 00609000
  610. LA R1,ERT2+7 POINT TO END OF STRING 00610000
  611. SR R1,DR SUBTRACT NUMBER OF CHARS 00611000
  612. B *+10 SKIP OVER MVC 00612000
  613. MVC 1(0,IR),0(R1) LENGTH FILLED IN BY MVC 00613000
  614. EX DR,*-6 COPY STRING 00614000
  615. B SEND GO FINISH UP SUBSTITUTION 00615000
  616. SPACE 00616000
  617. TRTBL EQU *-C'0' DISPLACE TRANSLATE TABLE BACK 00617000
  618. DC C'0123456789ABCDEF' TRANSLATE TABLE 00618000
  619. EJECT 00619000
  620. * HEX4A OPTION. COVERT THE SOURCE DATA FIELD INTO GRAPHIC 00620000
  621. * HEXADECIMAL, INSERTING A BLANK ON THE LINE AFTER EACH FOUR BYTES 00621000
  622. * OF INPUT ( FOUR BYTES OF OUTPUT). 00622000
  623. * NOTICE THAT THIS OPTION (HEX4A) IS DIFFERENT FROM THE HEX OPTION, 00623000
  624. * EVEN FOR VERY SHORT SUBSTITUTIONS -- UNDER FOUR CHARACTERS. 00624000
  625. * THE DIFFERENCE IS THAT YOU ALWAYS SPECIFIED FOUR BYTES OF DATA WITH 00625000
  626. * THE HEX OPTION, AND IF THE FIELD CONTAINS LESS THAN EIGHT BYTES, 00626000
  627. * YOU TRUNCATE FROM THE LEFT, KEEPING LOW-ORDER DIGITS IN THE FINAL 00627000
  628. * TEXT. IN THE CASE OF THE HEX4A OPTION, YOU TRUNCATE FROM THE RIGHT. 00628000
  629. * IN FACT, IT WAS THIS CONFUSION THAT CASUED ME NOT EVEN TO ALLOW A 00629000
  630. * LENGTH OT BE SPECIFIED WITH THE 'HEXA' OPTION. 00630000
  631. SH4 EQU * 00631000
  632. TM ERSBF,ERSFL DID THE USER SPECIFY A LENGTH? 00632000
  633. BNO SH4A GO IF HE DID NOT 00633000
  634. SPACE 00634000
  635. * IF THE USER SPECIFIED A LENGTH, IT IS THE LENGTH OF THE SOURCE FIELD, 00635000
  636. * WHICH IS TO BE CONVERTED. WE MUST COMPUTE THE FIELD SIZE WHICH HE 00636000
  637. * WILL REQUIRE FOR HIS INPUT LENGTH. THIS WILL BE APPROXIMATELY 00637000
  638. * 9/4'THS OF THE INPUT LENGTH. THE EXACT FORMULA IS: 00638000
  639. * REQUIRED LENGTH = (L-1)/4*9 + 2*MOD(L-1,4) + 2 00639000
  640. * WE COMPUTE THIS FORMULA BELOW, EXCEPT THAT WE ADD IN '+1' RATHER THAN 00640000
  641. * '+2', SINCE WE ARE INTERESTED IN THE LENGTH-1, TO COMPARE WITH 00641000
  642. * REGISTER DR. 00642000
  643. SLR R0,R0 00643000
  644. SLR R1,R1 00644000
  645. IC R1,ERSBL GET SPECIFIED LENGTH 00645000
  646. BCTR R1,0 R1 <- (L-1) 00646000
  647. LTR R1,R1 WAS LENGTH = 0? 00647000
  648. BM SEND NOTHING TO DO IF SO 00648000
  649. SPACE 00649000
  650. * WE DIVIDE (L-1) BY 4. THE QUOTIENT IS IN REG 1, AND THE 00650000
  651. * REMAINDER (MOD(L-1,4)) IS IN REG 0. 00651000
  652. D R0,=F'4' DIVIDE BY 4 00652000
  653. MH R1,=H'9' R1 <- (L-1)/4*9 00653000
  654. AR R0,R0 R0 <- 2*MOD(L-1,4) 00654000
  655. AR R1,R0 R1 <- (L-1)/4*9 + 2*MOD(L-1,4) 00655000
  656. LA R1,1(,R1) ADD AN EXTRA 1 00656000
  657. SPACE 00657000
  658. * R1 CONTAINS THE (NEEDED FIELD LENGTH) - 1 00658000
  659. CLR R1,DR TAKE MINIMUM OF THE TWO 00659000
  660. BNL *+6 00660000
  661. LR DR,R1 00661000
  662. SPACE 00662000
  663. * WE NOW CONVERT 4 BYTES AT A TIME OF THE SOURCE INTO EIGHT CHARACTERS, 00663000
  664. * AND INSERT THEM INTO THE MESSAGE AREA, PUTTING A BLANK AT THE END 00664000
  665. * OF EACH GROUP. 00665000
  666. SH4A EQU * 00666000
  667. LA XR,1(,DR) XR CONTAINS REAL FIELD SIZE 00667000
  668. LR R14,IR R14 -> TARGET AREA 00668000
  669. L R15,ERSBD R15 -> SOURCE AREA 00669000
  670. SPACE 00670000
  671. * LOOP BACK TO THIS POINT EACH TIME TO CONVERT FOUR MORE BYTES. 00671000
  672. SH4B EQU * 00672000
  673. LR R1,XR GET NUMBER OF BYTES REMAINING 00673000
  674. L R2,0(R15) GET DATA TO BE CONVERTED @VA02693 00674000
  675. ST R2,ERT1 PUT DATA INTO WORK AREA @VA02693 00675000
  676. UNPK ERT2(9),ERT1(5) CONVERT FOUR MORE BYTES @VA02693 00676000
  677. TR ERT2(8),TRTBL 00677000
  678. CH R1,=H'8' AT LEAST EIGHT BYTES LEFT? 00678000
  679. BL *+8 SKIP IF NOT 00679000
  680. LA R1,8 USE ONLY 8 CHARS IF MORE 00680000
  681. BCTR R1,0 DECREMENT FOR EX 00681000
  682. B *+10 SKIP OVER MVC 00682000
  683. MVC 1(,R14),ERT2 LENGTH FILLED IN BY EX 00683000
  684. EX R1,*-6 COPY DATA INTO MESSAGE AREA 00684000
  685. LA R14,9(,R14) SKIP OVER COPIED DATA AND BLANK 00685000
  686. LA R15,4(,R15) SKIP OVER SOURCE JUST CONVERTED 00686000
  687. SH XR,=H'9' COMPUTE NUMBER BYTES REMAINING 00687000
  688. BP SH4B GO IF SOMETHING LEFT 00688000
  689. B SEND OTHERWISE, FINISH UP SUB 00689000
  690. EJECT 00690000
  691. * DEC OR DECA OPTION. PERFORM A DECIMAL CONVERSION. 00691000
  692. SD EQU * 00692000
  693. L R1,ERSBD GET DATA ADDRESS, IF DECA 00693000
  694. TM ERSBF,ERSFA WAS IT DECA? 00694000
  695. BZ *+10 SKIP MVC IF NOT 00695000
  696. MVC ERSBD,0(R1) COPY DATA INTO ERSBD 00696000
  697. L R0,ERSBD R0 NOW CONTAINS THE VALUE TO *00697000
  698. BE CONVERTED. 00698000
  699. LTR XR,R0 GET NUMBER 00699000
  700. BNM ERDD1 GO IF NO MINUS SIGN 00700000
  701. SPACE 00701000
  702. * IF THE NUMBER IS NEGATIVE, WE INCREASE IR AND DECREASE DR, SO 00702000
  703. * THAT WE WILL HAVE ROOM FOR A MINUS SIGN. 00703000
  704. LA IR,1(,IR) INCREASE OUTPUT POINTER 00704000
  705. LPR R0,R0 MAKE NUMBER POSITIVE 00705000
  706. BCTR DR,0 DECREASE FIELD LENGTH BY 1 00706000
  707. SPACE 00707000
  708. * THE NUMBER IN R0 IS NOW POSITIVE. THE REAL NUMBER IS IN XR. 00708000
  709. ERDD1 EQU * 00709000
  710. CH DR,=H'14' BUFFER LENGTH EXCEED 15? 00710000
  711. BL *+8 SKIP IF NOT 00711000
  712. LA DR,14 15 IS THE MAXIMUM 00712000
  713. SPACE 00713000
  714. CVD R0,ERT1 CONVERT NUMBER TO DECIMAL 00714000
  715. MVC ERT2(16),ERDDED MOVE IN EDIT PATTERN 00715000
  716. ED ERT2(16),ERT1 CONVERT NUMBER TO BCD 00716000
  717. SPACE 00717000
  718. * COPY ONLY THE LAST K CHARACTERS, WHERE K IS THE LENGTH OF THE FIELD. 00718000
  719. LA R1,ERT2+15 POINT TO END OF STRING 00719000
  720. SR R1,DR SUBTRACT NUMBER OF CHARS 00720000
  721. B *+10 SKIP OVER MVC 00721000
  722. MVC 1(0,IR),0(R1) LENGTH FILLED IN BY EX 00722000
  723. EX DR,*-6 COPY BCD DECIMAL STRING 00723000
  724. SPACE 00724000
  725. * WE MUST RESET SOME POINTERS, IF THE ORIGINAL NUMBER WAS NEGATIVE. 00725000
  726. LTR XR,XR WAS NUMBER NEGATIVE? 00726000
  727. BNM SEND FINISH UP IF NOT 00727000
  728. BCTR IR,0 RESET FIELD POINTER 00728000
  729. LA DR,1(,DR) RESET FIELD LENGTH 00729000
  730. SPACE 00730000
  731. * WE SEARCH FOR THE FIRST NON-BLANK IN THE DECIMAL NUMBER, AND 00731000
  732. * INSERT A MINUS SIGN IN FRONT OF IT. 00732000
  733. LR R1,IR R1 -> BLANK BEFORE FIELD 00733000
  734. LA R1,1(,R1) INCREMENT CHAR POINTER 00734000
  735. CLI 0(R1),C' ' IS IT A BLANK 00735000
  736. BE *-8 LOOP BACK IF IT IS 00736000
  737. BCTR R1,0 POINT TO BLANK PRECEDING DIGIT 00737000
  738. MVI 0(R1),C'-' MOVE IN MINUS SIGN 00738000
  739. B SEND GO FINISH UP SUBSTITUTION 00739000
  740. SPACE 00740000
  741. ERDDED DC C' ',13X'20',X'2120' EDIT PATTERN 00741000
  742. EJECT 00742000
  743. * FINISH UP THE SUBSTITUTION. WE MUST SKIP ALL LEADING BLANKS IN 00743000
  744. * THE SUBSTITUTION FIELD (THE COPY LOOP WILL SKIP TERMINATING BLANKS). 00744000
  745. * OF COURSE WE DON'T DO THAT IF BLANK COMPRESSION IS NOT WANTED. 00745000
  746. SEND EQU * 00746000
  747. L DR,ERSSZ RESTORE SIZE OF SUB FIELD 00747000
  748. LA DR,1(,DR) DR <- # CHARS IN SUB FIELD 00748000
  749. TM ERPF2,ERF2CM BLANK COMPRESSION WANTED? 00749000
  750. BZ ERLUP GO IMMEDIATELY IF NOT 00750000
  751. SPACE 00751000
  752. * THE FOLLOWING LOOP SKIPS LEADING BLANKS. 00752000
  753. SEND1 EQU * 00753000
  754. CLI 1(IR),C' ' NEXT CHAR A BLANK? 00754000
  755. BNE ERLUP RE-ENTER SCAN LOOP IF NOT 00755000
  756. LA IR,1(,IR) SKIP OVER TO IT 00756000
  757. BCT DR,SEND1 LOOP BACK IF NOT END OF FIELD 00757000
  758. B ERLUP RE-ENTER SCAN LOOP 00758000
  759. * COME HERE ON END OF SCAN. 00759000
  760. ND EQU * 00760000
  761. TM ERPF2,ERF2DT DOES HE WANT A DOT? 00761000
  762. BZ NDD GO IF NOT 00762000
  763. TM ERPF2,ERF2CM DOES HE WANT BLANK COMPRESSION? 00763000
  764. BZ NB SKIP IF NOT 00764000
  765. CLI 0(OR),C' ' IS THERE A TERMINATING BLANK? 00765000
  766. BNE NB SKIP IF NOT 00766000
  767. BCTR OR,0 JUMP BACK IF SO 00767000
  768. SPACE 00768000
  769. NB EQU * 00769000
  770. CLI 0(OR),C'.' IS LAST CHAR ALREADY A DOT? 00770000
  771. BNE *+6 SKIP IF NOT 00771000
  772. BCTR OR,0 DON'T HAVE TWO, IF SO 00772000
  773. MVI 1(OR),C'.' INSERT A DOT 00773000
  774. LA OR,1(,OR) POINT TO LAST CHAR OF MESSAGE 00774000
  775. SPACE 00775000
  776. * AT THIS POINT, OR -> THE LAST CHAR OF THE MESSAGE. WE COMPUTE 00776000
  777. * MESSAGE LENGTH AND MESSAGE STARTING ADDRESS, AND STORE THEM INTO 00777000
  778. * THE 'TYPLIN' PLIST, FOR LACK OF A BETTER PLACE. 00778000
  779. NDD EQU * 00779000
  780. LA R1,ERMESS POINT TO START OF MESSAGE 00780000
  781. TM ERPF1,ERF1HD IS THERE A MESSAGE HEADER? 00781000
  782. BO *+8 SKIP IF SO 00782000
  783. LA R1,ERTEXT OTHERWISE, POINT TO TEXT AREA 00783000
  784. ST R1,ERTPLA STORE ADDRESS IN TYPLIN PLIST 00784000
  785. SR OR,R1 COMPUTE MESSAGE LENGTH 00785000
  786. LA OR,1(,OR) OR CONTAINS MESSAGE LENGTH 00786000
  787. ST OR,ERTPLL STORE LENGTH IN TYPLIN PLIST 00787000
  788. TM ERPF1,ERF1BF WAS 'BUFFA' SPECIFIED? 00788000
  789. BZ NU GO IF NOT 00789000
  790. SPACE 00790000
  791. * OTHERWISE, WE COPY THE MESSAGE TEXT INTO THE USER'S BUFFER AREA. 00791000
  792. L R1,ERTPLL GET MESSAGE LENGTH 00792000
  793. L R14,ERTPLA ADDRESS OF MESSAGE TEXT 00793000
  794. BCTR R14,0 POINT TO PRECEDING BYTE 00794000
  795. STC R1,0(R14) STORE LENGTH INTO PRECEDING BYTE 00795000
  796. L R15,ERPBFA POINT TO SPECIFIED BUFFER AREA 00796000
  797. B *+10 SKIP OVER MVC 00797000
  798. MVC 0(0,R15),0(R14) LENGTH FILLED IN BY EX 00798000
  799. EX R1,*-6 COPY OVER LENGTH AND MESSAGE 00799000
  800. SPACE 00800000
  801. NU EQU * 00801000
  802. SPACE 00802000
  803. * WE NOW BRANCH TO A SPECIAL ROUTINE DEPENDING ON WHAT THE MACRO 00803000
  804. * SPECIFIED IN THE 'DISP' FIELD. 00804000
  805. IC R1,ERPF2 GET DISP BYTE 00805000
  806. N R1,=AL1(0,0,0,7) GET LAST THREE BITS 00806000
  807. AR R1,R1 MULTIPLY BY 4 00807000
  808. AR R1,R1 00808000
  809. B *+4(R1) BRANCH TO SPECIALIZED ROUTINE 00809000
  810. B DER DISP=ERRMSG 00810000
  811. B DTY DISP=TYPE 00811000
  812. B DSI DISP=SIO 00812000
  813. B DNO DISP=NONE 00813000
  814. B DPR DISP=PRINT 00814000
  815. B DCP DISP=CPCOMM 00815000
  816. B DTY ILLEGAL 00816000
  817. B DTY ILLEGAL 00817000
  818. B DTY ILLEGAL 00818000
  819. EJECT 00819000
  820. * 'ERRMSG' OPTION. IN MOST CASES, WE WILL SET A SPECIAL BIT IN THE 00820000
  821. * TYPLIN PLIST SO THAT CONWRIT WILL DO THE SIO TO CP WITH A SPECIAL 00821000
  822. * OPCODE OF X'05', WHICH WILL INDICATE TO CP THAT THIS IS TO BE 00822000
  823. * PROCESSED AS AN ERROR MESSAGE. 00823000
  824. DER EQU * 00824000
  825. SPACE 00825000
  826. * TYPLIN PLIST BITS 00826000
  827. ERMBIT EQU X'40' ERROR MESSAGE BIT 00827000
  828. NOHTBIT EQU X'01' 'HT' CAN'T CANCEL THIS LINE 00828000
  829. SPACE 00829000
  830. * THE BITS THAT GET SET IN THE PLIST DEPEND ON THE 'LET' FIELD OF THE 00830000
  831. * ERROR MESSAGE. THE BITS ARE SET AS FOLLOWS: 00831000
  832. * E + I + W -> ERMBIT 00832000
  833. * S + T -> NOHTBIT 00833000
  834. * R + OTHERS -> NO BITS 00834000
  835. SPACE 00835000
  836. * WE CHECK THE LETTER NINE BYTES FROM THE START OF THE MESSAGE TEXT, 00836000
  837. * WHETHER DMSERR CREATED THE HEADER OR NOT. THIS WILL ALLOW 00837000
  838. * 'LINEDIT DISP=ERRMSG' TO WORK PROPERLY, WITH THE USER SPECIFYING HIS 00838000
  839. * OWN HEADER. 00839000
  840. L R1,ERTPLA GET ADDRESS OF MESSAGE TEXT 00840000
  841. CLI 9(R1),C'E' IS LETTER = E 00841000
  842. BE DERE GO IF YES 00842000
  843. CLI 9(R1),C'I' LETTER = I 00843000
  844. BE DERE GO IF SO 00844000
  845. CLI 9(R1),C'W' LETTER = W 00845000
  846. BE DERE GO IF SO 00846000
  847. CLI 9(R1),C'S' LETTER = S 00847000
  848. BE DERH GO IF SO 00848000
  849. CLI 9(R1),C'T' LETTER = T 00849000
  850. BE DERH GO IF SO 00850000
  851. SPACE 00851000
  852. * OTHERWISE, WE SET NO BITS WHATSOEVER, AND GO TYPE IT OUT. 00852000
  853. MVI ERTPLL+1,0 ZERO OUT FLAG BYTE 00853000
  854. B DTY 00854000
  855. SPACE 00855000
  856. * FOR E, I AND W, SET THE ERMBIT, SO THAT SIO X'05' WILL BE USED. 00856000
  857. DERE EQU * 00857000
  858. MVI ERTPLL+1,ERMBIT SET ERROR MESSAGE BIT 00858000
  859. B DTY GO TYPE MESSAGE 00859000
  860. SPACE 00860000
  861. * FOR S AND T MESSAGES, SET NOHTBIT, SO THAT THE MESSAGE CAN NEVER 00861000
  862. * BE CANCELED. 00862000
  863. DERH EQU * 00863000
  864. MVI ERTPLL+1,NOHTBIT SET NO HT BIT 00864000
  865. B DTY 00865000
  866. EJECT 00866000
  867. * 'TYPE' OPTION. WE BALR TO TYPLIN, SO THAT WE WON'T DO AN SVC, SO 00867000
  868. * THAT WE CAN BE CALLED FROM THE SAVC HANDLER, DMSITS. 00868000
  869. DTY EQU * 'TYPE' OPTION 00869000
  870. L R15,=V(DMSCWR) POINT TO TYPLIN ROUTINE 00870000
  871. LA R1,ERTPL POINT TO TYPLIN PLIST 00871000
  872. MVI ERTPLA,1 FILL IN REST OF IT 00872000
  873. MVI ERTPLL,C'R' 00873000
  874. MVC ERTPL(8),=CL8'TYPLIN' 00874000
  875. BAL RR,NUCCALL CALL TYPEOUT ROUTINE 00875000
  876. B DNO 00876000
  877. EJECT 00877000
  878. * PRINT OPTION. 00878000
  879. DPR EQU * 00879000
  880. MVC ERTPL(8),=CL8'PRINTR' SET UP PRINTR PLIST 00880000
  881. LA R1,ERTPL AND POINT TO IT 00881000
  882. L R15,=V(PRINTR) VCON FOR PRINTR ROUTINE 00882000
  883. BAL RR,NUCCALL GO CALL IT 00883000
  884. B DNO WE'RE FINISHED 00884000
  885. EJECT 00885000
  886. * DISP=SIO IS USED ONLY FOR EMERGENCIES, SUCH AS WHEN TYPLIN IS 00886000
  887. * CALLING DMSERR. IT DOES ITS OWN SIO'S TO THE TERMINAL, AND DOESN'T 00887000
  888. * USE SYSTEM FACILITIES. 00888000
  889. DSI EQU * 00889000
  890. SSM =X'00' DISABLE ALL INTERRUPTS V0005 00890000
  891. SR R1,R1 V0005 00891000
  892. BCTR R1,0 R1 <- -1 V0005 00892000
  893. DIAG R1,R14,X'24' FIND ADDRESS OF CONSOLE V0005 00893000
  894. BC B'0001',DSNC CC = 3 -> NO VIRTUAL CONSOLV0005 00894000
  895. SPACE 1 V0005 00895000
  896. * OTHERWISE, R1 CONTAINS THE VIRTUAL CONSOLE ADDRESS V0005 00896000
  897. SPACE 1 V0005 00897000
  898. * WE NOW 'REMEMBER' WHETHER THERE IS ACTIVITY PENDING ON THE V0005 00898000
  899. * VIRTUAL CONSOLE, SO WE CAN RESTORE THE STATUS AFTER WE HAVE V0005 00899000
  900. * TYPED OUT THE MESSAGE. V0005 00900000
  901. SR XR,XR ZERO FLAG = NO TERMINAL ACTIVITY 00901000
  902. TIO 0(R1) ANY CONSOLE ACTIVITY? V0005 00902000
  903. BZ DSIS GO IF NOT 00903000
  904. LA XR,1 SET FLAG FOR CONSOLE ACTIVITY 00904000
  905. TIO 0(R1) WAIT FOR CONSOLE ACTIVITY V0005*00905000
  906. TO FINISH V0005 00906000
  907. BC 7,*-4 JUMP BACK IF NOT FINISHED 00907000
  908. SPACE 00908000
  909. * SET UP CCW 00909000
  910. DSIS EQU * 00910000
  911. MVC ERT2(16),CCWS COPY DUMMY CCWS INTO WORK AREA 00911000
  912. MVC ERT2+1(3),ERTPLA+1 COPY DATA ADDRESS INTO CCW 00912000
  913. MVC ERT2+5(3),ERTPLL+1 COPY DATA LENGTH INTO CCW 00913000
  914. LA R0,ERT2 00914000
  915. ST R0,CAW STORE IN CAW V0005 00915000
  916. SIO 0(R1) DO OUTPUT TO CONSOLE V0005 00916000
  917. BC 7,*-4 LOOP UNTIL IT 'TAKES' 00917000
  918. TIO 0(R1) WAIT FOR COMPLETION V0005 00918000
  919. BC 7,*-4 WAIT UNTIL IT COMPLETES 00919000
  920. LTR XR,XR WAS THERE ANY CONSOLE ACTIVITY? 00920000
  921. BZ DNO NOTHING TO DO IF NOT 00921000
  922. SPACE 1 V0005 00922000
  923. * WE NOW WISH TO RESTORE THE 'ACTIVITY PENDING' STATUS OF THE V0005 00923000
  924. * CONSOLE, TO KEEP THE CONSOLE HANDLING ROUTINES HAPPY. THE V0005 00924000
  925. * WAY TO DO THIS IS TO DO A SIO ON THE SECOND OF THE TWO CCW'S V0005 00925000
  926. * IN CCWCONS, WHICH IS THE AREA IN NUCON USED BY THE CONSOLE V0005 00926000
  927. * ROUTINES. V0005 00927000
  928. MVI CONCCWS+8,4 CHANGE NOP TO SENSE V0005 00928000
  929. LA R0,CONCCWS+8 POINT TO CCW V0005 00929000
  930. ST R0,CAW STORE IN CAW V0005 00930000
  931. SIO 0(R1) START I/O ON THIS CCW V0005 00931000
  932. BC 7,*-4 LOOP UNTIL IT 'TAKES' V0005 00932000
  933. MVI CONCCWS+8,3 CHANGE SENSE BACK TO NOP V0005 00933000
  934. B DNO GO FINISH UP 00934000
  935. SPACE 2 V0005 00935000
  936. * IF THE GUY HAS NO CONSOLE ATTACHED, THEN WE PRODUCE THE MESSAGE V0005 00936000
  937. * BY MEANS OF 'CP MSG *' COMMAND. V0005 00937000
  938. DSNC EQU * V0005 00938000
  939. LA R1,DSMS POINT TO MSG * V0005 00939000
  940. LA R0,DSMSL GET LENGTH OF MESSAGE V0005 00940000
  941. DIAG R1,R0,8 DIAGNOSE TO CP V0005 00941000
  942. B DIE DIE IMMEDIATELY V0005 00942000
  943. SPACE 1 V0005 00943000
  944. DSMS DC C'MSG * DMSERR215T NO VIRTUAL CONSOLE ATTACHED. ' V0005 00944000
  945. DC C'RE-IPL CMS.' V0005 00945000
  946. DSMSL EQU *-DSMS V0005 00946000
  947. SPACE 2 00947000
  948. CCWS CCW 9,0,X'60',0 WRITE WITH CC/SILI 00948000
  949. CCW 3,0,X'20',1 NOP 00949000
  950. EJECT 00950000
  951. * CPCOMM OPTION. PASS THE TEXT TO CP TO EXECUTE AS A COMMAND. 00951000
  952. DCP EQU * 00952000
  953. LA R1,=CL16'CONWAIT CON1' POINT TO A PLIST @VA09080 00952300
  954. L R15,=V(DMSCWT) GET ADDRESS OF CONWAIT ROUTINE @VA09080 00952600
  955. BAL RR,NUCCALL AND CALL CONWAIT TO DRAIN I/O @VA09080 00952900
  956. L R1,ERTPLA GET ADDRESS OF MESSAGE TEXT 00953000
  957. L R0,ERTPLL GET LENGTH OF MESSAGE TEXT 00954000
  958. DC X'83100008' DIAGNOSE IT TO CP 00955000
  959. ST R0,ERSAVE+4*R15 SAVE ERROR CODE FOR OUR RETURN 00956000
  960. B DNO GO FINISH UP 00957000
  961. EJECT 00958000
  962. * COME HERE ON 'NONE' DISPOSITION, AND ALSO TO FINISH UP. 00959000
  963. * WE MUST RETURN TO CALLER, EITHER BY A NORMAL RETURN, OR BY 00960000
  964. * LOADING A DISABLED WAIT STATE PSW. 00961000
  965. DNO EQU * 00962000
  966. TM ERPF2,ERF2DI WAS DIE=YES SPECIFIED? 00963000
  967. BO DIE GO DIE IF SO 00964000
  968. LM R0,R15,ERSAVE RESTORE REGISTERS 00965000
  969. BR R14 AND RETURN TO CALLER 00966000
  970. EJECT 00967000
  971. * SUBROUTINE TO CALL A NUCLEUS ROUTINE, IF THE VCON TO IT WAS 00968000
  972. * RESOLVED. IF IT WAS NOT RESOLVED, THEN SVC 202 IS CALLED. 00969000
  973. * WE ASSUME R1 POINTS TO THE PLIST. 00970000
  974. NUCCALL EQU * 00971000
  975. ST RR,ERT1 SAVE RETURN REGISTER 00972000
  976. LTR R15,R15 WAS VCON RESOLVED? 00973000
  977. BZ NUCCALLS NO -- MAKE AN SVC CALL 00974000
  978. LA R13,ERPAS13 POINT TO A SAVE AREA 00975000
  979. BALR R14,R15 CALL ROUTINE 00976000
  980. SPACE 00977000
  981. * THE ROUTINE MAY HAVE CLOBBERED ALL OUR REGISTERS, WE ASSUME 00978000
  982. * NOTHING. 00979000
  983. BALR R15,0 RE-ESTABLISH ADDRESSABILITY 00980000
  984. USING *,R15 00981000
  985. L BR,=A(DMSERR) 00982000
  986. DROP R15 00983000
  987. L TR,=V(DMSERT) POINT TO WORK AREA 00984000
  988. L RR,ERT1 RESTORE RETURN REG 00985000
  989. BR RR AND RETURN TO CALLER 00986000
  990. SPACE 00987000
  991. NUCCALLS EQU * 00988000
  992. SVC 202 MAKE AN SVC CALL 00989000
  993. DC AL4(*+4) 00990000
  994. BR RR 00991000
  995. * COME HERE TO DIE 00992000
  996. DIE EQU * 00993000
  997. * IF BATCH IS RUNNING, DON'T ALLOW DISABLED WAIT STATE V0742 00994000
  998. TM BATFLAGS,BATRUN BATCH MONITOR RUNNING? V0742 00995000
  999. BZ NOTBAT IF NOT, FORGET THIS... V0742 00996000
  1000. TM BATFLAG2,BATSYSAB RECURSIVE SYS ABEND CHEK @VA05162 00997000
  1001. BZ BATABEND FIRST TIME, GOTO BATCH @VA05162 00998000
  1002. BAL R1,DIEDIAG POINT TO MSG LINE @VA05162 00999000
  1003. DIEMSG DC C'MSG OPERATOR CMSBATCH SYSTEM ABEND' @VA05162 01000000
  1004. DIEMSGLN EQU *-DIEMSG @VA05162 01001000
  1005. DIEDIAG LA R2,DIEMSGLN PROVIDE LENGTH OF DIE MSG @VA05162 01002000
  1006. DC X'83120008' DIAG MSG TO CP AND... @VA05162 01003000
  1007. B NOTBAT NOW DIE IN PEACE. @VA05162 01004000
  1008. BATABEND OI BATFLAG2,BATSYSAB SET RECURSION FLAG ... @VA05162 01005000
  1009. L R15,ABATABND GO TO BATCH ABEND PROC. V0742 01006000
  1010. BALR R14,R15 AND DON'T COME BACK... V0742 01007000
  1011. NOTBAT EQU * V0742 01008000
  1012. SPACE 01009000
  1013. L R15,AUSERRST ANY MACHINE THAT WANTS TO BE @V60C5BE 01010000
  1014. * RESTARTED SHOULD PUT A VCON HERE.@V60C5BE 01011000
  1015. XC AUSERRST,AUSERRST ZERO THE LOCATION TO PREVENT @V60C5BE 01012000
  1016. * RECURSIVE ABEND LOOPS @V60C5BE 01013000
  1017. LTR R15,R15 DID VM SUPPLY A RESTART ENTRY PT?@V60C5BE 01014000
  1018. BCR 7,R15 IF THERE IS ONE, GO TO IT. @V60C5BE 01015000
  1019. SPACE 01016000
  1020. * IF THE GUY DID NOT REQUEST AN SIO, THEN WE DO A CONWAIT BEFORE DYING. 01017000
  1021. IC R1,ERPF2 GET HIS 'DISP' VALUE 01018000
  1022. N R1,=AL1(0,0,0,7) GET LAST THREE BITS 01019000
  1023. CH R1,=AL2(ERF2SI) DID HE REQUEST 'SIO'? 01020000
  1024. BE DIEW YES -- GO DIE DIRECTLY 01021000
  1025. LA R1,=CL16'CONWAIT CON1' POINT TO A PLIST 01022000
  1026. L R15,=V(DMSCWT) LOAD VCON FOR CONWAIT ROUTINE 01023000
  1027. BAL RR,NUCCALL CALL CONWAIT 01024000
  1028. SPACE 01025000
  1029. * NOW, FINALLY, WE CAN DIE 01026000
  1030. DIEW EQU * 01027000
  1031. SPACE 01028000
  1032. * WE MUST DECIDE WHETHER WE WERE CALLED BY SVC OR BALR CALL. 01029000
  1033. L XR,CURRSAVE GET ADDRESS OF SYSTEM SAVE AREA 01030000
  1034. LTR XR,XR IS THERE ANY? 01031000
  1035. BZ DIEBALR NO -> WE WERE CALLED BY BALR 01032000
  1036. USING SSAVE,XR 01033000
  1037. SPACE 01034000
  1038. * WE ARE NOW POINTING TO THE CURRENT SYSTEM SAVE AREA. WE CHECK TO 01035000
  1039. * SEE IF THE CALLEE NAME IS DMSERR OR LINEDIT. 01036000
  1040. CLC CALLEE,=CL8'DMSERR' IS THE CALLEE DMSERR? 01037000
  1041. BE DIESVC SVC CALL IF SO 01038000
  1042. CLC CALLEE,=CL8'LINEDIT' IS THE CALLED LINEDIT? 01039000
  1043. BNE DIEBALR BALR CALL IF NOT 01040000
  1044. SPACE 01041000
  1045. * FOR SVC CALLS, WE SIMPLE DISABLE THE SVC OLD PSW, AND SET THE 01042000
  1046. * WAIT STATE BIT ON. 01043000
  1047. DIESVC EQU * 01044000
  1048. MVI OLDPSW,0 TURN OFF THE SYSTEM MASK 01045000
  1049. OI OLDPSW+1,X'02' TURN ON WAIT STATE BIT 01046000
  1050. LM R0,R15,ERSAVE RESTORE REGS 01047000
  1051. BR R14 RETURN TO SVC HANDLER 01048000
  1052. SPACE 01049000
  1053. * FOR BALR CALLS, WE CREATE OUR OWN DISABLED WAIT STATE PSW AND LOAD 01050000
  1054. * IT. 01051000
  1055. DIEBALR EQU * 01052000
  1056. SPACE 01053000
  1057. ERMPSW EQU X'30' CONSTRUCTION AREA FOR PSW 01054000
  1058. MVC ERMPSW(4),=X'00020000' SET DISABLED WAIT STATE 01055000
  1059. LM R0,R15,ERSAVE RESTORE REGISTERS 01056000
  1060. ST R14,ERMPSW+4 SET ADDR IN PSW 01057000
  1061. LPSW ERMPSW DIE 01058000
  1062. LTORG 01059000
  1063. EJECT 01060000
  1064. DMSERT 01061000
  1065. NUCON 01062000
  1066. SVCSAVE 01063000
  1067. END 01064000
ibm/vm370-lib/cms/dmserr.assemble_src.txt ยท Last modified: 2023/08/06 13:35 by Site Administrator