User Tools

Site Tools


ibm:vm370-lib:cms:dmspio.assemble_src

DMSPIO Source

References

Source Listing

DMSPIO.ASSEMBLE.txt
  1. PIO TITLE 'DMSPIO (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00004000
  4. * MODULE NAME: DMSPIO (ALSO KNOWN AS PRINTIO) 00005000
  5. * 00006000
  6. * FUNCTIONS: 1) TO BUILD PRINTER CCWS BASED ON ASA OR MACHINE CODE 00007000
  7. * CONTROL CHARACTERS 00008000
  8. * 00009000
  9. * 2) TO ISSUE START I/O TO VIRTUAL PRINTER AND ANALYZE 00010000
  10. * THE RESULTING STATUS 00011000
  11. * 00012000
  12. * ATTRIBUTES: NUCLEUS RESIDENT, REENTRANT 00013000
  13. * 00014000
  14. * ENTRY POINTS: DMSPIO(PRINTR) - PRINT 1 LINE 00015000
  15. * DMSPIOCC - PUT CCWS AND DATA IN CALLER'S BUFFER 00016000
  16. * DMSPIOSI - PRINT CALLER'S BUFFER 00017000
  17. * 00018000
  18. * ENTRY CONDITIONS: UPON ENTRY, R1 POINTS TO A PARAMETER LIST. 00019000
  19. * THE FORMATS OF THE PLISTS FOR THE 3 ENTRY POINTS 00020000
  20. * ARE AS FOLLOWS: 00021000
  21. * 00022000
  22. * PLIST FOR DMSPIO: CL8'PRINTIO'|CL8'PRINTR' 00023100
  23. * A(LINE TO BE PRINTED) 00024000
  24. * H - '0' = ASA CODE (SEE NOTES) 00025000
  25. * '1' = MACH CODE (SEE NOTES) 00026000
  26. * H - LENGTH OF THE LINE 00027000
  27. * 8X'FF' 00028000
  28. * 00029000
  29. * PLIST FOR DMSPIOCC: CL8'DMSPIOCC' 00030000
  30. * A(LINE TO BE PUT IN BUFFER) 00031000
  31. * H - '0' = ASA CODE (SEE NOTES) 00032000
  32. * '1' = MACH CODE (SEE NOTES) 00033000
  33. * H - LENGTH OF THE LINE 00034000
  34. * A(BUFFER) 00035000
  35. * 8X'FF' 00036000
  36. * 00037000
  37. * PLIST FOR DMSPIOSI: CL8'DMSPIOSI' 00038000
  38. * A(BUFFER) 00039000
  39. * 8X'FF' 00040000
  40. * 00041000
  41. * EXIT CONDITIONS: AT EXIT R15 CONTAINS ONE OF THE FOLLOWING: 00042000
  42. * 00043000
  43. * R15 MEANING 00044000
  44. * 0 NORMAL COMPLETION 00045000
  45. * 1 LINE TOO LONG 00046000
  46. * 2 CHANNEL 12 DETECTED (VIRTUAL 3211 OR 3203) 00047000
  47. * 3 CHANNEL 9 DETECTED (VIRTUAL 3211 OR 3203) 00048000
  48. * 5 UNKNOWN ERROR 00049000
  49. * 100 NO VIRTUAL PRINTER 00050000
  50. * 00051000
  51. * CALLS TO OTHER ROUTINES: DMSIOW (WAIT) - WAIT FOR DEVICE END 00052000
  52. * DMSERR - PROCESS ERROR MESSAGES 00053000
  53. * 00054000
  54. * EXTERNAL REFERENCES: NUCON 00055000
  55. EJECT 00056000
  56. * 00057000
  57. * TABLES/WORKAREAS: AREA PROVIDED BY INTSVC OR BUFFER 00058000
  58. * PROVIDED BY CALLER 00059000
  59. * 00060000
  60. * REGISTER USAGE: 00061000
  61. * R1 PLIST POINTER AT ENTRY 00062000
  62. * R2 PLIST POINTER SAVE 00063000
  63. * R10 RETURN ADDRESS SAVE 00064000
  64. * R11 BASE REG IN CALLER'S BUFFER OR ZERO 00065000
  65. * R12 BASE REGISTER 00066000
  66. * R13 BUFFER/WORK AREA POINTER 00067000
  67. * R14 RETURN REG AT ENTRY 00068000
  68. * R15 A(WAIT) OR RETURN CODE 00069000
  69. * 00070000
  70. * NOTES: THE COMMAND CODES THAT ARE PUT IN THE CCWS ARE BASED ON THE 00071000
  71. * FIRST CHARACTER OF THE LINE TO BE PRINTED. IF THIS 00072000
  72. * CHARACTER IS AN ASA DEFINED CODE, APPROPRIATE CCWS ARE 00073000
  73. * BUILT TO SKIP OR SPACE AS NEEDED, THEN PRINT. IF THE 00074000
  74. * CHARACTER IS ITSELF A VALID MACHINE CCW COMMAND CODE, A 00075000
  75. * CCW IS BUILT USING THE CHARACTER AS THE COMMAND CODE. 00076000
  76. * IF THE CHARACTER IS NOT RECOGNIZED AS EITHER ASA OR 00077000
  77. * MACHINE CODE, A CCW WITH THE MACHINE CODE X'09' IS BUILT, 00078000
  78. * TO SPACE 1 AFTER PRINTING. 00079000
  79. * 00080000
  80. * THERE ARE TWO CHARACTERS, X'C1' AND X'C3', THAT ARE VALID 00081000
  81. * BOTH AS ASA CODES AND AS MACHINE CODES. IF THE HALFWORD 00082000
  82. * AT 12 INTO THE PLIST CONTAINS 0, THE ASA CODES ARE CHECKED 00083000
  83. * BEFORE THE MACHINE CODES, AND THEREFORE X'C1' AND X'C3' WILL 00084000
  84. * BE INTERPRETED AS ASA CODES. IF THE HALFWORD IS EQUAL TO 1, 00085000
  85. * ASA CODES ARE NOT CHECKED AT ALL, SO X'C1' AND X'C3' ARE 00086000
  86. * INTERPRETED AS MACHINE CODES. NOTE THAT IF THE HALFWORD 00087000
  87. * EQUALS 0, ALL ASA CODES AND ALL MACHINE CODES EXCEPT X'C1' 00088000
  88. * AND X'C3' ARE RECOGNIZED, BUT IF THE HALFWORD EQUALS 1, 00089000
  89. * ONLY MACHINE CODES ARE RECOGNIZED. 00090000
  90. * 00091000
  91. * 00092000
  92. * OPERATION: 00093000
  93. * DMSPIO(PRINTR) - A CHAIN OF 3 STOCK CCWS IS MOVED INTO 00094000
  94. * THE WORK AREA PROVIDED BY INTSVC. THESE CCWS ARE SPACE, 00095000
  95. * PRINT, AND NOP. THE FIRST CHARACTER OF THE LINE TO BE 00096000
  96. * PRINTED IS ANALYZED TO DETERMINE WHAT CCW COMMANDS TO USE. 00097000
  97. * THE STOCK CCWS ARE MODIFIED WITH WITH THESE COMMANDS. IF 00098000
  98. * ONLY ONE CCW IS NEEDED TO PERFORM THE REQUESTED FUNCTION, 00099000
  99. * THE SECOND CCW IS USED. IF THE GIVEN CODE IS AN IMMEDIATE 00100000
  100. * MACHINE CODE, NO DATA ARE PRINTED. THE LAST CCW IN THE 00101000
  101. * CHAIN IS A NOP TO FORCE CHANNEL END AND DEVICE END TO COME 00102000
  102. * TOGETHER. WHEN THE CCWS ARE SET UP, THE CAW IS SET TO 00103000
  103. * POINT TO THE CHAIN, AND A START I/O IS ISSUED TO THE 00104000
  104. * VIRTUAL PRINTER. DMSIOW (WAIT) IS CALLED TO WAIT FOR 00105000
  105. * DEVICE END. THE STATUS AND, IF NECESSARY, THE SENSE 00106000
  106. * INFORMATION, IS ANALYZED. ANY ERRORS ENCOUNTERED ARE 00107000
  107. * RETURNED TO THE CALLER. 00108000
  108. EJECT 00109000
  109. * 00110000
  110. * DMSPIOCC - TO USE DMSPIOCC, THE CALLER MUST PROVIDE A 00111000
  111. * 4096-BYTE BUFFER ON A PAGE BOUNDARY. THE BUFFER MUST 00112000
  112. * BE IN THE FOLLOWING FORMAT: 00113000
  113. * 00114000
  114. * PAGE BOUNDARY +--------+--------+ 00115000
  115. * | BUFCTR | BATCTR | 00116000
  116. * +8 +--------+--------+ 00117000
  117. * | | | 00118000
  118. * +16 +--------+--------+ 00119000
  119. * | BUFDATA | 00120000
  120. * | | 00121000
  121. * | | 00122000
  122. * | (ETC.) | 00123000
  123. * 00124000
  124. * WHERE 'BUFCTR' IS A FULLWORD CONTAINING THE ADDRESS OF THE 00125000
  125. * NEXT AVAILABLE LOCATION IN THE BUFFER, AND 'BUFDATA' IS 00126000
  126. * THE FIRST DATA LOCATION, AND BATCTR IS A FULLWORD USED 00127000
  127. * FOR CMS BATCH ACCOUNTING. 00128000
  128. * 00129000
  129. * A CHAIN OF 3 STOCK CCWS IS MOVED INTO THE CALLER'S BUFFER, 00130000
  130. * AND THE FIRST CHARACTER OF THE LINE IS ANALYZED AS 00131000
  131. * DESCRIBED ABOVE TO DETERMINE THE CCW COMMAND CODES TO BE 00132000
  132. * USED. IF ONLY ONE CCW IS NEEDED, THE FIRST ONE IS USED. 00133000
  133. * WHEN THE CCWS ARE SET UP, THE DATA ARE MOVED INTO THE 00134000
  134. * CALLER'S BUFFER, PRECEDED BY A TIC CCW THAT POINTS TO THE 00135000
  135. * NEXT DOUBLEWORD ADDRESS BEYOND THE DATA. THE CALLER'S 00136000
  136. * BUFCTR IS UPDATED TO POINT TO THE NEXT AVAILABLE 00137000
  137. * LOCATION. 00138000
  138. * 00139000
  139. * DMSPIOSI - TO USE DMSPIOSI, THE CALLER MUST PROVIDE 00140000
  140. * A BUFFER IN THE FORMAT DESCRIBED ABOVE. THE BUFFER 00141000
  141. * CONTAINS CHAINED CCWS, TICS AROUND DATA, AND DATA. 00142000
  142. * SINCE ALL CCWS PUT IN THE BUFFER BY DMSPIOCC HAVE THE 00143000
  143. * COMMAND CHAIN FLAG ON, THE CALLER SHOULD MOVE A NOP 00144000
  144. * INTO THE END OF THE BUFFER BEFORE CALLING DMSPIOSI. 00145000
  145. * WHEN DMSPIOSI IS ENTERED, THE CAW IS SET TO POINT TO 00146000
  146. * THE BEGINNING OF THE CCW CHAIN, AND A START I/O IS 00147000
  147. * ISSUED TO THE VIRTUAL PRINTER. DMSIOW (WAIT) IS CALLED 00148000
  148. * TO WAIT FOR DEVICE END. THE STATUS AND, IF NECESSARY, 00149000
  149. * THE SENSE INFORMATION, IS ANALYZED. IF ERRORS ARE DETECTED, 00150000
  150. * THEY ARE RETURNED TO THE CALLER. 00151000
  151. * 00152000
  152. *. 00153000
  153. ********************************************************************* 00154000
  154. EJECT 00155000
  155. *********************************************************************** 00156000
  156. * 00157000
  157. * START OF PROGRAM 00158000
  158. * 00159000
  159. *********************************************************************** 00160000
  160. SPACE 1 00161000
  161. DMSPIO START 0 00162000
  162. ENTRY PRINTR 00163000
  163. PRINTR EQU DMSPIO 00164000
  164. LR R12,R15 ESTABLISH ADDRESSABILITY 00165000
  165. USING DMSPIO,R12 00166000
  166. USING NUCON,0 00167000
  167. SR R11,R11 R11 = 0 WILL INDICATE WE ENTERED HERE 00168000
  168. B JOIN 00169000
  169. SPACE 1 00170000
  170. ENTRY DMSPIOCC 00171000
  171. DMSPIOCC EQU * 00172000
  172. LR R12,R15 GET SAME ADDRESSABILITY AS ABOVE 00173000
  173. LA R15,DMSPIOCC-DMSPIO ... 00174000
  174. SR R12,R15 NOW IT IS CORRECT 00175000
  175. L R11,16(,R1) ADDRESS OF CALLER'S BUFFER IN R11 00176000
  176. USING BUFSECT,R11 ADDRESSABILITY IN CALLER'S BUFFER 00177000
  177. L R13,BUFCTR NEXT AVAILABLE BUFFER ADDRESS IN R13 00178000
  178. B JOIN 00179000
  179. SPACE 1 00180000
  180. ENTRY DMSPIOSI 00181000
  181. DMSPIOSI EQU * 00182000
  182. LR R12,R15 GET SAME ADDRESSABILITY AS ABOVE 00183000
  183. LA R15,DMSPIOSI-DMSPIO ... 00184000
  184. SR R12,R15 NOW IT IS CORRECT 00185000
  185. LR R10,R14 SAVE RETURN ADDRESS IN R10 00186000
  186. L R11,8(,R1) ADDRESS OF BUFFER IN R11 00187000
  187. LA R3,BUFDATA ADDRESS OF DATA START IN R3 00188000
  188. B PRINGO GO DO SIO - NO CCW BUILD 00189000
  189. SPACE 1 00190000
  190. SPACE 1 00191000
  191. JOIN EQU * 00192000
  192. LR R10,R14 SAVE RETURN ADDRESS IN R10 00193000
  193. LR R2,R1 KEEP ADDRESS OF PLIST IN R2 00194000
  194. * 00195000
  195. * LENGTH OF LINE TO PRINT INTO R7... 00196000
  196. * 00197000
  197. L R7,12(R2) LOW ORDER HALFWORD IS THE LENGTH 00198000
  198. N R7,=A(X'FFFF') ENSURE IT'S NOT A NEGATIVE NUMBER 00199000
  199. BZ NORMRET0 RETURN IMMEDIATELY IF NOTHING TO DO 00200000
  200. LA R15,151 MAXIMUM ALLOWABLE LENGTH 00201000
  201. CR R7,R15 IS HIS TOO BIG? 00202000
  202. BH ERROR1 IF SO, THAT'S ERROR 1 00203000
  203. BCTR R7,0 DECREMENT TO ALLOW FOR CARRIAGE CONTROL 00204000
  204. * 00205000
  205. * MOVE CCWS INTO STORAGE PROVIDED BY INTSVC OR INTO 00206000
  206. * BUFFER IF CALLED BY BALR (TO KEEP IT REENTRANT)... 00207000
  207. * 00208000
  208. MVC 0(24,R13),CCW MOVE CCWS INTO R13 AREA 00209000
  209. SPACE 3 00210000
  210. *********************************************************************** 00211000
  211. * 00212000
  212. * DEAL WITH CARRIAGE CONTROL CHARACTER... 00213000
  213. * 00214000
  214. *********************************************************************** 00215000
  215. SPACE 1 00216000
  216. L R6,8(,R2) LOOK AT GIVEN CARRIAGE CONTROL CHARACTER 00217000
  217. CLC 12(2,R2),=XL2'0001' WAS MACH CODE SPECIFIED? 00218000
  218. BE MAC YES, BYPASS ASA CHECK 00219000
  219. * 00220000
  220. * CHECK FOR CHARACTERS 'BLANK','0','-','A,B,C', AND '+'. 00221000
  221. * 00222000
  222. CLI 0(R6),C' ' IS CONTROL CHAR BLANK? 00223000
  223. BE PRINDEF BRANCH IF SO - USE DEFINED ASA CONTROL 00224000
  224. BL MAC (OR GO DEAL WITH MACHINE CODES) 00225000
  225. LA R15,X'13' READY FOR SPACE 2 LINES BEFORE PRINT 00226000
  226. CLI 0(R6),C'0' IS THAT WHAT HE WANTS? 00227000
  227. BE PRINCC BRANCH IF SO (GO DO IT) 00228000
  228. LA R15,X'1B' READY FOR SPACE 3 LINES BEFORE PRINT 00229000
  229. CLI 0(R6),C'-' IS THAT WHAT HE WANTS? 00230000
  230. BE PRINCC BRANCH IF SO (GO DO IT) 00231000
  231. LA R15,2 SET INDEX IN CASE ONE OF THE NEXT 3 00232000
  232. CLI 0(R6),C'A' DOES HE WANT TO SKIP TO 10? 00233000
  233. BE ASKIP BRANCH IF SO 00234000
  234. CLI 0(R6),C'B' DOES HE WANT TO SKIP TO 11? 00235000
  235. BE BSKIP BRANCH IF SO 00236000
  236. CLI 0(R6),C'C' DOES HE WANT TO SKIP TO 12? 00237000
  237. BE CSKIP BRANCH IF SO 00238000
  238. CLI 0(R6),C'+' DOES HE WANT OVERPRINT? 00239000
  239. BNE USASKIP BRANCH IF NOT (CHECK REST OF ASA CODES) 00240000
  240. LTR R7,R7 ARE THERE ANY DATA? 00241000
  241. BZ NORMRET0 BRANCH IF NOT (NOTHING TO DO) 00242000
  242. B PRINT GO PRINT WITHOUT CARRIAGE CONTROL 00243000
  243. SPACE 1 00244000
  244. ASKIP BCTR R15,0 REDUCE INDEX BY 1 00245000
  245. BSKIP BCTR R15,0 REDUCE INDEX BY 1 00246000
  246. CSKIP IC R15,ABC(R15) INDEX INTO TABLE FOR CORRECT CODE 00247000
  247. B PRINCC GO BUILD THE CCW 00248000
  248. SPACE 1 00249000
  249. ABC DC XL4'D3DBE300' SKIP CODES FOR ASA 'A,B,C' 00250000
  250. SPACE 1 00251000
  251. * 00252000
  252. * SEE IF CARRIAGE CONTROL IS ONE OF THE OTHER 00253000
  253. * ASA CODES (SKIP COMMANDS)... 00254000
  254. * 00255000
  255. USASKIP EQU * 00256000
  256. CLI 0(R6),X'F9' IS CONTROL CHAR TOO HIGH TO BE ASA? 00257000
  257. BH DEFAULT BRANCH IF SO - USE DEFAULT CARR CONTROL 00258000
  258. CLI 0(R6),X'F1' IS IT TOO LOW? 00259000
  259. BL MAC BRANCH IF SO - CHECK MACHINE CODES 00260000
  260. IC R15,0(R6) CARRIAGE CONTROL CHAR INTO R15 00261000
  261. SLL R15,3 MOVE CHANNEL VALUE OVER TO RIGHT PLACE 00262000
  262. LA R15,3(,R15) INDICATE CARRIAGE CONTROL ONLY (NO DATA) 00263000
  263. B PRINCC 00264000
  264. * 00265000
  265. * SEE IF CARRIAGE CONTROL IS A PERMISSABLE MACHINE CODE. 00266000
  266. * FIRST TEST LITERAL ONES (NOT THE SKIP COMMANDS) 00267000
  267. * 00268000
  268. MAC EQU * 00269000
  269. LA R3,MACODES READY TO LOOP THRU MACHINE CODES 00270000
  270. LA R4,1 LOOP INCREMENT 00271000
  271. LA R5,MACODES+L'MACODES-1 LOOP LIMIT 00272000
  272. SPACE 1 00273000
  273. MACLOOP EQU * LOOP THRU LITERAL MACHINE CODES 00274000
  274. CLC 0(1,R6),0(R3) IS THIS IT? 00275000
  275. BE MACFOUND BRANCH IF SO 00276000
  276. BXLE R3,R4,MACLOOP LOOP BACK 00277000
  277. * 00278000
  278. * SEE IF CONTROL CHARACTER IS A 'SKIP' MACHINE CODE 00279000
  279. * 00280000
  280. TM 0(R6),X'81' COULD IT BE 'SKIP TO CHANNEL N'? 00281000
  281. BNO DEFAULT BRANCH IF NOT - USE DEFAULT CONTROL CHAR 00282000
  282. TM 0(R6),X'04' MAKE SURE 00283000
  283. BO DEFAULT BRANCH IF NOT VALID FOR SKIP COMMAND 00284000
  284. CLI 0(R6),X'E3' IS IT TOO HIGH? 00285000
  285. BH DEFAULT BRANCH IF SO - USE DEFAULT 00286000
  286. CLI 0(R6),X'89' IS IT TOO LOW? 00287000
  287. BNL MACFOUND BRANCH IF OK TO USE AS IS 00288000
  288. SPACE 1 00289000
  289. DEFAULT MVI 0(R6),X'09' USE MACH CODE TO PRINT, THEN SPACE 00290000
  290. MACFOUND EQU * WE'VE FOUND A VALID MACHINE CODE 00291000
  291. TM 0(R6),X'03' IS IT AN IMMEDIATE COMMAND? 00292000
  292. BNO MACDATA NO, PRINT WHATEVER DATA IS GIVEN 00293000
  293. SR R7,R7 YES, NO DATA WILL BE PRINTED 00294000
  294. MACDATA EQU * 00295000
  295. MVC 8(1,R13),0(R6) REPLACE COMMAND CODE IN 2ND CCW 00296000
  296. B PRINT GO DO IT 00297000
  297. EJECT 00298000
  298. ********************************************************************** 00299000
  299. * 00300000
  300. * COME HERE TO PERFORM PRELIMINARY CARRIAGE CONTROL 00301000
  301. * 00302000
  302. *********************************************************************** 00303000
  303. SPACE 1 00304000
  304. PRINCC EQU * 00305000
  305. STC R15,0(,R13) STORE COMMAND CODE IN FIRST CCW 00306000
  306. SPACE 1 00307000
  307. PRINDEF EQU * (COME HERE TO SPACE 1 BEFORE PRINT) 00308000
  308. LTR R11,R11 BUILDING BUFFER ONLY? 00309000
  309. BNZ PRINDEF1 BRANCH IF SO 00310000
  310. LR R3,R13 READY TO START FROM BEGINNING OF CCWS 00311000
  311. LTR R7,R7 ARE THERE ANY DATA TO PRINT? 00312000
  312. BNZ PRINSET BRANCH IF SO - SET UP 2ND CCW 00313000
  313. * 00314000
  314. * IF CARRIAGE CONTROL ALONE IS REQUIRED, USE SECOND CCW 00315000
  315. * INSTEAD OF THE FIRST 00316000
  316. * 00317000
  317. MVC 8(8,R13),0(R13) MOVE COMMAND TO 2ND CCW 00318000
  318. * 00319000
  319. * DROP THROUGH TO 'PRINT', WHICH, SINCE R7=0, WILL SET R3 00320000
  320. * TO ADDRESS OF 2ND CCW AND BRANCH TO 'PRINGO' 00321000
  321. * 00322000
  322. SPACE 1 00323000
  323. *********************************************************************** 00324000
  324. * 00325000
  325. * COME HERE TO PERFORM PRINTING WITHOUT PRELIMINARY CARRIAGE 00326000
  326. * CONTROL, OR DROP THROUGH FROM ABOVE TO PERFORM CARRIAGE 00327000
  327. * CONTROL WITHOUT PRINTING ANY DATA... 00328000
  328. * 00329000
  329. ********************************************************************** 00330000
  330. SPACE 1 00331000
  331. PRINT EQU * 00332000
  332. LTR R11,R11 BUILDING BUFFER ONLY? 00333000
  333. BNZ PRINT1 BRANCH IF SO 00334000
  334. LA R3,8(,R13) READY TO START WITH 2ND CCW 00335000
  335. LTR R7,R7 ARE THERE ANY DATA TO PRINT? 00336000
  336. BZ PRINGO BRANCH IF NOT - USE A BLANK 00337000
  337. SPACE 1 00338000
  338. PRINSET EQU * SET UP CCW FOR PRINTING THE LINE 00339000
  339. IC R15,8(,R13) SAVE COMMAND CODE IN 2ND CCW 00340000
  340. LA R6,1(,R6) ADDRESS OF LINE TO PRINT 00341000
  341. ST R6,8(,R13) STORE IN CCW 00342000
  342. STC R15,8(,R13) RESTORE COMMAND CODE 00343000
  343. STH R7,14(,R13) STORE LENGTH ALSO 00344000
  344. B PRINGO GO ISSUE START I/O 00345000
  345. EJECT 00346000
  346. *********************************************************************** 00347000
  347. * 00348000
  348. * COME HERE TO MOVE DATA INTO CALLER'S BUFFER. 00349000
  349. * 00350000
  350. * STOCK CCWS HAVE BEEN MOVED INTO THE BUFFER. 00351000
  351. * NOW, FINISH BUILDING THESE CCWS, ADD APPROPRIATE 00352000
  352. * TIC CCW AROUND THE DATA, AND MOVE THE DATA TO THE 00353000
  353. * BUFFER. 00354000
  354. * 00355000
  355. *********************************************************************** 00356000
  356. SPACE 1 00357000
  357. PRINDEF1 EQU * COME HERE FOR DEFINED CCWS FOR BUFFER 00358000
  358. LA R13,8(,R13) 1ST CCW OK - POINT R13 TO 2ND CCW 00359000
  359. LTR R7,R7 ARE THERE ANY DATA? 00360000
  360. BNZ PRINSET1 BRANCH IF SO - SET UP 2ND CCW 00361000
  361. *** CARRIAGE CONTROL ONLY - LEAVE 1ST CCW AS IS 00362000
  362. ST R13,BUFCTR UPDATE BUFFER ADDRESS 00363000
  363. B NORMRETC 00364000
  364. SPACE 1 00365000
  365. PRINT1 EQU * COME HERE TO USE ONLY 1 CCW 00366000
  366. MVC 0(8,R13),8(R13) MOVE COMMAND TO 1ST CCW 00367000
  367. LTR R7,R7 ARE THERE ANY DATA? 00368000
  368. BNZ PRINSET1 BRANCH IF SO 00369000
  369. TM 0(R13),X'03' IMMEDIATE COMMAND? 00370000
  370. BO IMMED IF SO, NO DATA NEEDED 00371000
  371. LA R6,NODATA NO DATA GIVEN, AND NOT IMM. CMD. @VA05935 00372000
  372. LA R7,1 ...USE A BLANK AS DATA 00373000
  373. B PRINSET1 ...AND PUT SAME IN BUFFER 00374000
  374. IMMED LA R8,8(,R13) NO DATA - ADDRESS AFTER CCW IN R8 00375000
  375. ST R8,BUFCTR UPDATE RESUME ADDRESS IN BUFFER 00376000
  376. B NORMRETC 00377000
  377. * 00378000
  378. * COME HERE IF THERE ARE DATA TO MOVE TO BUFFER. R13 POINTS 00379000
  379. * TO EITHER 1ST OR 2ND CCW. THIS CCW WILL BE FILLED IN FOR 00380000
  380. * THE DATA TO PRINT. R6 POINTS TO THE DATA, AND R7, WHICH 00381000
  381. * IS NONZERO, CONTAINS THE COUNT. 00382000
  382. * 00383000
  383. PRINSET1 EQU * 00384000
  384. LA R3,16(,R13) FILL IN DATA ADDRESS IN CCW 00385000
  385. STCM R3,B'0111',1(R13) ... 00386000
  386. STH R7,6(R13) FILL IN BYTE COUNT IN CCW 00387000
  387. LA R3,16(R7,R13) BASIC CONTINUATION ADDRESS IN R3 00388000
  388. BCTR R7,0 DECREMENT LENGTH FOR EXECUTE 00389000
  389. EX R7,BUFLOAD MOVE DATA TO BUFFER 00390000
  390. SR R9,R9 ZERO R9 00391000
  391. LA R9,7 COMPUTE ACTUAL... 00392000
  392. AR R3,R9 ...CONTINUATION ADDRESS... 00393000
  393. SRL R3,3 ...BY ROUNDING UP TO NEXT... 00394000
  394. SLL R3,3 ...DOUBLEWORD BOUNDARY 00395000
  395. ST R3,8(,R13) BUILD TIC CCW 00396000
  396. MVI 8(R13),X'08' AND MOVE IN COMMAND CODE 00397000
  397. ST R3,BUFCTR UPDATE CONTINUATION ADDRESS 00398000
  398. B NORMRETC 00399000
  399. SPACE 1 00400000
  400. BUFLOAD MVC 16(0,R13),1(R6) MOVE DATA INTO BUFFER 00401000
  401. EJECT 00402000
  402. ********************************************************************** 00403000
  403. * 00404000
  404. * COME HERE TO PERFORM START I/O AND ANALYZE STATUS 00405000
  405. * 00406000
  406. * R3 POINTS TO CCW 00407000
  407. * R11 = 0 MEANS WE CAME HERE AFTER ENTERING AT DMSPIO(PRINTR) 00408000
  408. * AND WE ARE PRINTING A SINGLE LINE 00409000
  409. * R11 NONZERO MEANS ENTRY WAS MADE AT DMSPIOSI, AND WE ARE 00410000
  410. * PRINTING THE CALLER'S BUFFER 00411000
  411. * 00412000
  412. ********************************************************************** 00413000
  413. SPACE 1 00414000
  414. PRINGO EQU * 00415000
  415. USING PRSECT,R13 00416000
  416. LA R5,14 ASSUME PRINTER '00E' 00417000
  417. MVC PRWAITP(20),PWAIT MOVE WAIT PLIST TO KEEP IT REENTRANT 00418000
  418. LA R1,PRWAITP ADDRESS OF WAIT PLIST IN R1 00419000
  419. SPACE 1 00420000
  420. SIO EQU * 00421000
  421. SR R15,R15 ZERO CSW SAVE FIELD 00422000
  422. ST R15,PRCSW ... 00423000
  423. LA R14,SIO SET RETURN VECTOR FOR WAIT 00424000
  424. LA R4,NORMRET SET RETURN VECTOR FOR TALL 00425000
  425. ST R3,CAW STORE ADDRESS OF CCW FOR SIO 00426000
  426. LR R9,R3 SAVE ADDRESS OF CCW @VA07597 00426100
  427. SIO 0(R5) ISSUE START I/O 00427000
  428. BC 8,IOWAIT BRANCH IF SUCCESSFULLY STARTED 00428000
  429. BC 4,CSWSTOR CC1 - CSW STORED 00429000
  430. BC 2,BUSY CC2 - BUSY 00430000
  431. B ERR113S CC3 - NOT OPERATIONAL 00431000
  432. SPACE 1 00432000
  433. IOWAIT EQU * 00433000
  434. L R15,=V(WAIT) ADDRESS OF WAIT ROUTINE 00434000
  435. BALR R14,R15 WAIT FOR INTERRUPT 00435000
  436. MVC PRCSW(8),CSW MOVE IT TO SAVE AREA 00436000
  437. TM PRSTAT,X'04' HAVE WE DEVICE END? 00437000
  438. BO TSTINT YES, SEE KIND OF INTERRUPTS 00438000
  439. L R15,=V(WAIT) ADDRESS OF WAIT ROUTINE 00439000
  440. BALR R14,R15 WAIT FOR DEVICE END 00440000
  441. OC PRSTAT(2),CSW+4 OR IN THE STATUS BYTES 00441000
  442. SPACE 1 00442000
  443. TSTINT EQU * 00443000
  444. CLC ZERO,PRCOUNT ANY RESIDUAL COUNT? 00444000
  445. BE TESTCSW NO RESIDUAL COUNT, CHECK CSW 00445000
  446. LA R8,8 00446000
  447. L R15,PRCSW ADDRESS OF NEXT CCW IN R15 00447000
  448. SR R15,R8 ADDRESS OF THIS CCW IN R15 00448000
  449. TM 0(R15),X'03' CHECK COMMAND TYPE 00449000
  450. BO TESTCSW IMMEDIATE COMMAND - SKIP CHECK 00450000
  451. LA R15,1 RETURN ERROR 1 00451000
  452. B ERRET RETURN TO CALLER 00452000
  453. SPACE 1 00453000
  454. TESTCSW EQU * 00454000
  455. TM PRSTAT,X'02' HAVE WE UNIT CHECK? 00455000
  456. BO FEEL YES, CHECK SENSE BYTES 00456000
  457. TM PRSTAT,X'01' HAVE WE UNIT EXCEPTION? 00457000
  458. BNO TALL NO, TEST FOR OTHER ERRORS 00458000
  459. LTR R11,R11 PRINTING FROM BUFFER? 00459000
  460. BZ ERROR2 NO,ERROR2 00460000
  461. TM DOSFLAGS,EIGHT IS THIS DOS PIO CALL? @V305066 00460100
  462. BO ERROR2 YES, BREAK CCW CHAIN ON UE @V305066 00460200
  463. BAL R8,RESTART YES, RESTART THE BUFFER 00461000
  464. ERROR2 LA R15,2 RETURN 'CHAN 12 SENSED' 00462000
  465. B ERRET 00463000
  466. SPACE 1 00464000
  467. TALL EQU * 00465000
  468. TM PRSTAT+1,X'3F' ANY OTHER ERRORS? 00466000
  469. BCR 8,R4 NO,RETURN VIA R4 00467000
  470. B ERROR5 ELSE, UNKNOWN ERROR RETURNED 00468000
  471. SPACE 1 00469000
  472. CSWSTOR EQU * 00470000
  473. LA R4,ERROR5 IN CASE OF UNKNOWN ERROR 00471000
  474. MVC PRSTAT(2),CSW+4 SAVE STORED CSW (BYTES 4,5 ONLY) 00472000
  475. CLC PRSTAT(2),=X'0C00' IS CSWSTOR FOR NOP? @VA03714 00472300
  476. BE NORMRET YES, GOTO NORMAL RETURN @VA03714 00472600
  477. TM PRSTAT,X'0C' NICE CE+DE? 00473000
  478. BM WAITDE CE GIVEN - WAIT FOR DE 00474000
  479. B TESTCSW TEST THE CSW STATUS 00475000
  480. SPACE 1 00476000
  481. WAITDE EQU * 00477000
  482. L R15,=V(WAIT) ADDRESS OF WAIT ROUTINE 00478000
  483. BALR R14,R15 WAIT FOR DE 00479000
  484. OC PRSTAT(2),CSW+4 SAVE STATUS BITS IF ANY 00480000
  485. B TESTCSW TEST THE CSW STATUS 00481000
  486. SPACE 1 00482000
  487. BUSY EQU * 00483000
  488. L R15,=V(WAIT) ADDRESS OF WAIT ROUTINE 00484000
  489. BR R15 WAIT FOR INTERRUPT 00485000
  490. SPACE 1 00486000
  491. FEEL EQU * 00487000
  492. LA R15,PRSNCCW LOCATION FOR SENSE CCW, NOP 00488000
  493. MVC 0(16,R15),SENCCW PUT THE SENSE CCW THERE 00489000
  494. ST R15,CAW STORE ADDRESS FOR SIO 00490000
  495. LA R15,PRSENFO LOCATION FOR SENSE BYTE 00491000
  496. MVI 0(R15),X'FF' INITIALIZE WITH BAD NEWS 00492000
  497. ST R15,PRSNCCW ADDRESS INTO CCW 00493000
  498. MVI PRSNCCW,X'04' CHANGE COMMAND CODE 00494000
  499. SIO 0(R5) READ THE SENSE BYTE 00495000
  500. BNE *-4 00496000
  501. TIO 0(R5) THEN WAIT UNTIL... 00497000
  502. BC 2,*-4 ...IT'S DONE 00498000
  503. TM 0(R15),X'40' IS INTERVENTION REQUIRED? 00499000
  504. BO ERROR4 PRINT MESSAGE IF SO @VA14336 00500000
  505. TM 0(R15),X'3C' DATA ERRORS? 00501000
  506. BNZ ERR145S 00502000
  507. TM 0(R15),X'01' CHAN 9 SENSED? 00503000
  508. BZ ERROR5 NO, DON'T KNOW WHAT IT IS 00504000
  509. LTR R11,R11 PRINTING FROM BUFFER? 00505000
  510. BZ ERROR3 NO, ERROR3 00506000
  511. TM DOSFLAGS,EIGHT IS THIS DOS PIO CALL? @V305066 00506100
  512. BO ERROR3 YES, BREAK CCW CHAIN ON UC @V305066 00506200
  513. BAL R8,RESTART YES, RESTART THE BUFFER 00507000
  514. ERROR3 LA R15,3 RETURN WITH CHAN 9 SENSED 00508000
  515. B ERRET 00509000
  516. SPACE 1 00510000
  517. RESTART EQU * ATTEMPT BUFFER RESTART 00511000
  518. L R15,PRCSW 1ST WORD OF CSW IN R15 00512000
  519. LA R3,0(,R15) ADDRESS OF NEXT CCW IN R3 00513000
  520. LTR R3,R3 ...WILL BE 0 IF 'CSW STORED' 00514000
  521. BZ RETRYIO CSW STORED ON SIO @VA07597 00515110
  522. CLI 0(R3),X'08' IS NEXT CCW A TIC? @VA02370 00515300
  523. BNE SIO NO, GO AHEAD AND RESTART @VA02370 00515400
  524. ICM R3,7,1(R3) PICK UP TIC-TO ADDRESS @VA02370 00515500
  525. B SIO AND RESTART ON THAT @VA02370 00515600
  526. RETRYIO EQU * @VA07597 00515700
  527. LR R3,R9 PICKUP CCW ADD FOR RETRY @VA07597 00515800
  528. B SIO GO RETRY SIO @VAO7597 00515900
  529. EJECT 00517000
  530. ********************************************************************** 00518000
  531. * 00519000
  532. * ERROR MESSAGES 00520000
  533. * 00521000
  534. ********************************************************************** 00522000
  535. SPACE 1 00523000
  536. ERR113S EQU * 00524000
  537. LA R3,NATT 00525000
  538. LA R4,113 00526000
  539. BAL R8,ERRMSG @VA14336 00527000
  540. LA R15,100 @VA14336 00527300
  541. B ERRET0 @VA14336 00527600
  542. SPACE 1 00528000
  543. ERROR4 EQU * @VA14336 00528100
  544. LA R3,INT @VA14336 00528200
  545. LA R4,145 @VA14336 00528300
  546. BAL R8,ERRMSG @VA14336 00528400
  547. LA R15,4 @VA14336 00528500
  548. B ERRET0 @VA14336 00528600
  549. SPACE 1 @VA14336 00528700
  550. ERR145S EQU * 00529000
  551. LA R3,INT 00530000
  552. LA R4,145 00531000
  553. BAL R8,ERRMSG @VA14336 00532000
  554. LA R15,100 @VA14336 00532300
  555. B ERRET0 @VA14336 00532600
  556. SPACE 1 00533000
  557. ERRMSG EQU * 00534000
  558. DMSERR MF=(E,'SYS'),LET=S,NUM=(4),TEXTA=(3) 00535000
  559. BR R8 @VA14336 00536000
  560. SPACE 1 00538000
  561. ERROR1 EQU * COME HERE FOR LINE TOO LONG 00539000
  562. LA R15,1 00540000
  563. B ERRET0 00541000
  564. SPACE 1 00542000
  565. ERROR5 EQU * COME HERE IF ANY OTHER I/O ERROR 00543000
  566. LA R15,5 00544000
  567. B ERRET 00545000
  568. EJECT 00546000
  569. ********************************************************************* 00547000
  570. * 00548000
  571. * RETURNS 00549000
  572. * 00550000
  573. ********************************************************************* 00551000
  574. SPACE 1 00552000
  575. NORMRETC EQU * 00553000
  576. L R3,BATCTR 00554000
  577. LA R4,1 00555000
  578. AR R3,R4 00556000
  579. ST R3,BATCTR 00557000
  580. SPACE 1 00558000
  581. NORMRET0 EQU * NORMAL RETURN 00559000
  582. SR R15,R15 ZERO RETURN CODE 00560000
  583. ERRET0 LR R14,R10 RESTORE RETURN ADDRESS 00561000
  584. BR R14 RETURN 00562000
  585. SPACE 1 00563000
  586. NORMRET EQU * NORMAL RETURN 00564000
  587. SR R15,R15 ZERO RETURN CODE 00565000
  588. ERRET TM BATFLAGS,BATRUN+BATNOEX IS CMS BATCH RUNNING? 00566000
  589. BM BATTERUP BRANCH IF SO 00567000
  590. LR R14,R10 RESTORE RETURN ADDRESS 00568000
  591. BR R14 RETURN 00569000
  592. SPACE 1 00570000
  593. BATTERUP EQU * COME HERE IF BATCH IS RUNNING 00571000
  594. L R6,ABATLIMT ADDRESSABILITY IN BATCH LIMITS AREA 00572000
  595. USING BATLSECT,R6 ... 00573000
  596. LH R7,BATPRTC CURRENT PRINT LINE COUNT 00574000
  597. LA R8,1 LINE COUNT THIS PRINTING 00575000
  598. LTR R11,R11 ...IF NOT PRINTING BUFFER 00576000
  599. BZ BATIK 00577000
  600. L R8,BATCTR LINE COUNT IF PRINTING BUFFER 00578000
  601. BATIK AR R7,R8 UPDATE BATCH PRINT COUNT 00579000
  602. LH R8,BATPRTL GET LIMIT AS A FULLWORD 00580000
  603. CR R7,R8 ARE WE OVER THE LIMIT? 00581000
  604. BNH BATHOS NO, UPDATE BATCH'S FIELD, RETURN 00582000
  605. OI BATFLAGS+1,BATXLIM+BATXPRT YES, SIGNAL TROUBLE 00583000
  606. L R15,ABATABND ...AND ABEND BATCH 00584000
  607. BR R15 ... 00585000
  608. BATHOS STH R7,BATPRTC UPDATE PRINT COUNT 00586000
  609. LR R14,R10 RESTORE RETURN ADDRESS 00587000
  610. BR R14 RETURN 00588000
  611. EJECT 00589000
  612. *********************************************************************** 00590000
  613. * 00591000
  614. * DATA 00592000
  615. * 00593000
  616. *********************************************************************** 00594000
  617. SPACE 1 00595000
  618. * 00596000
  619. * LEGAL MACHINE CODES (EXCLUDING CHANNEL CODES)... 00597000
  620. * 00598000
  621. DS 0F 00599000
  622. MACODES DC X'010911190B131B03' 00600000
  623. SPACE 1 00601000
  624. DS 0F 00602000
  625. BLANK DC X'40000000' 00603000
  626. DS 0H @VA05935 00603300
  627. NODATA DC X'0040' @VA05935 00603600
  628. SPACE 1 00604000
  629. * 00605000
  630. * DUMMY CCWS - MOVED INTO R13 AREA BEFORE EXECUTION... 00606000
  631. * 00607000
  632. SPACE 1 00608000
  633. CCW CCW X'0B',0,CC+SILI,1 CCW FOR CARRIAGE CONTROL 00609000
  634. CCW X'01',BLANK,CC+SILI,1 2ND OR 'PRIMARY' CCW 00610000
  635. CCW X'03',0,SILI,1 (NO-OP FOR EFFICIENCY) 00611000
  636. SPACE 1 00612000
  637. * 00613000
  638. * WAIT PLIST - MOVED TO R13 AREA BEFORE EXECUTION... 00614000
  639. * 00615000
  640. PWAIT DS 0F 00616000
  641. DC CL8'WAIT' 00617000
  642. DC CL4'PRN1' 00618000
  643. DC F'0' 00619000
  644. DC CL4'PRN1' (LET WAIT OFF THE HOOK) 00620000
  645. SPACE 1 00621000
  646. * 00622000
  647. * SENSE CCW - MOVED TO R13 AREA BEFORE EXECUTION... 00623000
  648. * 00624000
  649. SPACE 1 00625000
  650. SENCCW CCW X'04',*-*,CC+SILI,1 00626000
  651. CCW X'03',0,SILI,1 NOP FOR EFFICIENCY 00627000
  652. ZERO DC H'0' 00628000
  653. SPACE 1 00629000
  654. NATT DC AL1(L'NATTMS) 00630000
  655. NATTMS DC C'PRINTER NOT ATTACHED' 00631000
  656. * 00632000
  657. INT DC AL1(L'INTMS) 00633000
  658. INTMS DC C'INTERVENTION REQUIRED ON PRINTER' 00634000
  659. * 00635000
  660. CC EQU X'40' 00636000
  661. SILI EQU X'20' 00637000
  662. EIGHT EQU X'08' DOS PRINTER INDICATOR IN NUCON @V305066 00637100
  663. * 00638000
  664. LTORG 00639000
  665. EJECT 00640000
  666. ********************************************************************** 00641000
  667. * 00642000
  668. * DSECTS 00643000
  669. * 00644000
  670. ********************************************************************** 00645000
  671. SPACE 1 00646000
  672. PRSECT DSECT 00647000
  673. PRCCWS DS 3D LOCATION FOR STOCK CCWS 00648000
  674. PRWAITP DS 5F AREA FOR WAIT PLIST 00649000
  675. PRSENFO DS 1F SENSE AREA 00650000
  676. PRSNCCW DS 2D SENSE CCW, NOP 00651000
  677. PRCSW DS 4B CSW SAVE AREA... 00652000
  678. PRSTAT DS 2B ...STATUS BYTES... 00653000
  679. PRCOUNT DS 2B ...COUNT... 00654000
  680. PRMISC DS 2D 00655000
  681. SPACE 1 00656000
  682. BUFSECT DSECT 00657000
  683. BUFCTR DC A(*-*) 00658000
  684. BATCTR DC A(*-*) 00659000
  685. DS 2F 00660000
  686. BUFDATA DS 500D 00661000
  687. SPACE 1 00662000
  688. BATLIMIT 00663000
  689. EJECT 00664000
  690. NUCON 00665000
  691. REGEQU 00666000
  692. END 00667000
ibm/vm370-lib/cms/dmspio.assemble_src.txt ยท Last modified: 2023/08/06 13:35 by Site Administrator