Table of Contents

DMKVSP Source

References

Source Listing

DMKVSP.ASSEMBLE.txt
  1. VSP TITLE 'DMKVSP (CP) VM/370 - RELEASE 6' 00001000
  2. ISEQ 73,80 VALIDATE SEQUENCING OF INPUT 00002000
  3. MACRO 00003000
  4. &NAME RELOC 00004000
  5. ENTRY &NAME 00005000
  6. &NAME DS 0H 00006000
  7. DROP R10 00007000
  8. USING *,R12 00008000
  9. ENTER 00009000
  10. SL R12,=A(&NAME-&SYSECT) 00010000
  11. USING &SYSECT,R12 00011000
  12. USING &SYSECT+4096,R10 00012000
  13. MEND 00013000
  14. *. 00014000
  15. * MODULE NAME - 00015000
  16. * 00016000
  17. * DMKVSP 00017000
  18. * 00018000
  19. * FUNCTION - 00019000
  20. * 00020000
  21. * TO HANDLE THE SIMULATION OF ALL USER SIO'S TO A VIRTUAL UNIT 00021000
  22. * RECORD DEVICE (CARD READER, PUNCH, PRINTER, OR PSEUDO 00022000
  23. * TIMER) THAT IS SPOOLED RATHER THAN DEDICATED. ALSO, TO 00023000
  24. * HANDLE CONTROL PROGRAM REQUESTS THAT WISH TO PRINT ON THE 00024000
  25. * USERS VIRTUAL PRINTER 00025000
  26. * 00026000
  27. * ATTRIBUTES - 00027000
  28. * 00028000
  29. * REENTRANT, RESIDENT, ENTERED VIA GOTO FROM DMKVIOEX 00029000
  30. * 00030000
  31. * ENTRY POINTS - 00031000
  32. * 00032000
  33. * DMKVSPEX - TO SIMULATE A SIO TO A SPOOLED UNIT RECORD DEVICE 00033000
  34. * DMKVSPRT - TO PLACE A LINE GENERATED BY THE CONTROL PRO- 00034000
  35. * GRAM ON THE USER'S SPOOLED PRINTER 00035000
  36. * DMKVSPCR - TO STOP PROCESSING THE FILE CURRENTLY IN THE SPOOL- 00036000
  37. * ED CARD READER, AND TO CLEAR ALL PENDING STATUS 00037000
  38. * FROM THE DEVICE 00038000
  39. * DMKVSPCO - TO PERFORM SIMILAR CLOSE FUNCTIONS FOR 00039000
  40. * THE SPOOLED PRINTERS AND PUNCHES 00040000
  41. * 00041000
  42. * DMKVSPCP - CALLED FROM WITHIN DMKVSP TO WRITE CONSOLE 00042000
  43. * HARDCOPY PRINT LINE 00043000
  44. * DMKVSPTO - CALLED FROM DMKVIO AS A SUBROUTINE TO CHECK IF 00044000
  45. * THE VIRL READER IS EMPTY 00045000
  46. * NON-EXECUTABLE ENTRY POINTS - 00046000
  47. * 00047000
  48. * DMKVSPWA - INDEX WORK AREA FOR 3211 00048000
  49. * 00049000
  50. * ENTRY CONDITIONS - 00050000
  51. * 00051000
  52. * GPR2 = CONTENTS OF THE USER'S CAW (VIRTUAL ADDRESS) 00052000
  53. * GPR8 = ADDRESS OF THE VDEVBLOK FOR ADDRESSED VIRTUAL DEVICE 00053000
  54. * GPR9 = DEVICE ADDRESS (CCU IN BINARY) 00054000
  55. * GPR11 = ADDRESS OF USER'S VMBLOK 00055000
  56. * GPR12 = ADDRESS OF DMKVSP 00056000
  57. * 00057000
  58. * NOTE THAT WHEN DMKVSPEX IS ENTERED FROM DMKVIO, GPR13 DOES 00058000
  59. * NOT POINT TO A SAVEAREA, AND THE ENTER AND EXIT MACROS MAY NOT 00059000
  60. * BE USED. INSTEAD EXIT IS MADE DIRECTLY TO DMKDSPCH VIA A 00060000
  61. * GOTO. HOWEVER, IF ANY OF THE OTHER ENTRY POINTS ARE CALLED, 00061000
  62. * THE RETURN MUST BE MADE IN THE NORMAL MANNER 00062000
  63. * 00063000
  64. * EXIT CONDITIONS - 00064000
  65. * 00065000
  66. * NORMAL - 00066000
  67. * EXIT IS MADE DIRECTLY TO DMKDSPCH, WITH THE CORRECT PENDING 00067000
  68. * STATUS PLACED IN ALL VIRTUAL IO BLOKS AND THE USER'S 00068000
  69. * CHANNEL PROGRAM COMPLETELY INTERPRETED. NOTE THAT THE 00069000
  70. * USER HAS REMAINED IN EXWAIT DURING THE ENTIRE PROCESS, IN CON- 00070000
  71. * TRAST TO SELECTOR CHANNEL IO 00071000
  72. * 00072000
  73. EJECT 00073000
  74. * 00074000
  75. * CALLS TO OTHER ROUTINES - 00075000
  76. * 00076000
  77. * DMKPGTSG - TO OBTAIN DASD PAGE BUFFER SPACE 00077000
  78. * DMKRPAGT - TO READ A PAGE BUFFER INTO VIRTUAL MEMORY 00078000
  79. * DMKRPAPT - WRITE A BUFFER FROM VIRTUAL MEMORY TO DASD 00079000
  80. * DMKSCNVD - TO GET FULL VIRTUAL DEVICE ADDRESS 00080000
  81. * DMKSCNVU - TO LOCATE THE VCUBLOK AND VCHBLOK IN ORDER TO POST 00081000
  82. * ANY PENDING INTERRUPT AFTER INTERPRETATION IS COM- 00082000
  83. * PLETED 00083000
  84. * DMKSPLOV - TO OPEN A NEW DASD OUTPUT SPOOL FILE 00084000
  85. * DMKSPLCV - TO CLOSE A NEW DASD OUTPUT SPOOL FILE 00085000
  86. * DMKSPLDL - TO PURGE A PARTIALLY COMPLETE FILE 00086000
  87. * DMKSTKCP - TO QUEUE A CP EXEC BLOK 00087000
  88. * DMKCVTBH - CONVERT DEVICE ADDRESS FOR ERROR MESSAGES 00090000
  89. * DMKTMRPT - TO GET USER'S TOTAL PROBLEM TIME USED 00091000
  90. * DMKERMSG - TO WRITE ERROR MESSAGES 00092000
  91. * DMKPGTVR - TO RELEASE VIRTUAL BUFFER 00093000
  92. * DMKPGTVG - TO GET A VIRTUAL BUFFER 00094000
  93. * DMKPSASC - CHECK IF CCW'S ARE WRITTING INTO A SHARED PAGE 00096000
  94. * DMKPSACC - TO TEST IF A SHARED PAGE WAS CHANGED BY RUNUSER 00097000
  95. * DMKVMAPS - TO UNSHARE A NAMED SYSTEM FROM RUNUSER 00098000
  96. * DMKFREE, DMKFRET, DMKQCNWT, AND DMKCVTDT FOR THE USUAL REASONS 00099000
  97. * DMKCKSPL - CHECKPOINT THE SFBLOK 00100000
  98. * 00101000
  99. * EXTERNAL REFERENCES - 00102000
  100. * 00103000
  101. * DMKVIOMK - A TABLE OF BIT FLAGS INDEXABLE BY DEVICE ADDRESS, 00104000
  102. * USED TO SET AND CLEAR PENDING FLAGS IN VIRTUAL 00105000
  103. * DEVICE, CONTROL UNIT AND CHANNEL BLOKS 00106000
  104. * 00108000
  105. * TABLES / WORKAREAS - 00109000
  106. * 00110000
  107. * 00111000
  108. * REGISTER USAGE - 00112000
  109. * 00113000
  110. * GPR2 = REAL ADDRESS OF THE PAGED SPOOL BUFFER 00114000
  111. * GPR3 = REAL ADDRESS OF THE USER'S DATA AREA 00115000
  112. * GPR4,5 - WORK REGISTERS 00116000
  113. * GPR5 = BASE REG FOR VFCBBLOK (PARTIME) 00117000
  114. * GPR6 = INTERNAL SUBROUTINE LINKAGE 00118000
  115. * GPR7 = ADDRESS OF SFBLOK FOR ACTIVE FILE 00119000
  116. * GPR8 = ADDRESS OF VDEVBLOK FOR ACTIVE VIRTUAL DEVICE 00120000
  117. * GPR9 = ADDRESS OF VSPLCTL WORKAREA 00121000
  118. * GPR10 = DMKVSP BASE ADDRESS NUMBER TWO 00122000
  119. * GPR11 = ADDRESS OF THE USER'S VMBLOK 00123000
  120. * GPR12 = DMKVSP BASE ADDRESS 00124000
  121. * GPR13 = INDEX TO DATA IN SPOOLING BUFFER 00125000
  122. * GPR13 = DEVICE ADDRESS, OR SAVEAREA IF ONE OF THE VIRTUAL 00126000
  123. * CLOSE ROUTINES WAS CALLED 00127000
  124. * GPR14,15 - BALR LINKAGE FOR DMKFREE/DMKFRET 00128000
  125. * 00129000
  126. EJECT 00130000
  127. * NOTES - 00131000
  128. * 00132000
  129. * OPERATION - 00133000
  130. * 00134000
  131. * 1. IF THE DEVICE IS CP BUSY (VDEVSVC=1): BAL TO 00135000
  132. * STKCPBLK ROUTINE TO BUILD AND STACK A CPEXBLOK 00136000
  133. * ON VSPSTK ANCHOR CHAIN TO DELAY THE REQUEST. 00137000
  134. * WHEN THE CPEXBLOK IS UNSTACKED CONTROL WILL BE 00138000
  135. * GIVEN TO ROUTINE AT LABEL RETCPEX. 00139000
  136. * MARK THE VIRTUAL DEVICE AND SUBCHANNEL BUSY, CLEAR THE 00140000
  137. * CSW AND SAVE THE STORAGE KEY; THEN, IF THE SIO IS TO 00141000
  138. * PSEUDO TIMER DEVICE, GO HANDLE THAT CASE; OTHERWISE, 00142000
  139. * CONTINUE 00143000
  140. * 00144000
  141. * 2. FOR SIO'S TO VIRTUAL READERS, PRINTERS AND PUNCHES, TEST 00145000
  142. * TO SEE IF A FILE IS ALREADY OPEN ON THE DEVICE; IF ONE IS 00146000
  143. * OPEN, BRANCH TO HANDLE THE PARTICULAR DEVICE TYPE, 00147000
  144. * OTHERWISE, GO OPEN THE FILE. 00148000
  145. * 00149000
  146. * 3. IF A FILE IS SUCCESFULLY OPENED, CONTINUE PROCESSING FOR 00150000
  147. * THE GIVEN DEVICE TYPE; OTHERWISE RETURN AN ERROR CON- 00151000
  148. * DITION TO THE USER 00152000
  149. * 00153000
  150. * ERROR MESSAGES - 00154000
  151. * 00155000
  152. * DMKVSP427I (TYPE) (VADDR) SYSTEM SPOOL SPACE FULL; FILE CLOSED 00156000
  153. * DMKVSP429I (TYPE) (VADDR) SPOOL ERROR; FILE HELD 00157000
  154. * DMKVSP429I (TYPE) (VADDR) SPOOL ERROR; FILE PURGED 00158000
  155. * 00159000
  156. * ABEND VSP001 00160000
  157. * A CALL TO DMKSCNVU TO LOCATE THE VDEVBLOK, VCHBLOK AND 00161000
  158. * VCUBLOK. ONE OR MORE OF THE BLOK COULD NOT BE LOCATED 00162000
  159. * 00163000
  160. *. 00164000
  161. EJECT 00165000
  162. COPY OPTIONS 00166000
  163. COPY LOCAL OPTIONS 00167000
  164. EJECT 00168000
  165. DMKVSP CSECT LOADER CONTROL ONLY 00169000
  166. SPACE 00170000
  167. ENTRY DMKVSPEX 00171000
  168. SPACE 3 00172000
  169. EXTRN DMKCVTDT,DMKPGTVR,DMKPGTSG 00173000
  170. EXTRN DMKSCNVU,DMKPGTVG,DMKCVTBH 00174000
  171. EXTRN DMKSPLOV,DMKSPLCV 00175000
  172. EXTRN DMKSCNVD @VA12421 00176000
  173. EXTRN DMKTMRPT 00177000
  174. EXTRN DMKRPAGT,DMKRPAPT,DMKVIOMK 00178000
  175. EXTRN DMKPGTSD @VA11232 00178100
  176. EXTRN DMKERMSG,DMKPTRUL,DMKSPLDL 00179000
  177. EXTRN DMKPSASC,DMKPSACC @V60BC11 00180000
  178. EXTRN DMKSTKCP 00181000
  179. EXTRN DMKCKSPL @V304298 00182000
  180. EXTRN DMKVMASH @VA07351 00182100
  181. EXTRN DMKVSQPD @V60BCAA 00182150
  182. SPACE 3 00183000
  183. USING PSA,R0 00184000
  184. USING SPLINK,R2 00185000
  185. USING SFBLOK,R7 00186000
  186. USING VDEVBLOK,R8 00187000
  187. USING VSPLCTL,R9 00188000
  188. USING VMBLOK,R11 00189000
  189. SPACE 2 00190000
  190. DMKVSPEX EQU * 00191000
  191. SPACE 00192000
  192. USING *,R12 00193000
  193. USING *+4096,R10 00194000
  194. SPACE 2 00195000
  195. B VSP0001 00196000
  196. ID DC CL8'DMKVSP' MODULE NAME 00197000
  197. VSP0001 EQU * 00198000
  198. LR R10,R12 SET UP SECOND BASE REGISTER 00199000
  199. A R10,F4096 .. 00200000
  200. STH R13,VDEVUNIT SAVE FULL ADDRESS OF UNIT 00201000
  201. L R1,VDEVIOCT GET IOCOUNT FOR DEVICE 00202000
  202. AL R1,F1 BUMP IO COUNT 00203000
  203. ST R1,VDEVIOCT AND STORE 00204000
  204. TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ?? @VM01021 00205000
  205. BZ SETBUSY NO - @VM01021 00206000
  206. LA R6,RETCPEX ADDRESS OF CPEX RETURN @VM01021 00207000
  207. B STKCPBLK WAIT FOR DEVICE TO FREE UP @VM01021 00208000
  208. RETCPEX AL R8,VMDVSTRT GET VDEVBLOK ADDRESS @VM01021 00209000
  209. NI VDEVSFLG,X'FF'-VDEVSVC RESET CP BUSY @VM01021 00210000
  210. SETBUSY OI VDEVSTAT,VDEVBUSY+VDEVCHBS INDICATE CP BUSY @VM01021 00211000
  211. XC VDEVCSW,VDEVCSW CLEAR VIRTUAL CSW 00212000
  212. LA R1,0(,R2) CLEAR STORAGE KEY FROM CAW 00213000
  213. OI VDEVFLAG,VDEVCCW1 INDICATE 1ST CCW 00214000
  214. STCM R2,8,VDEVKEY SAVE STORAGE KEY IN VDEVBLOK 00215000
  215. CLI VDEVTYPE,TYPTIMER SIO TO A VIRTUAL PSEUDO-TIMER? 00216000
  216. BE SIOTIMER YES -- 00217000
  217. L R9,VDEVSPL GET ADDRESS OF SPOOLING WORKAREA 00218000
  218. LTR R9,R9 IS FILE OPEN YET? 00219000
  219. BNZ INPROCES YES 00220000
  220. BAL R6,OPEN GO OPEN THE FILE 00221000
  221. ST R7,VSPSFBLK SAVE ADDRESS OF SPOOL FILE BLOK 00222000
  222. ST R1,VSPCAW SAVE CAW ADDRESS 00223000
  223. SPACE 00224000
  224. WKBUF EQU * ABTAIN A WORK BUFFER FOR CCW'S AND DATA 00225000
  225. L R5,VSPBUFBK ADDRESS OF WORK BUFFER 00226000
  226. LTR R5,R5 BUFFER PRESENT ?? 00227000
  227. BNZ INPRO1 YES - 00228000
  228. SPACE 00229000
  229. LA R0,VSPBUFSZ LENGTH OF WORK BUFFER 00230000
  230. CALL DMKFREE OBTAIN STORAGE FOR WORK BUFFER 00231000
  231. ST R1,VSPBUFBK SAVE ADDRESS OF WORK BUFFER 00232000
  232. B INPRO1 AND PROCESS 00233000
  233. SPACE 2 00234000
  234. INPROCES ST R1,VSPCAW SAVE VIRTUAL ADDRESS OF CCW 00235000
  235. INPRO1 L R7,VSPSFBLK GET ADDRESS OF SPOOL FILE BLOCK 00236000
  236. L R6,VSPBUFBK WORK BUFFER AVAILABLE ? 00237000
  237. LTR R6,R6 .. 00238000
  238. BZ WKBUF NO WORK BUFFER - GO GET ONE 00239000
  239. XC VSPCCW,VSPCCW CLEAR CCW SAVEAREA 00240000
  240. MVI VSPIDASW,0 RESET IDA SWITCH 00241000
  241. BAL R6,GETCCW GO PICK UP FIRST CCW 00242000
  242. NOP *+4 CORRECT ALLIGNMENT FOR RETURN @VA04572 00242350
  243. * FROM LABEL 'NONIDA' @VA04572 00242700
  244. CLI VDEVTYPC,CLASURI IS IT UNIT RECORD READER ?? 00243000
  245. BE READER YES -- READER TYPE 00244000
  246. B PRINTER FOR PRINTER AND PUNCH TYPE 00245000
  247. EJECT 00246000
  248. *. 00247000
  249. * 00248000
  250. * PSEUDO-TIMER DEVICE PROCESSING 00249000
  251. * 00250000
  252. * 1. VERIFY THAT THE CCW ADDRESS IS ALIGNED AND WITHIN THE 00251000
  253. * USER'S VIRTUAL ADDRESS SPACE 00252000
  254. * 00253000
  255. * 2. TRANS FOR THE CCW AND VERIFY THAT THE DATA ADDRESS IS 00254000
  256. * WITHIN THE USER'S ADDRESS SPACE, AND THAT THE 24 BYTE 00255000
  257. * DATA AREA WILL NOT CROSS A PAGE BOUNDARY 00256000
  258. * 00257000
  259. * 3. TRANS FOR THE DATA PAGE, VERIFY THAT STORAGE PROTECTION IS 00258000
  260. * NOT VIOLATED, AND MOVE THE DATE, TIME, VIRTUAL CPU TIME 00259000
  261. * AND TOTAL CPU TIME TO THE USER 00260000
  262. * 00261000
  263. * 4. EXIT TO DMKDSPCH WITHOUT POSTING ANY INTERRUPTS AS 00262000
  264. * PENDING 00263000
  265. * 00264000
  266. *. 00265000
  267. SPACE 2 00266000
  268. SIOTIMER EQU * HERE TO SIMULATE A SIO TO A PSEUDO TIMER 00267000
  269. EX R1,CAWTEST TEST FOR DOUBLE WORD ALIGNMENT 00268000
  270. BNZ PROGCHK INVALID ALIGNMENT 00269000
  271. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 00270000
  272. TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 00271100
  273. * USER CCW 00272000
  274. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00273000
  275. L R1,0(,R2) GET DATA ADDRESS 00274000
  276. LA R1,0(,R1) CLEAR CCW OP-CODE 00275000
  277. LR R2,R1 DATA MUST NOT CROSS PAGE BOUNDARY 00276000
  278. A R2,=F'23' FINE LAST DATA BYTE ADDRESS 00277000
  279. N R2,NFFS ROUND DOWN TO PAGE NUMBER 00278000
  280. * NFFS = X'FFFFF000' 00279000
  281. CR R1,R2 CROSS PAGE BOUNDARY? 00280000
  282. BL PROGCHK YES -- 00281000
  283. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 00282000
  284. TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 00283100
  285. * USER DATA 00284000
  286. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00285000
  287. IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 00286000
  288. CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 00287000
  289. BNE PROTCHK PROTECTION VIOLATION 00288000
  290. LR R3,R2 SAVE REAL ADDRESS 00289000
  291. A R2,=F'23' PROTECTION TEST FOR 2K BOUNDARY 00290000
  292. IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 00291000
  293. CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 00292000
  294. BNE PROTCHK PROTECTION VIOLATION 00293000
  295. LA R1,0(,R3) FIELD FOR DATE 00294000
  296. LA R2,8(,R3) FIELD FOR TIME 00295000
  297. CALL DMKCVTDT FILL THEM IN.. 00296000
  298. CALL DMKTMRPT OBTAIN UP-TO-DATE VTIME @V2B2638 00297000
  299. STM R0,R1,TEMPR0 SAVE IT FOR TOTAL CPU TIME CALCULATION 00298000
  300. BAL R14,CVTIME AND CONVERT IT 00299000
  301. ST R1,16(,R3) STORE FOR USER 00300000
  302. LM R4,R5,VMTTIME GET SUPERVISOR OVERHEAD TIME 00301000
  303. SL R5,TEMPR1 SUBTRACT OUT PROBLEM TIME 00302000
  304. BC 8+2+1,*+8 BR. IF NO-CARRY 00303000
  305. SL R4,F1 ADJUST FOR CARRY 00304000
  306. SL R4,TEMPR0 TOTAL CPU TIME NOW IN R4-5 00305000
  307. BAL R14,CTTIME AND CONVERT IT 00306000
  308. ST R1,20(,R3) AND STORE IT 00307000
  309. NI VDEVSTAT,X'FF'-(VDEVBUSY+VDEVCHBS) MARK DEVICE NOT BUSY 00308000
  310. B EXIT EXIT 00309000
  311. SPACE 00310000
  312. CTTIME LM R0,R1,=X'7FFFFFFFFFFFF000' 00311000
  313. SLR R1,R5 COMPUTE SUPERVISOR TIME USED 00312000
  314. BC 8+2+1,*+8 BR. ON NO-CARRY 00313000
  315. SL R0,F1 RE-ADJUST FOR CARRY 00314000
  316. SLR R0,R4 00315000
  317. SPACE 00316000
  318. CVTIME SRDL R0,12 CONVERT TO MICRO-SECONDS 00317000
  319. SLR R0,R0 REFLECT ONLY THE VALUE AFTER @VW01580 00318000
  320. * WRAPAROUND 00319000
  321. * IF VALUE MORE THAN X'FFFFFFFF' 00320000
  322. LTR R1,R1 BYPASS DIVISION IF ZERO VALUE @VW01580 00321000
  323. BZ *+8 @VW01580 00322000
  324. D R0,=F'13' COMVERT TO TIMER UNITS 00323000
  325. BR R14 RETURN TO CALLER 00324000
  326. SPACE 2 00325000
  327. CAWTEST TM ALIGNMNT,0 EXECUTED TO TEST CAW ALIGNMENT 00326000
  328. SPACE 00327000
  329. ALIGNMNT DC X'07' 00328000
  330. DS 0F 00329000
  331. NFFS DC X'FFFFF000' 00330000
  332. SPACE 00331000
  333. DS 0H 00332000
  334. EJECT 00333000
  335. *. 00334000
  336. * 00335000
  337. * SPOOLED CARD READER PROCESSING - 00336000
  338. * 00337000
  339. * 1. VERIFY THAT THE CCW OP-CODE IS LEGAL, AND SET UP INITIAL 00338000
  340. * STATUS CONDITIONS IN THE CSW 00339000
  341. * 00340000
  342. * 2. VERIFY THAT THE COMMAND SEQUENCE IS LEGAL; THEN, IF THE 00341000
  343. * COMMAND IS A FEED ONLY, GO TO STEP 5; OTHERWISE, CONTINUE 00342000
  344. * 00343000
  345. * 3. FOR A DATA MOVING READ, INDEX TO THE NEXT DATA RECORD IN 00344000
  346. * THE BUFFER, LOCATE AND PAGE IN THE USERS DATA AREA, AND 00345000
  347. * MOVE THE RECORD TO THE USER'S VIRTUAL MEMORY SPACE. THE 00346000
  348. * DATA MOVING SUBROUTINES MUST ALSO TEST FOR ADDRESSING AND 00347000
  349. * PROTECTION VIOLATIONS 00348000
  350. * 00349000
  351. * 4. TEST TO SEE IF A FEED HAS BEEN REQUESTED; IF IT HAS, 00350000
  352. * CONTINUE; OTHERWISE, SKIP TO STEP 6. 00351000
  353. * 00352000
  354. * 5. LOCATE THE NEXT CARD IMAGE TO BE PASSED; IF NECESSARY, PAGE 00353000
  355. * IN THE NEXT SPOOL BUFFER, AND TEST FOR A POSSIBLE END OF 00354000
  356. * FILE CONDITION 00355000
  357. * 00356000
  358. * 6. CURRENT OPERATION IS NOW COMPLETE. TEST FOR ANY ERROR 00357000
  359. * CONDITIONS, AND IF FOUND EXIT AFTER POSTING PROPER ENDING 00358000
  360. * STATUS; OTHERWISE, CONTINUE 00359000
  361. * 00360000
  362. * 7. TEST FOR POSSIBLE COMMAND OR DATA CHAINING OR IDA: IF YES, 00361000
  363. * LOCATE AND VERIFY NEXT CCW AND RESTART INTERPRETATION 00362000
  364. * PROCESS; OTHERWISE, EXIT AFTER POSTING PROPER ENDING 00363000
  365. * STATUS 00364000
  366. * 00365000
  367. *. 00366000
  368. SPACE 2 00367000
  369. READER EQU * HERE TO PROCESS SIO TO SPOOLED READER 00368000
  370. LTR R7,R7 ANY FILE FOUND? @VA03503 00369000
  371. BZ READER1 NO--BYPASS OPEN PROCESS @VA03503 00370000
  372. L R1,VSPVPAGE GET VIRT. ADDR @VA03503 00371000
  373. LTR R1,R1 ALREADY OPENED BY TIO OR SIO? @VA03503 00372000
  374. BNZ READER1 ALREADY OPENED BY SIO @VA03503 00373000
  375. BAL R6,OPENTIO HALF OPEN--FINISH THE OPEN @VA03503 00374000
  376. READER1 EQU * @VA03503 00375000
  377. MVI VDEVCSW+4,X'00' CLEAR STSTUS FOR NEW COMMAND @VA09566 00376100
  378. NI VDEVCSW+5,PCI LEAVING PCI INTACT @VA09566 00376200
  379. CLI VSPCCW,4 IS IT A SENSE COMMAND ?? 00377000
  380. BE SENSE YES -- 00378000
  381. XC VDEVSNSE(4),VDEVSNSE CLEAR SENSE INFORMATION 00379000
  382. TM VSPCCW,X'0F' PROGRAM CHECK CONDITION ?? 00380000
  383. BNZ TESTRDY NO -- TEST FOR DEVICE READY 00381000
  384. OI VDEVCSW+5,PRGC SET PROGRAM CHECK ON 00382000
  385. B RDREOFU USER IS FORCING EOF 00383000
  386. TESTRDY TM VDEVSTAT,VDEVNRDY DEVICE READY ?? 00384000
  387. BO NOTREADY NO -- DEVICE NOT READY 00385000
  388. TM VSPCCW,2 IS THE READ BIT ON? 00386000
  389. BZ RDREOFU NO -- USER IS FORCING EOF 00387000
  390. SPACE 00388000
  391. LTR R7,R7 SPOOL FILE AVAILBLE FOR THIS RDR ?? 00389000
  392. BNZ TSTNOP YES - CONT 00390000
  393. MVI VDEVSNSE,INTREQ SET SENSE TO INTERVENTION REQ 00391000
  394. B NOFILE .. 00392000
  395. SPACE 00393000
  396. SPACE 00394000
  397. TSTNOP CLI VSPCCW,3 IS IT A NOP 00395000
  398. BNE TESTBAD NO -- GO TEST FOR ILLEGAL CCW 00396000
  399. OI VDEVCSW+4,DE NOP WILL PRESENT DE IMMEDIATELY 00397000
  400. B NOFEED GO TEST FOR MORE CCWS 00398000
  401. SPACE 00399000
  402. TESTBAD TM VSPCCW,X'1C' ANY ILLEGAL BITS ON? 00400000
  403. BNZ RDREOFU YES -- 00401000
  404. CLI VSPCCW,X'C3' INVALID OP CODE ? 00402000
  405. BE RDREOFU YES - 00403000
  406. CLI VSPCCW,X'E3' INVALID OP CODE ? 00404000
  407. BE RDREOFU YES - 00405000
  408. SPACE 00406000
  409. TM SFBFLAG,SFBEOF HAS EOF BEEN REACHED? 00407000
  410. BO RDREOF YES -- NORMAL END OF FILE 00408000
  411. FEEDTEST TM VSPCCW,X'23' FEED ONLY? 00409000
  412. BNO READ NO -- GO DO READ 00410000
  413. NI VSPCCW,3 FORCE TREATMENT AS IMMEDIATE COMMAND 00411000
  414. CLI VDEVTYPE,TYP3505 3505 READER ? 00412000
  415. BE RDRFEED YES -- NO ERROR CHECK ON OP 23 00413000
  416. TM VDEVSFLG,VDEVFEED TWO FEEDS IN A ROW ?? 00414000
  417. BZ RDRFEED NO -- COMMAND SEQUENCE OK 00415000
  418. MVI VDEVSNSE,CMDREJ INVALID SEQUENCE 00416000
  419. B UNITCHK GO GIVE UNIT CHECK 00417000
  420. SPACE 3 00418000
  421. READ EQU * HERE TO SIMULATE READ 00419000
  422. L R3,VSPBUFBK ADDRESS OF WORK BUFFER 00420000
  423. LH R5,SFBRECSZ DEVICE LOGICAL RECORD SIZE 00421000
  424. RDRCD LA R0,MOVERDR POINT TO PROPER MOVE INSTRUCTION 00422000
  425. * FOR READER 00423000
  426. TM VSPCCW,3 NOP-CODE TYPE 00424000
  427. BO NOFEED YES -- NO DATA MOVE 00425000
  428. BAL R6,MOVEDATA AND GO MOVE DATA FROM WORK BUFFER 00426000
  429. * TO USER 00427000
  430. SPACE 2 00428000
  431. * 00429000
  432. * READ HAS BEEN SIMULATED 00430000
  433. * 00431000
  434. SPACE 2 00432000
  435. TM VSPCCW+4,CD+IDA IS USER DATA CHAINING OR IDA ?? 00433000
  436. BNZ NOFEED YES -- DO NOT FEED 00434000
  437. SPACE 2 00435000
  438. TM VSPCCW,X'C0' IS IT A READ WITHOUT A FEED? 00436000
  439. BNO RDRFEED NO -- GO SIMULATE A FEED 00437000
  440. OI VDEVCSW+4,DE DE WITH CE FOR READ WITHOUT FEED 00438000
  441. TM VDEVSFLG,VDEVFEED HAS FEED BEEN DONE ?? 00439000
  442. BZ SETUS NEITHER -- THIS IS AN UNUSUAL 00440000
  443. * SEQUENCE 00441000
  444. RESETFD NI VDEVSFLG,X'FF'-VDEVFEED FEED NOT DONE FOR THIS COMMAND 00442000
  445. B NOFEED CONTINUE PROCESSING 00443000
  446. SPACE 00444000
  447. SETUS EQU * 00445000
  448. MVI VDEVSNSE,2 INDICATE UNUSUAL SEQUENCE 00446000
  449. B NOFEED AND CONTINUE 00447000
  450. SPACE 2 00448000
  451. RDRFEED EQU * HERE TO SIMULATE FEED 00449000
  452. OI VDEVSFLG,VDEVFEED FEED DONE FOR THIS COMMAND 00450000
  453. L R1,VSPVPAGE ADDRESS OF VIRTUAL BUFFER 00451000
  454. * PAGE THE BUFFER IN 00452000
  455. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 00453000
  456. TRANS 2,1,OPT=(BRING,DEFER,SYSTEM),IOER=ERR2 @VA00716 00454000
  457. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00455000
  458. LH R13,VSPNEXT INDEX TO NEXT RECORD IN BUFFER 00456000
  459. BAL R6,RDRDATA GO LOCATE NEXT RECORD IN READER 00457000
  460. * BUFFER 00458000
  461. EJECT 00459000
  462. * 00460000
  463. * UPON RETURN FROM RDRDATA, THE FIELD 'VSPNEXT' 00461000
  464. * WILL BE UPDATED TO INDICATE THE DISPLACEMENT 00462000
  465. * OF THE NEXT DATA RECORD. IF THE RECORD 00463000
  466. * JUST READ WAS THE LAST ONE IN THE FILE, 00464000
  467. * THE EOF LATCH WILL BE SET, AND THE 'FEED' WILL BE BYPASSED 00465000
  468. * 00466000
  469. SPACE 2 00467000
  470. NOFEED EQU * IO OPERATION IS COMPLETE 00468000
  471. BAL R6,PCITEST GO TEST FOR PCI INTERRUPT 00469000
  472. OI VDEVCSW+4,CE SET CHANNEL END FOR ALL COMMANDS 00470000
  473. TM VDEVSNSE,2 UNUSUAL SEQUENCE? 00471000
  474. BO UNITCHK YES -- GO SET UNIT CHECK 00472000
  475. OI SFBFLAG,SFBOPEN INDICATE FILE OPENED 00473000
  476. TM VDEVCSW+5,IL WAS INCORRECT LENGTH POSTED? 00474000
  477. BO LASTCCW YES -- TERMINATE CHANNEL PROGRAM @VA01095 00475000
  478. SPACE 2 00476000
  479. CKCHAIN TM VSPCCW+4,CD+CC+IDA ANY CHAINING GOING ON ?? 00477000
  480. BZ LASTCCW NO -- 00478000
  481. L R1,VDEVCSW YES -- GET ADDRESS OF NEXT CCW 00479000
  482. ST R1,VSPCAW AND SAVE IN WORKAREA 00480000
  483. NI VDEVFLAG,X'FF'-VDEVCCW1 NO LONGER PROCESSING 1ST CCW 00481000
  484. BAL R6,GETCCW GO LOCATE AND VALIDATE NEXT 00482000
  485. * NON-TIC CCW 00483000
  486. B READER RETURN IS HERE IF USER WAS COMMAND 00484000
  487. * CHAINING 00485000
  488. B RDRCD AND HERE IF HE WAS DATA CHAINING 00486000
  489. SPACE 2 00487000
  490. MOVERDR MVC 0(*-*,R2),12(R3) EXECUTED TO MOVE DATA TO USER 00488000
  491. SPACE 2 00489000
  492. ERR2 EQU * HERE IF IOERROR ON SPOOLING @VA00716 00490000
  493. * BUFFER (TRANS) 00491000
  494. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 00492000
  495. SPACE 00493000
  496. ERR1 EQU * HERE IF IOERROR ON SPOOLING BUFFER 00494000
  497. OI SFBFLAG2,SFBHOLD DO NOT PURGE FILE 00495000
  498. OI SFBFLAG,SFBRECER SET ALLOCATION RECORDS INCOMPLETE 00496000
  499. BAL R6,FILECLR CLEAR FILE 00497000
  500. BAL R6,DVICECLR CLEAR DEVICE 00498000
  501. B MSG429I GO GIVE ERROR MESSAGE 00499000
  502. EJECT 00500000
  503. RDRDATA EQU * HERE TO LOCATE THE NEXT VALID DATA RECORD IN THE 00501000
  504. * READER BUFFER. IF THE FILE WAS ORIGINALLY THE OUTPUT OF 00502000
  505. * A PRINTER, IMMEDIATE RECORDS ARE BYPASSED. AFTER 00503000
  506. * THE LAST RECORD IS FED, THE EOF LATCH IS SET. 00504000
  507. * 00505000
  508. L R0,VSPRECNO GET NUMBER OF RECS REMAINING IN 00506000
  509. * BUFFER 00507000
  510. AR R13,R2 POINT TO REAL ADDRESS OF NEXT RECORD 00508000
  511. RDRCOUNT BCT R0,NEXTCARD AND COUNT DOWN BY ONE 00509000
  512. SPACE 2 00510000
  513. CLC VSPDPAGE,SFBLAST BUFFER IS EMPTY--WAS THAT LAST PAGE? 00511000
  514. BNE NEXTPAGE NO -- GO GET NEXT PAGE 00512000
  515. ZEROCNT OI SFBFLAG,SFBEOF LAST PAGE SET EOF 00513000
  516. B RDREND END OF FILE 00514000
  517. SPACE 2 00515000
  518. NEXTPAGE L R0,SPNXTPAG GET CHAIN POINTER IN BUFFER 00516000
  519. L R1,VSPVPAGE VIRTUAL BUFFER ADDRESS 00517000
  520. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00518000
  521. CALL DMKRPAGT,PARM=BRING+SYSTEM GET NEXT BUFFER,AND 00519000
  522. BNZ ERR2 SPOOL READ ERROR @VA01460 00520000
  523. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00521000
  524. ST R0,VSPDPAGE SAVE DASD PAGE ADDRESS 00522000
  525. SPACE 2 00523000
  526. SR R1,R1 CLEAR 00524000
  527. STH R1,VSPNEXT BUFFER DISPLACEMENT 00525000
  528. * 00526000
  529. * HERE TO BUILD DUMMY ALLOCATION RECORD TO BE USED FOR 00527000
  530. * FAST DELETE LATER 00528000
  531. * 00529000
  532. TM SFBFLAG,SFBRECER ALLOCATION COMPLETE SO FAR ?? 00530000
  533. BO SKIPREC NO -- SKIP DURING DUMMY RECORD 00531000
  534. LA R1,SFBRECS POINT TO ALLOCATION STRING 00532000
  535. USING RECBLOK,R1 00533000
  536. SRL R0,16 GET CYLINDER NUMBER @VA00808 00534000
  537. SPACE 00535000
  538. FINDBLOK LR R4,R1 SAVE BACKCHAIN POINTER 00536000
  539. L R1,RECPNT POINT TO NEXT RECBLOK ON CHAIN 00537000
  540. LTR R1,R1 IS THERE ONE ?? 00538000
  541. BNZ TESTCYL YES -- SEE IF ITS FOR THIS CYLINDER 00539000
  542. SPACE 00540000
  543. LA R0,RECSIZE BUILD A NEW BLOK 00541000
  544. CALL DMKFREE 00542000
  545. ST R1,RECPNT-RECBLOK(,R4) CHAIN NEW BLOK 00543000
  546. XC RECBLOK(RECSIZE*8),RECBLOK CLEAR TO ZEROES 00544000
  547. L R0,VSPDPAGE GET CYLINDER NUMBER 00545000
  548. ST R0,RECCYL AND STORE IN BLOK 00546000
  549. MVI RECUSED,X'00' ZERO OUT PAGE NUMBER 00547000
  550. B SETREC AND GO MARK RECORD 00548000
  551. SPACE 00549000
  552. TESTCYL CH R0,RECCYL IS RECBLOK FOR THIS CYLINDER 00550000
  553. BNE FINDBLOK NO -- KEEP LOOKING 00551000
  554. CLC RECCYL+3(1),VSPDPAGE+3 CORRECT DEVICE ?? 00552000
  555. BNE FINDBLOK NO -- KEEP LOOKING 00553000
  556. SETREC EQU * FOUND THE BLOK -- 00554000
  557. SR R14,R14 .. @VA00808 00555000
  558. ICM R14,B'0001',VSPDPAGE+2 GET PAGE NUMBER @VA00808 00556000
  559. BCTR R14,0 -1 FOR DIVIDE 00557000
  560. SRDL R14,3 DIVIDE BY 8 00558000
  561. SRL R15,29 AND SAVE THE REMAINDER 00559000
  562. LA R14,RECMAP(R14) POINT TO BYTE TO UPDATE 00560000
  563. IC R15,ALOCTABL(R15) AND GET BIT MASK 00561000
  564. EX R15,TSTALLOC PAGE ALL-READY MARKED ? @VW01580 00562000
  565. BO SKIPREC YES - SKIP ALLOCATE AND UPDATE @VW01580 00563000
  566. EX R15,ALOCATE MARK THE PAGE 00564000
  567. IC R15,RECUSED GET NUMBER OF RECORDS FOUND 00565000
  568. LA R15,1(,R15) INCREMENT 00566000
  569. STC R15,RECUSED AND SAVE 00567000
  570. SPACE 00568000
  571. SKIPREC L R0,SPRECNUM GET NUMBER OF RECORDS IN BUFFER 00569000
  572. LA R13,SPSIZE(,R2) ADDRESS OF 1ST RECORD CCW 00570000
  573. C R0,F0 BUFFER RECORD COUNT ZERO ?? 00571000
  574. BE ZEROCNT YES -- EMPTY BUFFER 00572000
  575. SPACE 2 00573000
  576. NEXTCARD ST R0,VSPRECNO SAVE NUMBER OF RECORDS IN BUFFER 00574000
  577. LR R15,R2 ADDRESS OF BUFFER @VA01460 00575000
  578. A R15,F4095 POINT END OF BUFFER @VA01460 00576000
  579. CLR R13,R15 DATA ADDRESS WITH IN PAGE ? @VA01460 00577000
  580. BH UNITCHK NO - BAD DATA IN BUFFER @VA01460 00578000
  581. TM 0(R13),3 IS IT AN IMMEDIATE OP-CODE 00579000
  582. BNO SETNEXT NO -- 00580000
  583. * ASSUME ALL IMMEDIATE RECORDS MUST BE CONTROL TYPE 00581000
  584. TM 4(R13),SKIP IS THIS AN IMMED RECORD ?? @V293598 00582000
  585. BNO SKIP63 SKIP PAST ITS DATA IF NOT @V293598 00583000
  586. LA R13,8(,R13) POINT TO NEXT CCW 00584000
  587. B RDRCOUNT AND CONTINUE THE COUNT-DOWN 00585000
  588. SPACE 2 00586000
  589. SKIP63 AH R13,10(R13) UPDATE TO NEXT CCW 00587000
  590. B RDRCOUNT CONTINUE THE COUNT-DOWN 00588000
  591. SPACE 2 00589000
  592. SETNEXT LR R14,R13 SAVE RECORD ADDRESS 00590000
  593. CLI 0(R13),X'02' READER FILE CCW ?? 00591000
  594. BE *+12 YES -- 00592000
  595. CLI 0(R13),X'42' READER FILE CCW ?? 00593000
  596. BNE SETCONT NO - CONTINUE 00594000
  597. LH R13,10(R14) PICK UP ADDRESS IN TIC CCW 00595000
  598. N R13,F4095 GET DISPLACEMENT INTO PAGE 00596000
  599. B SAVEDISP .. 00597000
  600. SPACE 00598000
  601. SETCONT EQU * 00599000
  602. SR R13,R2 GET DISPLACEMENT INTO BUFFER 00600000
  603. LR R5,R13 SAVE DISPLACEMENT 00601000
  604. AH R13,10(R14) GET DISPLACEMENT TO NEXT CCW 00602000
  605. SAVEDISP STH R13,VSPNEXT SAVE DISPLACEMENT TO NEXT CCW 00603000
  606. L R5,VSPBUFBK WORK BUFFER ADDRESS 00604000
  607. LA R4,VSPBUFSZ LENGTH OF BUFFER AREA 00605000
  608. SLL R4,3 TIMES 8 00606000
  609. LR R13,R4 .. @VW01580 00607000
  610. SH R4,=H'2' -2 FOR CLEAR 00608000
  611. MVI 0(R5),X'40' BLANK 00609000
  612. EX R4,CLRWK CLEAR WORK BUFFER TO BLANKS 00610000
  613. LH R4,6(R14) CCW DATA COUNT 00611000
  614. LA R4,11(R4) ADD 12 BYTES FOR CCWS AND -1 FOR 00612000
  615. * MOVE 00613000
  616. CLR R4,R13 COUNT LARGER THAN BUFFER ??? @VW01580 00614000
  617. BNL NOTREADY YES--UNIT CHECK @VA03503 00615000
  618. EX R4,RDRBUF MOVE CCWS AND DATA TO WORK BUFFER 00616000
  619. RDREND BR R6 RETURN TO CALLER 00617000
  620. SPACE 2 00618000
  621. CLRWK MVC 1(0,R5),0(R5) EXECUTED CLEAR WORK BUFFER TO 00619000
  622. * BLANKS 00620000
  623. SPACE 2 00621000
  624. RDRBUF MVC 0(0,R5),0(R14) EXECUTED MOVE DATA TO WORK BUFFER 00622000
  625. SPACE 2 00623000
  626. ALOCATE OI 0(R14),0 EXECUTED TO MARK PAGE AS ALLOCATED 00624000
  627. TSTALLOC TM 0(R14),0 EXECUTED TO TEST FOR MARK PAGE @VW01580 00625000
  628. SPACE 00626000
  629. ALOCTABL DC X'8040201008040201' BIT MASKS FOR ALLOCATION 00627000
  630. DS 0H 00628000
  631. EJECT 00629000
  632. *. 00630000
  633. * 00631000
  634. * END OF FILE PROCESSING FOR SPOOLED CARD READER 00632000
  635. * 00633000
  636. * 1. CLOSE REQUEST ISSUED VIA CLOSE OR SPOOL COMMANDS: 00634000
  637. * (A) IF THE DEVICE IS CP BUSY (VDEVSVC=1); BRANCH TO 00635000
  638. * STKCPBLK ROUTINE TO BUILD AND STACK CPEXBLOK 00636000
  639. * ON VSPSTK ANCHOR TO DELAY THE REQUEST, AND GO 00637000
  640. * TO DISPATCHER.(DMKDSPCH) 00638000
  641. * ENTRY POINT FOR CPEXBLOK IS LABEL RDRCLRET 00639000
  642. * (B) IF THE DEVICE IS BUSY (SIO-VDEVBUSY=1); 00640000
  643. * SET DEFFERED CLOSE REQUEST FLAG AND EXIT TO 00641000
  644. * THE CALLER. 00642000
  645. * (C) IF THE DEVICE IS NOT BUSY OR CP BUSY OR 00643000
  646. * ENTRY VIA THE STACKED CPEXBLOK; CONTINUE 00644000
  647. * 00645000
  648. * 2. IF USER HAS FORCED END OF FILE VIA CONSOLE FUNCTION 00646000
  649. * OR ILLEGAL CCW COMMAND CODE, CLEAR FILE FROM SYSTEM (UNLESS 00647000
  650. * USER HAS REQUESTED SAVING), CLEAR STATUS FROM DEVICE 00648000
  651. * AND EXIT, POSTING COMMAND REJECT IF APPROPRIATE 00649000
  652. * 00650000
  653. * 3. IF END OF FILE IS REACHED NORMALLY, PROCEED AS IN STEP 2 00651000
  654. * ABOVE, UNLESS USER HAS REQUESTED CONTINUOUS READING. 00652000
  655. * 00653000
  656. * 4. FOR CONTINUOUS READING, DO NOT POST END OF FILE UNLESS 00654000
  657. * NO MORE FILES REMAIN IN THE SYSTEM 00655000
  658. * 00656000
  659. * 5. IF NO MORE FILES REMAIN AND CONTINUOUS READING WITH END 00657050
  660. * OF FILE IS IN EFFECT,POST UNIT EXCEPTION OTHERWISE POST 00657150
  661. * INTERVENTION REQUIRED - READER EMPTY 00657250
  662. * 00657350
  663. * 6. IF NOT CONTINUOUS READING AND END OF FILE IS NOT SET THEN 00657450
  664. * POST INTERVENTION REQUIRED - READER NOT READY 00657550
  665. * 00657650
  666. * 7. BEFORE THE EXIT IS MADE TO THE CALLER,BAL TO 00657750
  667. * UNSTKBLK ROUTINE TO UNSTACK THE NEXT CPEXBLOK,IF ANY 00657850
  668. * FOR THIS DEVICE. 00657950
  669. SPACE 2 00666000
  670. USING SAVEAREA,R13 00667000
  671. DMKVSPCR RELOC 00668000
  672. LR R10,R12 SET UP SECOND BASE REGISTER 00669000
  673. A R10,F4096 .. 00670000
  674. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00671000
  675. LA R6,RDRCLRET RETURN ADDRESS FOR DELAY @VM01028 00672000
  676. B SPLADD - @VM01028 00673000
  677. RDRCLRET AL R8,VMDVSTRT VDEVBLOK ADDRESS @VM01028 00674000
  678. NI VDEVSFLG,X'FF'-VDEVSVC RESET CP BUSY @VM01028 00675000
  679. SPLADD ICM R9,B'1111',VDEVSPL GET ACTIVE FILE POINTER @VM01028 00676000
  680. BZ RDRESET BRANCH IF NO ACTIVE FILE @VM01028 00677000
  681. L R7,VSPSFBLK GET POINTER TO SFBLOK 00678000
  682. LTR R7,R7 SPOOL FILE BLOK PRESENT ?? 00679000
  683. BZ *+8 NO -- 00680000
  684. OI SFBFLAG,SFBRECER ALLOCATION CHAIN INCOMPLETE 00681000
  685. TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ?? @VM01028 00682000
  686. BO DELAYCL YES - SET UP DELAY @VM01028 00683000
  687. TM VDEVSTAT,VDEVBUSY IS THE DEVICE CURRENTLY BUSY ?? 00684000
  688. BZ RDRCLOSE NO -- CONTINUE WITH CLOSE 00685000
  689. TM VDEVSFLG,VDEVDIAG BUSY WITH DIAGNOSE ?? 00686000
  690. BZ DELAYCL NO - SET UP FOR POSSIBLE DELAY CLOSE 00687000
  691. NI VDEVSTAT,X'FF'-VDEVBUSY RESET BUSY FOR DIAGNOSE 00688000
  692. SPACE 00689000
  693. RDRCLOSE OI VDEVSFLG,VDEVSVC INDICATE DEVICE CP BUSY @VM01028 00690000
  694. BAL R6,FILECLR GO CLEAR FILE @VM01028 00691000
  695. BAL R6,DVICECLR AND DEVICE 00692000
  696. RDRESET MVI VDEVINTS,0 CLEAR STATUS 00693000
  697. NI VDEVSFLG,X'FF'-(VDEVFEED+VDEVSVC) RESET FLAGS @VM01016 00694000
  698. NI VDEVFLAG,X'FF'-VDEVCCW1 RESET 1ST CCW FLAG 00695000
  699. BAL R6,UNSTKBLK GO UNSTACK CPEX BLOK @VM01028 00696000
  700. EXIT - EXIT TO CALLER @VM01028 00697000
  701. SPACE 00698000
  702. DROP R13 00699000
  703. SPACE 2 00700000
  704. EJECT 00701000
  705. RDREOFU EQU * HERE IF USER FORCED THE EOF VIA AN ILLEGAL COMMAND 00702000
  706. SPACE 00703000
  707. TM VDEVFLAG,VDEVCCW1 STILL ON FIRST CCW ?? 00704000
  708. BO TSTFILE YES -- 00705000
  709. BAL R6,PCITEST TEST FOR PCI INTERRUPT 00706000
  710. OI VDEVCSW+4,CE+DE SET CHANNEL AND DEVICE END 00707000
  711. MVC VDEVCSW+6(2),VSPCCW+6 MOVE IN RESIDUAL COUNT 00708000
  712. TSTFILE LTR R7,R7 SPOOL FILE BLOK PRESENT ?? 00709000
  713. BZ NOFILE NO -- 00710000
  714. OI SFBFLAG,SFBRECER ALLOCATION CHAIN INCOMPLETE 00711000
  715. BAL R6,FILECLR GO CLEAR READER FILE 00712000
  716. NOFILE EQU * HERE IF NO FILE FOUND 00713000
  717. BAL R6,DVICECLR GO CLEAR DEVICE BLOCK 00714000
  718. NI VDEVSFLG,X'FF'-VDEVCFCL RESET DEFERED CLOSED 00715000
  719. SPACE 00716000
  720. SETSENSE TM VDEVSNSE,INTREQ INTERVENTION REQUIRED ?? 00717000
  721. BO UNITCHK YES -- SET UNIT CHECK 00718000
  722. TM VDEVCSW+5,PRGC PROGRAM CHECK SET ?? 00719000
  723. BO PROGCHK YES -- GO 00720000
  724. MVI VDEVSNSE,CMDREJ SET COMMAND REJECT 00721000
  725. B UNITCHK AND GO GIVE UNIT CHECK 00722000
  726. SPACE 2 00723000
  727. RDREOF EQU * HERE ON NORMAL CARD READER END -OF-FILE 00724000
  728. TM VDEVSFLG,VDEVCONT DOES USER WANT CONTINOUS READING ? 00725000
  729. BZ LASTFILE NO -- 00726000
  730. BAL R6,FILECLR GO CLEAR CURRENT FILE 00727000
  731. BAL R6,OPENCONT YES -- GO FIND ANOTHER CARD FILE 00728000
  732. BZ LASTFILE NO MORE FILES TO DO 00729000
  733. ST R7,VSPSFBLK HOLD ADDRESS OF NEW SPOOL FILE BLOK 00730000
  734. B FEEDTEST AND START PROCESSING THE NEW FILE 00731000
  735. SPACE 2 00732000
  736. LASTFILE EQU * HERE TO INDICATE EOF 00733000
  737. TM VDEVSFLG,VDEVEOF END OF FILE BUTTON PUSHED ? 00734000
  738. BO SETUE YES -- GO SET UNIT EXCEPTION 00735000
  739. TM VDEVSFLG,VDEVCONT IS THIS A CONTINUOUS READ ? @VA09064 00735100
  740. BO CONTREAD YES,KEEP READER READY @VA09064 00735200
  741. OI VDEVSTAT,VDEVNRDY INDICATE VIRTUAL DEVICE NOT @VA09064 00735300
  742. * READY 00735400
  743. CONTREAD EQU * @VA09064 00735500
  744. MVI VDEVSNSE,INTREQ OTHERWISE, SET INT.REQ. 00736000
  745. OI VDEVCSW+4,UC AND UNIT CHECK 00737000
  746. B SETRID AND SET RESIDUAL COUNT 00738000
  747. SPACE 00739000
  748. SETUE OI VDEVCSW+4,UE PUT UNIT EXCEPTION IN CSW 00740000
  749. SETRID MVC VDEVCSW+6(2),VSPCCW+6 SET RESIDUAL COUNT 00741000
  750. BAL R6,FILECLR GO CLEAR CURRENT FILE 00742000
  751. BAL R6,DVICECLR AND DEVICE BLOCK 00743000
  752. TM VDEVFLAG,VDEVCCW1 FIRST CCW ?? 00744000
  753. BO VSPEXIT YES -TAKE GENERAL EXIT 00745000
  754. B ENDCCW BREAK CHAIN AND EXIT 00746000
  755. SPACE 2 00747000
  756. FILECLR EQU * HERE TO START CLEARING THE OLD READER FILE 00748000
  757. * UNLESS THE USER WANTS IT SAVED 00749000
  758. LTR R9,R9 SPOOL CONTROL BLOK ?? 00750000
  759. BCR 8,R6 NO -- LEAVE 00751000
  760. L R7,VSPSFBLK LOAD ADDRESS OF SFBLOK 00752000
  761. LTR R7,R7 SPOOL FILE PRESENT ?? 00753000
  762. BCR 8,R6 NO - 00754000
  763. NI SFBFLAG,X'FF'-SFBEOF RESET EOF @VA12597 00755000
  764. TM SFBFLAG2,SFBHOLD FILE TO BE HELD ?? 00756000
  765. BO TSTCONT TEST FOR CONT WITH HOLD @V200930 00757000
  766. TM SFBFLAG2,SFBNOHLD FILE TO BE DELETED ?? 00758000
  767. BO FILECLR1 YES - 00759000
  768. TM VDEVSFLG,VDEVHOLD SHOULD FILE BE SAVED ?? 00760000
  769. BZ FILECLR1 NO - CLEAR IT 00761000
  770. TSTCONT TM VDEVSFLG,VDEVCONT CONT READING ON DEVICE ?? @V200930 00762000
  771. BZ HOLDFILE NO, SAVE FILE @V200930 00763000
  772. OI SFBFLAG,SFBUHOLD FORCE FILE TO USER HOLD @V200930 00764000
  773. HOLDFILE NI SFBFLAG2,X'FF'-SFBHOLD RESET HOLD FLAG 00765000
  774. OI SFBFLAG,SFBRECER ALLOCATION CHAIN INCOMPLETE 00766000
  775. NI SFBFLAG,X'FF'-SFBOPEN RESET OPEN FLAG @VA03105 00767000
  776. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @V304298 00768000
  777. CALL DMKCKSPL,PARM=CHGSFB CHECKPOINT @V304298 00769000
  778. AL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @V304298 00770000
  779. NI SFBFLAG,X'FF'-SFBINUSE RESET INUSE @VA12597 00770500
  780. BR R6 SAVE IS ON - DON'T CLEAR IT 00771000
  781. FILECLR1 EQU * 00772000
  782. NI SFBFLAG,X'FF'-SFBINUSE RESET INUSE @VA12597 00772050
  783. NI SFBFLAG2,X'FF'-SFBNOHLD RESET NOHOLD FLAG 00773000
  784. TM SFBFLAG,SFBOPEN WAS THE FILE SUCCESSFULLY OPENED ?? 00774000
  785. BCR 8,R6 NO -- EXIT NOW 00775000
  786. L R1,VSPSFBLK GET ADDRESS OF SPOOL FILE BLOCK 00776000
  787. L R2,ARSPRD AND ADDRESS OF READER FILE CHAIN 00777000
  788. FILECLR2 L R3,0(,R2) POINTER TO NEXT FILE BLOCK 00778000
  789. CR R1,R3 HAVE WE FOUND THE BLOCK? 00779000
  790. BE UNCHAIN YES -- UNCHAIN IT 00780000
  791. LR R2,R3 SAVE ADDRESS OF PREVIOUS BLOCK 00781000
  792. B FILECLR2 AND KEEP LOOKING 00782000
  793. UNCHAIN MVC 0(4,R2),0(R3) UNCHAIN THE BLOCK 00783000
  794. XC VSPSFBLK(4),VSPSFBLK CLEAR SFBLOK ADDRESS 00784000
  795. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00785000
  796. CALL DMKSPLDL AND CALL THE FILE DELETER 00786000
  797. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00787000
  798. SR R7,R7 CLEAR SFBLOK ADDRESS 00788000
  799. BR R6 RETURN TO CALLER 00789000
  800. SPACE 2 00790000
  801. DVICECLR EQU * HERE TO CLEAR THE DEVICE BLOCK 00791000
  802. L R9,VDEVSPL ADDRESS VSPLCTL 00792000
  803. LTR R9,R9 ACTIVE BLOK ?? 00793000
  804. BCR 8,R6 NO - 00794000
  805. L R1,VSPVPAGE GET VIRTUAL BUFFER ADDRESS 00795000
  806. LTR R1,R1 VIRTUAL BUFFER ADDRESS PRESENT ?? 00796000
  807. BZ CLRBUFBK NO - 00797000
  808. SR R0,R0 DUMMY DASD ADDRESS 00798000
  809. SPACE 00799000
  810. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00800000
  811. CALL DMKRPAGT,PARM=SYSTEM TO RELEASE STORAGE PAGE 00801000
  812. CALL DMKPGTVR RELEASE THE VIRTUAL BUFFER ADDRESS 00802000
  813. XC VSPVPAGE(4),VSPVPAGE CLEAR VIRTUAL PAGE POINTER 00803000
  814. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00804000
  815. SPACE 00805000
  816. CLRBUFBK L R1,VSPBUFBK ADDRESS OF WORK BUFFER 00806000
  817. LTR R1,R1 BUFFER BLOCK PRESENT ?? 00807000
  818. BZ CLRCTL NO - 00808000
  819. LA R0,VSPBUFSZ NUMBER OF DOUBLE WORDS 00809000
  820. CALL DMKFRET RELEASE THE WORK BUFFER 00810000
  821. SPACE 00811000
  822. CLRCTL EQU * 00812000
  823. SPACE 00813000
  824. L R1,VDEVSPL ADDRESS OF VSPLCTL 00814000
  825. SR R9,R9 00815000
  826. LTR R1,R1 ADDRESS VALID ?? 00816000
  827. BCR 8,R6 NO - RETURN 00817000
  828. LA R0,VSPSIZE SIZE IN DOUBLE WORDS 00818000
  829. CALL DMKFRET FRET THE BLOCK 00819000
  830. XC VDEVSPL,VDEVSPL CLEAR THE POINTER 00820000
  831. NI VDEVSFLG,X'FF'-VDEVDIAG RESET DIAG FLAG FOR DUMP 00821000
  832. BR R6 AND RETURN TO CALLER 00822000
  833. EJECT 00823000
  834. *. 00824000
  835. * 00825000
  836. * SPOOLED PRINTER AND PUNCH PROCESSING - 00826000
  837. * 00827000
  838. * 1. VERIFY VALIDITY OF CCW OP-CODE, AND SET UP INITIAL CSW 00828000
  839. * STATUS 00829000
  840. * 00830000
  841. * 2. DETERMINE WHETHER CCW WILL TRANSFER DATA OR IS AN IMMEDIATE 00831000
  842. * CONTROL COMMAND; FOR CONTROL COMMANDS, GO TO STEP4; OTHER- 00832000
  843. * WISE, CONTINUE 00833000
  844. * 00834000
  845. * 3. FOR DATA MOVING CCW, MOVE DATA AND CCW TO WORK BUFFER, 00835000
  846. * TRUNCATE ALL RIGHT JUSTIFIED BLANKS AND LOCATE 00836000
  847. * SPACE IN A PAGED SPOOL BUFFER AND MOVE THE CCW AND 00837000
  848. * DATA FROM THE WORK BUFFER TO THE SPOOL BUFFER, THEN GO 00838000
  849. * STEP 5. 00839000
  850. * 00840000
  851. * 4. FOR CONTROL COMMANDS, INSERT ONLY THE CONTROL CCW INTO THE 00841000
  852. * BUFFER, UNLESS IT IS A UCS COMMAND; IN THIS CASE, IGNORE 00842000
  853. * THE COMMAND AND CONTINUE 00843000
  854. * 00844000
  855. * 5. AFTER PROCESSING THE CCW, TEST FOR ANY ERROR CONDITIONS; 00845000
  856. * IF THERE ARE ANY, TERMINATE THE CHANNEL PROGRAM AND EXIT 00846000
  857. * AFTER POSTING THE APPROPRIATE ERROR STATUS; OTHERWISE 00847000
  858. * CONTINUE WITH THE NEXT CCW IN THE CHANNEL PROGRAM (IF THERE 00848000
  859. * IS ONE) 00849000
  860. * 00850000
  861. * 6. AFTER THE LAST CCW IS PROCESSED, EXIT AFTER POSTING THE 00851000
  862. * PROPER ENDING STATUS 00852000
  863. * 00853000
  864. *. 00854000
  865. SPACE 2 00855000
  866. PRINTER EQU * HERE TO PROCESS A SIO TO A SPOOLED PRINTER 00856000
  867. PUNCH EQU * OR PUNCH -- 00857000
  868. SPACE 00858000
  869. MVI VDEVCSW+4,X'00' CLEAR STSTUS FOR NEW COMMAND @VA09566 00859100
  870. NI VDEVCSW+5,PCI LEAVING PCI INTACT @VA09566 00859200
  871. CLI VSPCCW,4 IS IT A SENSE COMMAND ?? 00860000
  872. BE SENSE YES -- 00861000
  873. XC VDEVSNSE(4),VDEVSNSE CLEAR SENSE INFORMATION 00862000
  874. TM VSPCCW,X'0F' PROGRAM CHECK CONDITION ?? 00863000
  875. BZ PRTEOFU2 YES -- SET PROGRAM CHECK 00864000
  876. TM VDEVSTAT,VDEVNRDY DEVICE READY ?? 00865000
  877. BO NOTREADY NO - 00866000
  878. CLC SFBSTART(4),ZEROES DASD ADDRESS AVAILABLE ?? 00867000
  879. BNE DASDOK YES -- GO 00868000
  880. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 00869000
  881. CALL DMKPGTSG GET A DASD ADDRESS 00870000
  882. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 00871000
  883. LTR R1,R1 ANY DASD SPACE LEFT ?? 00872000
  884. BNZ SETDASD YES -- SET UP ADDRESSES 00873000
  885. BAL R6,PRTPUR NO -- CLEAR DEVICE 00874000
  886. B MSG427I GIVE ERROR MSG DMKVSP427I 00875000
  887. SETDASD ST R1,SFBSTART SAVE DASD ADDRESS 00876000
  888. ST R1,SFBLAST IN SFBLOK AND 00877000
  889. ST R1,VSPDPAGE CONTROL BLOK 00878000
  890. DASDOK CLI VSPCCW,3 IS IT A NO - OP ?? 00879000
  891. BNE TSTCMD NO -- TEST FOR VALID COMMAND 00880000
  892. SPACE 00881100
  893. * THE FOLLOWING CHECK WILL ALLOW A NOP CCW TO BE TREATED AS 00881200
  894. * A DATA MOVER. THIS UPDATE WILL CAUSE NOP COMMANDS WITH 00881300
  895. * COUNTS GREATER THAN ONE WHICH ARE EXECUTED ON (SPOOL) 00881400
  896. * SIMULATED UNIT RECORD OUTPUT DEVICES TO BE ENTERED INTO THE 00881500
  897. * SPOOL OUTPUT FILE WITH THEIR DATA BUFFERS, BUT WILL NOT 00881600
  898. * AFFECT THE I/0 INTERFACE PRESENTED TO THE VIRTUAL MACHINE 00881700
  899. * PROGRAM (E.I. NOP COMMANDS WILL CONTINUE TO APPEAR AS 00881800
  900. * IMMEDIATE NON-DATA MOVER COMMANDS). THE CODE WITHIN THIS 00881900
  901. * MODULE RELATING TO THIS UPDATE CAN BE RECOGNIZED BY THE 00882000
  902. * FOLLOWING SNDCODE @V63A4B5. THE NOP DATA MOVERS CAN ONLY 00883100
  903. * BE READ WHEN USING THE DIAGNOSE 14 INTERFACE TO MANIPULATE 00883200
  904. * THE INPUT SPOOL FILES. 00883300
  905. CLC VSPCCW+6(2),F1+2 IS COUNT GREATER THAN 1? @V60A4B5 00883400
  906. BH CCWOK YES -> TREAT AS A DATA MVR @V60A4B5 00883500
  907. B FLAGTEST OTHERWISE, DO NEXT CCW OR END @V60A4B5 00883600
  908. SPACE 00884000
  909. TSTCMD TM VDEVTYPE,TYPPUN IS IT A PUNCH ?? 00885000
  910. BO CKPUNCCW YES -- VALIDATE PUNCH COMMANDS 00886000
  911. LA R15,CCWCNT NUMBER OF VALID PRINTER CCW OP-CODES 00887000
  912. LA R14,CCWEND POINT TO END OF VALID CODE LIST 00888000
  913. IC R1,VSPCCW GET CCW OP CODE 00889000
  914. CLILP EX R1,CLICCW VALID OP-CODE ?? 00890000
  915. BNE OPNEXT NO -- CHECK NEXT 00891000
  916. TM VSPCCW,X'03' CONTROL TYPE OP CODE ?? 00892000
  917. BO PRTCNTRL YES -- 00893000
  918. B CCWOK DATA TYPE CCW OP-CODE COMMAND 00894000
  919. CLICCW CLI 0(R14),0 EXECUTED COMPARE 00895000
  920. OPNEXT BCTR R14,0 -1 CCW OP CODE LIST 00896000
  921. BCT R15,CLILP BRANCH IF NOT END OF LIST 00897000
  922. TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 00898000
  923. BNO REGPRT NO--1403 @V386298 00899000
  924. USING VFCBBLOK,R13 @VA00716 00900000
  925. L R13,VDEVFCBK ADDRESS OF FORMS CONTROL BLOK @VA00716 00901000
  926. CLI VSPCCW,X'63' FORMS CONTROL OP-CODE ? @VA00716 00902000
  927. BE CCWOK YES -- PROCESS @VA00716 00903000
  928. CLI VSPCCW,X'07' DIAG GATE COMMAND ? @VA00716 00904000
  929. BE CMD07 YES -- @VA00716 00905000
  930. CLI VSPCCW,X'12' READ FCB COMMAND ? @VA00716 00906000
  931. BE CCWOK YES -- @VA00716 00907000
  932. TM VFCBFLAG,VFCBDIAG DIAG GATE ACTIVE ? @VA00716 00908000
  933. BZ PRT3211 NO -- CONT @VA00716 00909000
  934. CLI VSPCCW,X'06' CHECK READ BUFFER COMMAND ? @VA00716 00910000
  935. BE CCWOK YES - SET WORK BUFFER ADDRESS @VA00716 00911000
  936. VFCBDIAG EQU X'01' DIAG OP-CODE X'07' PROCESSED @VA00716 00912000
  937. PRT3211 NI VFCBFLAG,X'FF'-VFCBDIAG RESET CMD 07 PROCESSING @VA00716 00913000
  938. LA R15,LEN3211 COUNT OF NOP TYPE CCW OP-CODES 00914000
  939. CLI VDEVTYPE,TYP3203 IS IT A 3203 PRINTER ?? @V386298 00914100
  940. BNE CLILP2 NO--MAKE 3211 OPCODE @V386298 00914200
  941. * COMPARE 00914300
  942. BCTR 15,0 DECREMENT CMD CODE TABLE @V386298 00914400
  943. * BY 1 FOR 3203 CMD CODE 00914500
  944. * TABLE 00914600
  945. CLILP2 EX R1,CLICCW OP-CODE COMPARE ? 00915000
  946. BE FORCE3 YES -- TREAT AS NOP 00916000
  947. BCTR R14,0 CCW LIST ADDRESS -1 00917000
  948. BCT R15,CLILP2 BRANCH IF NOT END OF LIST 00918000
  949. B PRTEOFU INVALID OP-CODE - FORCE EOF 00919000
  950. REGPRT LA R14,REGEND END OF FORCE3 TYPE OP-CODES 00920000
  951. LA R15,REGCNT LENGTH OF LIST 00921000
  952. CLILP3 EX R1,CLICCW OP-CODE COMPARE ? 00922000
  953. BE FORCE3 YES -- TREAT AS NOP 00923000
  954. BCTR R14,0 LIST ADDRESS -1 00924000
  955. BCT R15,CLILP3 BRANCH IF NOT END OF LIST 00925000
  956. B PRTEOFU INVALID OP-CODE - FORCE EOF 00926000
  957. SPACE 00927000
  958. CMD07 EQU * HERE IF PROCESSING DIAG CMD FOR @VA00716 00928000
  959. * 3211 OR 3203 00929000
  960. OI VFCBFLAG,VFCBDIAG INDICATE CMD07 PROCESSING @VA00716 00930000
  961. B FORCE3 AND TREAT AS NOP @VA00716 00931000
  962. SPACE 00932000
  963. CMD06 EQU * HERE TO CONVERT FCB BUFFER @VA00716 00933000
  964. * COUNTER TO HARDWARE 00934000
  965. * FCB ADDRESS REGISTER VALUE 00935000
  966. MVI 0(R3),X'00' CLEAR BYTE FOR NEW HARDWARE VALUE @VA00716 00936000
  967. LH R0,VFCBCNT GET CURRENT LINE COUNT @VA00716 00937000
  968. AL R0,F1 ADJUST COUNTER TO HARDWARE VALUE @VA00716 00938000
  969. STC R0,1(R3) SAVE IN WORK BYTE @VA00716 00939000
  970. LA R14,1 TM MASK (BINARY COUNTER) @VA00716 00940000
  971. LA R15,128 OI MASK (HARDWARE COUNTER) @VA00716 00941000
  972. * BIT 0=1, 1=2, 2=4, 3=8, 4=16, 5=32, 6=64, 7=128 00942000
  973. LA R6,8 LOOP COUNT @VA00716 00943000
  974. CMD06LP EX R14,TMCNT BIT PRESENT ?? @VA00716 00944000
  975. BZ *+8 NO -- @VA00716 00945000
  976. EX R15,OICNT CONVERT TO HARDWARE VALUE @VA00716 00946000
  977. SLL R14,1 SHIFT BINARY MASK @VA00716 00947000
  978. SRL R15,1 SHIFT HARDWARE MASK @VA00716 00948000
  979. BCT R6,CMD06LP AND TEST NEXT BIT @VA00716 00949000
  980. MVC 1(179,R3),0(R3) FILL BUFFER WITH HARDWARE VALUE @VA00716 00950000
  981. LA R5,150 SET MAX BUFFER SIZE @VA00716 00951000
  982. B CMD0612 NOW MOVE DATA @VA00716 00952000
  983. TMCNT TM 1(R3),0 EXECUTED TM INSTRUCTION @VA00716 00953000
  984. OICNT OI 0(R3),0 EXECUTED OI INSTRUCTION @VA00716 00954000
  985. MOVEFCB MVC 0(*-*,R2),0(R3) MOVE DATA FROM BUFFER TO USER @VA00716 00955000
  986. * AREA 00956000
  987. SPACE 00957000
  988. CMD12 EQU * HERE ON FCB READ COMMAND @VA00716 00958000
  989. MVC 0(180,R3),VFCBLOAD MOVE FCB DATA TO BUFFER @VA00716 00959000
  990. LA R5,180 SET MAX BUFFER SIZE @VA00716 00960000
  991. CMD0612 EQU * HERE TO MOVE BUFFER DATA TO @VA00716 00961000
  992. * USER AREA 00962000
  993. LA R0,MOVEFCB ADDRESS OF MOVE INSTRUCTION @VA00716 00963000
  994. BAL R6,MOVEDATA MOVE DATA TO USER @VA00716 00964000
  995. B SETDE SET DEVICE END AND CHECK FOR @VA00716 00965000
  996. * CC,IDA 00966000
  997. SPACE 00967000
  998. FORCE3 TM VSPCCW+4,CD IS CCW DATA CHAINING? @VA12613 00968000
  999. BZ FORCE3A NO - NO FLAG NECESSARY @VA12613 00968200
  1000. OI VSPFLAG1,VSPDCFOP FLAG CD CCW FORCED TO '03' @VA12613 00968400
  1001. FORCE3A MVI VSPCCW,X'03' FORCE '03'OP CODE @VA00716 00968600
  1002. B SETDE GO SET UP DEVICE END STATUS @VA00716 00969000
  1003. SPACE 00970000
  1004. REGBEG DC X'EBFBF3737B' 00971000
  1005. REGEND EQU *-1 00972000
  1006. REGCNT EQU *-REGBEG 00973000
  1007. BEG3211 DC X'83FB4323737B020A066B0E' @VA00716 00974000
  1008. END3211 EQU *-1 00975000
  1009. LEN3211 EQU *-BEG3211 00976000
  1010. CCWBEG DC X'E3E1DBD9D3D1CBC9C3C1BBB9B3B1ABA9A3A19B9993' 00977000
  1011. DC X'918B8919111B130B0901' 00978000
  1012. CCWEND EQU *-1 00979000
  1013. CCWCNT EQU *-CCWBEG 00980000
  1014. DS 0H 00981000
  1015. EJECT 00982000
  1016. SPACE 00983000
  1017. CKPUNCCW EQU * HERE TO VALIDATE PUNCH CCW 00984000
  1018. TM VSPCCW,1 WRITE CCW ? 00985000
  1019. BZ PRTEOFU NO -- ILLEGAL COMMAND 00986000
  1020. TM VSPCCW,4 ALWAYS ILLEGAL 00987000
  1021. BO PRTEOFU ASSUME USER IS FORCING EOF 00988000
  1022. TM VSPCCW,X'18' THESE BITS INVALID FOR PUNCH 00989000
  1023. BNZ PRTEOFU FORCE END OF FILE 00990000
  1024. TM VSPCCW,X'C0' BOTH BITS MAY NOT BE ON -- 00991000
  1025. BO PRTEOFU IF BOTH ON, ILLEGAL COMMAND 00992000
  1026. TM VSPCCW,X'03' PUNCH BLANK CARD ? 00993000
  1027. BO PRTEOFU ILLEGAL PUNCH COMMAND @VA05105 00994100
  1028. SPACE 3 00998000
  1029. * 00999000
  1030. * CCW IS WRITE -- START TO TRANSFER DATA 01000000
  1031. * 01001000
  1032. SPACE 01002000
  1033. CCWOK EQU * HERE TO MOVE USER'S DATA 01003000
  1034. L R3,VSPBUFBK ADDRESS OF WORK BUFFER 01004000
  1035. LA R3,12(R3) ADJUST PASS CCW AND TIC 01005000
  1036. LH R5,SFBRECSZ DEVICE LOGICAL RECORD SIZE 01006000
  1037. TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 01007000
  1038. BNO PRTCD NO-- @V386298 01008000
  1039. L R13,VDEVFCBK LOAD ADDRESS OF FCB BLOK @VA00716 01009000
  1040. NI VFCBFLAG,X'FF'-VFCBDIAG RESET DIAG FLAG @VA00716 01010000
  1041. CLI VSPCCW,X'06' CHECK READ CMD (3211/3203) @V386298 01011000
  1042. BE CMD06 YES -- @VA00716 01012000
  1043. CLI VSPCCW,X'12' READ FCB CMD (3211/3203) @V386298 01013000
  1044. BE CMD12 YES -- @VA00716 01014000
  1045. DROP R13 @VA00716 01015000
  1046. CLI VSPCCW,X'63' FORMS CONTROL COMMAND ?? 01016000
  1047. BNE PRTCD NO - 01017000
  1048. *********************************************************************** 01017100
  1049. *** THE NEXT THREE COMMANDS WILL ENSURE THAT THE SILI BIT IS ON IF *** 01017200
  1050. *** THE PRINTER IS A 3203. THIS WILL PREVENT INCORRECT LENGTH FROM *** 01017300
  1051. *** BEING REFLECTED. *** 01017400
  1052. *********************************************************************** 01017500
  1053. TM VDEVTYPE,TYP3203 @V60A6B6 01017600
  1054. BNO MOD3211 @V60A6B6 01017700
  1055. OI VSPCCW+4,SILI @V60A6B6 01017800
  1056. MOD3211 EQU * @V60A6B6 01017900
  1057. LA R5,181 MAX RECORD LENGTH FOR FCB 01018000
  1058. SPACE 01019000
  1059. PRTCD TM VSPFLAG1,VSPDCFOP WAS CD CCW FORCED TO '03'? @VA12613 01020000
  1060. BZ PRTCD1 NO - REG3 & REG5 INITIALIZED @VA12613 01020100
  1061. L R3,VSPBUFBK WE DIDN'T COME THRU CCWOK, SO @VA12613 01020200
  1062. LA R3,12(R3) ..INITIALIZE REG 3 AND REG5 @VA12613 01020300
  1063. LH R5,SFBRECSZ ...NOW @VA12613 01020400
  1064. NI VSPFLAG1,255-VSPDCFOP RESET FLAG @VA12613 01020500
  1065. PRTCD1 CLI VSPCCW,X'06' CK RD CMD ( 3211-TYPE PRNTR ) @V6CD1F1 01020600
  1066. BE CMD0612 YES - @VA00716 01021000
  1067. CLI VSPCCW,X'12' FCB READ CMD (3211/3203) ? @V386298 01022000
  1068. BE CMD0612 YES -- @VA00716 01023000
  1069. LA R0,MOVEPRT ADDRESS OF MOVE INSTRUCTION TO @VA00716 01024000
  1070. * MOVE 01025000
  1071. * USER DATA TO WORK BUFFER 01026000
  1072. TEST63 CLI VSPCCW,X'63' FORMS CONTROL CMD (3211/3203) ? @V386298 01035000
  1073. BE DATAMOVE YES -- @V60A4B5 01036000
  1074. CLI VSPCCW,X'03' IS IT A NO-OP? @V60A4B5 01036100
  1075. BE DATAMOVE YES -> MUST HAVE DATA @V60A4B5 01036200
  1076. TM VSPCCW,3 NOP-CODE OR COMMAND IMMEDIATE ?? 01037000
  1077. BO FLAGTEST YES -- NO DATA MOVE 01038000
  1078. DATAMOVE EQU * @V60A4B5 01038100
  1079. BAL R6,MOVEDATA GET USER'S DATA 01039000
  1080. TM VSPCCW+4,CD+IDA ANY CD CHAINING OR IDA ?? 01040000
  1081. BNZ FLAGTEST YES - 01041000
  1082. OP23 LR R13,R3 SAVE ADDRESS OF DATA END PLUS ONE 01042000
  1083. L R3,VSPBUFBK ADDRESS OF WORK BUFFER 01043000
  1084. MVC 0(12,R3),MODELCCW MOVE CCW AND TIC 01044000
  1085. CLI VSPCCW,X'03' IT IS A NO-OP? @V60A4B5 01044100
  1086. BE NOPGO YES -> USE NOP OPCODE IN CCW@V60A4B5 01044200
  1087. TM VDEVTYPE,TYPPUN PUNCH ?? 01045000
  1088. BO COMPRESS YES - 01046000
  1089. NOPGO EQU * @V60A4B5 01046100
  1090. MVC 0(1,R3),VSPCCW USE OP-CODE FROM VSPCCW 01047000
  1091. SPACE 01048000
  1092. CLI VDEVTYPE,TYP3211 3211 PRINTER ?? 01049000
  1093. BNE COMPRESS NO -- 01050000
  1094. CLI VSPCCW,X'63' FORM CONTROL OP-CODE ?? 01051000
  1095. BE COMPRESS YES -- NO NEED TO INDEX 01052000
  1096. USING VFCBBLOK,R14 01053000
  1097. L R14,VDEVFCBK ADDRESS OF VFCBBLOK 01054000
  1098. SR R5,R5 .. 01055000
  1099. NI VFCBNDEX,X'1F' TURN OFF INDEX FLAG 01056000
  1100. ICM R5,B'0001',VFCBNDEX GET INDEX COUNT, IF ANY 01057000
  1101. BZ COMPRESS NO INDEXING -- 01058000
  1102. LR R15,R13 ADDRESS OF DATA END +1 01059000
  1103. LA R13,12(R3) START OF DATA 01060000
  1104. SR R15,R13 LENGTH OF DATA 01061000
  1105. BCTR R15,0 .. 01062000
  1106. L R6,WRKADD ADDRESS OF INDEX WORK AREA 01063000
  1107. MVI 0(R6),X'40' CLEAR IT 01064000
  1108. MVC 1(183,R6),0(R6) .. 01065000
  1109. BCTR R5,0 INDEX -1 01066000
  1110. AR R6,R5 ADJUST ADDRESS TO OFFSET OF INDEX 01067000
  1111. EX R15,MINDEX MOVE DATA TO WORK AREA OFFSET 01068000
  1112. SR R6,R5 RESET WORK AREA ADDRESS TO START 01069000
  1113. LH R5,SFBRECSZ GET DEVICE LOGICAL RECORD SIZE 01070000
  1114. AR R13,R5 SET DATA END ADDRESS PLUS ONE 01071000
  1115. BCTR R5,0 -1 FOR MOVE OF NEW RECORD 01072000
  1116. EX R5,RINDEX MOVE OFFSETTED DATA BACK TO BUFFER 01073000
  1117. DROP R14 01074000
  1118. SPACE 01075000
  1119. * TRUNCATE ALL RIGHT JUSTIFIED BLANKS 01076000
  1120. SPACE 01077000
  1121. SPACE 01078000
  1122. COMPRESS LA R5,12(R3) ADDRESS OF FIRST DATA BYTE 01079000
  1123. NEXTCOL BCTR R13,R0 MINUS ONE COL 01080000
  1124. CR R5,R13 ZERO LENGTH RECORD OR BLANK RECORD 01081000
  1125. BE CNT1 YES SET UP FOR 8 BYTE DATA 01082000
  1126. CLI 0(R13),X'40' BLANK ?? 01083000
  1127. BE NEXTCOL YES KEEP CHECKING 01084000
  1128. CNT1 SR R13,R5 NEW DATA BYTE COUNT FOR CCW 01085000
  1129. LA R13,1(R13) CORRECT COUNT BY ADDING ONE 01086000
  1130. FILLCCW STH R13,6(R3) STORE NEW DATA COUNT IN CCW 01087000
  1131. LA R13,19(R13) ADD CCW LENGTH PLUS 7 FOR ROUND 01088000
  1132. TM VDEVTYPE,TYPPUN DEVICE PUNCH ?? 01089000
  1133. BZ *+8 NO - 01090000
  1134. LA R13,4(R13) ADD 4 BYTES FOR BACKCHAIN ADDRESS 01091000
  1135. N R13,=A(X'FFFFF8') ROUNDING TO DOUBLE WORD 01092000
  1136. STH R13,10(R3) FILL IN TIC CCW RELATIVE ADDRESS 01093000
  1137. * TO NEXT CCW 01094000
  1138. TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER ??@V386298 01095000
  1139. BNO PUTDATA NO--1403 @V386298 01096000
  1140. CLI VSPCCW,X'63' FORMS CONTROL COMMAND 01097000
  1141. BNE PUTDATA NO --CONTINUAL 01098000
  1142. L R15,VSPBUFBK ADDRESS OF WORK BUFFER 01099000
  1143. USING VFCBBLOK,R6 @VA01095 01100000
  1144. L R6,VDEVFCBK ADDRESS OF VFCB BLOK @VA01095 01101000
  1145. LR R14,R6 SET UP MOVE REGISTER @VA01095 01102000
  1146. XC 0(VFCBSIZE*8,R14),0(R14) CLEAR TO BINARY ZEROES 01103000
  1147. LH R13,6(R3) GET DATA COUNT 01104000
  1148. BCTR R13,0 -1 FOR MOVE 01105000
  1149. TM 12(R15),X'80' FIRST BYTE INDEX ?? 01106000
  1150. BZ *+6 NO -- 01107000
  1151. BCTR R14,0 SET MOVE TO ADDRESS TO VFCBNDEX 01108000
  1152. EX R13,FCBMOVE MOVE DATA TO VFCBLOK 01109000
  1153. B VALIDATE VALIDATE FCB DATA @VA01095 01110000
  1154. SPACE 01111000
  1155. PUTDATA LR R3,R13 R3 CONTAINS LENGTH OF BUFFER 01112000
  1156. CALL DMKVSQPD GO OBTAIN NEEDED BUFFER SPACE @V60BCAA 01113000
  1157. B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01113100
  1158. * ERROR MESSAGE 01113200
  1159. * IF NO ERROR OCCURRED, WILL FALL THRU 01113300
  1160. SPACE 2 01114000
  1161. * 01115000
  1162. * WRITE HAS BEEN SIMULATED 01116000
  1163. * 01117000
  1164. B CMD3211 PROCESS 3211/3203 CMDS @V386298 01118000
  1165. SPACE 2 01119000
  1166. PRTCNTRL EQU * HERE FOR CONTROL COMMANDS 01120000
  1167. L R3,VSPBUFBK ADDRESS OF WORK BUFFER 01121000
  1168. MVC 1(7,R3),MODELCCW+1 GET MODEL CCW (CC+SILI) 01122000
  1169. MVC 0(1,R3),VSPCCW GET CONTROL OP-CODE 01123000
  1170. OI 4(R3),SKIP INDICATE NO DATA @V293598 01124000
  1171. LA R3,8 NEED ONLY 8 BYTES FOR CCW 01125000
  1172. CALL DMKVSQPD GO OBTAIN BUFFER SPACE @V60BCAA 01126000
  1173. B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01126100
  1174. * ERROR MESSAGE. 01126200
  1175. * IF NO ERROR OCCURRED, WILL FALL THROUGH 01126300
  1176. SPACE 01127000
  1177. TM VSPCCW+4,IDA IDA ???? 01128000
  1178. BZ CMD3211 NO -- 01129000
  1179. MVC VSPCCW+6(2),VSPIDACT RESTORE CCW COUNT 01130000
  1180. NI VSPCCW+4,X'FF'-(CD+IDA) RESET CD AND IDA FLAGS 01131000
  1181. OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 01132000
  1182. SPACE 2 01133000
  1183. CMD3211 EQU * PROCESS 3211/3203 CMDS @V386298 01134000
  1184. TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER ??@V386298 01135000
  1185. BNO FLAGTEST NO--1403 @V386298 01136000
  1186. L R6,VDEVFCBK RELOAD BASE 01137000
  1187. NI VFCBFLAG,X'FF'-VFCBDIAG RESET CMD 07 FLAG @VA00716 01138000
  1188. NI VFCBFLAG,X'FF'-VFCBEOF TURN OFF EOF FLAG FORM CONTROL 01139000
  1189. SPACE 01140000
  1190. SR R4,R4 CLEAR REG 01141000
  1191. IC R4,VSPCCW CCW COMMAND 01142000
  1192. SRL R4,3 SHIFT RIGHT 3 POSITIONS 01143000
  1193. N R4,=X'0000000F' ONLY COUNT OR CHANNEL NUMBER 01144000
  1194. LTR R4,R4 ZERO SPACE REQUIRED ?? 01145000
  1195. BZ FLAGTEST YES -- 01146000
  1196. STC R4,VFCBCHL STORE SPACE CNT OR CHANNEL NUMBER 01147000
  1197. TESTLOOP LH R15,VFCBCNT GET LINE COUNT 01148000
  1198. LA R14,VFCBLOAD(R15) POINT TO CURRENT BUFFER COL 01149000
  1199. A R15,F1 UPDATE TO NEXT LINE 01150000
  1200. STH R15,VFCBCNT AND SAVE 01151000
  1201. BCTR R15,0 RESTORE CURRENT LINE COUNT 01152000
  1202. TM VSPCCW,X'80' SKIP COMMAND ?? 01153000
  1203. BO SKIP3211 YES -- 01154000
  1204. * 01155000
  1205. * PROCESSING SPACE COMMAND 01156000
  1206. * 01157000
  1207. LTR R15,R15 FIRST POSITION ?? 01158000
  1208. BZ SPACE1 BYPASS EOF TEST 01159000
  1209. TM 0(R14),X'10' END OF FORMS FLAG ON ?? 01160000
  1210. BZ SPACE1 NO -- 01161000
  1211. MVI VFCBCNT+1,X'00' RESET LINE POINTER TO ONE 01162000
  1212. CLI 0(R14),X'19' CHANNEL 9 WITH END OF FORMS ? 01163000
  1213. BE CHL9 YES -- 01164000
  1214. CLI 0(R14),X'1C' CHANNEL 12 WITH END OF FORMS ?? 01165000
  1215. BE CHL12 YES -- 01166000
  1216. B ZEROTEST TEST FOR ANY MORE SPACES 01167000
  1217. SPACE 01168000
  1218. SPACE1 CLI 0(R14),X'09' CHANNEL 9 ?? 01169000
  1219. BE CHL9 YES - 01170000
  1220. CLI 0(R14),X'0C' CHANNEL 12 ?? 01171000
  1221. BE CHL12 YES -- 01172000
  1222. ZEROTEST BCT R4,TESTLOOP -1 SPACE AND COUNTING 01173000
  1223. B FLAGTEST TEST FOR CHAINING 01174000
  1224. SPACE 01175000
  1225. CHL9 OI VDEVINTS,UC SET UNIT CHECK FOR DEVICE END TIME 01176000
  1226. OI VDEVSNSE,X'01' SET CHANNEL 9 SENSE BIT 01177000
  1227. TM VSPCCW+4,CC COMMAND CHAINING ? 01178000
  1228. BZ ENDCCW1 NO -- 01179000
  1229. B ENDCCW2 BREAK CHAINING AND LEAVE 01180000
  1230. SPACE 01181000
  1231. CHL12 OI VDEVINTS,UE SET UNIT EXCEPTION FOR DEVICE END 01182000
  1232. * TIME 01183000
  1233. TM VSPCCW+4,CC COMMAND CHAINING ? 01184000
  1234. BZ ENDCCW1 NO -- 01185000
  1235. TM VDEVFLAG,VDEVCCW1 STILL ON FIRST CCW @VA11708 01185300
  1236. BO ENDCCW1 YES- LEAVE UE FOR INTERRUPT @VA11708 01185600
  1237. * AFTER INITIAL STATUS (CE) @VA11708 01185900
  1238. OI VDEVCSW+4,UE SET UNIT EXCEPTION 01186000
  1239. B ENDCCW AND LEAVE NOW 01187000
  1240. SPACE 01188000
  1241. SKIP3211 EQU * PROCESS SKIP COMMANDS 01189000
  1242. SPACE 01190000
  1243. LTR R15,R15 FIRST POSITION ?? 01191000
  1244. BZ COMP YES - DO NOT TEST BIT 3 01192000
  1245. TM 0(R14),X'10' END OF FORMS FLAG ?? 01193000
  1246. BZ COMP NO DO COMPARE 01194000
  1247. MVI VFCBCNT+1,X'00' RESET COUNTER TO LINE ONE 01195000
  1248. TM VFCBFLAG,VFCBEOF END OF FORMS PASSED ONCE ?? 01196000
  1249. BO EOFERR YES ??? (CARRIAGE RUNAWAY) 01197000
  1250. OI VFCBFLAG,VFCBEOF TURN ON EOF BIT FLAG 01198000
  1251. SPACE 01199000
  1252. COMP EQU * R14 CONTAINS ADDRESS OF CURRENT LINE 01200000
  1253. CLC VFCBCHL(1),0(R14) CHANNEL EQUAL ?? 01201000
  1254. BE FLAGTEST YES SKIP COMPLETE 01202000
  1255. OI VFCBCHL,X'10' SET 3 BIT FOR COMPARE 01203000
  1256. CLC VFCBCHL(1),0(R14) COMPARE FOR CHANNEL WITH BIT 3 ON 01204000
  1257. BE FLAGTEST EQUAL COMPARE 01205000
  1258. NI VFCBCHL,X'0F' RESET UNWANTED BITS 01206000
  1259. B TESTLOOP NO CHECK NEXT COL 01207000
  1260. SPACE 01208000
  1261. EOFERR OI VDEVINTS,UC SET UNIT CHECK 01209000
  1262. OI VDEVSNSE,DATACHK SET DATA CHECK 01210000
  1263. OI VDEVSNSE+1,X'10' SET CARRIAGE COMPARE ERROR 01211000
  1264. TM VSPCCW+4,CC COMMAND CHAINING ? 01212000
  1265. BZ ENDCCW1 NO -- 01213000
  1266. B ENDCCW2 BREAK CHAINING AND LEAVE 01214000
  1267. SPACE 01215000
  1268. VALIDATE EQU * VALIDATE BUFFER INFORMATION 01216000
  1269. SR R1,R1 GET INDEX VALUE 01217000
  1270. ICM R1,B'0001',VFCBNDEX INDEX PRESENT ? 01218000
  1271. BZ VALID1 NO -- CONT 01219000
  1272. SL R1,=F'128' REMOVE INDEX FLAG 01220000
  1273. BC 6,LOADCK COUNT NOT POSITIVE 01221000
  1274. C R1,=F'31' GREATER THAN 31 ? 01222000
  1275. BH LOADCK YES -- 01223000
  1276. BCTR R13,0 COUNT -1 DUE INDEX BYTE 01224000
  1277. VALID1 MVI VFCBLOAD+180,X'00' CLEAR BYTE 181 @VA01095 01225000
  1278. LA R1,VFCBLOAD ADDRESS OF FIRST DATA BYTE @VA01095 01226000
  1279. AR R13,R1 ADDRESS OF LAST DATA BYTE @VA01095 01227000
  1280. TM 0(R1),X'10' COL1. 6 OR 8 LINES PER INCH ? @VA01095 01228000
  1281. BO CHECK1C YES -- VALIDATE CHANNEL @VA01095 01229000
  1282. CLI 0(R1),X'0C' CHANNEL VALUE LARGER THAN 12 ? @VA01095 01230000
  1283. BH LOADCK YES -- LOAD CHECK @VA01095 01231000
  1284. CHECK1C CLI 0(R1),X'1C' LARGER THAN CHANNEL 12 WITH BIT 3@VA01095 01232000
  1285. BNH CKLOOP NO -- CHECK NEXT @VA01095 01233000
  1286. LOADCK OI VDEVSNSE,X'02' SET LOAD CHECK @VA01095 01234000
  1287. MVI VFCBNDEX,X'00' CLEAR OUT INDEX BYTE @VA01095 01235000
  1288. MVI VFCBCNT+1,X'00' RESET LINE COUNTER @VA01095 01236000
  1289. B ENDCCW2 BREAK CHAINING AND LEAVE @VA01095 01237000
  1290. SPACE 01238000
  1291. CKLOOP LA R1,1(,R1) UPDATE VFCBLOAD ADDRESS @VA01095 01239000
  1292. CLR R1,R13 IS THIS THE LAST BYTE OF BUFFER ?@VA01095 01240000
  1293. BH LOADCK YES - EOF MISSING LOAD CHECK @VA01095 01241000
  1294. TM 0(R1),X'10' END OF FORMS BIT ? @VA01095 01242000
  1295. BO CHECKEOF YES -- @VA01095 01243000
  1296. CLI 0(R1),X'0C' GREATER THAN CHANNEL 12 ? @VA01095 01244000
  1297. BH LOADCK YES - LOAD CHECK @VA01095 01245000
  1298. B CKLOOP CHECK NEXT BYTE IN BUFFER @VA01095 01246000
  1299. SPACE 01247000
  1300. CHECKEOF CLI 0(R1),X'1C' VALID CHANNEL VALUE ? @VA01095 01248000
  1301. BH LOADCK NO - LOAD CHECK @VA01095 01249000
  1302. SLR R13,R1 CALULATE RESIDUAL COUNT @VA01095 01250000
  1303. AH R13,VDEVCSW+6 ADD PRESENT RESIDUAL COUNT @VA01095 01251000
  1304. STH R13,VDEVCSW+6 AND STORE IN CSW @VA01095 01252000
  1305. MVI VFCBCNT+1,X'01' SET COUNTER TO ONE @VA01095 01253000
  1306. SETDE OI VDEVCSW+4,DE SET DEVICE END FOR THIS COMMAND 01254000
  1307. SPACE 01255000
  1308. FLAGTEST EQU * HERE TO FINISH UP WITH CCW 01256000
  1309. OI VDEVCSW+4,CE SET CHANNEL END FOR EVERYONE 01257000
  1310. CLI VSPCCW,X'03' IS IT A NOP COMMAND? @V60A4B5 01257100
  1311. BNE NOTIMMED NOPE - DON'T FORCE IMMED END@V60A4B5 01257200
  1312. MVI VDEVCSW+5,X'00' CLEAR POSSIBLE IL @V60A4B5 01257300
  1313. TM VSPCCW+4,CC+CD ANY CHAINING SPECIFIED? @V60A4B5 01257400
  1314. BNZ NOTIMMED NO IMMED END IF SO @V60A4B5 01257500
  1315. OI VDEVCSW+4,DE SET DE TO CAUSE IMMED END @V60A4B5 01257600
  1316. NOTIMMED EQU * @V60A4B5 01257700
  1317. BAL R6,PCITEST GO TEST FOR PCI INTERRUPT 01258000
  1318. TM VDEVCSW+5,IL INCORRECT LENGTH ?? 01259000
  1319. BO LASTCCW YES - FINISHED CHANNEL PROGRAM 01260000
  1320. TM VSPCCW+4,CD+CC+IDA IS ANY CHAINING OR IDA ?? 01261000
  1321. BZ LASTCCW NO -- FINISHED WITH CHANNEL PROGRAM 01262000
  1322. NI VDEVFLAG,X'FF'-VDEVCCW1 RESET FIRST CCW INDICATOR 01263000
  1323. BAL R6,GETCCW GO LOCATE AND VERIFY NEXT NON-TIC 01264000
  1324. * CCW 01265000
  1325. B PRINTER RETURN HERE IF USER IS COMMAND 01266000
  1326. * CHAINING 01267000
  1327. B PRTCD OR HERE IF HE IS DATA CHAINING 01268000
  1328. SPACE 2 01269000
  1329. MOVEPRT MVC 0(*-*,R3),0(R2) EXECUTED TO MOVE DATA 01270000
  1330. * FROM USER TO BUFFER 01271000
  1331. MINDEX MVC 0(0,R6),12(R3) MOVE DATA TO WORK AREA OFFSET 01272000
  1332. RINDEX MVC 12(0,R3),0(R6) MOVE OFFSET DATA TO BUFFER 01273000
  1333. SPACE 01274000
  1334. SPACE 01275000
  1335. EJECT 01276000
  1336. *. 01277000
  1337. * 01278000
  1338. * SPOOLED PRINTER AND PUNCH END OF FILE PROCESSING - 01279000
  1339. * 01280000
  1340. * 1. CLOSE REQUEST ISSUED VIA CLOSE OR SPOOL COMMANDS: 01281000
  1341. * (A) IF THE DEVICE IS CP BUSY (VDEVSVC=1); BRANCH TO 01282000
  1342. * STKCPBLK ROUTINE TO BUILD AND STACK CPEXBLOK 01283000
  1343. * ON VSPSTK ANCHOR TO DELAY THE REQUEST, AND GO TO 01284000
  1344. * DISPATCHER (DMKDSPCH). 01285000
  1345. * ENTRY POINT FOR CPEXBLOK IS LABEL RDRCLRET 01286000
  1346. * (B) IF THE DEVICE IS BUSY (SIO-VDEVBUSY=1); 01287000
  1347. * SET DEFFERED CLOSE REQUEST FLAG AND EXIT TO 01288000
  1348. * THE CALLER. 01289000
  1349. * (C) IF THE DEVICE IS NOT BUSY OR CP BUSY OR 01290000
  1350. * ENTRY VIA THE STACKED CPEXBLOK; CONTINUE 01291000
  1351. * 01292000
  1352. * 2. VERIFY THAT THE FILE TO BE CLOSED IS NOT EMPTY AND WRITE 01293000
  1353. * THE FINAL PAGE BUFFER TO DASD. THEN CALL DMKSPLCV TO 01294000
  1354. * COMPLETE HOUSEKEEPING AND QUEUE THE FILE FOR FURTHER PRO- 01295000
  1355. * CESSING EITHER ON THE REAL SPOOLING HARDWARE OF, IF XFERED, 01296000
  1356. * QUEUE IT AS A VIRTUAL INPUT READER FILE 01297000
  1357. * 01298000
  1358. * 3. IF THE END OF FILE HAS BEEN FORCED VIA AN ILLEGAL CCW OP- 01299000
  1359. * CODE, POST COMMAND REJECCT AND EXIT. 01300000
  1360. * 01301000
  1361. * 4. BEFORE THE EXIT IS MADE TO THE CALLER, A BAL TO 01302000
  1362. * UNSTKBLK ROUTINE TO UNSTACK THE NEXT CPEXBLOK,IF ANY 01303000
  1363. * FOR THIS DEVICE. 01304000
  1364. * 01305000
  1365. *. 01306000
  1366. SPACE 2 01307000
  1367. USING SAVEAREA,R13 01308000
  1368. DMKVSPCO RELOC FOR CONSOLE FUNCTIONS 01309000
  1369. LR R10,R12 SET UP SECOND BASE REGISTER 01310000
  1370. A R10,F4096 .. 01311000
  1371. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VM01028 01312000
  1372. LA R6,OUTRET DELAY CPEX RETURN ADDRESS @VM01028 01313000
  1373. TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01028 01314000
  1374. BO DELAYCL YES - DELAY CLOSE @VM01028 01315000
  1375. CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ? @VM01028 01316000
  1376. BE CLPRTPUN YES - SKIP BUSY TEST @VM01028 01317000
  1377. TM VDEVSTAT,VDEVBUSY DEVICE BUSY ?? @VM01028 01318000
  1378. BO DELAYCL YES - DELAY CLOSE @VM01028 01319000
  1379. B CLPRTPUN CLOSE OUTPUT DEVICE @VM01028 01320000
  1380. OUTRET AL R8,VMDVSTRT FULL VDEVBLOK ADDRESS @VM01028 01321000
  1381. NI VDEVSFLG,X'FF'-VDEVSVC RESET DEVICE CP BUSY @VM01028 01322000
  1382. CLPRTPUN ICM R9,B'1111',VDEVSPL ADDRESS OF CONTROL BLOK @VM01028 01323000
  1383. BZ VSPCFXIT BRANCH IF NO FILE @VM01028 01324000
  1384. NI SAVER2+3,VDEVPURG KEEP ONLY PURGE OPTION @VM01028 01325000
  1385. OC VDEVSFLG,SAVER2+3 SET FLAG OPTION @VM01028 01326000
  1386. L R7,VSPSFBLK ADDRESS OF SPOOL FILE BLOK @VM01028 01327000
  1387. OI VDEVSFLG,VDEVSVC INDICATE DEVICE CP BUSY @VM01028 01328000
  1388. LA R6,CLOSERET RETURN ADDRESS @VM01028 01329000
  1389. ST R6,SAVEWRK6 SAVE RETURN ADDRESS 01330000
  1390. BAL R6,PRTEOF GO CLOSE SPOOL FILE @VM01028 01331000
  1391. CLOSERET NI VDEVSFLG,X'FF'-VDEVSVC RESET DEVICE CP BUSY @VM01028 01332000
  1392. VSPCFXIT BAL R6,UNSTKBLK GO UNSTACK CPEX BLOK @VM01028 01333000
  1393. EXIT - EXIT TO CALLER @VM01028 01334000
  1394. SPACE 01335000
  1395. DROP R13 01336000
  1396. SPACE 3 01337000
  1397. PRTEOFU2 EQU * HERE FOR CHANNEL PROGRAM CHECK CONDITION 01338000
  1398. LA R6,PROGCHK SET RETURN ADDRESS 01339000
  1399. B PRTEOFU1 FORCE CLOSING OF FILE 01340000
  1400. SPACE 01341000
  1401. PRTEOFU EQU * HERE TO CLOSE COMPLETED SPOOL FILE 01342000
  1402. BAL R6,PCITEST CHECK FOR PCI 01343000
  1403. MVI VDEVSNSE,CMDREJ MOVE IN COMMAND REJECT 01344000
  1404. LA R6,UNITCHK UNITCHECK AND COMMAND REJECT 01345000
  1405. PRTEOFU1 TM VDEVSFLG,VDEVCONT CONT OUTPUT ?? @V200930 01346000
  1406. BCR 1,R6 YES - DO NOT CLOSE FILE 01347000
  1407. MVC VDEVCSW+6(2),VSPCCW+6 MOVE IN RESIDUAL COUNT 01348000
  1408. SPACE 01349000
  1409. PRTEOF L R1,VSPVPAGE GET VIRTUAL BUFFER ADDRESS 01350000
  1410. * PAGE IN LAST BUFFER PAGE 01351000
  1411. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 01352000
  1412. TRANS 2,1,OPT=(BRING,DEFER,SYSTEM),IOER=EMSG429 @VA00716 01353000
  1413. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 01354000
  1414. L R0,SFBRECNO GET TOTAL NUMBER OF RECORDS 01355000
  1415. TM SFBFLAG2,SFBFLNMT IS FILE EMPTY ?? @VA04920 01356000
  1416. BNO PRTPUR YES THEN PURGE IT. @VA04920 01357000
  1417. LA R5,10 RETRY COUNT 01358000
  1418. TM VDEVTYPE,TYPPUN PUNCH ?? 01359000
  1419. BZ PRTCNT NO - 01360000
  1420. AL R0,VMPNCH UPDATE PUNCH CARD COUNT 01361000
  1421. ST R0,VMPNCH .. 01362000
  1422. B CHAINBUF .. 01363000
  1423. PRTCNT AL R0,VMLINS UPDATE LINE COUNT 01364000
  1424. ST R0,VMLINS .. 01365000
  1425. CHAINBUF L R1,SFBSTART GET START CCPD @VA11232 01366000
  1426. L R0,SPPREPAG DETERMINE WHETHER RE-WRITING @VA11232 01366100
  1427. LTR R0,R0 FIRST PAGE BECAUSE OF ERROR @VA11232 01366200
  1428. BNZ USESTRT NOT FIRST PAGE @VA11232 01366300
  1429. C R1,VSPDPAGE ARE WE WRITING IT IN SAME SLOT? @VA11232 01366400
  1430. BE USESTRT YES, SFBSTART IS OK @VA11232 01366500
  1431. L R1,VSPDPAGE USE CURRENT BUFFER AS START CCPD @VA11232 01366600
  1432. ST R1,SFBSTART UPDATE SFBSTART AND SFBLAST @VA11232 01366700
  1433. ST R1,SFBLAST BEFORE WRITE @VA11232 01366800
  1434. USESTRT ST R1,SPRMISC SAVE NEW START CCPD @VA11232 01366900
  1435. ST R0,SFBPNT SFBPNT PTS TO PREV. WHILE WRITE @VA11232 01367000
  1436. ST R1,SPNXTPAG CHAIN TAIL OF FILE TO HEAD @VA11232 01367100
  1437. LM R0,R1,VSPDPAGE GET BUFFER AND VIRTUAL ADDRESSES 01368000
  1438. MVC SPFILID,SFBFILID FILE ID FOR VALIDATING PAGE @V60B9BA 01369000
  1439. MVC SPTIME,SFBTIME MORE VALIDATION DATA @V60B9BA 01370000
  1440. LR R4,R2 SAVE BUFFER ADDRESS 01371000
  1441. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01372000
  1442. CALL DMKRPAPT,PARM=SYSTEM AND WRITE PAGE TO DASD 01373000
  1443. LR R2,R4 RESTORE BUFFER ADDRESS 01374000
  1444. LR R3,R0 LAST BUFFER CCPD WRITTEN @VA11232 01375000
  1445. BZ TSTPUR NO ERRORS -- 01376000
  1446. BCT R5,*+8 RETRY 10 TIMES 01377000
  1447. B EMSG429 RETRYED 10 CONSECUTIVE TIMES @VA01460 01378000
  1448. OI VSPFLAG1,VSPERR INDICATE BUFFER WRITE ERROR @VA11232 01379000
  1449. CALL DMKPGTSG GET NEW DASD BUFFER (CCPD) 01380000
  1450. LTR R1,R1 VALID DASD ADDRESS 01381000
  1451. BZ EMSG429 NO MORE DASD SPACE -- @VA01460 01382000
  1452. * WHILE IN ERROR RECOVERY - 01383000
  1453. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01384000
  1454. ST R1,VSPDPAGE SAVE NEW CCPD 01385000
  1455. B CHAINBUF RE-WRITE USING NEW CCPD 01389000
  1456. SPACE 01390000
  1457. TSTPUR AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01391000
  1458. TM VSPFLAG1,VSPERR BUFFER WRITE ERROR ? @VA11232 01392000
  1459. BO TSTERR YES -- 01393000
  1460. ST R3,SFBLAST UPD. SFBLAST IF SUCCESSFUL WRITE @VA11232 01393100
  1461. TM VDEVSFLG,VDEVPURG WAS PURGE REQUESTED ?? 01394000
  1462. BO PRTPUR YES -- 01395000
  1463. B SETOPTS NO -- CLOSE FILE 01396000
  1464. TSTERR NI VSPFLAG1,X'FF'-VSPERR RESET ERROR INDICATOR @VA11232 01397000
  1465. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01398000
  1466. ICM R0,B'1111',SPPREPAG GET PREVIOUS BUFFER DASD ADDRESS 01399000
  1467. BNZ UPDPREV UPDATE PREVIOUS BUFFER @VA11232 01400000
  1468. MVC SFBSTART,VSPDPAGE UPDATE NEW START CCPD @VA11232 01400100
  1469. B TSTPUR GO UPDATE SFBLAST @VA11232 01400200
  1470. UPDPREV L R1,VSPVPAGE GET VIRTUAL PAGE ADDRESS @VA11232 01400300
  1471. CALL DMKRPAGT,PARM=(SYSTEM+BRING+LOCK) GET BUFFER 01402000
  1472. LR R2,R4 RE-ESTABLISH BUFFER ADDRESS @VA11232 01403000
  1473. BNZ EMSG429B SPOOL READ ERROR @VA11232 01403100
  1474. ST R3,SPNXTPAG UPDATE FORWARD BUFFER POINTER @VA11232 01404000
  1475. CALL DMKRPAPT,PARM=(SYSTEM) WRITE OUT BUFFER 01405000
  1476. LR R2,R4 RE-ESTABLISH BUFFER ADDRESS @VA11232 01406000
  1477. BZ TSTPUR NO ERRORS, UPDATE SFBLAST @VA11232 01406100
  1478. L R6,SPPREPAG SFBPNT SHOULD POINT TO PREVIOUS @VA11232 01406200
  1479. ST R6,SFBPNT GOOD BUFFER WRITE @VA11232 01406300
  1480. B EMSG429B GO PURGE FILE @VA11232 01406400
  1481. PRTPUR XC VSPSFBLK(4),VSPSFBLK CLEAR SFBLOK POINTER 01408000
  1482. CLI VDEVTYPE,TYP3210 IS THIS A SPOOLED CONSOLE @VA14162 01408100
  1483. BE NOPURFLG YES,THEN FILE HAS BEEN CKPT @VA14162 01408200
  1484. OI SFBFLAG2,SFBPURGE PURGING AN OPEN SPOOL FILE @VA11439 01408500
  1485. NOPURFLG DS 0H @VA14162 01408600
  1486. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01409000
  1487. CALL DMKSPLDL AND PURGE THE FILE 01410000
  1488. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01411000
  1489. SR R7,R7 CLEAR SFBLOK GPR 01412000
  1490. B PRTDONE AND EXIT NOW 01413000
  1491. SPACE 01414000
  1492. SETOPTS MVC SFBCLAS,VDEVCLAS MOVE IN FILE CLASS 01415000
  1493. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01416000
  1494. CALL DMKSPLCV CALL VIRTUAL OUTPUT FILE CLOSE 01417000
  1495. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01418000
  1496. * ROUTINE 01419000
  1497. SPACE 2 01420000
  1498. PRTDONE EQU * HERE WHEN FINISHED CLOSING THE FILE 01421000
  1499. L R9,VDEVSPL RESTORE ADDRESS OF WORKAREA 01422000
  1500. L R1,VSPVPAGE GET VIRTUAL BUFFER ADDRESS 01423000
  1501. SR R0,R0 DUMMY DASD ADDRESS 01424000
  1502. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01425000
  1503. CALL DMKRPAGT,PARM=SYSTEM TO RELEASE CORE PAGE, AND 01426000
  1504. CALL DMKPGTVR TO RELEASE VIRTUAL BUFFER ADDRESS 01427000
  1505. L R1,VSPVPG2 SECOND VIRTUAL BUFFER ADDRESS @VA11232 01427200
  1506. LTR R1,R1 IS THERE ONE ? @VA11232 01427400
  1507. BZ NOBUFF2 NO, NOTHING TO RELEASE @VA11232 01427600
  1508. CALL DMKRPAGT,PARM=SYSTEM RELEASE CORE PAGE @VA11232 01427800
  1509. CALL DMKPGTVR AND RELEASE VIRTUAL BUFFER @VA11232 01428000
  1510. NOBUFF2 AL R8,VMDVSTRT RE-ESTABLISH VDEVBLOK ADDRESS @VA11232 01428200
  1511. L R1,VSPBUFBK GET ADDRESS OF WORK BUFFER 01429000
  1512. LTR R1,R1 BLOK TO BE FRETED ?? 01430000
  1513. BZ FRETSPL NO - FRET VSPLCTL BLOK 01431000
  1514. LA R0,VSPBUFSZ SIZE OF BLOK 01432000
  1515. CALL DMKFRET FRET IT 01433000
  1516. SPACE 01434000
  1517. FRETSPL LR R1,R9 GET ADDRESS OF VSPLCTL WORKAREA 01435000
  1518. LA R0,VSPSIZE AND ITS SIZE 01436000
  1519. CALL DMKFRET AND FREE IT 01437000
  1520. SR R9,R9 01438000
  1521. ST R9,VDEVSPL CLEAR ADDRESS OF VSPLCTL 01439000
  1522. NI VDEVSFLG,X'FF'-(VDEVPURG+VDEVCFCL) RESET PURGE AND 01440000
  1523. * CONSOLE FUNCTION FLAG 01441000
  1524. BR R6 AND LEAVE 01442000
  1525. SPACE 3 01443000
  1526. DELAYCL EQU * HERE TO SET UP FOR POSSIBLE DELAYED CLOSE 01444000
  1527. OI VDEVSFLG,VDEVCFCL FLAG CONSOLE CLOSE PENDING 01445000
  1528. USING SAVEAREA,R13 01446000
  1529. TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01028 01447000
  1530. BO STKCPBLK YES - SET DELAY @VM01028 01448000
  1531. CLC SAVER1,=C'CLOS' PROCESSING CLOSE COMMAND ? 01449000
  1532. DROP R13 01450000
  1533. BE VSPCFXIT YES - RETURN TO CALLER 01451000
  1534. OI VDEVKEY,X'0F' FORCE CHANNEL PROGRAM CHECK 01452000
  1535. USING CPEXBLOK,R1 01453000
  1536. STKCPBLK LA R0,CPEXSIZE SIZE OF CPEXBLOK @VM01021 01454000
  1537. CALL DMKFREE GET STORAGE 01455000
  1538. XC CPEXBLOK(CPEXSIZE*8),CPEXBLOK CLEAR IT 01456000
  1539. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 01457000
  1540. LR R15,R6 SET UP ENTRY ADDRESS 01458000
  1541. STM R15,R14,CPEXADD SET ENTRY POINT AND SAVE REGS 01459000
  1542. LA R2,VSPSTK GET LOCAL STACK CP BLOKS 01460000
  1543. LR R3,R2 SAVE PREVIOUS ADDRESS @VA01460 01461000
  1544. ICM R2,B'1111',0(R2) GET ADDRESS OF NEXT CPEXBLOK @VA01460 01462000
  1545. BNZ *-6 BRANCH IF NOT LAST @VA01460 01463000
  1546. ST R1,0(,R3) CHAIN THIS ONE TO END @VA01460 01464000
  1547. GOTO DMKDSPCH RETURN CONTROL BACK TO SYSTEM 01465000
  1548. DROP R1 01466000
  1549. SPACE 3 01467000
  1550. SPACE 01468000
  1551. SPACE 3 01469000
  1552. EJECT 01470000
  1553. *. 01471000
  1554. * 01472000
  1555. * HANDLING CONTROL PROGRAM REQUESTS TO USE THE VIRTUAL PRINTER - 01473000
  1556. * 01474000
  1557. * 1. UPON ENTRY TO DMKVSPRT, THE FOLLOWING REGISTERS MUST BE 01475000
  1558. * LOADED - 01476000
  1559. * GPR0 = BYTE COUNT OF LINE TO PRINTED 01477000
  1560. * GPR1 = ADDRESS OF FIRST BYTE OF OUTPUT LINE 01478000
  1561. * GPR11 = ADDRESS OF VMBLOK FOR OWNER OF VIRTUAL PRINTER 01479000
  1562. * GPR12 = ADDRESS OF DMKVSPRT 01480000
  1563. * GPR13 = ADDRESS OF SAVEAREA 01481000
  1564. * 01482000
  1565. * 2. VERIFY THAT THE LINE BYTE COUNT IS 0 TO 132, IF NOT SET 01483000
  1566. * RETURN CODE 4 AND EXIT TO THE CALLER. 01484000
  1567. * 01485000
  1568. * 3. LOCATE AN AVAILABLE VIRTUAL PRINTER; IF NONE, SET RETURN 01486000
  1569. * CODE 4 AND EXIT TO THE CALLER 01487000
  1570. * 01488000
  1571. * 4. IF THE DEVICE IS CP BUSY(VDEVSVC=1) OR BUSY(SIO-VDEVBUSY=1) 01489000
  1572. * BRANCH TO STKCPBLK ROUTINE TO BUILD AND STACK A 01490000
  1573. * CPEXBLOK ON VSPSTK ANCHOR CHAIN, AND GO TO DISPATCHER. 01491000
  1574. * 01492000
  1575. * 5. IF THE DEVICE IS NOT CP BUSY OR BUSY OR ENTRY FROM A 01493000
  1576. * PREVIOUS STACK CPEXBLOK; OPEN A FILE FOR THIS DEVICE IF 01494000
  1577. * NECESSARY AND PLACE THE LINE INTO THE FILE. IF LINE COUNT 01495000
  1578. * WAS ZERO, INSERT A SKIP TO CHANNEL ONE CCW. 01496000
  1579. * 01497000
  1580. * 6. BAL TO THE UNSTKBLK ROUTINE TO UNSTACK THE NEXT 01498000
  1581. * CPEXBLOK FOR THIS DEVICE, IF ANY. 01499000
  1582. * 01500000
  1583. * 7. SET THE CORRECT RETURN CODE IN GPR2 AND EXIT TO THE CALLER 01501000
  1584. * 01502000
  1585. * 01503000
  1586. * EXIT CONDITIONS 01504000
  1587. * 01505000
  1588. * GPR2 = ZERO SUCCESSFULL COMPLETION 01506000
  1589. * GPR2 = 4 VIRTUAL PRINTER DEVICE NOT FOUND OR 01507000
  1590. * DEDICATED TO REAL DEVICE OR NOT-READY. 01508000
  1591. * GPR2 = 8 SPOOLING SPACE FULL OR SPOOL IO ERROR 01509000
  1592. * 01510000
  1593. * HANDLING CONTROL PROGRAM REQUESTS FOR HARD COPY OF CONSOLE 01511000
  1594. * REAL OR VIRTUAL - 01512000
  1595. * 01513000
  1596. * 1. UPON ENTRY TO DMKVSPVP, THE FOLLOWING REGISTERS MUST BE 01514000
  1597. * LOADED - 01515000
  1598. * GPR0 = BYTE COUNT OF DATA TO BE SPOOLED 01516000
  1599. * GPR1 = ADDRESS OF FIRST BYTE OF OUTPUT LINE 01517000
  1600. * GPR8 = ADDRESS OF CONSOLE VDEVBLOK 01518000
  1601. * GPR11 = ADDRESS OF VMBLOK FOR OWNER OF VIRUAL CONSOLE 01519000
  1602. * GPR12 = ADDRESS OF DMKVSPVP 01520000
  1603. * GPR13 = ADDRESS OF SAVEAREA 01521000
  1604. * 01522000
  1605. * 2. VERIFY THAT THE LINE BYTE COUNT IS 1 TO 132, IF NOT, 01523000
  1606. * EXIT TO THE CALLER. 01524000
  1607. * 01525000
  1608. * 3. IF THE VIRTUAL CONSOLE IS CP BUSY(VDEVSVC=1), DO THE 01526000
  1609. * FOLLOWING TO PREVENT USER LOCK OUT: (NOT BUSY GO TO STEP 6) 01527000
  1610. * (A) GET FREE STORAGE TO HOLD THE PRINT LINE DATA. 01528000
  1611. * (B) GET STORAGE FOR CPEXBLOK AND STACK BY CALLING 01529000
  1612. * DMKSTKCP FOR ENTRY POINT VSPCON. 01530000
  1613. * (C) EXIT TO CALLER TO PREVENT USER LOCKOUT. 01531000
  1614. * 4. ENTRY POINT - VSPCON - 01532000
  1615. * (A) CALL DMKVSPCP TO WRITE DATA LINE TO SPOOL FILE 01533000
  1616. * (B) ON RETURN FROM DMKVSPCP, RETURN BUFFER STORAGE. 01534000
  1617. * (C) GO TO DISPATCHER (DMKDSPCH) 01535000
  1618. * 01536000
  1619. * 5. ENTRY POINT - DMKVSPCP - IF THE CONSOLE DEVICE IS CP BUSY, 01537000
  1620. * BRANCH TO STKCPBLK ROUTINE TO BUILD AND STACK A CPEXBLOK 01538000
  1621. * ON VSPSTK ANCHOR CHAIN AND GO TO DISPATCHER. 01539000
  1622. * WHEN THE CPEXBLOK IS UNSTACKED BY CP RETURN IS TO 01540000
  1623. * STEP 6. 01541000
  1624. * 01542000
  1625. * 6. OPEN A FILE FOR THIS DEVICE IF NECESSARY AND PLACE THE 01543000
  1626. * LINE INTO THE FILE. INSERT A SKIP TO CHANNEL ONE, 01544000
  1627. * EVERY 60 LINES OF DATA. 01545000
  1628. * 01546000
  1629. * 7. BAL TO UNSTKBLK ROUTINE TO UNSTACK THE NEXT CPEXBLOK 01547000
  1630. * IF ANY, FOR THIS DEVICE AND EXIT TO CALLER.. 01548000
  1631. * 01549000
  1632. * EXIT CONDITIONS - 01550000
  1633. * 01551000
  1634. * VDEVBLOK - VDEVCSPL WILL BE RESET IF SPOOL 01552000
  1635. * SPACE FULL OR SPOOL BUFFER ERROR 01553000
  1636. * CONDITION. THE USER WILL RECEIVE ERROR 01554000
  1637. * MESSAGE DMKVSP427I OR DMKVSP429I. 01555000
  1638. * 01556000
  1639. * NO RETURN CODE IS RETURN TO THE CALLER 01557000
  1640. * 01558000
  1641. *. 01559000
  1642. SPACE 2 01560000
  1643. USING SAVEAREA,R13 01561000
  1644. DMKVSPRT RELOC 01562000
  1645. LR R10,R12 SET UP SECOND BASE REGISTER 01563000
  1646. A R10,F4096 .. 01564000
  1647. SR R2,R2 CLEAR RETURN CODE REG 01565000
  1648. ST R2,SAVEWRK2 .. 01566000
  1649. SR R1,R1 ZERO CHANNEL INDEX 01567000
  1650. LA R4,2 INCREMENT VALUE 01568000
  1651. LA R5,30 TABLE LENGTH 01569000
  1652. VCH LH R6,VMCHTBL(R1) LOAD INDEX TO NEXT VIRT CHANNEL 01570000
  1653. LTR R6,R6 CHANNEL EXIST ?? 01571000
  1654. BM VCHI NO, TRY NEXT 01572000
  1655. A R6,VMCHSTRT POINT TO VCHBLOK 01573000
  1656. USING VCHBLOK,R6 01574000
  1657. SR R2,R2 ZERO CU TABLE INDEX 01575000
  1658. VCU LH R7,VCHCUTBL(R2) LOAD INDEX TO NEXT VIRT CONTROL UNIT 01576000
  1659. LTR R7,R7 DOES IT EXIST ?? 01577000
  1660. BM VCUI NO, TRY NEXT 01578000
  1661. A R7,VMCUSTRT POINT TO VCUBLOK 01579000
  1662. USING VCUBLOK,R7 01580000
  1663. SR R3,R3 CLEAR DEVICE INDEX 01581000
  1664. VDV LH R8,VCUDVTBL(R3) LOAD INDEX TO DEVICE BLOK 01582000
  1665. LTR R8,R8 DOES IT EXIST ?? 01583000
  1666. BM NEXTDEV NO TRY NEXT 01584000
  1667. A R8,VMDVSTRT POINT TO VDEVBLOK 01585000
  1668. CLI VDEVTYPC,CLASURO OUTPUT DEVICE ?? 01586000
  1669. BNE NEXTDEV NO - 01587000
  1670. TM VDEVSTAT,VDEVDED DEDICATED TO REAL DEVBLOK ? 01588000
  1671. BO NEXTDEV YES - 01589000
  1672. TM VDEVTYPE,TYPPRT PRINTER DEVICE ?? 01590000
  1673. BO PRTFND YES -- GO 01591000
  1674. NEXTDEV BXLE R3,R4,VDV INCREMENT THRU DEVICES 01592000
  1675. VCUI BXLE R2,R4,VCU INCREMENT THRU CONTROL UNIT 01593000
  1676. VCHI BXLE R1,R4,VCH INCREMENT THRU CHANNEL 01594000
  1677. L R8,FFS INDICATE NO VDEVBLOK 01595000
  1678. SPACE 01596000
  1679. USING SFBLOK,R7 01597000
  1680. VSPRT4 MVI SAVEWRK2+3,4 SET RETURN CODE 01598000
  1681. B VSPRINTX USER HAS NO PRINTER 01599000
  1682. SPACE 01600000
  1683. DMKVSPVP RELOC ENTRY FOR CONSOLE SUPPORT HARD COPY 01601000
  1684. LR R10,R12 SET UP SECOND BASE REGISTER 01602000
  1685. A R10,F4096 .. 01603000
  1686. SR R2,R2 CLEAR RETURN CODE 01604000
  1687. ST R2,SAVEWRK2 .. 01605000
  1688. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 01606000
  1689. CL R0,F1 LENGTH 1 OR GREATER ? 01607000
  1690. BL VSPRT4 NO -- EXIT 01608000
  1691. TM VDEVSTAT,VDEVNRDY+VDEVDED DEDICATED OR NOT READY ?? 01609000
  1692. BNZ VSPRT4 YES --RESET SPOOL ACTIVE AND EXIT 01610000
  1693. TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01021 01611000
  1694. BZ PRTNBUSY NO - CONTINUE @VM01021 01612000
  1695. LR R2,R1 SAVE DATA ADDRESS @VM01021 01613000
  1696. LR R4,R0 SAVE DATA COUNT @VM01021 01614000
  1697. TM VDEVFLAG,VDEVDLY WAIT AND SPOOL IT LATER? @VA04213 01614250
  1698. BNO NODELAY NO...DO IT NOW @VA04213 01614500
  1699. NI VDEVFLAG,255-VDEVDLY RESET DELAY FLAG @VA04213 01614750
  1700. LA R0,7(,R4) GET NUMBER OF DOUBLE WORDS @VM01021 01615000
  1701. SRL R0,3 .. @VM01021 01616000
  1702. LR R5,R0 SAVE FOR BUFFER FRET @VM01021 01617000
  1703. CALL DMKFREE GET STORAGE FOR BUFFER @VM01021 01618000
  1704. LR R3,R1 SAVE ADDRESS OF BUFFER @VM01021 01619000
  1705. BCTR R4,0 DATA BYTE COUNT -1 @VM01021 01620000
  1706. EX R4,MOVEPRT MOVE DATA TO NEW TEMP BUFFER @VM01021 01621000
  1707. LA R0,CPEXSIZE BUILD CPEXBLOK @VM01021 01622000
  1708. CALL DMKFREE .. @VM01021 01623000
  1709. USING CPEXBLOK,R1 @VM01021 01624000
  1710. XC CPEXBLOK(CPEXSIZE*8),CPEXBLOK CLEAR IT @VM01021 01625000
  1711. LA R0,1(,R4) BYTE COUNT OF DATA @VM01021 01626000
  1712. L R8,SAVER8 RESTORE VDEVBLOK DISPLACEMENT @VM01021 01627000
  1713. LA R15,VSPCON CPEX ENTRY ADDRESS @VM01021 01628000
  1714. STM R15,R14,CPEXADD SET ENTRY POINT AND SAVE REGS @VM01021 01629000
  1715. ST R3,CPEXR1 SET BUFFER ADDRESS IN REG 1 @VM01021 01630000
  1716. CALL DMKSTKCP HAVE CP STACK IT @VM01021 01631000
  1717. EXIT - EXIT TO CALLER @VM01021 01632000
  1718. NODELAY LA R6,VSPCON1 RETURN ADDRESS @VA04213 01632350
  1719. B STKCPBLK STACK IT @VA04213 01632700
  1720. SPACE 01633000
  1721. VSPCON EQU * ENTER HERE FROM CPEX BLOK @VM01021 01634000
  1722. CALL DMKVSPCP WRITE CONSOLE HARDCOPY OF @VM01021 01635000
  1723. * DATA PASSED BY CPEX BLOK 01636000
  1724. LR R0,R5 SIZE OF TEMP BUFFER @VM01021 01637000
  1725. LR R1,R3 ADDRESS OF TEMP BUFFER @VM01021 01638000
  1726. CALL DMKFRET RETURN TEMP BUFFER STORAGE @VM01021 01639000
  1727. GOTO DMKDSPCH GO TO DISPATCHER @VM01021 01640000
  1728. SPACE 01641000
  1729. DMKVSPCP RELOC - ENTRY FOR STACKED HARD COPY DATA @VM01021 01642000
  1730. AL R8,VMDVSTRT FULL VDEVBLOK ADDRESS @VM01021 01643000
  1731. B CONFND TRY AND PRINT A LINE @VM01021 01644000
  1732. SPACE 01645000
  1733. DROP R1 @VM01021 01646000
  1734. VSPCON1 LR R0,R4 GET THE COUNT @VA04213 01646140
  1735. LR R1,R2 AND THE DATA ADDRESS @VA04213 01646280
  1736. AL R8,VMDVSTRT AND THE VDEVBLOK ADDRESS @VA04213 01646420
  1737. B PRTNBUSY PICK UP THIS TASK @VA04213 01646560
  1738. SPACE 2 01646700
  1739. PRTFND TM VDEVSTAT,VDEVNRDY DEVICE NOT READY ? 01647000
  1740. BO NEXTDEV BRANCH NOT READY 01648000
  1741. TM VDEVSTAT,VDEVBUSY DEVICE BUSY WITH SIO ? @VM01021 01649000
  1742. BO PRTDLY YES - SET UP DELAY @VM01021 01650000
  1743. CONFND TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ?? @VM01021 01651000
  1744. BZ PRTNBUSY NO - START PROCESSING @VM01021 01652000
  1745. PRTDLY LA R6,PRTCPEX CPEX ENTRY ADDRESS @VM01021 01653000
  1746. B STKCPBLK GO STACK CPEX BLOK @VM01021 01654000
  1747. PRTCPEX AL R8,VMDVSTRT GET VDEVBLOK ADDRESS @VM01021 01655000
  1748. PRTNBUSY L R9,VDEVSPL ADDRESS OF SPOOL CONTROL BLOK @VM01021 01656000
  1749. OI VDEVSFLG,VDEVSVC INDICATE CALL BY SVC 01657000
  1750. LTR R9,R9 IS ANY FILE OPEN? 01658000
  1751. BNZ FILEOPEN 01659000
  1752. CALL DMKSCNVD GET FULL DEVICE ADDRESS 01660000
  1753. BNZ VSPRT4 VCUBLOK OR VCHBLOK MISSING 01661000
  1754. STH R1,VDEVUNIT SAVE FULL DEVICE ADDRESS 01662000
  1755. BAL R6,OPEN OPEN FILE - SFBLOK VSPLCTL 01663000
  1756. ST R7,VSPSFBLK STORE ADDRESS OF SFBLOK 01664000
  1757. CLC SFBSTART(4),ZEROES DASD SPACE AVAILABLE ?? 01665000
  1758. BNE OPENCKPT YES - CHECKPOINT IT .. @VM02132 01666000
  1759. LA R6,VSPRINTX RETURN ADDRESS FOR EXIT 01667000
  1760. ST R6,SAVEWRK6 SAVE IT 01668000
  1761. BAL R6,PRTPUR PURGE FILE - CLEAR DEVICE 01669000
  1762. B MSG427I GIVE ERROR MSG DMKVSP427I 01670000
  1763. * CONTROL WILL RETURN TO VSPRINTX 01671000
  1764. OPENCKPT CLI VDEVTYPE,TYP1052 @VA05480 01672100
  1765. BNE FILEOPEN @VA05480 01672200
  1766. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA07487 01672250
  1767. CALL DMKCKSPL,PARM=OPNSFB+ADDSFB+PRTCHN @VA05480 01672300
  1768. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA07487 01672400
  1769. FILEOPEN L R7,VSPSFBLK GET ADDRESS OF SPOOL FILE BLOK 01673000
  1770. L R5,VSPBUFBK ADDRESS OF WORK BUFFER 01674000
  1771. LTR R5,R5 VALID WORK ADDRESS 01675000
  1772. BP SETCCW YES 01676000
  1773. LA R0,VSPBUFSZ NUMBER OF DOUBLE WORDS FOR PRINTER 01677000
  1774. SPACE 01678000
  1775. CALL DMKFREE GET STORAGE FOR WORK BUFFER 01679000
  1776. ST R1,VSPBUFBK SAVE ADDRESS OF WORK BUFFER 01680000
  1777. LR R5,R1 ADDRESS OF WORK BUFFER 01681000
  1778. SETCCW MVC 1(11,R5),MODELCCW+1 GET MODEL CCW AND TIC 01682000
  1779. MVI 0(R5),X'09' SET UP FOR PRINT AND SPACE 01683000
  1780. CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ?? 01684000
  1781. BNE SPACE01 NO -- CHECK FOR SPACE NO PRINT 01685000
  1782. ICM R3,B'1111',SFBRECNO RECORD COUNT OF ZERO @VA01330 01686000
  1783. BZ CONSKIP YES -- DO SKIP 01687000
  1784. SR R2,R2 SET UP FOR DIVIDE 01688000
  1785. D R2,=F'60' 60 LINES PER PAGE 01689000
  1786. LTR R2,R2 TIME FOR SKIP 01690000
  1787. BNZ TESTCNT NO --CONTINUE 01691000
  1788. CONSKIP MVI 0(R5),X'8B' INSERT SKIP TO CHANNEL ONE @VW01580 01692000
  1789. OI 4(R5),SKIP SET CCW TO INDICATE NO DATA @V293598 01693000
  1790. LA R3,8 LENGTH OF SKIP CCW @VW01580 01694000
  1791. LA R6,CONSRET SET UP RETURN ADDRESS @VW01580 01695000
  1792. ST R6,SAVEWRK6 .. @VW01580 01696000
  1793. CALL DMKVSQPD GET BUFFER SPACE AND MOVE DATA @V60BCAA 01697000
  1794. B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01697100
  1795. * ERROR MESSAGE. 01697200
  1796. * IF NO ERROR OCCURRED, WILL FALL THROUGH 01697300
  1797. CONSRET L R5,VSPBUFBK RESTORE ADDRESS OF BUFFER @VW01580 01698000
  1798. NI 4(R5),X'FF'-SKIP AND RESET THE CCW @V293598 01699000
  1799. MVI 0(R5),X'09' PRINT AND SPACE CCW OP-CODE @VW01580 01700000
  1800. B TESTCNT NOW PROCESS INPUT LINE 01701000
  1801. SPACE 01702000
  1802. SPACE01 CLI VSPCCW,X'01' LAST CCW WRITE NOSPACE 01703000
  1803. MVI VSPCCW,X'09' SET UP FOR PRINT AND SPACE 01704000
  1804. BNE TESTCNT NO -- 01705000
  1805. MVI VSPCCW,X'0B' SET UP TO SPACE IMMEDIATE 01706000
  1806. MVI 0(R5),X'0B' .. 01707000
  1807. OI 4(R5),SKIP INDICATE NO DATA @V293598 01708000
  1808. LA R3,8 LENGTH OF CCW 01709000
  1809. LA R6,SPACERET RETURN ADDRESS 01710000
  1810. ST R6,SAVEWRK6 .. 01711000
  1811. CALL DMKVSQPD GO OBTAIN BUFFER SPACE @V60BCAA 01712000
  1812. B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01712100
  1813. * ERROR MESSAGE. 01712200
  1814. * IF NO ERROR OCCURRED, WILL FALL THROUGH 01712300
  1815. NI 4(R5),X'FF'-SKIP AND RESET THE CCW @V293598 01713000
  1816. SPACERET MVI VSPCCW,X'01' PRINT AND NOSPACE 01714000
  1817. MVI 0(R5),X'01' .. 01715000
  1818. TESTCNT L R4,SAVER0 RESTORE BYTE COUNT 01716000
  1819. LTR R4,R4 COUNT ZERO ?? 01717000
  1820. BNZ NOSKIP NO - NO SKIP 01718000
  1821. MVI 0(R5),X'8B' MOVE IN SKIP TO ONE 01719000
  1822. OI 4(R5),SKIP INDICATE NO DATA @V293598 01720000
  1823. LA R3,8 SET LENGTH TO 8 01721000
  1824. B SKLINE 01722000
  1825. NOSKIP CL R4,=F'132' WILL IT FIT ON ONE LINE? @VA05182 01723500
  1826. BNH LOWLIMIT YES @VM03186 01724000
  1827. LA R4,132 SET MAXIMUM LINE LENGTH @VA05182 01725500
  1828. LOWLIMIT L R1,SAVER1 RESTORE ADDRESS OF INPUT DATA @VM03186 01726000
  1829. * LINE 01727000
  1830. LA R15,12(R5) POINT TO START OF DATA IN BUFFER 01728000
  1831. LR R6,R15 SAVE FOR DATA MOVE INSTRUCTION 01729000
  1832. TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 01730000
  1833. BNO SETCNT NO--1403 @V386298 01731000
  1834. USING VFCBBLOK,R14 01732000
  1835. L R14,VDEVFCBK ADDRESS OF FORMS BLOK 01733000
  1836. SR R3,R3 SET UP TO TEST FOR INDEXING 01734000
  1837. NI VFCBNDEX,X'1F' RESET ALL EXCEPT COUNT 01735000
  1838. ICM R3,B'0001',VFCBNDEX GET INDEX BYTE COUNT 01736000
  1839. BZ SETCNT NO INDEXING AVAILABLE 01737000
  1840. MVI 12(R5),X'40' CLEAR FIRST 31 BYTES 01738000
  1841. MVC 13(31,R5),12(R5) OF DATA AREA 01739000
  1842. BCTR R3,0 INDEX COUNT -1 01740000
  1843. AR R4,R3 ADD INDEX COUNT TO INPUT LINE CNT 01741000
  1844. C R4,=F'150' GREATER THAN MAX LINE ?? 01742000
  1845. BNH *+8 NO -- 01743000
  1846. LA R4,150 RESET TO MAX OF 150 01744000
  1847. SR R4,R3 GET NEW INPUT DATA COUNT 01745000
  1848. AR R6,R3 SET UP NEW BUFFER DATA ADDRESS 01746000
  1849. SETCNT LR R3,R4 SAVE COUNT OF DATA 01747000
  1850. BCTR R4,0 -1 FOR MOVE 01748000
  1851. EX R4,VSPMOVE MOVE DATA TO BUFFER 01749000
  1852. AR R3,R15 POINT TO END OF DATA 01750000
  1853. TRUNC BCTR R3,R0 -1 TO TRUNCATE BLANKS 01751000
  1854. CR R3,R15 START OF BUFFER ?? 01752000
  1855. BNH NONBLANK YES - 01753000
  1856. CLI 0(R3),C' ' IS THIS COL BLANK ?? 01754000
  1857. BE TRUNC YES - CHECK NEXT 01755000
  1858. SPACE 01756000
  1859. NONBLANK SR R3,R15 FIND LENGTH 01757000
  1860. LA R3,1(R3) ADD ONE TO LENGTH 01758000
  1861. STH R3,6(R5) STORE LENGTH IN CCW 01759000
  1862. LA R3,19(R3) CCW LENGTH PLUS 7 FOR ROUNDING 01760000
  1863. N R3,=A(X'FFFFF8') ROUND TO DOUBLE WORD 01761000
  1864. STH R3,10(R5) SET TIC ADDRESS OF NEXT CCW 01762000
  1865. * R3 LENGTH OF WORK BUFFER 01763000
  1866. SKLINE LA R6,VSPRINTX GET RETURN ADDRESS 01764000
  1867. ST R6,SAVEWRK6 AND SAVE 01765000
  1868. CALL DMKVSQPD GO OBTAIN BUFFER SPACE @V60BCAA 01766000
  1869. B ERROMSG IF RETURN TO THIS POINT, GO WRITE@V60BCAA 01766100
  1870. * ERROR MESSAGE. 01766200
  1871. * IF NO ERROR OCCURRED, WILL FALL THROUGH 01766300
  1872. VSPRINTX EQU * EXIT TO CALLER 01767000
  1873. LTR R8,R8 VALID VDEVBLOK ADDRESS 01768000
  1874. BNP RETCODE NO -- SET RETURN CODE AND EXIT @VA00808 01769000
  1875. NI VDEVSFLG,X'FF'-VDEVSVC RESET ENTRY INDICATOR 01770000
  1876. BAL R6,UNSTKBLK GO UNSTACK CPEX BLOCK @VM01021 01771000
  1877. CLI VDEVTYPE,TYP3210 CONSOLE DEVICE? @VA11114 01771200
  1878. BNE RETCODE IF NOT, GO SET RETURN CODE @VA11114 01771400
  1879. TM VDEVSFLG,VDEVSVC WAS A CPEXBLOK UNSTACKED? @VA11114 01771600
  1880. BO PRTEXIT IF SO, BEAT IT QUIETLY @VA11114 01771800
  1881. TM VMRSTAT,VMCPWAIT WAITIING FOR CP RESOURCE? @VA11114 01772000
  1882. BNZ PRTEXIT IF SO, OUT QUIETLY @VA11114 01772200
  1883. TM VMPEND,255 ANY PENDING INTERRUPTS AT ALL? @VA11114 01772400
  1884. BZ PRTEXIT NOPE, ALL IS WELL @VA11114 01772600
  1885. * AT THIS POINT, CONSOLE SPOOLING MAY HAVE BLOCKED A USER, 01772800
  1886. * SO GIVE HIM A SHOT AT DISPATCH: 01773000
  1887. LA R0,CPEXSIZE @VA11114 01773200
  1888. CALL DMKFREE NEED A CPEXBLOK NOW @VA11114 01773400
  1889. USING CPEXBLOK,R1 TELL SAM @VA11114 01773600
  1890. XC CPEXBLOK(CPEXSIZE*8),CPEXBLOK CLEARED, PLEASE @VA11114 01773800
  1891. LA R15,VSPCDISP WHERE TO COME BACK @VA11114 01774000
  1892. STM R15,R14,CPEXADD STOW THE REGISTERS @VA11114 01774200
  1893. CALL DMKSTKCP AND STACK RETURN @VA11114 01774400
  1894. B PRTEXIT NO RETURN CODE FOR CONSOLE @VA11114 01774600
  1895. DROP R1 NO MORE CPEXBLOK @VA11114 01774800
  1896. * 01775000
  1897. RETCODE DS 0H HERE TO SET RETURN CODE @VA11114 01775200
  1898. L R2,SAVEWRK2 GET RETURN CODE @VA11114 01775400
  1899. ST R2,SAVER2 AND STORE IN CALLER'S REG2 @VA11114 01775600
  1900. PRTEXIT DS 0H RETURN TO CALLER @VA11114 01775800
  1901. EXIT , -------------------------------->@VA11114 01776000
  1902. * 01776200
  1903. VSPCDISP DS 0H HERE ON CPEXBLOK UNSTACK @VA11114 01776400
  1904. GOTO DMKDSPCH WAKE UP, YOU ------------------->@VA11114 01776600
  1905. * 01776800
  1906. SPACE 01777000
  1907. SPACE 2 01778000
  1908. VSPMOVE MVC 0(*-*,R6),0(R1) MOVE DATA TO BUFFER 01779000
  1909. SPACE 01780000
  1910. DROP R14 01781000
  1911. SPACE 01782000
  1912. DROP R13 01783000
  1913. EJECT 01784000
  1914. LTORG * 01785000
  1915. EJECT 01786000
  1916. SPACE 3 01980000
  1917. EJECT 01981000
  1918. SPACE 2 01983000
  1919. MODELCCW EQU * MODEL CCW AND TIC 01984000
  1920. DC X'41' PUNCH OP-CODE 01985000
  1921. DC AL3(12) RELATIVE DATA ADDRESS 01986000
  1922. DC AL1(CC+SILI,0) FLAGS 01987000
  1923. DC AL2(80) DATA LENGTH 01988000
  1924. DC X'08' TIC OP-CODE 01989000
  1925. DC AL3(96) RELATIVE ADDRESS OF NEXT RECORD 01990000
  1926. SPACE 01991000
  1927. DS 0H 01992000
  1928. EJECT 01993000
  1929. SENSE EQU * HERE TO DO A SENSE TO READER 01994000
  1930. * PRINTER, OR PUNCH 01995000
  1931. SPACE 3 01996000
  1932. L R1,VSPCCW GET DATA ADDRESS 01997000
  1933. LA R1,0(,R1) CLEAR COMMAND CODE 01998000
  1934. BAL R6,PCITEST GO TEST FOR PCI INTERRUPT 01999000
  1935. OI VDEVCSW+4,CE+DE SENSE RETURNS CE+DE TOGETHER 02000000
  1936. LA R3,VDEVSNSE ADDRESS OF VDEVICE SENSE BYTES 02001000
  1937. SR R4,R4 GET CCW COUNT @VA00808 02002000
  1938. ICM R4,B'0011',VSPCCW+6 .. @VA00808 02003000
  1939. TM VDEVSTAT,VDEVNRDY DEVICE NOTREADY 02004000
  1940. BO SETNR YES - 02005000
  1941. SPACE 02006000
  1942. SPACE 02007000
  1943. LTR R7,R7 ACTIVE FILE ?? 02008000
  1944. BNZ *+8 YES -- INDICATE PRESENT SENSE 02009000
  1945. SETNR MVI VDEVSNSE,INTREQ INDICATE INTERVENTION REQUIRED 02010000
  1946. LA R5,1 SENSE COUNT OF ONE 02011000
  1947. CLI VDEVTYPE,TYP3505 3505 RDR ? 3525 PUN ? 02012000
  1948. BNE CNT3211 NO--CHECK 3211/3203 @V386298 02013000
  1949. LA R5,4 SENSE COUNT FOR 3505 AND 3525 02014000
  1950. TM VDEVSNSE,INTREQ INTERVENTION REQUIRED ? 02015000
  1951. BZ *+8 NO -- CHECK FOR COMMAND REJECT 02016000
  1952. MVI VDEVSNSE+1,X'10' SENSE BYTE 1 FOR 3505 OR 3525 02017000
  1953. TM VDEVSNSE,CMDREJ COMMAND REJECT ?? 02018000
  1954. BZ SENTST NO -- SENSE INFORMATION OK 02019000
  1955. MVI VDEVSNSE+1,X'80' INDICATE PERMANENT ERROR 02020000
  1956. B SENTST CONTINUE 02021000
  1957. CNT3211 EQU * 02021500
  1958. TM VDEVTYPE,TYP3211 IS IT A 3203/3211 PRINTER?? @V386298 02022000
  1959. BNO SENTST NO--1403 @V386298 02023000
  1960. ICM R5,B'1111',VDEVFCBK ADDRESS OF FORM CONTROL BLOK@VA00716 02024000
  1961. BZ *+8 NONE PRESENT - BRANCH @VA00716 02025000
  1962. NI VFCBFLAG-VFCBBLOK(R5),X'FF'-VFCBDIAG @VA14403 02026010
  1963. * RESET CMD 07 PROCESSING 02027010
  1964. CLI VDEVTYPE,TYP3203 IS IT A 3203 PRINTER ?? @V386298 02027100
  1965. BNE SENS3211 NO--LOAD 3211 SESE COUNT @V386298 02027200
  1966. LA R5,24 LOAD 3203 SENSE BYTE COUNT @V386298 02027300
  1967. B SENTST GO CHECK CCW SENSE COUNT @V386298 02027400
  1968. SENS3211 EQU * @V386298 02027500
  1969. LA R5,6 SENSE COUNT FOR 3211 02028000
  1970. SPACE 02029000
  1971. SENTST CR R4,R5 CCW SENSE COUNT VALID 02030000
  1972. BH COUNTHI CCW COUNT HIGH 02031000
  1973. BL CNTLOW CCW COUNT LOWER THAN DEVICE COUNT 02032000
  1974. B SENSEQ SENSE COUNT EQUAL 02033000
  1975. SPACE 02034000
  1976. COUNTHI EQU * HERE IF COUNT IS TOO BIG 02035000
  1977. SR R4,R5 RESIDUAL COUNT 02036000
  1978. STH R4,VDEVCSW+6 STORE RESIDUAL COUNT 02037000
  1979. LR R4,R5 GET DEVICE SENSE COUNT 02038000
  1980. TM VSPCCW+4,CD+IDA DATA CHAINING OR IDA ?? 02039000
  1981. BZ TSTWLR NO -- TEST SILI FLAG 02040000
  1982. TM VSPCCW+4,IDA IDA ?? 02041000
  1983. BZ SNSIL NO --SET INCORRECT LENGTH 02042000
  1984. LH R14,VSPIDACT GET ORIGNAL CCW DATA COUNT 02043000
  1985. SR R14,R5 GET TRUE RESIDUAL COUNT 02044000
  1986. STH R14,VDEVCSW+6 AND STORE IN CSW 02045000
  1987. OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 02046000
  1988. NI VSPCCW+4,X'FF'-IDA REMOVE IDA FROM CCW 02047000
  1989. B SNSIL SET INCORRECT LENGTH 02048000
  1990. SPACE 02049000
  1991. CNTLOW TM VSPCCW+4,IDA IDA ?? 02050000
  1992. BO IDALOW YES -- 02051000
  1993. TM VSPCCW+4,CD DATA CHAINING ?? 02052000
  1994. BO NORMSNS YES -- TAKE NORMAL PATH 02053000
  1995. B TSTWLR NO -- CHECK SILI FLAG 02054000
  1996. IDALOW CH R4,VSPIDACT MOVE COUNT EQUAL TOTAL COUNT ? 02055000
  1997. BNE NORMSNS NO -- 02056000
  1998. BAL R6,SENSMOVE MOVE SENSE INFORMATION 02057000
  1999. SPACE 02058000
  2000. IDAEND1 TM VSPCCW+4,SILI SUPPRESS INCORRECT LENGTH ?? 02059000
  2001. BZ *+8 NO -- 02060000
  2002. OI VDEVCSW+5,IL YES - SET INCORRECT LENGTH 02061000
  2003. OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 02062000
  2004. NI VSPCCW+4,X'FF'-IDA REMOVE IDA FROM CCW 02063000
  2005. B CKCC CHECK FOR CHAINING 02064000
  2006. TSTWLR TM VSPCCW+4,SILI SUPPRESS INCORRECT LENGTH ?? 02065000
  2007. BO NORMSNS YES -- 02066000
  2008. SNSIL OI VDEVCSW+5,IL NO -- SET INCORRECT LENGTH 02067000
  2009. NORMSNS SR R5,R4 SAVE REMAINING COUNT 02068000
  2010. LTR R4,R4 MOVE COUNT ZERO ?? 02069000
  2011. BZ *+8 YES -- 02070000
  2012. BAL R6,SENSMOVE GO MOVE SENSE TO USER AREA 02071000
  2013. TM VDEVCSW+5,IL INCORRECT LENGTH ?? 02072000
  2014. BO LASTCCW YES -- END CHAIN 02073000
  2015. TM VSPCCW+4,CD+CC+IDA ANY CHAINING OR IDA ?? 02074000
  2016. BZ LASTCCW NO -- LEAVE 02075000
  2017. NI VDEVFLAG,X'FF'-VDEVCCW1 RESET FIRST CCW INDICATOR 02076000
  2018. BAL R6,GETCCW GET NEXT CCW 02077000
  2019. B CHKDEVIC COMMAND CHAINING 02078000
  2020. SR R4,R4 GET NEXT CCW COUNT @VA00808 02079000
  2021. ICM R4,B'0011',VSPCCW+6 .. @VA00808 02080000
  2022. L R1,VSPCCW GET DATA ADDRESS 02081000
  2023. LA R1,0(R1) 02082000
  2024. CR R4,R5 COUNT EQUAL REMAINING COUNT ?? 02083000
  2025. BH COUNTHI NO - COUNT HIGH 02084000
  2026. BL CNTLOW COUNT LOW 02085000
  2027. SPACE 02086000
  2028. * HERE DIRECTLY IF COUNT OK 02087000
  2029. SENSEQ EQU * 02088000
  2030. BAL R6,SENSMOVE GO MOVE SENSE BYTES TO USER'S AREA 02089000
  2031. SR R5,R5 INDICATE ZERO DEVICE COUNT LEFT 02090000
  2032. CKCC TM VSPCCW+4,CD+CC+IDA ANY CHAINING OR IDA ?? 02091000
  2033. BZ LASTCCW NO -- 02092000
  2034. NI VDEVFLAG,X'FF'-VDEVCCW1 RESET FIRST CCW INDICATOR 02093000
  2035. SNSNXT BAL R6,GETCCW GO LOCATE AND VALIDATE NEXT CCW 02094000
  2036. B CHKDEVIC BRANCH IF COMMAND CHAINING 02095000
  2037. SR R4,R4 HERE IF DATA CHAINING @VA00808 02096000
  2038. ICM R4,B'0011',VSPCCW+6 GET CCW COUNT @VA00808 02097000
  2039. B SENTST AND CONTINUAL 02098000
  2040. SPACE 02099000
  2041. SENSMOVE TM VSPCCW+4,SKIP SKIP FLAG ON ?? 02100000
  2042. BO CKCC YES - 02101000
  2043. ALTER1 SL R8,VMDVSTRT VDEVBLOK DISP @VA05901 02102700
  2044. TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02103400
  2045. * USER AREA 02104000
  2046. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 02105000
  2047. IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 02106000
  2048. CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 02107000
  2049. BNZ PROTCHK REFLECT PROTECTION EXCEPTION @V304735 02108000
  2050. CALL DMKPSACC CHECK IF PAGE WAS CHANGED. @V304735 02109000
  2051. BZ NOTCHG1 IF NOT CONTINUE @V304735 02110000
  2052. CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02110100
  2053. B ALTER1 RE-ISSUE THE TRANS @V304735 02112000
  2054. NOTCHG1 LA R14,VDEVFCBK ADDR. POINTER TO FCB BLOK @V304735 02113000
  2055. CR R3,R14 MUST ZERO LAST 2 BYTES OF 02114000
  2056. BL MOVEINST 6 COUNT SENSE 02115000
  2057. BE SENBYTE4 CHECK DEVICE FOR SENSE BYTE 4 @VA11722 02115200
  2058. SENRET EQU * @VA11722 02115400
  2059. MVI 0(R2),X'00' ZERO SENSE BYTE 02116000
  2060. B UPDATSEN CONTINUE WITH SENSE BYTES @VA11722 02117100
  2061. SENBYTE4 EQU * @VA11722 02117150
  2062. CLI VDEVTYPE,TYP3203 IS THIS A 3203 PRINTER ? @VA11722 02117200
  2063. BNE SENRET NO,CONTINUE @VA11722 02117250
  2064. MVI 0(R2),DEVID84 MOVE IN DEVICE IDENTIFIER @VA11722 02117300
  2065. B UPDATSEN CONTINUE WITH SENSE BYTES @VA11722 02117350
  2066. MOVEINST MVC 0(1,R2),0(R3) MOVE SENSE BYTE TO USER'S AREA 02118000
  2067. UPDATSEN EQU * @VA11722 02118500
  2068. LA R1,1(R1) UPDATE OUTPUT ADDRESS 02119000
  2069. LA R3,1(R3) UPDATE SENSE ADDRESS 02120000
  2070. BCT R4,SENSMOVE GO MOVE NEXT BYTE 02121000
  2071. BR R6 02122000
  2072. SPACE 02123000
  2073. SPACE 2 02124000
  2074. CHKDEVIC CLI VDEVTYPC,CLASURI INPUT DEVICE ?? 02125000
  2075. BE READER CONTINUE WITH READER 02126000
  2076. B PRINTER CONTINUE WITH PRINTER/PUNCH 02127000
  2077. EJECT 02128000
  2078. * CALLED FROM DMKVSI, FOR PROCESSING VIRTUAL TIO,AS A 02129000
  2079. * SUBROUTINE TO TEST IF THE RDR IS EMPTY. 02130000
  2080. SPACE 02131000
  2081. USING SAVEAREA,R13 @VA03503 02132000
  2082. DMKVSPTO RELOC ENTRY FOR TIO TO A SPOOL READER @VA03503 02133000
  2083. LR R10,R12 SET UP SECOND BASE REGISTER @VA03503 02134000
  2084. A R10,F4096 ... @VA03503 02135000
  2085. BAL R6,CHEKRDR GO SEARCH THE RDR FILE CHAIN @VA13708 02136000
  2086. LTR R7,R7 SET CC @VA03503 02142000
  2087. EXITVIO EXIT @VA03503 02143000
  2088. EJECT 02144000
  2089. OPEN EQU * HERE TO OPEN 1ST FILE 02145000
  2090. CLI VDEVTYPC,CLASURI IS IT A READER FILE ?? 02146000
  2091. BE OPENRDR YES -- 02147000
  2092. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 02148000
  2093. CALL DMKSPLOV CALL VIRTUAL SPOOL FILE OPEN ROUTINE 02149000
  2094. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02150000
  2095. LR R4,R1 SAVE CAW ADDRESS @V386298 02150100
  2096. CLI VDEVTYPE,TYP3203 IS IT A 3203 PRINTER ?? @V386298 02150200
  2097. BE CKFCBBK YES--GO GET VFCBBLOK ADDRESS@V386298 02150300
  2098. CLI VDEVTYPE,TYP3211 3211 PRINTER ?? 02151000
  2099. BNE OPENRET NO 02153000
  2100. ICM R5,B'1111',WRKADD INDEX WORK AREA PRESENT ?? 02154000
  2101. BNZ CKFCBBK YES -- 02155000
  2102. LA R0,184/8 LENGTH OF INDEX WORK AREA 02156000
  2103. CALL DMKFREE GET STORAGE 02157000
  2104. ST R1,WRKADD AND SAVE ADDRESS 02158000
  2105. CKFCBBK L R5,VDEVFCBK GET VFCBBLOK ADDRESS 02159000
  2106. DROP R6 02160000
  2107. USING VFCBBLOK,R5 SET BASE FOR BLOK 02161000
  2108. LTR R5,R5 VFCBBLOK PRESENT ?? 02162000
  2109. BP OPENRET YES 02163000
  2110. LA R0,VFCBSIZE SIZE OF BLOCK 02164000
  2111. CALL DMKFREE GET STORAGE 02165000
  2112. LR R5,R1 LOAD BASE REG 02166000
  2113. ST R5,VDEVFCBK STORE ADDRESS IN VDEVBLOK 02167000
  2114. XC VFCBBLOK(VFCBSIZE*8),VFCBBLOK CLEAR VFCBBLOK 02168000
  2115. * 02169000
  2116. * SET DEFAULT CHANNELS 02170000
  2117. * 02171000
  2118. MVI VFCBCNT+1,X'01' SET COUNT TO LINE 2 @VA00716 02172000
  2119. MVC VFCBLOAD(11),=X'0102030405060708090A0B' 02173000
  2120. MVI VFCBLOAD+59,X'0C' PUT IN CHANNEL 12 02174000
  2121. OI VFCBLOAD+65,X'10' END OF FORMS BIT 02175000
  2122. OPENRET LR R1,R4 RESTORE CAW ADDRESS 02176000
  2123. BR R6 RETURN TO CALLER 02177000
  2124. SPACE 2 02178000
  2125. OPENRDR EQU * HERE TO OPEN A READER FILE 02179000
  2126. LR R5,R1 SAVE CAW 02180000
  2127. LA R0,VSPSIZE GET CORE FOR 02181000
  2128. CALL DMKFREE A VSPLCTL WORK AREA 02182000
  2129. LR R9,R1 SAVE ITS ADDRESS 02183000
  2130. ST R9,VDEVSPL IN THE VDEVBLOK 02184000
  2131. XC VSPLCTL(VSPSIZE*8),VSPLCTL CLEAR OUT THE BLOK 02185000
  2132. ST R5,VSPCAW SAVE CAW ADDRESS 02186000
  2133. LA R0,VSPBUFSZ LENGTH OF WORK BUFFER 02187000
  2134. CALL DMKFREE GET STORAGE 02188000
  2135. ST R1,VSPBUFBK 02189000
  2136. SPACE 02190000
  2137. OPENCONT EQU * 02191000
  2138. L R1,VSPCAW RESTORE CAW ADDRESS @VA02259 02192000
  2139. CHEKRDR DS 0H @VA13708 02192500
  2140. SLR R7,R7 CLEAR READER FILE POINTER @VA02259 02193000
  2141. TM VDEVSTAT,VDEVNRDY IS READER READY? @VA02259 02194000
  2142. BO OPNTST NO, RETURN TO CALLER @VA02259 02195000
  2143. L R7,ARSPRD POINT TO READER FILE CHAIN @VA02259 02196000
  2144. SPACE 02197000
  2145. FILESRCH L R7,SFBPNT POINTER TO NEXT FILE 02198000
  2146. OPNTST LTR R7,R7 ANY MORE FILES? @VA02259 02199000
  2147. BCR 8,R6 NO, RETURN COND ZERO TO CALLER @V200930 02200000
  2148. CLC VMUSER,SFBUSER IS THIS A FILE FOR THIS USER? 02201000
  2149. BNE FILESRCH NO -- KEEP LOOKING 02202000
  2150. TM SFBFLAG,SFBINUSE+SFBDUMP+SFBUHOLD INUSE, DUMP @V200930 02203000
  2151. * OR HOLD ? 02204000
  2152. BNZ FILESRCH YES -- 02205000
  2153. TM SFBFLAG2,SFBMON IS THIS A MONITOR FILE @V50A2B5 02205100
  2154. BO FILESRCH YES, SO SKIP THIS @V50A2B5 02205200
  2155. CLI VDEVCLAS,C'*' READ ANY CLASS ?? @V200930 02206000
  2156. BE SETFLAG YES, FOUND A FILE @V200930 02207000
  2157. CLC VDEVCLAS,SFBCLAS RIGHT CLASS?? 02208000
  2158. BNE FILESRCH NO -- 02209000
  2159. * 02210000
  2160. * FINALLY FOUND A FILE 02211000
  2161. * 02212000
  2162. SETFLAG DS 0H @VA12125 02213500
  2163. CLI VMINST,X'9D' TIO? @VA12125 02214000
  2164. BER R6 YES - EXIT @VA12125 02214500
  2165. OI SFBFLAG,SFBINUSE MARK SPOOL FILE IN USE @VA12125 02215000
  2166. OPENTIO LR R3,R6 SAVE FIRST LEVEL RTN ADDR @VA03503 02216000
  2167. L R1,VSPVPAGE GET VIRTUAL PAGE ADDRESS 02217000
  2168. LTR R1,R1 ADDRESS PRESENT ?? 02218000
  2169. BNZ VPAGE YES -- 02219000
  2170. SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 02220000
  2171. CALL DMKPGTVG GET VIRTUAL BUFFER 02221000
  2172. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02222000
  2173. ST R1,VSPVPAGE SAVE ADDRESS 02223000
  2174. VPAGE LA R2,SFBSTART POINT TO DASD ADDRESS 02224000
  2175. BAL R6,NEXTPAGE FETCH FIRST PAGE BUFFER 02225000
  2176. L R6,SFBRECNO GET NUMBER OF RECORDS IN FILE @VA02075 02226000
  2177. AL R6,VMCRDS UPDATE CARD COUNT @VA02075 02227000
  2178. ST R6,VMCRDS AND STORE @VA02075 02228000
  2179. TM SFBFLAG,SFBEOF END OF FILE OR DATA ? @VW01580 02229000
  2180. BZ *+8 BRANCH IF DATA PRESENT @VW01580 02230000
  2181. OI SFBFLAG,SFBOPEN ZERO RECORD FILE 02231000
  2182. L R1,VSPCAW RESTORE CONTENTS OF CALLER'S R1 02232000
  2183. OI VDEVSFLG,VDEVFEED INDICATE FEED DONE FOR 1ST CARD 02233000
  2184. CR R6,R12 SET CONDITION CODE NON-ZERO 02234000
  2185. BR R3 FILE FOUND - GO PROCESS 02235000
  2186. EJECT 02236000
  2187. GETCCW EQU * HERE TO FIND AND VALIDATE THE NEXT 02237000
  2188. * NON-TIC CCW IN THE CHANNEL PROGRAM 02238000
  2189. L R1,VSPCAW POINT TO NEXT CCW TO PROCESS 02239000
  2190. TM VSPIDASW,X'C0' PROCESSING IDA CCW ?? 02240000
  2191. BM VSPIDA2 YES -- PART TWO PROCESSING 02241000
  2192. ADDRTEST TM VSPCAW+3,7 CHECK DOUBLE-WORD ALIGNMENT 02242000
  2193. BNZ PROGCHK ALIGNMENT ERROR 02243000
  2194. TM VDEVKEY,X'0F' CAW BITS 4-7 ZERO ?? 02244000
  2195. BNZ PROGCHK NO -- CHANNEL PROGRAM CHECK 02245000
  2196. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02246000
  2197. ALTER2 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02247100
  2198. CALL DMKPSACC CHECK IF SHARED PAGE CHANGED @V304735 02248000
  2199. BZ NOTCHG2 IF NOT CONTINUE @V304735 02249000
  2200. CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02249100
  2201. B ALTER2 RE-ISSUE TRANS @V304735 02251000
  2202. NOTCHG2 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02252000
  2203. LA R15,8(,R1) GET CCW ADDRESS+8 02253000
  2204. ST R15,VDEVCSW AND SAVE IN CSW 02254000
  2205. ST R15,VSPCAW AND IN CAW FOR NEXT TIME 02255000
  2206. TM 0(R2),7 COULD IT BE A TIC? 02256000
  2207. BNZ NOTTIC NO -- 02257000
  2208. TM 0(R2),8 IS IT A TIC 02258000
  2209. BO TIC YES -- 02259000
  2210. SPACE 2 02260000
  2211. NOTTIC LH R1,6(,R2) IS THE 02261000
  2212. LTR R1,R1 COUNT ZERO? 02262000
  2213. BZ PROGCHK YES -- BAD NEWS 02263000
  2214. TM 4(R2),3 BITS 38-39 OF THE CCW MUST BE 0 02264000
  2215. BNZ PROGCHK IF NOT -- 02265000
  2216. TM 4(R2),IDA IS THIS A IDA CCW ?? @VA00808 02266000
  2217. BZ NONIDA NO -- BRANCH @VA00808 02267000
  2218. L R1,0(R2) GET DATA ADDRESS 02268000
  2219. LA R1,0(R1) CLEAR HIGH BYTE 02269000
  2220. TM 3(R2),3 IDAL ADDRESS ON FULL WORD BOUNDS ?? 02270000
  2221. BNZ PROGCHK NO -- 02271000
  2222. TM VSPCCW+4,CD IS USER DATA CHAINING ?? 02272000
  2223. MVC VSPCCW+1(7),1(R2) MOVE IN MOST OF CCW 02273000
  2224. BZ VSPIDA NO -- COMMAND CHAINING 02274000
  2225. AL R6,F4 SET UP FOR CHAIN DATA RETURN 02275000
  2226. B VSPIDA1 ... @V304635 02276000
  2227. VSPIDA MVC VSPCCW(1),0(R2) MOVE IN COMMAND CODE 02277000
  2228. VSPIDA1 L R1,VSPCCW ADDRESS OF IDAL @V304635 02278000
  2229. LA R1,0(R1) CLEAR COMMAND CODE 02279000
  2230. STCM R1,B'0111',VSPIDAL SAVE ADDRESS OF IDAL 02280000
  2231. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02281000
  2232. ALTER3 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02282100
  2233. CALL DMKPSACC CHECK IF SHARED PAGE CHANGED @V304735 02283000
  2234. BZ NOTCHG3 IF NOT CONTINUE @V304735 02284000
  2235. CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02284100
  2236. B ALTER3 RE-ISSUE TRANS CALL @V304735 02286000
  2237. NOTCHG3 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02287000
  2238. CLI 0(R2),0 FIRST BYTE ZERO ?? 02288000
  2239. BNE PROGCHK NO -- 02289000
  2240. SPACE 02290000
  2241. L R14,0(R2) LOAD FIRST IDAW 02291000
  2242. STCM R14,B'0111',VSPCCW+1 STORE FIRST IDAW IN CCW 02292000
  2243. N R14,F2047 FIND DISPLACEMENT INTO 2048 02293000
  2244. L R15,F2048 02294000
  2245. SR R15,R14 NUMBER OF BYTES TO NEXT 2048 02295000
  2246. SR R14,R14 .. 02296000
  2247. ICM R14,B'0011',VSPCCW+6 GET CCW DATA COUNT 02297000
  2248. STH R14,VSPIDACT SAVE DATA COUNT 02298000
  2249. CR R14,R15 IS THERE AN OTHER IDAW ?? 02299000
  2250. BNH ONEIDAW NO -- ONLY ONE 02300000
  2251. SPACE 02301000
  2252. STH R15,VSPCCW+6 STORE THE DATA COUNT FOR THE FIRST 02302000
  2253. LA R1,4(R1) IDAW AND READ THE NEXT IDAW 02303000
  2254. ST R1,VSPIDAW2 SAVE ADDRESS OF IDAW2 02304000
  2255. MVI VSPIDASW,X'80' INDICATE 1ST CCW ALL SET UP 02305000
  2256. BR R6 AND RETURN 02306000
  2257. SPACE 02307000
  2258. VSPIDA2 EQU * HERE TO SET UP CCW WITH IDAW2 02308000
  2259. L R1,VSPIDAW2 GET ADDRESS OF IDAW2 02309000
  2260. * 02310000
  2261. * VALIDATE IDAW2 WORD 02311000
  2262. * 02312000
  2263. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02313000
  2264. ALTER4 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02314100
  2265. CALL DMKPSACC CHECK IF SHARED PAGE WAS CHANGED @V304735 02315000
  2266. BZ NOTCHG4 IF NOT CONTINUE @V304735 02316000
  2267. CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02316100
  2268. B ALTER4 RE-ISSUE THE TRANS CALL @V304735 02318000
  2269. NOTCHG4 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02319000
  2270. CLI 0(R2),0 HIGH ORDER BYTE MUST BE ZERO 02320000
  2271. BNE PROGCHK NO -- 02321000
  2272. TM 3(R2),X'FF' CHECK FOR 2048 BOUNDARY ALINED 02322000
  2273. BNZ PROGCHK NOT ON 2048 BOUNDS 02323000
  2274. TM 2(R2),X'07' STILL CHECKING 2048 02324000
  2275. BNZ PROGCHK NOT ON 2048 BOUNDS 02325000
  2276. SPACE 02326000
  2277. MVC VSPCCW+1(3),1(R2) STORE IDAW2 DATA ADDRESS IN CCW 02327000
  2278. AL R6,F4 SET RETURN FOR DATA CHAINING 02328000
  2279. SR R14,R14 CLEAR COUNT REGS @VA00808 02329000
  2280. SR R15,R15 .. @VA00808 02330000
  2281. ICM R14,B'0011',VSPIDACT GET ORIGINAL COUNT @VA00808 02331000
  2282. ICM R15,B'0011',VSPCCW+6 GET DATA COUNT FOR 1ST IDAW@VA00808 02332000
  2283. SR R14,R15 COUNT FOR REMAINING DATA 02333000
  2284. STH R14,VSPCCW+6 AND STORE IN CCW 02334000
  2285. SPACE 02335000
  2286. ONEIDAW OI VSPIDASW,X'C0' INDICATE ALL DONE 02336000
  2287. NI VSPCCW+4,X'FF'-IDA RESET IDA FLAG 02337000
  2288. BR R6 02338000
  2289. SPACE 02339000
  2290. NONIDA EQU * 02340000
  2291. TM VSPCCW+4,CD IS USER DATA CHAINING? 02341000
  2292. MVC VSPCCW+1(7),1(R2) IN ANY CASE, MOVE IN MOST OF CCW 02342000
  2293. BO 4(,R6) IF DATA CHAINING EXIT NOW 02343000
  2294. MVC VSPCCW(1),0(R2) IF COMMAND CHAINING, MOVE IN COMMAND 02344000
  2295. BR R6 AND EXIT TO HANDLE COMMAND CHAINING 02345000
  2296. SPACE 2 02346000
  2297. TIC EQU * HERE TO FOLLOW THE TIC 02347000
  2298. TM VDEVFLAG,VDEVCCW1 IS IT THE FIRST CCW? 02348000
  2299. BO PROGCHK YES -- GO SET PROGRAM CHECK 02349000
  2300. TM VSPCCW+5,X'01' TIC TO TIC?? 02350000
  2301. BO PROGCHK YES -- PROGRAM CHECK 02351000
  2302. OI VSPCCW+5,X'01' INDICATE LAST CCW WAS A TIC 02352000
  2303. L R1,0(,R2) GET ADDRESS OF NEXT CCW 02353000
  2304. LA R1,0(,R1) STRIP OP-CODE 02354000
  2305. ST R1,VSPCAW SAVE ADDRESS 02355000
  2306. B ADDRTEST GO VALIDATE NEW CCW 02356000
  2307. EJECT 02357000
  2308. MOVEDATA EQU * HERE TO LOCATE USER'S DATA AREA 02358000
  2309. * AND MOVE DATA BETWEEN USER AND WORK BUFFER. 02359000
  2310. * R3 ADDRESS OF THE SOURCE DATA OR WORK BUFFER 02360000
  2311. * R0 POINTS THE MOVE INSTRUCTION TO BE EXECUTED TO MOVE 02361000
  2312. * THE DATA IN THE PROPER DIRECTION 02362000
  2313. * GPR5 CONTAINS LOGICAL RECORD SIZE OR RESIDUAL COUNT FOR 02363000
  2314. * DATA CHAINING 02364000
  2315. * 02365000
  2316. L R1,VSPCCW GET VIRTUAL DATA ADDRESS 02366000
  2317. LA R1,0(,R1) CLEAR OUT COMMAND CODE 02367000
  2318. SR R4,R4 CLEAR COUNT REG @VA00808 02368000
  2319. ICM R4,B'0011',VSPCCW+6 GET COUNT FROM CCW @VA00808 02369000
  2320. CR R4,R5 COUNT VALID FOR THIS DEVICE ?? 02370000
  2321. BE COUNTOK YES COUNT OK 02371000
  2322. BL COUNTLOW MORE CHECKING 02372000
  2323. * 02373000
  2324. * HERE IS COUNT IS TOO HIGH 02374000
  2325. * 02375000
  2326. SR R4,R5 GET RESIDUAL COUNT 02376000
  2327. STH R4,VDEVCSW+6 PUT RESIDUAL COUNT IN CSW 02377000
  2328. LR R4,R5 SET UP MOVE COUNT REG 02378000
  2329. TM VSPCCW+4,CD+IDA CHAINING DATA OR IDA ?? 02379000
  2330. BZ COUNTLOW NO --CHECK SILI 02380000
  2331. NI VSPCCW+4,X'FF'-CD RESET CHAIN DATA 02381000
  2332. TM VSPCCW+4,IDA DOING IDA ?? 02382000
  2333. BZ SETWLR NO - MUST BE CHAIN DATA 02383000
  2334. NI VSPCCW+4,X'FF'-IDA RESET IDA 02384000
  2335. OI VSPIDASW,X'C0' INDICATE IDA COMPLETE 02385000
  2336. LH R14,VSPIDACT GET TOTAL CCW COUNT 02386000
  2337. SR R14,R4 SGET TRUE RESIDUAL COUNT 02387000
  2338. STH R14,VDEVCSW+6 AND STORE IN CSW 02388000
  2339. B SETWLR MUST SET INCORRECT LENGTH FLAG 02389000
  2340. SPACE 02390000
  2341. COUNTLOW EQU * @V60A6B6 02391000
  2342. *********************************************************************** 02391010
  2343. *** THE NEXT THREE LINES OF CODE WILL ENSURE THAT 3203 HAS THE SILI *** 02391020
  2344. *** BIT TURNED ON IN ORDER TO SUPPRESS THE INCORRECT LENGTH FROM *** 02391030
  2345. *** BEING REFLECTED. *** 02391040
  2346. *********************************************************************** 02391050
  2347. CLI VDEVTYPE,TYP3203 @V60A6B6 02391060
  2348. BNO CNTCHECK @V60A6B6 02391070
  2349. OI VSPCCW+4,SILI @V60A6B6 02391080
  2350. CNTCHECK EQU * @V60A6B6 02391090
  2351. TM VSPCCW+4,SILI+CD+IDA SUPRESS INCORRECT LENGTH OR@V60A6B6 02391100
  2352. * CHAIN OR IDA 02392000
  2353. BNZ COUNTOK YES - NO INCORRECT LENGTH 02393000
  2354. * DATA 02394000
  2355. CLI VDEVTYPE,TYP3211 3211 PRINTER ? @VA00716 02395000
  2356. BNE SETWLR NO -- SET WLR FLAG (IL) @VA00716 02396000
  2357. ICM R14,B'0011',VDEVCSW+6 RESIDUAL COUNT PRESENT ? @VA00716 02397000
  2358. BNZ SETWLR YES -- TRUE WLR @VA00716 02398000
  2359. LR R14,R5 CHECK FOR 132 BYTE 3211 DEVICE @VA00716 02399000
  2360. SR R14,R4 150 MINUS CCW COUNT @VA00716 02400000
  2361. C R14,=F'18' 132 BYTE -3211 ? @VA00716 02401000
  2362. BE COUNTOK YES -- DO NOT SET IL FLAG @VA00716 02402000
  2363. SPACE 02403000
  2364. SETWLR CLI VSPCCW,X'63' FORMS CONTROL OP-CODE ? 02404000
  2365. BE COUNTOK YES -- DO NOT SET INCORRECT LENGTH 02405000
  2366. OI VDEVCSW+5,IL SET INCORRECT LENGTH 02406000
  2367. SPACE 02407000
  2368. COUNTOK EQU * HERE DIRECTLY IF COUNT IS OK 02408000
  2369. SR R5,R4 GET RESIDUAL COUNT FOR THIS DEVICE 02409000
  2370. CNTOK LTR R4,R4 MOVE COUNT OF ZERO ??? 02410000
  2371. BZ RDRSKIP YES -- SKIP MOVE 02411000
  2372. TM VSPCCW,1 IS IT A WRITE CCW ?? 02412000
  2373. BO GETPAGE YES IGNORE POSSIBLE SKIP FLAG 02413000
  2374. TM VSPCCW+4,SKIP READ WITH SKIP ?? 02414000
  2375. BO RDRSKIP YES -- NO DATA MOVEMENT OR PROT 02415000
  2376. * TEST. 02416000
  2377. SPACE 02417000
  2378. GETPAGE EQU * GET DATA PAGE 02418000
  2379. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02419000
  2380. ALTER5 TRANS 2,1,OPT=(BRING,DEFER),ADEX=PROGCHK1,IOER=EXIT1 @VA05901 02420100
  2381. CALL DMKPSACC CHECK IF SHARED PAGE WAS CHANGED @V304735 02421000
  2382. BZ NOTCHG5 IF NOT CONTINUE @V304735 02422000
  2383. CALL DMKVMASH FLAG ALL CHANGED SHARED PAGES @VA07351 02422100
  2384. B ALTER5 RE-ISSUE THE TRANS CALL @V304735 02424000
  2385. NOTCHG5 AL R8,VMDVSTRT VDEVBLOK ADDRESS @V304735 02425000
  2386. TM VSPCCW,X'01' WILL CCW MODIFY STORAGE ? 02426000
  2387. BO KEYOK NO -- NO PROTECTION TEST 02427000
  2388. ST R0,TEMPR1 SAVE ADDRESS OF MOVE INSTRUCTION @V304735 02428000
  2389. IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 02429000
  2390. CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 02430000
  2391. L R0,TEMPR1 RESTORE REGISTER @V304735 02431000
  2392. BE KEYOK NO VIOLATION 02432000
  2393. B PROTCHK AND REFLECT INTERRUPT 02433000
  2394. SPACE 02434000
  2395. KEYOK EQU * HERE IF STORAGE KEYS MATCH 02435000
  2396. N R1,F4095 GET DISPLACEMENT INTO PAGE 02436000
  2397. L R15,F4096 SET SIZE OF PAGE 02437000
  2398. SR R15,R1 SUBST PAGE SIZE FROM DISPLACEMNT 02438000
  2399. CR R4,R15 R4 IS THE NUMBER OF BYTES TO BE 02439000
  2400. * MOVED 02440000
  2401. BNH ONEPAGE DATA AREA IS IN ONE PAGE 02441000
  2402. SPACE 2 02442000
  2403. * HERE IF USER'S DATA CROSSES PAGE BOUNDARY 02443000
  2404. SR R4,R15 AMOUNT OF DATA IN SECOND PAGE IN R4 02444000
  2405. BCTR R15,0 DECREMENT R15 FOR EXECUTE 02445000
  2406. LR R14,R0 POINT TO MOVE INSTRUCTION 02446000
  2407. EX R15,0(R14) EXCUTED MOVE INSTRUCTION 02447000
  2408. LA R3,1(R15,R3) BUMP POINTER TO NEXT DATA SLOT 02448000
  2409. L R1,VSPCCW GET ORIGINAL DATA ADDRESS 02449000
  2410. LA R1,1(R15,R1) POINT TO FIRST BYTE IN NEXT PAGE 02450000
  2411. B GETPAGE AND RE-EXECUTE THE SUBROUTINE 02451000
  2412. SPACE 02452000
  2413. ONEPAGE EQU * HERE WHEN REMAINING DATA IS ALL IN ONE PAGE 02453000
  2414. BCTR R4,0 DECREMENT LENGTH FOR EXECUTE 02454000
  2415. TM VSPCCW,X'01' WILL CCW MODIFY STORAGE ? 02455000
  2416. BO EXMVC NO -- GO MOVE DATA 02456000
  2417. AR R2,R4 POINT TO LAST BYTE OF DATA 02457000
  2418. ST R0,TEMPR1 SAVE ADDRESS OF MOVE INSTRUCTION @V304735 02458000
  2419. IC R0,VDEVKEY INSPECT VIRTUAL CAW KEY @V304735 02459000
  2420. CALL DMKPSASC CHECK FOR PROTECTION VIOLATION @V304735 02460000
  2421. L R0,TEMPR1 RESTORE REGISTER @V304735 02461000
  2422. BNE PROTCHK PROTECTION VIOLATION 02462000
  2423. SR R2,R4 RESTORE ADDRESS OF FIRST DATA BYTE 02463000
  2424. EXMVC LR R14,R0 POINT TO MOVE INSTRUCTION 02464000
  2425. EX R4,0(R14) EXECUTE MOVE INSTRUCTION PASSED BY 02465000
  2426. * CALLER 02466000
  2427. UPCNT LA R4,1(,R4) BUMP DATA COUNT 02467000
  2428. RDRSKIP AR R3,R4 BUMP DATA ADDRESS TO NEXT BYTE IN 02468000
  2429. * BUFFER 02469000
  2430. BR R6 AND RETURN TO CALLER 02470000
  2431. EJECT 02471000
  2432. * 02472000
  2433. * MISCELLANEOUS SUBROUTINES 02473000
  2434. * 02474000
  2435. SPACE 3 02475000
  2436. PCITEST EQU * HERE TO TEST FOR A PCI INTERRUPTION 02476000
  2437. TM VSPCCW+4,PCIF IS THEIR A PCI FLAG IN THE CCW? 02477000
  2438. BCR 8,R6 NO -- LEAVE 02478000
  2439. OI VDEVCSW+5,PCI YES SET PCI IN CSW 02479000
  2440. BR R6 AND LEAVE 02480000
  2441. SPACE 3 02481000
  2442. MSG427I EQU * HERE IF SPOOL SPACE FULL 02482000
  2443. LA R2,427 ERROR MSG DMKVSP427I 02483000
  2444. USING SAVEAREA,R13 02484000
  2445. ERROMSG LA R0,2 SET AREA FOR MESSAGE 02485000
  2446. CALL DMKFREE .. 02486000
  2447. XC 0(16,R1),0(R1) CLEAR AREA 02487000
  2448. LR R3,R1 SAVE ADDRESS OF AREA 02488000
  2449. LH R1,VDEVUNIT GET FULL ADDRESS OF VIRTUAL DEVICE 02489000
  2450. CALL DMKCVTBH CONVERT ADDRESS 02490000
  2451. STCM R1,B'0111',4(R3) STORE ADDRESS IN MESSAGE AREA 02491000
  2452. MVC 8(6,R3),=C'HELD ' .. 02492000
  2453. MVC 0(3,R3),=C'RDR' MOVE IN RDR, PRT OR PUN 02493000
  2454. TM VDEVTYPC,CLASURI READER ?? 02494000
  2455. BO EMSG YES -- 02495000
  2456. LTR R7,R7 FILE BEING PURGED ?? 02496000
  2457. BNZ *+10 NO -- 02497000
  2458. MVC 8(6,R3),=C'PURGED' .. 02498000
  2459. MVC 0(3,R3),=C'CON' SET CON TYPE IN MSG 02499000
  2460. NI VDEVFLAG,X'FF'-VDEVCSPL RESET CONSOLE SPOOL ACTIVE 02500000
  2461. CLI VDEVTYPE,TYP3210 CONSOLE DEVICE ? 02501000
  2462. BE EMSG YES -- 02502000
  2463. MVC 0(3,R3),=C'PRT' .. 02503000
  2464. OI VDEVSTAT,VDEVNRDY INDICATE VIRTUAL DEVICE NOT READY 02504000
  2465. TM VDEVTYPE,TYPPRT .. 02505000
  2466. BO EMSG .. 02506000
  2467. MVC 0(3,R3),=C'PUN' .. 02507000
  2468. EMSG LA R0,16 SET UP FOR CALL TO DMKERMSG 02508000
  2469. LR R1,R3 ADDRESS OF MESSAGE 02509000
  2470. ICM R0,14,ID+3 RETURN - INSERT MODULE ID 02510000
  2471. O R2,=X'80C90000' SET RETURN TO THIS MODULE 02511000
  2472. * AND INDICATE 'I' MSG 02512000
  2473. TM VDEVSFLG,VDEVSVC ENTERED VIA CALL ?? @VM01016 02513000
  2474. BZ NOCFRUN NO, SET UP RETURN ADDRESS @VM01016 02514000
  2475. PRTRET MVI SAVEWRK2+3,8 SET ERROR RETURN CODE 8 02515000
  2476. L R6,SAVEWRK6 GET RETURN ADDRESS FOR DMKVSPRT 02516000
  2477. B CALLERM GO WRITE ERROR MESSAGE 02517000
  2478. NOCFRUN EQU * 02518000
  2479. LA R6,NOTREADY RETURN ADDRESS FOR NO-CONSOL OR SVC 02519000
  2480. SPACE 02520000
  2481. CALLERM SL R8,VMDVSTRT VDEVBLOK DISPLACEMENT @VA01460 02521000
  2482. CALL DMKERMSG WRITE ERROR MESSAGE @VA01460 02522000
  2483. LA R0,2 LENGTH OF MESSAGE AREA 02523000
  2484. CALL DMKFRET FRET MESSAGE AREA 02524000
  2485. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02525000
  2486. BR R6 RETURN TO CALLER 02526000
  2487. SPACE 02526100
  2488. EMSG429B XC VSPCCW(8),VSPCCW CLEAR DUMMY SWAPTABLE @VA11232 02526200
  2489. LR R2,R4 RESTORE BUFFER ADDRESS @VA11232 02526300
  2490. LA R5,VSPCCW ADDRESS OF DUMMY SWAPTABLE @VA11232 02526400
  2491. EMSG429C L R4,VSPDPAGE DEALLOCATE CURRENT SLOT @VA11232 02526500
  2492. ST R4,VSPCCW+4 STORE IN DUMMY SWAPTABLE @VA11232 02526600
  2493. CALL DMKPGTSD DEALLOCATE PAGE @VA11232 02526700
  2494. EMSG429 EQU * HERE IF IO ERROR ON TRANS @VA01460 02527000
  2495. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA01460 02528000
  2496. MSG429F EQU * HERE IF SPOOLING DEVICE ERROR AND 02529000
  2497. * SFBLOK TO BE FRETED 02530000
  2498. MSG429 MVC SFBLAST(4),SFBPNT CCPD OF LAST BUFFER WRITTEN @VA01460 02531000
  2499. BAL R6,PRTPUR PURGE FILE AND CLEAR BLOKS @VA00808 02532000
  2500. SPACE 02533000
  2501. MSG429I EQU * HERE IF SPOOLING I/O ERROR 02534000
  2502. LA R2,429 ERROR MSG DMKVSP429I 02535000
  2503. DROP R13 02536000
  2504. B ERROMSG WRITE ERROR MSG 02537000
  2505. EJECT 02538000
  2506. * 02539000
  2507. * HERE FOR SUBROUTINES TO HANDLE EXIT FROM DMKVSPEX TO DMKVIOEX 02540000
  2508. * 02541000
  2509. SPACE 3 02542000
  2510. NOTREADY EQU * HERE IF VDEVICE NOT READY 02543000
  2511. MVI VDEVSNSE,INTREQ SET INTERVENTION REQUIRED 02544000
  2512. UNITCHK EQU * HERE TO INDICATE UNIT CHECK -- SENSE BYTE IS ALREADY 02545000
  2513. * ESTABLISHED 02546000
  2514. OI VDEVCSW+4,UC SET UNITCHECK 02547000
  2515. TM VDEVSNSE,INTREQ DEVICE NOT READY ? @VA03803 02548000
  2516. BNZ VSPCHK YES..SEE IF FIRST CCW @VA03803 02549000
  2517. TM VDEVSNSE,CMDREJ INVALID COMMAND CODE ? @VA03803 02550000
  2518. BZ LASTCCW NO..CONTINUE... @VA03803 02551000
  2519. NI VDEVCSW+4,255-(CE+DE) UNIT CHECK ALONE @VA03803 02552000
  2520. B VSPEXIT CONTINUE... @VA03803 02553000
  2521. SPACE 3 02554000
  2522. PROTCHK EQU * HERE ON A PROTECTION VIOLATION 02555000
  2523. OI VDEVCSW+5,PRTC SET PROTECTION CHECK 02556000
  2524. CLI VDEVTYPE,TYPTIMER PSEUDO TIMER ? @VA03182 02557000
  2525. BE VSPEXIT EXIT..CC SET @VA03182 02558000
  2526. OI VDEVCSW+4,CE+DE SET CORRECT ENDING STATUS @VA03182 02559000
  2527. VSPCHK TM VDEVFLAG,VDEVCCW1 PROCESSING FIRST CCW ?? 02560000
  2528. BO VSPEXIT YES -- GENERAL EXIT 02561000
  2529. B ENDCCW AND TAKE EXIT 02562000
  2530. SPACE 3 02563000
  2531. PROGCHK1 EQU * HERE ON A PROGRAM CHECK (TRANS) @VA00716 02564000
  2532. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 02565000
  2533. SPACE 02566000
  2534. PROGCHK EQU * HERE ON A PROGRAM CHECK 02567000
  2535. OI VDEVCSW+5,PRGC SET CHANNEL PROGRAM CHECK 02568000
  2536. B VSPCHK AND TAKE EXIT 02569000
  2537. SPACE 02570000
  2538. PROGCHK2 AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00808 02571000
  2539. OI VDEVCSW+5,PRGC INDICATE PROGRAM CHECK @VA00808 02572000
  2540. B ENDCCW POST ENDING STATUS AND EXIT @VA00808 02573000
  2541. SPACE 3 02574000
  2542. ENDCCW2 OI VDEVCSW+4,UC SET UNIT CHECK 02575000
  2543. ENDCCW NI VDEVINTS,X'FF'-(UE+UC) RESET UNUSED FLAGS 02576000
  2544. OI VDEVCSW+4,DE SET DEVICE END IN CSW 02577000
  2545. SPACE 02578000
  2546. ENDCCW1 OI VDEVCSW+4,CE SET CHANNEL END 02579000
  2547. SPACE 02580000
  2548. LASTCCW EQU * HERE TO FINISH PROCESSING THE LAST CCW 02581000
  2549. CLI VDEVTYPC,CLASURO OUTPUT DEVICE ?? 02582000
  2550. BE EXITDE YES -- 02583000
  2551. LTR R7,R7 ACTIVE FILE ?? 02584000
  2552. BNZ EXITDE YES - 02585000
  2553. BAL R6,DVICECLR GO CLEAR BLOKS 02586000
  2554. SPACE 02587000
  2555. EXITDE TM VDEVCSW+4,DE IS DE IN CSW? 02588000
  2556. BO VSPEXIT YES -- NO DE STATUS IN DEVICE 02589000
  2557. OI VDEVSTAT,VDEVPEND DE MUST BE PENDING IN DEVICE 02590000
  2558. OI VDEVINTS,DE 02591000
  2559. SPACE 3 02592000
  2560. VSPEXIT EQU * HERE FOR GENERAL EXIT 02593000
  2561. OI VDEVSTAT,VDEVCHAN SET CHANNEL INTERRUPT PENDING 02594000
  2562. USING VCHBLOK,R6 @VA00702 02595000
  2563. USING VCUBLOK,R7 @VA00702 02596000
  2564. LH R1,VDEVUNIT VIRTUAL DEVICE ADDRESS @VA00702 02597000
  2565. CALL DMKSCNVU LOC VCH AND VCU BLOKS @VA00702 02598000
  2566. BZ VSP006 ALL BLOCK FOUND - BRANCH @VA00702 02599000
  2567. * 02600000
  2568. * NO -- ONE OR MORE OF THE FOLLOWING BLOCKS ARE 02601000
  2569. * MISSING - VDEVBLOK - VCUBLOK - VCHBLOK 02602000
  2570. * 02603000
  2571. ABEND 1 ABEND VSP001 @VA00702 02604000
  2572. VSP006 DS 0H @VA10788 02605300
  2573. TM VCHTYPE,VCHSEL IS IT SELECTOR CHANNEL @VA10788 02605700
  2574. BZ VSP008 NO - BRANCH @VA00702 02606000
  2575. STH R1,VCHCEDEV SAVE ADDRESS OF UNIT @VA00702 02607000
  2576. OI VCHSTAT,VCHCEPND FLAG CHANNEL CLASS INTERRUPT @VA00702 02608000
  2577. VSP008 TM VDEVFLAG,VDEVCCW1 STILL ON 1ST CCW ? @VA00702 02609000
  2578. BZ VSPEXITX NO -- NO CHANCE FOR CC1 TO SIO 02610000
  2579. SPACE 02611000
  2580. TM VDEVCSW+4,CE+DE ANY CHANNEL OR DEVICE STATUS PENDING 02612000
  2581. BZ VSPLCC1 NO MUST BE AN UNUSUAL CONDITION 02613000
  2582. LTR R9,R9 ACTIVE FILE 02614000
  2583. BZ VSPEXITX NO - 02615000
  2584. TM VSPCCW,3 IS IT AN IMMEDIATE COMMAND? 02616000
  2585. BNO VSPEXITX NO --LEAVE 02617000
  2586. SPACE 02618000
  2587. CLI VSPCCW,X'63' FORM CONTROL LOAD ?? 02619000
  2588. BE VSPEXITX YES -- 02620000
  2589. SPACE 02621000
  2590. VSPLCC1 EQU * HERE FOR CC1 TO SIO 02622000
  2591. TM VMESTAT,VMEXTCM IS V.M. IN EXTENDED CONTROL MODE? 02623000
  2592. BZ VSP004 NO -- 02624000
  2593. OI VMPSW+2,X'10' SET CC1 IN EXTENDED PSW 02625000
  2594. B VSP005 02626000
  2595. VSP004 OI VMPSW+4,X'10' SET CC = 1 02627000
  2596. VSP005 LA R1,CSW ADDRESS OF CSW 02628000
  2597. SL R6,VMCHSTRT CHAN. DISP. @VA01770 02629000
  2598. SL R7,VMCUSTRT C.U. DISP. @VA01770 02630000
  2599. SL R8,VMDVSTRT VDEVBLOK DISP @VA00716 02631000
  2600. TRANS 2,1,OPT=(BRING,DEFER),IOER=EXIT1 GET USER PAGE 0@VA01770 02632000
  2601. AL R6,VMCHSTRT RESTORE CHAN ADDRESS @VA01770 02633000
  2602. AL R7,VMCUSTRT RESTORE C.U. ADDRESS @VA01770 02634000
  2603. AL R8,VMDVSTRT VDEVBLOK ADDRESS @VA00716 02635000
  2604. MVC 4(2,R2),VDEVCSW+4 STORE STATUS ONLY 02636000
  2605. NI VDEVSTAT,X'FF'-VDEVCHAN NO CHANNEL CLASS INTERRUPT PEND 02637000
  2606. TM VCHTYPE,VCHSEL IS IT SELECTOR CHANNEL @VA10788 02638500
  2607. BZ *+8 NO -- @VA00702 02639000
  2608. NI VCHSTAT,X'FF'-VCHCEPND RESET CE PENDING FLAG @VA00702 02640000
  2609. SPACE 3 02641000
  2610. VSPEXITX EQU * HERE TO TEST FOR AND POST PENDING INTERRUPTS 02642000
  2611. MVC VDEVCSW(1),VDEVKEY MOVE CAW KEY TO CSW 02643000
  2612. LTR R9,R9 ACTIVE FILE ?? 02644000
  2613. BZ VSP007 NO -- 02645000
  2614. TM VSPCCW,3 NO-OP-CODE ?? 02646000
  2615. BNO VSP007 NO - 02647000
  2616. CLI VSPCCW,X'63' FORM CONTROL ?? 02648000
  2617. BE VSP007 YES -- COUNT PRESENT IF ANY 02649000
  2618. MVC VDEVCSW+6(2),VSPCCW+6 MOVE IN RESIDUAL COUNT 02650000
  2619. VSP007 TM VDEVSTAT,VDEVCHAN+VDEVPEND ANY INTERRUPTS PENDING? 02651000
  2620. BZ VSPNOINT NO -- EXIT 02652000
  2621. L R2,=A(DMKVIOMK) POINT TO INTERRUPT PENDING @VA00702 02653000
  2622. * TABLE 02654000
  2623. LH R3,VDEVADD GET DEVICE ADDRESS 02655000
  2624. AR R3,R3 TIMES 2 02656000
  2625. LA R3,0(R3,R2) POINT TO CORRECT PENDING MASK 02657000
  2626. OC VCUDVINT,0(R3) SET PENDING FLAGS IN VCUBLOK 02658000
  2627. LH R3,VCUADD GET ADDRESS OF CONTROL UNIT 02659000
  2628. SRL R3,3 TIMES 2 02660000
  2629. LA R3,0(R3,R2) POINT TO CORRECT PENDING MASK 02661000
  2630. OC VCHCUINT,0(R3) AND SET PENDING FLAG 02662000
  2631. LH R3,VCHADD GET CHANNEL ADDRESS 02663000
  2632. SRL R3,7 TIMES 2 02664000
  2633. ALR R3,R2 POINT TO MASK BYTES 02665000
  2634. OC VMIOINT,0(R3) SET CHANNEL PENDING FLAG IN VMBLOK 02666000
  2635. OI VMPEND,VMIOPND SET SUMMARY PENDING FLAG 02667000
  2636. SPACE 3 02668000
  2637. VSPNOINT EQU * HERE DIRECTLY IF NO INTERRUPTS ARE PENDING 02669000
  2638. NI VDEVSTAT,X'FF'-(VDEVBUSY+VDEVCHBS) MARK DEVICE AND SUB- 02670000
  2639. * CHANNEL AS NO LONGER BUSY 02671000
  2640. TM VDEVSFLG,VDEVCFCL IS A CONSOLE CLOSE PENDING ?? 02672000
  2641. BZ EXIT NO -- EXIT 02673000
  2642. L R9,VDEVSPL ADDRESS OF SPL BLOK 02674000
  2643. LTR R9,R9 BLOK PRESENT ?? 02675000
  2644. BZ EXIT2 NO -- FILE CLOSED 02676000
  2645. L R7,VSPSFBLK RELOAD SFBLOK ADDRESS 02677000
  2646. LA R6,EXIT2 RETURN ADDRESS 02678000
  2647. CLI VDEVTYPC,CLASURI IS THE CLOSE FOR READER ? 02679000
  2648. BNE PRTEOF NO - GO CLOSE PRINTER OR PUNCH 02680000
  2649. B RDREOF CLOSE READER 02681000
  2650. SPACE 02682000
  2651. EXIT2 NI VDEVSFLG,X'FF'-VDEVCFCL RESET PENDING FLAG 02683000
  2652. B EXIT SKIP EXIT1 RESTORES @VA01770 02684000
  2653. EXIT1 AL R6,VMCHSTRT RESTORE VCHBLOK @VA01770 02685000
  2654. AL R7,VMCUSTRT RESTORE VCUBLOK @VA01770 02686000
  2655. AL R8,VMDVSTRT RESTORE VDEVBLOK @VA01770 02687000
  2656. EXIT NI VMRSTAT,X'FF'-VMEXWAIT TAKE USER OUT OF EXWAIT 02688000
  2657. BAL R6,UNSTKBLK GO UNSTACK CPEXBLOK @VM01021 02689000
  2658. GOTO DMKDSPCH EXIT - @VM01021 02690000
  2659. SPACE 2 02691000
  2660. UNSTKBLK EQU * HERE TO UNSTACK CPEXBLOK @VM01021 02692000
  2661. * FOR THIS VIRTUAL DEVICE 02693000
  2662. TM VDEVSFLG,VDEVSVC DEVICE CP BUSY ? @VM01021 02694000
  2663. BOR R6 YES - RETURN TO CALLER @VM01021 02695000
  2664. CLI VDEVTYPE,TYP3210 CONSOLE ? @VM01021 02696000
  2665. BE GETDISP YES - FORGET BUSY TEST @VM01021 02697000
  2666. TM VDEVSTAT,VDEVBUSY DEVICE BUSY WITH SIO ? @VM01021 02698000
  2667. BOR R6 YES - RETURN TO CALLER @VM01021 02699000
  2668. USING CPEXBLOK,R1 @VM01021 02700000
  2669. GETDISP LR R3,R8 GET VDEVBLOK DISPLACEMENT @VM01021 02701000
  2670. SL R3,VMDVSTRT .. @VM01021 02702000
  2671. LA R1,VSPSTK ADDRESS OF STACK CPEXBLOKS @VM01021 02703000
  2672. NXTCPEX LR R2,R1 SAVE PREVIOUS CPEXBLOK ADDRESS @VM01021 02704000
  2673. ICM R1,B'1111',CPEXFPNT GET ADDRESS OF NEXT CPEXBLOK@VM01021 02705000
  2674. BZR R6 BRANCH IF NONE LEFT @VM01021 02706000
  2675. C R11,CPEXR11 CPEXBLOK FOR THIS USER ? @VM01021 02707000
  2676. BNE NXTCPEX NO - CHECK NEXT @VM01021 02708000
  2677. C R3,CPEXR8 CPEXBLOK FOR THIS DEVICE ? @VM01021 02709000
  2678. BNE NXTCPEX NO - CHECK NEXT @VM01021 02710000
  2679. OI VDEVSFLG,VDEVSVC INDICATE BUSY @VM01021 02711000
  2680. MVC 0(4,R2),CPEXFPNT UNCHAIN THIS CPEXBLOK @VM01021 02712000
  2681. CALL DMKSTKCP HAVE CP STACK THIS BLOK @VM01021 02713000
  2682. BR R6 RETURN TO CALLER @VM01021 02714000
  2683. SPACE 2 02715000
  2684. FCBMOVE MVC VFCBLOAD-VFCBBLOK(0,R14),12(R15) 02716000
  2685. SPACE 2 02716100
  2686. DEVID84 EQU X'84' DEVICE IDENTIFICATION @VA11722 02716200
  2687. SPACE 02717000
  2688. SPACE 2 02720000
  2689. * KEEP THE FOLLOWING THREE IN ORDER: 02721000
  2690. ENTRY DMKVSPWA EXTERNAL NAME FOR ... @VA00881 02722000
  2691. DMKVSPWA DS 0F 3211 INDEX WORK AREA ... @VA00881 02723000
  2692. WRKADD DC F'0' ADDRESS OF INDEX WORK AREA 02724000
  2693. HDRADD DC F'0' ADDRESS OF HEADER BUFFER 02725000
  2694. VSPSTK DC F'0' ADDRESS OF LOCAL STACK CPEXBLOKS 02726000
  2695. F2047 DC F'2047' 02727000
  2696. F2048 DC F'2048' 02728000
  2697. DS 0F 02729000
  2698. EJECT 02730000
  2699. LTORG 02731000
  2700. EJECT 02732000
  2701. COPY EQU 02733000
  2702. COPY RBLOKS 02734000
  2703. COPY VBLOKS 02735000
  2704. COPY VMBLOK 02736000
  2705. COPY SPOOL 02737000
  2706. PSA 02738000
  2707. COPY SAVE 02739000
  2708. COPY DEVTYPES 02740000
  2709. COPY IOBLOKS 02741000
  2710. COPY ALLOC 02742000
  2711. COPY IOER 02743000
  2712. END 02744000