Table of Contents

DMSDIO Source

References

Source Listing

DMSDIO.ASSEMBLE.txt
  1. DIO TITLE 'DMSDIO (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00004000
  4. * 00005000
  5. * MODULE NAME: 00006000
  6. * 00007000
  7. * DMSDIO (DISKIO) 00008000
  8. * 00009000
  9. * SUBROUTINE NAME: 00010000
  10. * 00011000
  11. * DMSDIOR (RDTK) 00012000
  12. * 00013000
  13. * FUNCTION: 00014000
  14. * 00015000
  15. * TO READ ONE OR MORE 800-BYTE RECORDS (BLOCKS) FROM 00016000
  16. * DISK, OR TO READ ONE 200-BYTE RECORD (SUB-BLOCK) FROM 00017000
  17. * DISK. 00018000
  18. * 00019000
  19. * ATTRIBUTES: 00020000
  20. * 00021000
  21. * NUCLEUS RESIDENT, REENTRANT 00022000
  22. * 00023000
  23. * ENTRY POINTS: 00024000
  24. * 00025000
  25. * DMSDIOR 00026000
  26. * 00027000
  27. * ENTRY CONDITIONS: 00028000
  28. * 00029000
  29. * L R15,ARDTK WHERE ARDTK=V(DMSDIOR) 00030000
  30. * BALR R14,R15 00031000
  31. * 00032000
  32. * R1 MUST POINT TO PARAMETER LIST AS FOLLOWS: 00033000
  33. * 00034000
  34. * DS OF 00035000
  35. * PLIST DC A(BUFF) ADDRESS OF BUFFER INTO 00036000
  36. * WHICH DATA IS TO BE READ 00037000
  37. * DC F' ' SIZE OF ABOVE BUFFER (BYTE COUNT) 00038000
  38. * DC A(DISKAD) ADDRESS OF LIST CONTAINING 00039000
  39. * DISK ADDRESSES OF ALL RECORD(S) 00040000
  40. * TO BE READ 00041000
  41. * DC A(DSKTBL) ADDRESS OF (POINTER TO) ACTIVE 00042000
  42. * DISK TABLE BLOCK PERTAINING TO DISK 00043000
  43. * TO BE READ 00044000
  44. * 00045000
  45. * EXIT CONDITIONS: 00046000
  46. * 00047000
  47. * NORMAL RETURN 00048000
  48. * R15=0 (AND CONDITION-CODE=0) 00049000
  49. * 00050000
  50. * ERROR RETURNS 00051000
  51. * R15=1: NO ACTIVE-DISK-TABLE BLOCK FOUND BY ADTLKP 00052000
  52. * WHERE MODE-LETTER WAS SUPPLIED 00053000
  53. * R15=2: PERMANENT I/O ERROR READING DISK 00054000
  54. * R15=3: UNSUPPORTED DASD OR NOT ATTACHED 00055000
  55. * R15=5: DISK-ADDRESS=0 (A PROGRAMMING BUG BY CALLER) 00056000
  56. * OR NOT WITHIN DISK LIMITS 00057000
  57. * R15=7: ATTEMPT TO READ INTO CMS NUCLEUS BELOW FREAR 00058000
  58. * R15=8: UNDETERMINED ERROR (CP DIAGNOSE CONDITION CODE 2) 00059000
  59. * R15=25: INSUFFICIENT FREE STORAGE AVAILABLE 00059500
  60. * 00060000
  61. * CALLS TO OTHER ROUTINES: 00061000
  62. * 00062000
  63. * DMSLAD, DMSFREE, DMSFRET 00063000
  64. * 00064000
  65. * EXTERNAL REFERENCES: 00065000
  66. * 00066000
  67. * DMSNUC, ADTSECT, DIOSECT 00067000
  68. * 00068000
  69. * TABLES/WORKAREAS: 00069000
  70. * 00070000
  71. * 800 BYTE BUFFER AREA 00071000
  72. * 00072000
  73. * REGISTER USAGE: 00073000
  74. * 00074000
  75. * R15 DIOSECT 00075000
  76. * R2 BASE 00076000
  77. * REST WORK 00077000
  78. * 00078000
  79. * NOTES: 00079000
  80. * 00080000
  81. * (1) THE FORMAT OF EACH DISK ADDRESS SUPPLIED IN 00081000
  82. * THE LIST FOR EACH 800-BYTE RECORD IS A HALFWORD 00082000
  83. * BLOCK NUMBER. 00083000
  84. * 00084000
  85. * (2) IF THE BUFFER-SIZE (BYTE COUNT) IS ZERO, A 00085000
  86. * 200-BYTE RECORD (SIXTEENTH-TRACK) IS TO BE READ. 00086000
  87. * 00087000
  88. * (3) DMSDIOR WILL ACCEPT A DISK MODE IN PLACE OF 00088000
  89. * THE POINTER TO THE ACTIVE DISK TABLE: DMSIAD IS 00089000
  90. * CALLED IN THIS CASE TO FIND THE EQUIVALENT DISK. 00090000
  91. * 00091000
  92. * (4) A SPECIAL INTERFACE BETWEEN CMS AND CP WILL 00092000
  93. * CAUSE INPUT/OUTPUT OPERATIONS TO BE EXECUTED BY 00093000
  94. * CP. CONTROL WILL NOT BE RETURNED TO CMS UNTIL 00094000
  95. * THE OPERATION IS COMPLETE. ANY NECESSARY ERROR 00095000
  96. * RECOVERY WIL BE DONE BY CP. 00096000
  97. * 00097000
  98. * OPERATION: 00098000
  99. * 00099000
  100. * DMSDIOR DETERMINES WHETHER OR NOT THE CALLING PROGRAM 00100000
  101. * WISHES TO READ A 800-BYTE RECORD. IF IT DOES NOT, 00101000
  102. * DMSDIOR CHECKS TO SEE IF 00102000
  103. * THE BYTE COUNT EXCEEDS 800 BYTES, IMPLYING MORE THAN 00103000
  104. * ONE 800-BYTE RECORD TO BE READ. IF SO, FREE STORAGE 00104000
  105. * IS OBTAINED, AND CHAINED CCW'S ARE USED INSOFAR AS 00105000
  106. * PRACTICAL TO READ AS MANY RECORDS AS POSSIBLE WITH 00106000
  107. * ONE IO TO THE DISK. IF NOT MORE THAN 800, NO FREE 00107000
  108. * STORAGE IS NECESSARY AS A STANDARD CCW PACKAGE (IN 00108000
  109. * DIOSECT) IS USED. IN ANY EVENT, WHETHER OR NOT 00109000
  110. * REPEATED IO'S ARE NECESSARY, THE DATA IS READ INTO 00110000
  111. * THE DESIGNATED BUFFER, FREE STORAGE IS RETURNED IF 00111000
  112. * NECESSARY, AND RETURN IS MADE TO THE CALLER. IF THE 00112000
  113. * BYTE COUNT EXCEEDS 800, IT NEED NOT NECESSARILY BE AN 00113000
  114. * EXACT MULTIPLE OF 800. 00114000
  115. * 00115000
  116. * IF THE CALLING PROGRAM WISHES TO READ A 200-BYTE 00116000
  117. * RECORD (SUB-BLOCK), 00117000
  118. * DMSDIOR CALLS THE DMSFREE TO OBTAIN AN 800-BYTE 00118000
  119. * BUFFER. IT THEN READS THE 800-BYTE BLOCK CONTAINING 00119000
  120. * THE DESIRED SUB-BLOCK INTO THE BUFFER. 00120000
  121. * NEXT, DMSDIOR EXTRACTS THE DESIRED SUB-BLOCK FROM THE 00121000
  122. * 800-BYTE BUFFER AND MOVES IT TO THE 200-BYTE BUFFER 00122000
  123. * THE 200-BYTE 00123000
  124. * BUFFER SPECIFIED IN THE PARAMETER LIST. IT THEN 00124000
  125. * CALLS THE DMSFRET TO RELEASE THE 800-BYTE BUFFER, THE 00125000
  126. * ENTIRE BLOCK WAS READ INTO AND RETURNS TO THE CALLING 00126000
  127. * PROGRAM. SUB-BLOCKS ARE RESERVED FOR FIRST CHAIN 00127000
  128. * LINK AREAS AND SHOULD NOT BE USED FOR OTHER PURPOSES. 00128000
  129. * 00129000
  130. * NOTE: 00130000
  131. * 00131000
  132. * IF THE 200-BYTE BLOCK IS THE FIRST 200 BYTES OF AN 00132000
  133. * 800 BYTE BUFFER, DMSDIOR READS 200 BYTES DIRECTLY 00133000
  134. * INTO THE DESIGNATED 00134000
  135. * STORAGE AREA INSTEAD OF OBTAINING FREE STORAGE AND 00135000
  136. * MOVING THE 200 BYTES LATER. 00136000
  137. * 00137000
  138. * MODULE NAME: 00138000
  139. * 00139000
  140. * DMSDIO (DISKIO) 00140000
  141. * 00141000
  142. * SUBROUTINE NAME: 00142000
  143. * 00143000
  144. * DMSDIOW (WRTK) 00144000
  145. * 00145000
  146. * FUNCTION: 00146000
  147. * 00147000
  148. * TO WRITE ONE OR MORE 800-BYTE RECORDS (BLOCKS) ON 00148000
  149. * DISK, OR TO WRITE ONE 200-BYTE RECORD (SUB-BLOCK) ON 00149000
  150. * DISK. 00150000
  151. * 00151000
  152. * ATTRIBUTES: 00152000
  153. * 00153000
  154. * NUCLEUS RESIDENT, REENTRANT 00154000
  155. * 00155000
  156. * ENTRY POINTS: 00156000
  157. * 00157000
  158. * DMSDIOW 00158000
  159. * 00159000
  160. * ENTRY CONDITIONS: 00160000
  161. * 00161000
  162. * L R15,AWTRK WHERE WRTK=V(WRTK) 00162000
  163. * BALR R14,R15 00163000
  164. * 00164000
  165. * R1 MUST POINT TO PARAMETER LIST AS FOLLOWS: 00165000
  166. * DS OF 00166000
  167. * PLIST DS A(BUFF) ADDRESS OF BUFFER FROM WHICH 00167000
  168. * DATA IS TO BE WRITTEN 00168000
  169. * DC F' ' SIZE OF ABOVE BUFFER (BYTE COUNT) 00169000
  170. * DC A(DISKAD ADDRESS OF LIST CONTAINING DISK 00170000
  171. * ADDRESSES OF ALL RECORD(S) TO BE WRITTEN 00171000
  172. * DC A(DSKTBL) ADDRESS OF (POINTER TO) ACTIVE DISK 00172000
  173. * TABLE BLOCK PERTAINING TO DISK TO BE WRITTEN. 00173000
  174. * 00174000
  175. * EXIT CONDITIONS: 00175000
  176. * 00176000
  177. * NORMAL RETURN 00177000
  178. * R15=0 (AND CONDITION-CODE=0) 00178000
  179. * 00179000
  180. * ERROR RETURNS 00180000
  181. * R15=1: NO ACTIVE-DISK-TABLE BLOCK FOUND BY ADTLKP 00181000
  182. * WHERE MODE-LETTER WAS SUPPLIED 00182000
  183. * R15=2: PERMANENT I/O ERROR WRITING DISK 00183000
  184. * R15=3: UNSUPPORTED DASD OR NOT ATTACHED 00184000
  185. * R15=4: ATTEMPT TO WRITE ON SYSTEM DISK (MODE=S) 00185000
  186. * R15=5: DISK-ADDRESS=0 (A PROGRAMMING BUG BY CALLER) 00186000
  187. * OR NOT WITHIN DISK LIMITS 00187000
  188. * R15=6: ATTEMPT TO WRITE ON READ-ONLY DISK 00188000
  189. * R15=8: UNDETERMINED ERROR (CP DIAGNOSE CONDITION CODE 2) 00189000
  190. * R15=25: INSUFFICIENT FREE STORAGE AVAILABLE 00189500
  191. * 00190000
  192. * CALLS TO OTHER ROUTINES: 00191000
  193. * 00192000
  194. * DMSLAD, DMSFREE, DMSFRET 00193000
  195. * 00194000
  196. * EXTERNAL REFERENCES: 00195000
  197. * 00196000
  198. * DMSNUC, DIOSECT, ADTSECT 00197000
  199. * 00198000
  200. * TABLES/WORKAREAS: 00199000
  201. * 00200000
  202. * 800 BYTE BUFFER AREA OBTAINED FROM FREE STORAGE 00201000
  203. * 00202000
  204. * REGISTER USAGE: 00203000
  205. * 00204000
  206. * R0, R1, R3-14 = WORK REGISTERS 00205000
  207. * R15 DIOSECT 00206000
  208. * R2 BASE 00207000
  209. * 00208000
  210. * NOTES: 00209000
  211. * 00210000
  212. * (1) THE FORMAT OF EACH DISK ADDRESS SUPPLIED IN 00211000
  213. * THE LIST FOR EACH 800-BYTE RECORD IS A HALFWORD 00212000
  214. * BLOCK NUMBER. 00213000
  215. * 00214000
  216. * (2) IF THE BUFFER SIZE (BYTE COUNT) IS ZERO, A 00215000
  217. * 200-BYTE RECORD IS TO BE WRITTEN. 00216000
  218. * 00217000
  219. * (3) WRTK WILL ACCEPT A DISK MODE IN PLACE OF THE 00218000
  220. * POINTER TO THE ACTIVE DISK TABLE. 00219000
  221. * 00220000
  222. * OPERATION: 00221000
  223. * 00222000
  224. * DMSDIOW DETERMINES WHETHER OR NOT THE CALLING PROGRAM 00223000
  225. * WISHES TO WRITE A SUB-BLOCK. IF IT DOES NOT, DMSDIOW 00224000
  226. * CHECKS 00225000
  227. * TO SEE IF THE BYTE COUNT EXCEEDS 800 BYTES, IMPLYING 00226000
  228. * MORE THAN ONE 800-BYTE RECORD TO BE WRITTEN. IF SO, 00227000
  229. * FREE STORAGE IS OBTAINED, AND CHAINED CCW'S ARE USED 00228000
  230. * INSOFAR AS PRACTICAL TO WRITE AS MANY RECORDS AS 00229000
  231. * POSSIBLE WITH ONE IO OPERATION. IF NOT MORE THAN 00230000
  232. * 800, NO FREE STORAGE IS NECESSARY, AS A STANDARD CCW 00231000
  233. * PACKAGE (IN DIOSECT) IS USED. IN ANY EVENT, WHETHER 00232000
  234. * OR NOT REPEATED IO'S ARE NECESSARY, THE DATA IS 00233000
  235. * WRITTEN FROM THE DESIGNATED BUFFER, FREE STORAGE IS 00234000
  236. * RETURNED IF NECESSARY, AND RETURN IS MADE TO THE 00235000
  237. * CALLER. IF THE BYTE COUNT EXCEEDS 800, IT NEED NOT 00236000
  238. * NECESSARILY BE AN EXACT MULTIPLE OF 800. 00237000
  239. * 00238000
  240. * IF THE CALLING PROGRAM WISHES TO WRITE A SUB-BLOCK, 00239000
  241. * DMSDIOW OBTAINS 800 BYTES OF BUFFER SPACE INTO WHICH 00240000
  242. * TO READ 00241000
  243. * THE BLOCK (IN WHICH THE 200 BYTES OF DATA IS TO BE 00242000
  244. * PLACED). IT THEN READS THAT BLOCK INTO THE BUFFER. 00243000
  245. * NEXT, 00244000
  246. * DMSDIOW MOVES 200 BYTES OF DATA FROM THE BUFFER 00245000
  247. * POINTED TO BY THE PARAMETER 00246000
  248. * LIST INTO THE APPROPRIATE SUB-BLOCK LOCATION IN THE 00247000
  249. * BUFFER CONTAINING 00248000
  250. * THE 800-BYTE BLOCK. DMSDIOW THEN WRITES THE UPDATED 00249000
  251. * BLOCK BACK ONTO 00250000
  252. * THE DISK AT ITS ORIGINAL LOCATION, RELEASES THE 800 00251000
  253. * BYTES IT USED AS A BUFFER, AND RETURNS TO THE CALLING 00252000
  254. * PROGRAM. 00253000
  255. * 00254000
  256. * NOTE: 00255000
  257. * 00256000
  258. * IF THE 200-BYTE SUB-BLOCK IS THE FIRST 200 BYTES OF 00257000
  259. * AN 800-BYTE BUFFER AND THE REMAINING 600 BYTES ARE 00258000
  260. * NOT USED 00259000
  261. * DMSDIOW WRITES 200 BYTES DIRECTLY FROM THE DESIGNATED 00260000
  262. * STORAGE AREA 00261000
  263. * INSTEAD OF THE READ, MOVE, AND WRITE PROCEDURE 00262000
  264. * DESCRIBED ABOVE. 00263000
  265. * 00264000
  266. * DIRECT I/O 00265000
  267. * 00266000
  268. * INPUT/OUTPUT ACTIVITY TO DISK WILL BE INITIATED BY A 00267000
  269. * SPECIALLY CODED DIAGNOSE INSTRUCTION. 00268000
  270. * 00269000
  271. * A DIAGNOSE INSTRUCTION WITH A CODE X'18' IS ISSUED TO 00270000
  272. * SIGNAL CP TO PERFORM THE DESIGNATED I/O OPERATION. 00271000
  273. * R4 CONTAINS THE DEVICE-ADDRESS, AND R8 POINTS TO THE 00272000
  274. * STANDARD CCW CHAIN: 00273000
  275. * 00274000
  276. * FOR 2314 OR 2319 00275000
  277. * 00276000
  278. * SEEK CCHH 00277000
  279. * SEARCH CCHHR 00278000
  280. * TIC *-8 00279000
  281. * READ/WRITE 00280000
  282. * CCHHR DC X'CCHHR' 00281000
  283. * 00282000
  284. * FOR 3330, 3340, 3350 OR 3380 HRC004DS 00283490
  285. * 00284000
  286. * SEEK CCHH 00285000
  287. * SET SECTOR 00286000
  288. * SEARCH CCHHR 00287000
  289. * TIC *-8 00288000
  290. * READ/WRITE 00289000
  291. * CCHHR DC X'CCHHR' 00290000
  292. * 00291000
  293. * IF THE OPERATION IS SUCCESSFUL, CP RETURNS TO CMS WITH A 00292000
  294. * CONDITION-CODE 0; THIS INDICATES THAT THE OPERATION WAS 00293000
  295. * SUCCESSFULLY STARTED AND COMPLETED. 00294000
  296. * 00295000
  297. * UPON RETURN TO CMS, THE FOLLOWING CONDITION CODES AND ERROR 00296000
  298. * CODES ARE RETURNED: 00297000
  299. * 00298000
  300. * CONDITION-CODE (CC) = 0: I/O COMPLETE WITH NO ERRORS. 00299000
  301. * 00300000
  302. * CC = 1: ERROR CONDITION, AS PER R15 RETURNS 1-4 00301000
  303. * 00302000
  304. * CC = 2: ERROR CONDITION, AS PER R15 RETURNS 5-12 00303000
  305. * 00304000
  306. * CC = 3: UNCORRECTABLE I/O ERROR, AS PER R15 RETURN 13 00305000
  307. * OR INVALID DIAGNOSE CALL 00306000
  308. * 00307000
  309. * ERROR-CODE RETURNED IN R15, AS FOLLOWS: 00308000
  310. * 00309000
  311. * 1 = DEVICE NOT ATTACHED 00310000
  312. * 2 = DEVICE IS IS AN UNSUPPORTED DASD DEVICE 00311000
  313. * 3 = ATTEMPT TO WRITE ON A READ-ONLY DISK-WORD ALIGNED 00312000
  314. * 4 = CYLINDER NUMBER NOT WITHIN RANGE OF USER'S DISK 00313000
  315. * 5 = POINTER TO USER'S CCW STRING NOT DBL-WORD ALIGNED 00314000
  316. * 6 = CCW OR SEEK/SEARCH ARGUMENTS NOT WITHIN USER CORE 00315000
  317. * 7 = USER CCW IS INVALID 00316000
  318. * 8 = READ/WRITE BYTE-COUNT = 0 00317000
  319. * 9 = READ/WRITE BYTE-COUNT GREATER THAN 2048 00318000
  320. * 10 = USER'S R15 AT ENTRY NOT POSITIVE NUMBER 00319000
  321. * OR IS NOT LARGE ENOUGH FOR GIVEN CCW STRING 00320000
  322. * 12 = CYLINDER NUMBER ON SEEK-HEAD DOES NOT MATCH 00321000
  323. * THE CYLINDER NUMBER ON THE FIRST SEEK 00322000
  324. * 13 = UNCORRECTABLE I/O ERROR (CSW RETURNED 00323000
  325. * TO THE USER; SENSE BYTES AVAILABLE IF USER 00324000
  326. * DOES A SENSE.) 00325000
  327. * 00326000
  328. * UNSUCCESSFUL DISK I/O: BECAUSE OF USE OF THE DIAGNOSE 00327000
  329. * SIGNAL, CP IS IN A POSITION OF KNOWING WHAT I/O ACTIVITY THE 00328000
  330. * VIRTUAL MACHINE DESIRES. CP WILL PERFORM ERROR RECORDING, 00329000
  331. * RETRY, RECOVERY OR ABORT PROCEDURES FOR THE CMS VIRTUAL 00330000
  332. * MACHINE. 00331000
  333. * 00332000
  334. *. 00333000
  335. EJECT 00334000
  336. ********************************************************************** 00335000
  337. * 00336000
  338. * INITIALIZATION 00337000
  339. * 00338000
  340. ********************************************************************** 00339000
  341. DMSDIO START 0 @VA01921 00340300
  342. RDTK EQU DMSDIO @VA01921 00340600
  343. ENTRY RDTK @VA01921 00340900
  344. ENTRY WRTK 00341000
  345. ENTRY DMSDIOR 00342000
  346. ENTRY DMSDIOW 00343000
  347. USING NUCON,R0 00344000
  348. SPACE 00345000
  349. USING RDTK,R15 00346000
  350. DMSDIOR EQU * 00347000
  351. L R15,ADIOSECT SET UP R15 BRIEFLY FOR 00348000
  352. USING DIOSECT,R15 EXTERNAL DIO-SECT 00349000
  353. STM R0,R14,XRSAVE SAVE THE REGISTERS (NOT 15) 00350000
  354. LR R12,R15 SWITCH DSECT-ADDRESSABILITY 00351000
  355. DROP R15 TO R12 INSTEAD OF R15 00352000
  356. USING DIOSECT,R12 ... 00353000
  357. BALR BASE,0 NOW ESTABLISH 00354000
  358. USING *,BASE OUR OWN 00355000
  359. LA BASE,COMAD COMMON ADDRESSABILITY 00356000
  360. USING COMAD,BASE ... 00357000
  361. MVI IOCOMM,READ SET IO COMMAND TO READ 00358000
  362. CLC 0(4,R1),ANUCEND IS CORE-ADDRESS WITHIN CMS NUC? 00359000
  363. BNL COMMON TRF IF NOT (OK) - JOIN COMMON 00360000
  364. * 00361000
  365. MVI ERRCODE,07 ATTEMPT TO RDTK INTO NUCLEUS IS 00362000
  366. B RETURN2 NOW 'ERROR 7'. (24 NOV 70) 00363000
  367. DROP BASE 00364000
  368. SPACE 3 00365000
  369. USING WRTK,15 00366000
  370. DMSDIOW EQU * 00367000
  371. WRTK L R15,ADIOSECT SET UP R15 BRIEFLY FOR 00368000
  372. USING DIOSECT,R15 EXTERNAL DIO-SECT 00369000
  373. STM R0,R14,XRSAVE SAVE THE REGISTERS (NOT 15) 00370000
  374. LR R12,R15 SWITCH DSECT-ADDRESSABILITY 00371000
  375. DROP R15 TO R12 INSTEAD OF R15 00372000
  376. USING DIOSECT,R12 00373000
  377. BALR BASE,0 NOW ESTABLISH 00374000
  378. USING COMAD,BASE OUR OWN 00375000
  379. COMAD EQU * COMMON ADDRESSABILITY. 00376000
  380. MVI IOCOMM,WRITE SET IO COMMAND TO WRITE 00377000
  381. USING XPLIST,R1 (BRIEFLY) 00378000
  382. CLI XMODE,C'S' TEST FOR ATTEMPT TO WRITE ON SYSTEM DISK 00379000
  383. BNE COMMON OK, CONTINUE 00380000
  384. MVI ERRCODE,04 NO, SET ERROR CODE = 4 00381000
  385. B RETURN2 ERROR RETURN 00382000
  386. DROP R1 00383000
  387. EJECT 00384000
  388. ********************************************************************** 00385000
  389. * 00386000
  390. * COMMON RDTK/WRTK CODING 00387000
  391. * 00388000
  392. ********************************************************************** 00389000
  393. COMMON LR PLIST,1 SAVE PARAMETER LIST 00390000
  394. USING XPLIST,PLIST ... 00391000
  395. MVI DIOFLAG,X'00' CLEAR ALL FLAG-BITS 00392000
  396. CLI XMODE,00 CHECK MODE, HOPEFULLY = 00 00393000
  397. BE GETDEVT OK, GET DEVICE-TABLE DIRECTLY 00394000
  398. S R1,=F'12' BACK OFF 12 BYTES TO MAKE MODE 24(R1) 00395000
  399. L R15,VCADTLKP CALL ADTLKP @VM03093 00396100
  400. BALR R14,R15 ... 00397000
  401. BZ R1OK GOOD SHOW. 00398000
  402. MVI ERRCODE,01 ERROR 1 IF ERROR FROM ADTLKP (SICK MODE) 00399000
  403. B RETURN2 GO EXIT. 00400000
  404. * 00401000
  405. GETDEVT L R1,XMODE GET DEVICE-TABLE-ADDRESS FROM P-LIST 00402000
  406. * 00403000
  407. USING ADTSECT,R1 (BRIEFLY) 00404000
  408. R1OK ST R1,SAVEADT KEEP THIS SAFE IN CASE WE NEED IT. 00405000
  409. L XR1,ADTDTA ACCESS DEVICE TABLE IN NUCON 00406000
  410. DROP R1 00407000
  411. * 00408000
  412. L R14,AFVS REFERENCE FVS INFO 00409000
  413. USING FVSECT,R14 ... 00410000
  414. OI UFDBUSY,DIOBIT SET OUR BIT IN 'UFDBUSY' FLAG 00411000
  415. ST R1,ADTADD SAVE ADT ADDRESS @VA05652 00411500
  416. DROP R14 00412000
  417. * 00413000
  418. LH DISKIO,DTAD(,XR1) GET ACTUAL DISK ADDRESS 00414000
  419. IC R15,DTADT(,XR1) GET THE DEVICE-TYPE, @VA01695 00415100
  420. STC R15,DEVTYP AND SAVE FOR GENERAL USE @VA01695 00415200
  421. L BUFFAD,XBUFFAD GET ADDRESS OF BUFFER 00416000
  422. L BUFFSZ,XBUFFSZ GET BUFFER SIZE 00417000
  423. L DISKAD,XDISKAD GET ADDRESS OF DISK ADDRESS 00418000
  424. SR R11,R11 CLEAR ERROR-COUNT FOR LATER USE, 00419000
  425. ST R11,DIOFREE AND CLEAR FREE-STORAGE-ADDRESS 00420000
  426. LTR BUFFSZ,BUFFSZ CHECK BYTE-COUNT, 00421000
  427. BZ HANDLQQ BZ IF = 0, HANDLE DIFFERENTLY. 00422000
  428. C BUFFSZ,RECSZ IF NOT, IS BYTE-COUNT > 800 ? 00423000
  429. BNH READY BNH IF NOT, HANDLE REGULARLY. 00424000
  430. OI DIOFLAG,TOOBIG SIGNAL TOO BIG TO TRY DIAGNOSE 00425000
  431. LA R0,JSNEED IF > 800, GET 00426000
  432. * GET SOME FREE STORAGE FOR A CCW-CHAIN AND DISK ADDRESS 00427000
  433. DMSFREE DWORDS=(0),TYPCALL=BALR,TYPE=NUCLEUS 00428000
  434. LTR R15,R15 FAIL IF STORAGE NOT @VA02374 00428300
  435. BNZ ERROR25 ACQUIRED @VA02374 00428600
  436. STM R0,R1,FREER0 SAVE NO. WORDS & ADDRESS FOR LATER 00429000
  437. LR R8,R1 SET IT IN R8 WHERE NEEDED, 00430000
  438. MVI LASTCYL+3,X'FF' SET CYLINDER NO. TO 255 TO FORCE 00431000
  439. * A NEW CYLINDER-SEEK, AND CONTINUE... 00432000
  440. * MAIN LOOP FOR READING SEVERAL 800 -BYTE RECORDS ... 00433000
  441. LOOP LR R9,R8 SET R9 TO BEGINNING OF CCW-CHAIN, 00434000
  442. LA R10,DSEEKA(,R8) SET R10 FOR SEEK-ADDRESSES, 00436000
  443. MVI LASTREC,X'FF' FORCE SETSECT FOR 1ST IN CHN@VA02324 00436500
  444. MVI LASTHED+3,X'FF' SET HEAD NUMBER PURPOSELY TO 255, 00437000
  445. LA R0,PRACLIM PRACTICAL LIMIT INTO R0 FOR BCT-LOOP, 00438000
  446. B LOOP2 AND CONTINUE SHORTLY BELOW ... 00439000
  447. * LOOP FOR CHAINING ANOTHER CCW ... 00440000
  448. LOOP1 MVI 20(R9),X'60' TURN ON COMMAND CHAINING 00441000
  449. LA R9,24(,R9) REESTABLISH CCW-POINTER 00442000
  450. AL BUFFAD,RECSZ INC. CORE-ADDRESS FOR NEXT REC. @VA01695 00443100
  451. LA DISKAD,2(,DISKAD) INC. FOR NEXT DISK-ADDRESS, 00444000
  452. * MAIN LOOP FOR SETTING UP ONE CCW-PACKAGE ... 00445000
  453. LOOP2 BAL R13,JFILL2 FILL IN SEEK-ADDRESSES AND RWCCW, 00446000
  454. C R14,LASTCYL IS IT THE SAME CYLINDER AS LAST TIME? 00447000
  455. BE JAS1 BE IF YES. 00448000
  456. ST R14,LASTCYL IF NOT, STORE NEW CYLINDER NUMBER 00449000
  457. MVI LASTREC,X'FF' SET REC. NO. FOR SET-SECTOR TEST @VA01695 00449100
  458. CR R9,R8 ARE WE AT THE BEGINNING OF CCW'S ? 00450000
  459. BE JAS2A YES - START THE NEW CCW CHAIN. @VA01695 00451100
  460. BCTR DISKAD,0 IF NOT DECREMENT 'DISKAD' BY 2 TO 00452000
  461. BCTR DISKAD,0 COMPENSATE FOR BEING INCREMENTED LATER 00453000
  462. SL BUFFAD,RECSZ AND DECR BUFFAD FOR SAME REASON, @VA01695 00454100
  463. SH R9,=H'8' BACK UP TO THE LAST CCW P3094 00455000
  464. MVI 4(R9),X'20' TURN OFF COMMAND CHAINING P3094 00456000
  465. B JAS3A GO INCREMENT BUFFSZ & ADD NO-OP. 00457000
  466. * IF CYLINDER NO. SAME AS LAST TIME, CHECK HEAD NUMBER ... 00458000
  467. JAS1 C R15,LASTHED IF HEAD NUMBER SAME AS LAST TIME ? 00459000
  468. BE JAS3 BE IF YES, OMIT UNNECESSARY SEEK. 00460000
  469. CR R9,R8 AT THE BEGINNING OF CCW CHAIN ? @VA01695 00460100
  470. BE JAS2A YES - LEAVE "LASTREC" = X'FF'. @VA01695 00460200
  471. * (TO ENSURE A SET-SECTOR IS INCLUDED) 00460300
  472. * STORE NEW HEAD NUMBER, AND INCLUDE 'SEEK' IN CCW-CHAIN ... 00461000
  473. JAS2 MVI LASTREC,00 CLEAR REC NO FOR SET-SECTOR TEST @VA01695 00462100
  474. JAS2A ST R15,LASTHED STORE NEW HEAD NUMBER, @VA01695 00462200
  475. ST R10,0(,R9) STORE SEEKAD IN CCW, 00463000
  476. MVI 0(R9),X'1B' WITH SEEK COMMAND-CODE, 00464000
  477. MVC 4(4,R9),CCW1+4 MOVE IN THE RIGHT HALF, 00465000
  478. LA R9,8(,R9) ADJUST CCW-POINTER, 00466000
  479. * NOW SET UP SEARCH, TIC, AND READ/WRITE CCW'S ... 00467000
  480. JAS3 EQU * HRC004DS 00468110
  481. SR R13,R13 CLEAR A WORK REGISTER HRC004DS 00468120
  482. IC R13,6(,R10) ...AND GET THE DISPLACEMENT. HRC004DS 00468130
  483. TM DEVTYP,TYP3380 RPS TYPE DEVICE ? HRC004DS 00468140
  484. BO JAS3B HRC004DS 00468150
  485. TM DEVTYP,RPSTYP RPS TYPE DEVICE ? HRC004DS 00468160
  486. BNO JAS3M NO...BR @V2A2014 00468200
  487. JAS3B MVC 4(4,R9),CCWX+4 MOVE IN THE SET SECTOR CCW. HRC004DS 00470990
  488. IC R15,SECTNUMS(R13) GET THE NEEDED SECTOR NO @VA01695 00473500
  489. CLI DEVTYP,TYP3330 3330? @V2A2014 00473600
  490. BE SECTSET YES..USE 3330 SECTORS @V2A2014 00473700
  491. IC R15,SECT3350(R13) NO..USE 3350 SECTORS @V304498 00473740
  492. CLI DEVTYP,TYP3350 3350? @V304498 00473750
  493. BE SECTSET YES..USE 3350 SECTORS @V304498 00473760
  494. IC R15,SECT3380(R13) NO..USE 3380 SECTORS HRC004DS 00473770
  495. CLI DEVTYP,TYP3380 3380? HRC004DS 00473780
  496. BE SECTSET YES..USE 3380 SECTORS HRC004DS 00473790
  497. IC R15,SECT3340(R13) NO..USE 3340 SECTORS @V2A2014 00473800
  498. SECTSET EQU * @V2A2014 00473900
  499. STC R15,7(,R10) SAVE IT AFTER THE SEEK ARGUMENTS @VA01695 00474500
  500. LA R15,7(,R10) POINT TO WHERE WE PUT IT, @VA01695 00475500
  501. ST R15,0(,R9) STORE ADDRESS IN CCW, @VA01695 00476500
  502. MVI 0(R9),X'23' AND MOVE IN THE OP-CODE. 00478000
  503. SLR R15,R15 GET THE... @VA01695 00478100
  504. IC R15,LASTREC LAST RECORD WE HANDLED @VA01695 00478200
  505. LA R15,1(,R15) PLUS ONE; @VA01695 00478300
  506. CR R13,R15 THIS ONE SAME AS LAST+1 ? @VA01695 00478400
  507. BE JAS3M SAME AS LAST+1, OMIT SET-SECTOR. @VA01695 00478600
  508. LA R9,8(,R9) ADJUST THE CCW-POINTER. 00479000
  509. JAS3M EQU * HRC004DS 00480190
  510. STC R13,LASTREC SAVE "THIS ONE" (C.C. INTACT) HRC004DS 00480380
  511. LA R15,2(,R10) STORE SEEKAD+2 HRC004DS 00480570
  512. ST R15,0(,R9) IN CCW, 00481000
  513. MVI 0(R9),X'31' AND FILL IN SEARCH COMMAND CODE, 00482000
  514. MVC 4(20,R9),CCW2+4 MOVE IN THE REST OF MAIN CCW'S, 00483000
  515. ST R9,8(,R9) FILL IN ADDRESS OF '*-8' 00485000
  516. MVI 8(R9),X'08' AND THE 'TIC' COMMAND-CODE. 00486000
  517. LA R10,8(,R10) AND SEEKAD POINTER FOR NEXT ONE. 00487000
  518. S BUFFSZ,RECSZ DECREMENT BYTE COUNT 00488000
  519. BNP JAS4 BNP IF 0 (OR MINUS), ALL DONE. 00489000
  520. BCT R0,LOOP1 IF STILL PLUS, ITERATE UP TO LIMIT. 00490000
  521. LA R0,1 SET R0=1 IF DROPPED THRU BCT; @VA01695 00490100
  522. JAS3A A BUFFSZ,RECSZ IF LIMIT EXCEEDED, RESTORE 'BUFFSZ' 00491000
  523. JAS4 LA R15,PRACLIM+1 COMPUTE NO. OF CCW "PACKAGES" @VA01695 00492100
  524. SR R15,R0 ... (AND LEAVE IN R15); @VA01695 00492200
  525. MVI 0(R8),X'07' INSTALL SEEK OP-CODE 00493000
  526. B READY1 AND GO PREPARE TO START SIO SEQUENCE. 00494000
  527. * 00495000
  528. READY BAL R13,JFILL1 FILL IN SEEKAD'S AND CCW'S 00496000
  529. * 00497000
  530. LA R15,1 ONLY 1 READ OR WRITE FOR ST'D DIAG. 00498000
  531. READY1 XC CSW(8),CSW ZERO OUT THE CSW 00499000
  532. ST R8,CAW AND POINT TO THE CCWS 00500000
  533. DC X'83',X'48',AL2(DIAGNUM) 00501000
  534. BNZ DIAGBAD APPARENTLY DIDN'T DO TOO WELL! 00502000
  535. TM DIOFLAG,TOOBIG WAS THIS A ST'D DIAGNOSE CALL? 00503000
  536. BNO JAS9 YES. THEN THERE'S ONLY ONE ITERATION 00504000
  537. LA DISKAD,2(,DISKAD) INCREMENT DISK-ADDRESS FOR NEXT TIME 00505000
  538. AL BUFFAD,RECSZ ADVANCE CORE-ADDRESS @VA01695 00506100
  539. S BUFFSZ,RECSZ AND DECREMENT BYTE-COUNT 00507000
  540. BP LOOP BP IF STILL SOME MORE LEFT TO DO. 00508000
  541. JAS9 TM DIOFLAG,WRTKF TEST IF WRTK CALLED RDTK 00509000
  542. BO RECUR YES, HANDLE RECURSIVENESS 00510000
  543. TM DIOFLAG,QQTRK TEST IF ONLY 1/4 OF 1/4 DESIRED 00511000
  544. BZ CLEAR15 BZ IF NOT - WE'RE DONE. 00512000
  545. * 00513000
  546. BAL RETREG,QQCALC IF WE READ 16TH TRACK, SET UP REGISTERS 00514000
  547. MVC 0(200,BUFFAD),0(TEMP) AND MOVE DATA TO USER'S BUFFER. 00515000
  548. * 00516000
  549. CLEAR15 MVI ERRCODE,00 CLEAR ERROR CODE IN R15 00517000
  550. * 00518000
  551. RETURN LM R0,R1,FREER0 RESTORE R0 & R1 FOR FRET-CALL, 00519000
  552. LTR R1,R1 IS THERE ANYTHING TO RETURN ? 00520000
  553. BZ RETURN1 EXIT IF 0 (NO NEED FOR FRET CALL) 00521000
  554. * CALL FRET TO RETURN THE SPACE USED FOR CCW'S 00522000
  555. DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR 00523000
  556. RETURN1 L R14,AFVS REFERENCE FVS INFO 00524000
  557. USING FVSECT,R14 ... 00525000
  558. KXCHK DIOBIT CHECK FOR 'KX' WANTED... 00526000
  559. DROP R14 00527000
  560. RETURN2 LM R0,R15,XRSAVE RESTORE REGISTERS 0-14, ERROR-CODE TO R15 00528000
  561. LTR R15,R15 SET CONDITION-CODE FOR CONVENIENCE OF CALLER 00529000
  562. BR R14 AND RETURN TO CALLER. 00530000
  563. EJECT 00531000
  564. ********************************************************************** 00532000
  565. * 00533000
  566. * SPECIAL ROUTINES TO HANDLE 1/4 OF 1/4 TRK 00534000
  567. * 00535000
  568. ********************************************************************** 00536000
  569. * 00537000
  570. * DETERMINE WHETHER RDTK OR WRTK AND GET BUFFER SPACE 00538000
  571. * 00539000
  572. * CHECK FOR VARIOUS SPECIAL CASES FOR READ OR WRITE 200 BYTES... 00540000
  573. * 00541000
  574. HANDLQQ LA R13,READY R13 = A(READY) FOR MANY XFER'S BELOW, 00542000
  575. MVC QQDSK2(2),0(DISKAD) MOVE DISK-ADDRESS TO DIOSECT 00543000
  576. LA DISKAD,QQDSK2 AND REFER TO IT FROM THERE. 00544000
  577. H200 LA BUFFSZ,200 SET FOR READ OR WRITE OF 200 BYTES, 00545000
  578. CLI DEVTYP,TYP2314 IS THIS A 2314 ? @V2A2014 00546100
  579. BCR 7,R13 NO..NO ADJUST NECESSARY @V2A2014 00546200
  580. TM QQDSK2,X'20' CHECK 3RD BIT OF DISK-ADDRESS, 00548000
  581. BZ CHKNEW IF = 0 (BLOCK NO. < 8192), CHECK FURTHER 00549000
  582. TM QQDSK2,X'80' IF = 1, IS LEFTMOST BIT ALSO = 1 ? 00550000
  583. BCR 8,R13 'BZ READY' IF NOT (NO SPECIAL PROBLEM) 00551000
  584. L TEMP,QQDSK1 GET DISK-ADDRESS (IN RIGHT END OF REG.) 00552000
  585. SH TEMP,X6000 SUBTRACT NECESSARY ADJUSTER FOR SPECIAL 00553000
  586. STH TEMP,QQDSK2 CASE, AND STORE ADJUSTED DISK-ADDRESS 00554000
  587. BR R13 'B READY' (CAN READ OR WRITE 200 BYTES) 00555000
  588. X6000 DC AL2(X'6000') ADJUSTER FOR SPECIAL RANGE OF BLOCK NUMBR 00556000
  589. * 00557000
  590. CHKNEW CLI IOCOMM,WRITE IF BLOCK-NUMBER < 8192, = WRITE ? 00558000
  591. BE CLRLEFT BE IF YES, MUST CLEAR 16TH-TRACK BITS. 00559000
  592. TM QQDSK2,X'C0' IF A READ, MAYBE = 1ST 16TH TRACK ? 00560000
  593. BCR 8,R13 'BZ READY' IF YES, READ 1ST 200 BYTES. 00561000
  594. * 00562000
  595. CLRLEFT NI QQDSK2,X'3F' CLEAR LEFTMOST 2 BITS & USE OLD METHOD. 00563000
  596. * GET 800 BYTES FROM FREE 00564000
  597. DMSFREE DWORDS=100,TYPE=NUCLEUS,TYPCALL=BALR,ERR=*,MSG=NO 00565000
  598. * @VA15103 00565100
  599. LTR R15,R15 FAIL IF STORAGE NOT @VA02374 00565300
  600. BNZ ERROR25 ACQUIRED @VA02374 00565600
  601. STM R0,R1,FREER0 SAVE NO. WORDS & ADDRESS FOR LATER 00566000
  602. LR BUFFAD,R1 AND LOAD WHERE NEEDED. 00567000
  603. OI DIOFLAG,QQTRK SET 1/4 OF 1/4 MODE BIT 00568000
  604. L BUFFSZ,RECSZ SET ADJUSTED BUFFER SIZE 00569000
  605. CLI IOCOMM,WRITE CALLED FOR WRTK 00570000
  606. BCR 7,R13 NO, WE'RE ALL SET (GO TO 'READY') 00571000
  607. OI DIOFLAG,WRTKF IF YES,SET FLAG-BIT TO READ FIRST 00572000
  608. MVI IOCOMM,READ SET TO READ FIRST 00573000
  609. BR R13 'B READY' 00574000
  610. * 00575000
  611. * PROCESS WRTK CALLS RDTK CASE, AFTER READ COMPLETED 00576000
  612. * 00577000
  613. RECUR BAL RETREG,QQCALC CALCULATE APPROPRIATE 1/4 WITHIN BLOCK 00578000
  614. MVC 0(200,TEMP),0(BUFFAD) MOVE INTO TEMPORARY 800 BYTE BU 00579000
  615. MVI IOCOMM,WRITE RESET TO WRITE 00580000
  616. L BUFFAD,DIOFREE SET NEW BUFFER ADDRESS 00581000
  617. L BUFFSZ,RECSZ AND SIZE OF RECORD 00582000
  618. NI DIOFLAG,255-WRTKF-QQTRK CLEAR FLAG-BITS (ALMOST DONE) 00583000
  619. LA R13,READY1 SET R13 TO RETURN TO 'READY', 00584000
  620. LA R15,1 SIGNAL THIS IS A SINGLE 'I/O' 00585000
  621. B JFILL3 FILL IN CCW'S AND THEN WRITE THE BLOCK. 00586000
  622. EJECT 00587000
  623. ********************************************************************** 00588000
  624. * 00589000
  625. * I/O ERROR PROCESSOR 00590000
  626. * 00591000
  627. ********************************************************************** 00592000
  628. SPACE 00593000
  629. DIAGBAD STC R15,DIAGRET SAVE CP'S RETURN CODE. 00594000
  630. MVC IOOLD(16),IOOPSW AND PERTINENT INFO 00595000
  631. BC 4,RET1 HANDLE CONDITION CODE 1. 00596000
  632. BC 2,RET2 HANDLE CONDITION CODE 2 00597000
  633. MVI ERRCODE,02 MIGHT AS WELL NAME THIS ERROR NOW. 00598000
  634. GETOUT LA TEMP,SENCCW POINT TO THE SENSE-CCW 00599000
  635. ST TEMP,CAW REALLY POINT TO IT. 00600000
  636. SIO 0(DISKIO) NOW CRANK IT UP. 00601000
  637. TIO 0(DISKIO) AND WAIT. 00602000
  638. BC 2,*-4 ...SOME MORE... 00603000
  639. CLI DEVTYP,TYP2314 IS DISK A 2314? @VA04120 00603100
  640. BE RETURN YES; THEN DON'T ISSUE MSG BELOW @VA04120 00603200
  641. LA R1,L'SENSB DETERMINE # SENSE BYTES PRESENT HRC004DS 00603220
  642. SH R1,CSW+6 HRC004DS 00603240
  643. STH R1,DIOSNSCT HRC004DS 00603260
  644. TM SENSB+1,WRTINHIB 'WRITE-INHIBIT' IS NOT THE @VA01921 00603300
  645. BO WRTONLY USERS FAULT - GIVE A CLUE. @VA01921 00603600
  646. B RETURN GET OUT NOW SINCE INFO IS AVAILABLE. 00604000
  647. * 00605000
  648. RET1 CLI DIAGRET,X'04' DID CP CATCH SOMEONE GOING OFF THE END? 00606000
  649. BE ERROR5 YES. GO TELL HIM. 00607000
  650. CLI DIAGRET,X'03' OR WAS THE DISK READ-ONLY? 00608000
  651. BE ERROR6 YES. GO HANDLE. 00609000
  652. MVI ERRCODE,X'03' LABLE IT AS A WEIRD USER-ERROR. 00610000
  653. B RETURN RETURN TO CALLER 00611000
  654. * 00612000
  655. RET2 MVI ERRCODE,X'08' LABEL AS UNDETERMINED V0158 00613100
  656. B RETURN RETURN TO THE CALLER. 00621000
  657. * 00622000
  658. ERROR5 MVI ERRCODE,X'05' TELL HIM HIS EXTENT IS WRONG 00623000
  659. B RETURN RETURN TO THE CALLER 00624000
  660. * 00625000
  661. WRTONLY DMSERR NUM=905,LET=S,TEXT='WRITE-INHIBIT SWITCH SET ON DRIVE..X00625300
  662. .NOTIFY OPERATOR' @VA01921 00625600
  663. ERROR6 L R15,SAVEADT GET THAT ADDRESS WE SAVED SO NEATLY. 00626000
  664. USING ADTSECT,R15 00627000
  665. NI ADTFLG1,255-ADTFRW TURN OF THE R/W INDICATOR. 00628000
  666. OI ADTFLG1,ADTFRO TURN ON THE READ-ONLY INDICATOR. 00629000
  667. DROP R15 00630000
  668. MVI ERRCODE,X'06' TELL HIM THAT THE DISK IS R/O (NOW). 00631000
  669. B RETURN ... 00632000
  670. ERROR25 MVI ERRCODE,25 CAN'T DO IT WITHOUT @VA02374 00632300
  671. B RETURN WORK SPACE @VA02374 00632600
  672. EJECT 00633000
  673. *********************************************************************** 00634000
  674. * 00635000
  675. * CALCULATE DISPLACEMENT FOR 1/4 OF 1/4 00636000
  676. * 00637000
  677. ********************************************************************** 00638000
  678. QQCALC L TEMP,XDISKAD CALCULATE POSITION IN BUFFER 00639000
  679. LH TEMP,0(0,TEMP) ... 00640000
  680. SRL TEMP,14 GET 1/4 OF 1/4 NUMBR 00641000
  681. N TEMP,=XL4'00000003' NOW ISOLATE NUMBER (0 TO 3) 00642000
  682. MH TEMP,H200+2 EACH 1/4 OF 1/4 IS 200 BYTES 00643000
  683. A TEMP,DIOFREE ADD RELOCATION FACTOR 00644000
  684. L BUFFAD,XBUFFAD GET ORIGINAL 200 BYTE BUFFER ADDRESS 00645000
  685. BR RETREG RETURN TO CALLER 00646000
  686. SPACE 2 00647000
  687. * SUBROUTINE TO FILL IN SEEK-ADDRESS INFORMATION AND/OR 00648000
  688. * READ-WRITE CCW'S. (JAS) 00649000
  689. * 'JFILL1' FILLS IN BOTH FOR 'REGULAR' CALLS. 00650000
  690. * 'JFILL2' FILLS IN BOTH FOR LARGE BLOCKS. 00651000
  691. * 'JFILL3' FILLS IN ONLY CCW'S FOR 16-TH TRACKS. 00652000
  692. * (IN ANY CASE, R13 = RETURN-REGISTER) 00653000
  693. * 00654000
  694. JFILL1 LA R10,SEEKADR FOR REGULAR CASE, SET R10 = A(SEEKADR) 00655000
  695. MVC CCW1A(8),CCW1 ASSUME DEVICE IS NOT A 3330 00656000
  696. LA R8,CCW1A ALSO POINT R8 TO CCW1 FOR CAW LATER. 00657000
  697. * (AT ENTRY TO 'JFILL2', R10 MUST POINT TO SEEK-AD'S) 00658000
  698. JFILL2 SR R14,R14 CLEAR R14, 00659000
  699. ST R13,DOUBLE SAVE R13 (ONLY REGISTER WE HAVE HANDY) 00660000
  700. LA R13,TBL3330 SET TENTATIVELY FOR 3330. 00661000
  701. CLI DEVTYP,X'09' IS IT A 3330 ? 00662000
  702. BE R13OK BRANCH IF YES. 00663000
  703. LA R13,TBL3350 SET TENTATIVELY FOR 3350 @V304498 00663100
  704. CLI DEVTYP,TYP3350 IS THIS A 3350 ? @V304498 00663200
  705. BE R13OK YES, OBTAIN DISK ADDRESS @V304498 00663300
  706. LA R13,TBL3380 SET TENTATIVELY FOR 3380 HRC004DS 00663400
  707. CLI DEVTYP,TYP3380 IS THIS A 3380 ? HRC004DS 00663500
  708. BE R13OK YES, OBTAIN DISK ADDRESS HRC004DS 00663600
  709. LA R13,TBL2314 SET R13 TENTATIVELY FOR 2314, 00664000
  710. CLI DEVTYP,X'08' IS UNIT-TYPE = 08 (2314) ? 00665000
  711. BE R13OK BE IF YES 08, 2314. 00666000
  712. LA R13,TBL3340 MUST BE 3340 @V2A2014 00667100
  713. R13OK EQU * ... 00668000
  714. USING JTABLE,R13 ... 00669000
  715. LH R15,0(,DISKAD) OBTAIN THE DISK-ADDRESS, 00670000
  716. N R15,=X'0000FFFF' P0992 00671000
  717. BCTR R15,0 DECREMENT IT BY ONE (BLOCK NUMBER - 1) 00672000
  718. LTR R15,R15 WAS BLOCK-NUMBER = 0 (INVALID) 00673000
  719. BM ERROR5 BM IT IT WAS, ERROR 5 (NO MESSAGE) 00674000
  720. D R14,RECCYL DIVIDE BY NUMBER RECORDS PER CYLINDER, 00675000
  721. ST R15,0(,R10) STORE 00-00-00 & CYLINDER NUMBER, 00676000
  722. LR R15,R14 REMAINDER INTO R15, 00677000
  723. SR R14,R14 AND CLEAR R14 AGAIN, 00678000
  724. D R14,RECHED DIVIDE BY NUMBER RECORDS PER HEAD(S), 00679000
  725. LA R14,1(,R14) RECORD NUMBER STARTS WITH 1 (NOT 0) 00680000
  726. CLI NUMHED+1,01 IS IT PER 'ONE' HEAD ? 00681000
  727. BE R15OK BE IF YES (ALL OK AS IS) 00682000
  728. AR R15,R15 IF NOT, DOUBLE THE HEAD NUMBER, 00683000
  729. CH R14,OVEREC CHECK RECORD NUMBER FOR TRACK OVERFLOW 00684000
  730. BNH R15OK BNH IF NOT IN 'NEXT TRACK', 00685000
  731. LA R15,1(,R15) INCR. HEAD NUMBER IF REC 9 UP, ETC. 00686000
  732. R15OK STH R15,4(,R10) STORE 00 & HEAD-NUMBER. 00687000
  733. * (NOTE -- HEAD NUMBER REMAINS IN R15) 00688000
  734. STC R14,6(,R10) AND STORE RECORD NUMBER (1-4 OR 1-15) 00689000
  735. L R14,0(,R10) CYLINDER NUMBER BACK INTO R14 PER SPEC 00690000
  736. L R13,DOUBLE RESTORE R13 AND PROCEED TO JFILL3 ... 00691000
  737. DROP R13 ... 00692000
  738. * 00693000
  739. JFILL3 EQU * NOW CONTINUE (OR CAN ENTER HERE)... 00694000
  740. TM DEVTYP,TYP3380 IS THIS A 3380? HRC004DS 00694300
  741. BE JFILL3B HRC004DS 00694600
  742. TM DEVTYP,RPSTYP RPS TYPE DEVICE ? @V2A2014 00695100
  743. BNO JFILL3A NO...BR @V2A2014 00695200
  744. JFILL3B EQU * NOW CONTINUE (OR CAN ENTER HERE).HRC004DS 00696100
  745. TM DIOFLAG,TOOBIG IS THIS A STANDARD DIAGNOSE CALL? 00697000
  746. BNZ JFILL3A IF NOT, THIS CALC DONE ELSEWHERE @VA01695 00698100
  747. STM R14,R15,DOUBLE GET SOME WORKING ROOM, @VA01695 00698200
  748. SR R14,R14 AND A CLEAN REGISTER 00700000
  749. IC R14,6(,R10) NEED THE RECORD NUMBER. 00701000
  750. IC R15,SECTNUMS(R14) GET THE RIGHT SECTOR NUMBER; @VA01695 00702100
  751. CLI DEVTYP,TYP3330 3330 ? @V2A2014 00702200
  752. BE STRSECT YES..BR @V2A2014 00702300
  753. IC R15,SECT3350(R14) NO..USE 3350 SECTORS @V304498 00702340
  754. CLI DEVTYP,TYP3350 3350 ? @V304498 00702350
  755. BE STRSECT YES..BR @V304498 00702360
  756. IC R15,SECT3380(R14) NO..USE 3380 SECTORS HRC004DS 00702370
  757. CLI DEVTYP,TYP3380 3380 ? HRC004DS 00702380
  758. BE STRSECT YES..BR HRC004DS 00702390
  759. IC R15,SECT3340(R14) NO..USE 3340 SECTORS @V2A2014 00702400
  760. STRSECT STC R15,7(,R10) STORE WHERE NEEDED. @VA01695 00702600
  761. MVC CCW1(4),CCW1A BETTER MAKE SOME ROOM 00705000
  762. MVC CCW1A(8),CCWX MOVE IN THE SET SECTOR CCW 00706000
  763. LA R8,CCW1 AND POINT TO THE READJUSTED STRING 00707000
  764. LM R14,R15,DOUBLE GET THOSE REGISTERS BACK. 00708000
  765. JFILL3A EQU * NICE PLACE TO RESUME. 00709000
  766. ICM BUFFAD,8,IOCOMM INSERT OP CODE (06 OR 05), @VA01695 00710100
  767. ST BUFFAD,RWCCW STORE OP-CODE + DATA ADDRESS, @VA01695 00710200
  768. STH BUFFSZ,RWCCW+6 STORE COUNT (TENTATIVELY) 00712000
  769. C BUFFSZ,RECSZ IS IT TOO LARGE (> RECSIZ) ? 00713000
  770. BCR 13,R13 'BNH' IF NOT TOO LARGE, EXIT VIA R13. 00714000
  771. MVC RWCCW+6(2),RECSZ+2 IF TOO LARGE, SUBSTITUTE RECSIZ. 00715000
  772. BR R13 (R14 & R15 MEANINGFUL FOR JFILL1 OR JFILL2) 00716000
  773. EJECT 00717000
  774. * CONSTANTS & DISK TABLES ... 00718000
  775. * 00719000
  776. RECSZ DC F'800' CMS USUALLY READS & WRITES 800 BYTES 00720000
  777. * 00721000
  778. TBL2314 DS 0F 2314-TABLE (FOR GENERAL USE) ... 00731000
  779. * (INDICATED BY 'UNIT TYPE' OF X'08' A LA 'OS') 00732000
  780. DC F'150' NUMBER OF RECORDS PER CYLINDER 00733000
  781. DC F'15' NUMBER OF RECORDS PER ... 00734000
  782. DC H'2' PER TWO HEADS. 00735000
  783. DC H'8' OVERFLOW-RECORD NUMBER 00736000
  784. DC H'20' NUMBER OF HEADS (TRACKS) PER CYLINDER 00737000
  785. DC H'203' MAXIMUM NUMBER OF CYLINDERS 00738000
  786. * 00738050
  787. TBL3350 DS 0F 3350 TABLE (FOR GENERAL USE) @V304498 00738100
  788. * ( INDICATED BY 'UNIT TYPE' OF X'0B' A LA 'OS') 00738150
  789. DC F'570' NUMBER OF RECORDS PER CYLINDER @V304498 00738200
  790. DC F'19' NUMBER OF RECORDS PER ... @V304498 00738250
  791. DC H'1' PER ONE HEAD @V304498 00738300
  792. DC H'20' OVERFLOW-RECORD NUMBER (N/A) @V304498 00738350
  793. DC H'30' NUMBER OF TRACKS PER CYLINDER @V304498 00738400
  794. DC H'115' MAXIMUM NUMBER OF CYLINDERS @V304498 00738450
  795. * 00739000
  796. * HRC004DS 00739090
  797. TBL3380 DS 0F 3380 TABLE (FOR 800 BYTE BLKS) @V6AE8C1X00739180
  798. (INDICATED BY 'UNIT TYPE' OF X'0EHRC004DS 00739270
  799. DC F'540' NUMBER OF RECORDS PER CYLINDER HRC004DS 00739360
  800. DC F'36' NUMBER OF RECORDS PER TRACK HRC004DS 00739450
  801. DC H'1' PER ONE HEAD HRC004DS 00739540
  802. DC H'37' OVERFLOW RECORD NUMBER (N/A) HRC004DS 00739630
  803. DC H'15' NUMBER OF TRACKS PER CYLINDER HRC004DS 00739720
  804. DC H'121' MAXIMUM NUMBER OF CYLINDERS HRC004DS 00739810
  805. * HRC004DS 00739900
  806. TBL3330 DS 0F 3330-TABLE (FOR GENERAL USE) ... 00740000
  807. * (INDICATED BY 'UNIT TYPE' OF X'09' A LA 'OS') 00741000
  808. DC F'266' NUMBER OF RECORDS PER CYLINDER 00742000
  809. DC F'14' NUMBER OF RECORDS PER ... 00743000
  810. DC H'1' PER ONE HEAD. 00744000
  811. DC H'15' OVERFLOW-RECORD NUMBER (N/A) 00745000
  812. DC H'19' NUMBER OF HEADS (TRACKS) PER CYLINDER 00746000
  813. DC H'246' MAXIMUM NUMBER OF CYLINDERS 00747000
  814. * 00748000
  815. TBL3340 DS 0F 3340 TABLE @V2A2014 00748050
  816. DC F'96' @V2A2014 00748100
  817. DC F'8' @V2A2014 00748150
  818. DC H'1' @V2A2014 00748200
  819. DC H'9' @V2A2014 00748250
  820. DC H'12' @V2A2014 00748300
  821. DC H'682' @V2A2014 00748350
  822. * 00748400
  823. H8 DC H'8' 00749000
  824. WRTINHIB EQU X'02' SENSE BYTE 1, BIT 6 @VA01921 00749500
  825. * 00750000
  826. SECTNUMS DC XL1'00' 00751000
  827. DC X'020B141D252E374049525B646D75' @VA01695 00752100
  828. * 00753000
  829. SECT3340 DC XL1'00' @V2A2014 00753100
  830. DC X'020910171E252C32' @V2A2014 00753200
  831. * 00753300
  832. SECT3350 DC XL1'00' @V304498 00753600
  833. DC AL1(2,8,15,21,27,34,40,46,53,59,65,71,78,84,90) @V304498 00753610
  834. DC AL1(97,103,109,116) @V304498 00753620
  835. SECT3380 DC XL1'00' HRC004DS 00753621
  836. DC AL1(5,11,17,23,29,34,40,46,52,58,64,70) HRC004DS 00753622
  837. DC AL1(75,81,87,93,99,105,111,116,122,128,134,140) HRC004DS 00753623
  838. DC AL1(146,152,157,163,169,175,181,187,193,198) HRC004DS 00753624
  839. DC AL1(204,210) HRC004DS 00753625
  840. * 00753630
  841. LTORG 00754000
  842. * 00755000
  843. JTABLE DSECT 00756000
  844. RECCYL DS 1F NUMBER OF RECORDS PER CYLINDER 00757000
  845. RECHED DS 1F NUMBER OF RECORDS PER ... 00758000
  846. NUMHED DS 1H PER ONE OR TWO HEADS. 00759000
  847. OVEREC DS 1H OVERFLOW-RECORD NUMBER (OR N/A) 00760000
  848. HEDCYL DS 1H NUMBER OF HEADS (TRACKS) PER CYLINDER 00761000
  849. MAXCYL DS 1H MAXIMUM NUMBER OF CYLINDERS 00762000
  850. SPACE 2 00763000
  851. * PARAMETERS FOR HANDLING CHAINED CCW'S, ETC. 00764000
  852. * 00765000
  853. PRACLIM EQU 15 PRACTICAL LIMIT FOR NO. OF REC. FOR ONE 'SIO' 00766000
  854. * 00767000
  855. TYP3340 EQU X'07' DEVICE TYPE 3340 @V2A2014 00767100
  856. TYP3350 EQU X'0B' DEVICE TYPE 3350 @V304498 00767150
  857. TYP3380 EQU X'0E' DEVICE TYPE 3380 HRC004DS 00767170
  858. TYP2314 EQU X'08' DEVICE TYPE 2314 @V2A2014 00767200
  859. TYP3330 EQU X'09' DEVICE TYPE 3330 @V2A2014 00767300
  860. RPSTYP EQU X'01' ROTATIONAL POSITION SENSING @V2A2014 00767400
  861. JSNEED EQU PRACLIM*6 (FOR R0) NO DBL WORDS NEEDED FROM FREE 00768000
  862. DSEEKA EQU (PRACLIM*5)*8 OFFSET (IN BYTES) OF SEEK ADDRESSES 00769000
  863. EJECT 00770000
  864. NUCON 00771000
  865. DIOSECT 00772000
  866. ADT 00773000
  867. FVS 00774000
  868. REGEQU 00775000
  869. ********************************************************************* 00776000
  870. * 00777000
  871. * CONSTANTS AND DEFINITIONS 00778000
  872. * 00779000
  873. ********************************************************************* 00780000
  874. * 00781000
  875. * REGISTER ASSIGNMENTS 00782000
  876. * 00783000
  877. BASE EQU R2 00784000
  878. PLIST EQU 3 00785000
  879. DISKIO EQU R4 00786000
  880. BUFFAD EQU R5 00787000
  881. BUFFSZ EQU R6 00788000
  882. DISKAD EQU R7 00789000
  883. RETREG EQU R14 ... 00790000
  884. TEMP EQU R15 ... 00791000
  885. XR1 EQU 5 00792000
  886. * 00793000
  887. * FORMAT OF PARAMETER LIST 00794000
  888. * 00795000
  889. XPLIST DSECT 00796000
  890. XBUFFAD DC A(0) BUFFER ADDRESS 00797000
  891. XBUFFSZ DC F'0' BUFFER SIZE 00798000
  892. XDISKAD DC A(0) ADDRESS OF DISK ADDRESS LIST 00799000
  893. XMODE DC A(0) ACTIVE DISK TABLE ADDRESS (OR MODE) 00800000
  894. * 00801000
  895. READ EQU X'06' 00802000
  896. WRITE EQU X'05' 00803000
  897. SILI EQU X'20' 00804000
  898. PCI EQU X'80' 00805000
  899. CC EQU X'40' 00806000
  900. CE EQU X'08' 00807000
  901. DE EQU X'04' 00808000
  902. UC EQU X'02' 00809000
  903. PROGCHK EQU X'20' 00810000
  904. PROTCHK EQU X'10' 00811000
  905. END 00812000