Table of Contents

DMSLFS Source

References

Source Listing

DMSLFS.ASSEMBLE.txt
  1. LFS TITLE 'DMSLFS (CMS) VM/370 - RELEASE 6' 00001000
  2. SPACE 2 00002000
  3. *. 00003000
  4. * MODULE NAME: 00004000
  5. * 00005000
  6. * DMSLFS 00006000
  7. * 00007000
  8. * SUBROUTINE NAME: 00008000
  9. * 00009000
  10. * DMSLFS (FSTLKP) 00010000
  11. * 00011000
  12. * FUNCTION: 00012000
  13. * 00013000
  14. * TO FIND A SPECIFIED 40-BYTE FST ENTRY WITHIN THE FST 00014000
  15. * TABLES FOR READ-ONLY OR READ-WRITE DISK(S). 00015000
  16. * 00016000
  17. * ATTRIBUTES: 00017000
  18. * 00018000
  19. * NUCLEUS RESIDENT, REENTRANT 00019000
  20. * 00020000
  21. * ENTRY POINTS: 00021000
  22. * 00022000
  23. * DMSLFS 00023000
  24. * 00024000
  25. * ENTRY CONDITIONS: 00025000
  26. * 00026000
  27. * L R15,AFSTLKP WHERE AFSTLKP=V(DMSLFS) 00027000
  28. * BALR R14,R15 00028000
  29. * 00029000
  30. * 1. TO SEARCH APPROPRIATE DISK TABLE(S) FROM THE 00030000
  31. * BEGINNING: 00031000
  32. * 00032000
  33. * R0 = IMMATERIAL 00033000
  34. * R1 = POINTER TO USUAL P-LIST (WITH SIGN-BIT PLUS): 00034000
  35. * 00035000
  36. * DS 0F 00036000
  37. * PLIST DC CL8' ' IMMATERIAL 00037000
  38. * DC CL8' ' FILENAME OR '*' 00038000
  39. * DC CL8' ' FILETYPE OR '*' 00039000
  40. * DC CL2' ' FILEMODE OR '*' 00040000
  41. * 00041000
  42. * 2. TO SEARCH APPROPRIATE DISK TABLE(S), PICKING UP 00042000
  43. * FROM WHERE YOU LEFT OFF PREVIOUSLY, STARTING 00043000
  44. * WITH NEXT 40-BYTE FST ENTRY: 00044000
  45. * 00045000
  46. * R0 = POINTER TO ACTIVE DISK TABLE 00046000
  47. * R1 = POINTER TO USUAL P-LIST BUT WITH SIGN-BIT NEGATIVE 00047000
  48. * 00048000
  49. * EXIT CONDITIONS: 00049000
  50. * 00050000
  51. * FILE FOUND: 00051000
  52. * 00052000
  53. * R0 = POINTER TO ACTIVE DISK TABLE 00053000
  54. * R1 = POINTER TO (ADDRESS OF) 40-BYTE FST ENTRY FOUND 00054000
  55. * R15 = 0 (AND CONDITION-CODE = 0) 00055000
  56. * 00056000
  57. * FILE NOT FOUND: 00057000
  58. * 00058000
  59. * R0 = 0 00059000
  60. * R1 = 0 (WITH SIGN-BIT NEGATIVE) 00060000
  61. * R15 = 1 (AND CONDITION-CODE = 2) 00061000
  62. * R15= 80,81,82,83 ERROR ACCESSING OSFST FOR OS DISK 00061100
  63. * 00062000
  64. * PARAMETER LIST ERROR: 00063000
  65. * 00064000
  66. * R0 = 0 00065000
  67. * R1 = 0 (WITH SIGN-BIT NEGATIVE) 00066000
  68. * R15 = 2 (AND CONDITION-CODE = 2) 00067000
  69. * 00068000
  70. * CALLS TO OTHER ROUTINES: 00069000
  71. * 00070000
  72. * DMSLAD, DMSLADN, DMSROS 00071000
  73. * 00072000
  74. * EXTERNAL REFERENCES: 00073000
  75. * 00074000
  76. * ADTSECT, FVSECT 00075000
  77. * 00076000
  78. * TABLES/WORKAREAS 00077000
  79. * 00078000
  80. * NONE 00079000
  81. * 00080000
  82. * REGISTER USAGE: 00081000
  83. * 00082000
  84. * R13 FVSECT 00083000
  85. * R12 BASE 00084000
  86. * REST WORK 00085000
  87. * 00086000
  88. * OPERATION: 00087000
  89. * 00088000
  90. * DMSLFS CHECKS TO ENSURE THAT R1 IS NOT ZERO (A 00089000
  91. * CALLING ERROR), AND INITIALIZES 00090000
  92. * TO TEST FOR EITHER A READ-ONLY OR READ-WRITE DISK. 00091000
  93. * THEN THE PARAMETER LIST IS CHECKED TO ENSURE THAT THE 00092000
  94. * FILENAME AND FILETYPE ARE PRESENT (CALLING ERROR IF 00093000
  95. * NOT), AND CHECKS TO SEE IF THE MODE-LETTER IS 00094000
  96. * ALPHABETIC, AND IF SO WHETHER A MODE-NUMBER IS GIVEN. 00095000
  97. * 00096000
  98. * IF THE MODE IS ALPHABETIC, DMSLAD IS CALLED TO CHECK 00097000
  99. * FOR A DISK WHOSE MODE-LETTER 00098000
  100. * ADTM MATCHES THE PARAMETER LIST. IF THE MODE IS *-* 00099000
  101. * OR EQUIVALENT (NOT ALPHABETIC), DMSLADN IS CALLED TO 00100000
  102. * CHECK FOR ANY AVAILABLE DISK. AN ERROR RETURN FROM 00101000
  103. * DMSLAD OR DMSLADN TRIGGERS A 'FILE NOT FOUND' RETURN 00102000
  104. * FROM DMSLFS. ON A SUCCESSFUL RETURN, DMSLFS CHECKS TO 00103000
  105. * MAKE SURE THE DISK FOUND IS LOGGED IN 00104000
  106. * (AS EITHER READ-ONLY OR READ-WRITE OR IF DMSLFS WAS 00105000
  107. * CALLED BY DMSSTT, OS READ ONLY). IF NOT, THE 00105100
  108. * LOGIC CONTINUES AS DESCRIBED BELOW, WHERE THE GIVEN 00106000
  109. * FST ENTRY WAS NOT FOUND ON THE DISK. 00107000
  110. * IF THE DISK IS AN OS DISK, DMSLFS CALLS ROSSTT IN 00107050
  111. * DMSROS TO VERFIY THAT THE DATA SET EXISTS AND THAT THE 00107100
  112. * ATTRIBUTES OF THE DATA SET ARE SUPPORTED. UPON RETURN 00107150
  113. * FROM DMSROS, A RETURN CODE OF 88 INDICATES THAT 00107200
  114. * THE DATA SET WAS NOT FOUND AND DMSLFS INITIATES THE 00107250
  115. * SEARCH AGAIN USING THE NEXT DISK IN ORDER. ANY OTHER 00107300
  116. * ERRORS SUCH AS RETURN CODE 80 CAUSE DMSLFS TO EXIT 00107350
  117. * IMMEDIATELY. 00107400
  118. * 00107450
  119. * A RETURN CODE OF 0 FROM DMSROS INDICATES THAT THE DATA 00107500
  120. * SET WAS FOUND ON THE SPECIFIED DISK AND DMSLFS CONTINUES 00107550
  121. * AS IT DOES WHEN A CMS FST IS FOUND. 00107600
  122. * 00108000
  123. * IF THE DISK FOUND BY DMSLAD OR DMSLADN IS LOGGED IN, 00109000
  124. * DMSLFS CHECKS THROUGH THE VARIOUS 00110000
  125. * FST HYPERBLOCKS IN CORE TO FIND A MATCHING FST ENTRY 00111000
  126. * FOR THE FILENAME (IF GIVEN IN THE PARAMETER LIST) AND 00112000
  127. * FILETYPE (IF GIVEN). NOTE - IF R1 WAS NEGATIVE AT 00113000
  128. * ENTRY TO DMSLFS, SEARCHING FOR THE GIVEN FST RESUMES 00114000
  129. * FROM THE POINT LAST SEARCHED, AS INDICATED BY 00115000
  130. * THE ADTCHBA (CURRENT HYPERBLOCK ADDRESS) AND ADTCFST 00116000
  131. * (CURRENT FST ENTRY DISPLACMENT) POINTERS IN THE 00117000
  132. * ACTIVE DISK TABLE FOR THE GIVEN DISK. 00118000
  133. * 00119000
  134. * IF THE FILENAME AND FILETYPE ARE BOTH GIVEN AND MATCH 00120000
  135. * EXPLICITLY, THE FILE IS DEEMED 'FOUND' IRRESPECTIVE 00121000
  136. * OF ANY MODE-NUMBER IN THE PARAMETER LIST. IF EITHER 00122000
  137. * (OR BOTH) WAS '*' IN THE PARAMETER LIST, HOWEVER, AND 00123000
  138. * THE MODE-NUMBER WAS GIVEN, THEN THE MODE-NUMBER IN 00124000
  139. * THE PARAMETER LIST MUST MATCH THE MODE-NUMBER IN THE 00125000
  140. * FST ENTRY. 00126000
  141. * 00127000
  142. * THUS, FOR EXAMPLE, A CALL TO DMSLFS FOR "SOME FILE 00128000
  143. * A5" WOULD CONSIDER "SOME FILE A1" 00129000
  144. * (ON THE A-DISK) A MATCH EVEN THOUGH THE MODE-NUMBER 00130000
  145. * IS WRONG. (THIS LOGIC IS PURPOSELY PROVIDED TO AVOID 00131000
  146. * MISLEADING THE USER, SINCE YOU CANNOT HAVE TWO FILES 00132000
  147. * ON THE SAME DISK WITH SAME FILENAME AND FILETYPE, BUT 00133000
  148. * DIFFERENT MODE NUMBERS.) A SEARCH FOR "* FILE A5", 00134000
  149. * HOWEVER, WOULD NOT CONSIDER "SOME FILE A1" TO MATCH, 00135000
  150. * SINCE THE MODE NUMBER DIFFERS. 00136000
  151. * 00137000
  152. * (NOTE - THIS LOGIC IS NOW CONSISTENT THROUGHOUT CMS. 00138000
  153. * THAT IS, IF THE FILENAME AND FILETYPE MATCH 00139000
  154. * EXPLICITLY, THE MODE NUMBER NEED NOT BE CORRECT FOR A 00140000
  155. * MATCH; BUT IF THE FILENAME AND/OR FILETYPE IS '*' AND 00141000
  156. * THE MODE-NUMBER IS GIVEN, THEN IT MUST EQUAL THE FST 00142000
  157. * MODE-NUMBER TO BE CONSIDERED A MATCH.) 00143000
  158. * 00144000
  159. * IF DMSLFS FINDS THE MATCHING FILE ON THE GIVEN DISK, 00145000
  160. * IT RETURNS THE ADDRESSES OF THE ACTIVE 00146000
  161. * DISK TABLE (ADT) AND THE FST ENTRY IN R0 AND R1 AS 00147000
  162. * SHOWN IN EXIT CONDITIONS, AND REMEMBERS WHERE IT 00148000
  163. * FOUND THE FILE IN THE ADTCHBA AND ADTCFST POINTERS IN 00149000
  164. * THE ADT BLOCK. 00150000
  165. * 00151000
  166. * FST ENTRY NOT FOUND ON THE DISK 00152000
  167. * 00153000
  168. * IF THE FST ENTRY WAS NOT FOUND ON THE DISK JUST 00154000
  169. * CHECKED, DMSLFS CHECKS THE MODE SUPPLIED IN THE 00155000
  170. * P-LIST. IF IT WAS '*' (OR EQUIVALENT), DMSLADN IS 00156000
  171. * CALLED AND THE NEXT 00157000
  172. * DISK (IF ANY) IS CHECKED AS ABOVE FOR THE MATCHING 00158000
  173. * FILE. 00159000
  174. * 00160000
  175. * IF THE MODE, ON THE OTHER HAND, WAS ALPHABETIC, 00161000
  176. * DMSLADN IS CALLED TO DETERMINE IF ANOTHER 00162000
  177. * DISK IS AVAILABLE FOR CHECKING. IF SO, THE ADTMX 00163000
  178. * EXTENSION-MODE-LETTER IS CHECKED TO SEE IF IT MATCHES 00164000
  179. * THE MODE GIVEN IN THE PARAMETER LIST. IF IT MATCHES, 00165000
  180. * THIS INDICATES THAT THE NEW DISK IS A READ-ONLY 00166000
  181. * EXTENSION OF THE ONE PREVIOUSLY CHECKED, AND THE 00167000
  182. * GIVEN FILE IS LOOKED UP ON THIS DISK. IF FOUND, 00168000
  183. * SUCCESSFUL RETURN IS GIVEN POINTING TO THIS DISK AND 00169000
  184. * THE FST ENTRY FOUND. IF NOT, THIS PROCESS IF 00170000
  185. * REPEATED UNTIL A MATCH IS FOUND, OR UNTIL NO MORE 00171000
  186. * DISK(S) WITH A MATCHING ADTMX LETTER ARE FOUND. 00172000
  187. * 00173000
  188. * DMSLFS (FSTLKP) 00174000
  189. * 00175000
  190. * SUBROUTINE: 00176000
  191. * 00177000
  192. * DMSLFSW (FSTLKW) 00178000
  193. * 00179000
  194. * FUNCTION: 00180000
  195. * 00181000
  196. * TO FIND A SPECIFIED 40-BYTE FST ENTRY WITHIN THE FST 00182000
  197. * TABLES FOR READ-WRITE 00183000
  198. * DISK(S); ALSO, TO FIND AN EMPTY 40-BYTE ENTRY FOR USE 00184000
  199. * BY DMSFNS. 00185000
  200. * 00186000
  201. * ATTRIBUTES: 00187000
  202. * 00188000
  203. * NUCLEUS RESIDENT, REENTRANT 00189000
  204. * 00190000
  205. * ENTRY CONDITIONS: 00191000
  206. * 00192000
  207. * L R15,AFSTLKW WHERE AFSTLKW=V(DMSLFSW) 00193000
  208. * BALR R14,R15 00194000
  209. * 00195000
  210. * 1. TO SEARCH APPROPRIATE DISK TABLE(S) FROM THE 00196000
  211. * BEGINNING: 00197000
  212. * 00198000
  213. * R0 = IMMATERIAL 00199000
  214. * R1 = POINTER TO USUAL P-LIST (WITH SIGN-BIT PLUS) 00200000
  215. * DS 0F 00201000
  216. * PLIST DC CL8' ' IMMATERIAL 00202000
  217. * DC CL8' ' FILENAME OR '*' 00203000
  218. * DC CL8' ' FILETYPE OR '*' 00204000
  219. * DC CL2' ' FILEMODE OR '*' 00205000
  220. * 00206000
  221. * 2. TO SEARCH APPROPRIATE DISK TABLE(S) PICKING UP 00207000
  222. * FROM WHERE YOU LEFT OFF PREVIOUSLY, STARTING 00208000
  223. * WITH NEXT 40-BYTE FST ENTRY: 00209000
  224. * 00210000
  225. * R0 = POINTER TO ACTIVE DISK TABLE 00211000
  226. * R1 = POINTER TO USUAL P-LIST BUT WITH SIGN-BIT NEGATIVE 00212000
  227. * 00213000
  228. * 3. TO FIND AN EMPTY 40-BYTE ENTRY FOR A COMPLETED NEW 00214000
  229. * OUTPUT FILE (CALLED ONLY BY 'FINIS') 00215000
  230. * 00216000
  231. * R0 = POINTER TO ACTIVE DISK TABLE 00217000
  232. * R1 = 0 00218000
  233. * 00219000
  234. * EXIT CONDITIONS: 00220000
  235. * 00221000
  236. * FILE FOUND: 00222000
  237. * 00223000
  238. * R0 = POINTER TO ACTIVE DISK TABLE 00224000
  239. * R1 = POINTER TO (ADDRESS OF) 40-BYTE FST ENTRY 00225000
  240. * FOUND OR PROVIDED 00226000
  241. * R15 = 0 (AND CONDITION-CODE = 0) 00227000
  242. * 00228000
  243. * FILE NOT FOUND: 00229000
  244. * 00230000
  245. * R0 = 0 00231000
  246. * R1 = 0 (WITH SIGN-BIT NEGATIVE) 00232000
  247. * R15 = 1 (AND CONDITION-CODE = 2) 00233000
  248. * 00234000
  249. * PARAMETER LIST ERROR: 00235000
  250. * 00236000
  251. * R0 = 0 00237000
  252. * R1 = 0 (WITH SIGN-BIT NEGATIVE) 00238000
  253. * R15 = 2 (AND CONDITION-CODE = 2) 00239000
  254. * 00240000
  255. * CALLS TO OTHER ROUTINES: 00241000
  256. * 00242000
  257. * DMSLAD, DMSLADN, DMSFREE 00243000
  258. * 00244000
  259. * EXTERNAL REFERENCES: 00245000
  260. * 00246000
  261. * ADTSECT, FVSECT 00247000
  262. * 00248000
  263. * TABLES/WORKAREAS: 00249000
  264. * 00250000
  265. * 808 BYTE HYPEBLOCK AREA 00251000
  266. * 00252000
  267. * REGISTER USAGE: 00253000
  268. * 00254000
  269. * R12 BASE 00255000
  270. * R13 FVSECT 00256000
  271. * REST WORK 00257000
  272. * 00258000
  273. * OPERATION: 00259000
  274. * 00260000
  275. * DMSLFSW CHECKS TO SEE IF R1 = 0, INDICATING A SPECIAL 00261000
  276. * ENTRY MADE BY DMSFNS TO FIND 00262000
  277. * AN EMPTY 40-BYTE FST ENTRY, OR THE REGULAR ENTRIES 00263000
  278. * MADE TO LOCATE A SPECIFIC FILE. 00264000
  279. * 00265000
  280. * IF R1 IS NONZERO, DMSLFSW CHECKS THE SPECIFIC 00266000
  281. * READ-WRITE DISK (IF THE MODE LETTER 00267000
  282. * WAS ALPHABETIC) OR ALL READ-WRITE DISKS (IF THE MODE 00268000
  283. * LETTER WAS '*' OR EQUIVALENT) 00269000
  284. * FOR THE GIVEN FILE. THIS SEARCH IS ALMOST IDENTICAL 00270000
  285. * TO THAT PERFORMED BY DMSLFS, 00271000
  286. * EXCEPT THAT ONLY READ-WRITE DISK(S) ARE EXAMINED, AND 00272000
  287. * READ-ONLY EXTENSION(S) VIA THE ADTMX MODE LETTER ARE 00273000
  288. * NOT APPLICABLE. (SEE FSTLKP DESCRIPTION FOR 00274000
  289. * DETAILS.) 00275000
  290. * 00276000
  291. * IF R1 = 0, THE LOCATION OF THE LAST FILE IS 00277000
  292. * DETERMINED FROM THE ADTLHBA AND ADTLFST POINTERS IN 00278000
  293. * THE GIVEN ACTIVE DISK TABLE. IF THE 40-BYTE ENTRY AT 00279000
  294. * THIS LOCATION IS EMPTY (=0), ITS ADDRESS IS RETURNED. 00280000
  295. * IF NOT, A CHECK IS MADE TO SEE IF THE NEXT 40-BYTE 00281000
  296. * ENTRY IN THE SAME IN-CORE HYPERBLOCK IS AVAILABLE; 00282000
  297. * IF YES, ITS ADDRESS IS RETURNED AND THE ADTLFST 00283000
  298. * POINTER UPDATED BY 40. IF NOT, THEN A NEW 808-BYTE 00284000
  299. * BLOCK IS OBTAINED FROM FREE STORAGE, CLEARED, CHAINED 00285000
  300. * TO THE END OF THE LAST FST HYPERBLOCK, ALL 00286000
  301. * APPROPRIATE POINTERS AND COUNTERS UPDATED, AND THE 00287000
  302. * ADDRESS OF THE FIRST 40-BYTE ENTRY IN THE NEW BLOCK 00288000
  303. * RETURNED TO THE CALLER. 00289000
  304. * 00290000
  305. * IN ANY EVENT, THE EMPTY 40-BYTE ENTRY IS MADE 00291000
  306. * AVAILABLE TO THE CALLER (DMSFNS), AND 00292000
  307. * ALL COUNTERS AND POINTERS UPDATED INSOFAR AS 00293000
  308. * NECESSARY. 00294000
  309. * 00295000
  310. * NOTE: DMSLFSW IS INCLUDED WITH THE DMSLFS ROUTINE. 00296000
  311. * 00297000
  312. *. 00298000
  313. EJECT 00299000
  314. DMSLFS CSECT 00300000
  315. USING NUCON,R0 00301000
  316. ENTRY TYPSRCH QUICK FILETYPE SEARCH SUBROUTINE 00302000
  317. ENTRY FSTLKP,FSTLKW ***** REMOVE ***** 00303000
  318. ENTRY DMSLFSO,DMSLFSOW,DMSLFSW 00304000
  319. SPACE 00305000
  320. USING *,R15 00306000
  321. B LKP 00307000
  322. SPACE 00308000
  323. * THE FOLLOWING IS POINTED TO BY AFSTLKP IN NUCON 00309000
  324. DMSLFSO EQU * 00310000
  325. FSTLKP EQU * 00311000
  326. SVCENT LKP,SVLFS 00312000
  327. SPACE 00313000
  328. * THE FOLLOWING IS POINTED TO BY AFSTLKW IN NUCON. 00314000
  329. DMSLFSOW EQU * 00315000
  330. FSTLKW EQU * 00316000
  331. SVCENT LKW,SVLFS 00317000
  332. * 00318000
  333. EXTRN FVS 00319000
  334. * 00320000
  335. * ENTER 'FSTLKP' HERE ... 00321000
  336. LKP EQU * 00322000
  337. FSENTR DISK$SEG USE FREE STORAGE AT BEGINNING OF DISK$SEG 00323000
  338. LA R10,ADTFRO+ADTFRW SET R10 FOR READ-ONLY OR READ-WRITE 00324000
  339. LA R12,FSTL00 SET R12 FOR COMMON ADDRESSABILITY 00325000
  340. USING FSTL00,R12 ... 00326000
  341. LTR R2,R1 SAVE R1 IN R2 AND SET CONDITION-CODE 00327000
  342. BNZ FSTL01 OK IF R1 WAS NONZERO, JOIN FORCES. 00328000
  343. B ERROR2 PARAMETER-LIST ERROR IF R1=0 FOR FSTLKP 00329000
  344. DROP R12,R13 00330000
  345. * 00331000
  346. DMSLFSW EQU * 00332000
  347. LKW EQU * 00333000
  348. FSENTR DISK$SEG 00334000
  349. FSTL00 EQU * (COMMON ADDRESSABILITY) 00335000
  350. LA R10,ADTFRW SET R10 FOR JUST READ-WRITE DISK(S) 00336000
  351. * (CMS AND OS/DOS DISKS) @VA14929 00336500
  352. LTR R2,R1 SAVE R1 IN R2 AND SET CONDITION-CODE 00337000
  353. BZ FINDZERO IF R1 = 0, GO FIND AN EMPTY ENTRY. 00338000
  354. * 00339000
  355. FSTL01 CLI PLTYP(R2),X'FF' FILENAME & TYPE MUST BE THERE 00340000
  356. BE ERROR2 PARAMETER-LIST ERROR IF FENCE INSTEAD. 00341000
  357. LR R11,R0 SAVE R0 IN R11 IN CASE NEEDED LATER 00342000
  358. SR R15,R15 CLEAR R15 00343000
  359. CLI PLTYP(R2),C'*' ALL FILETYPES WANTED ? 00344000
  360. BE JS1 TRF IF YES. 00345000
  361. LM R0,R1,PLTYP(R2) FILETYPE INTO R0-R1, 00346000
  362. LA R15,TYPSRCH CALL "TYPSRCH" TO SEE IF IT 00347000
  363. BALR R14,R15 IS A "POPULAR NAME BRAND" 00348000
  364. LR R1,R2 (RESTORE R1 - NEEDED BY ACTLKP BELOW) 00349000
  365. JS1 ST R15,REGSAV0 STORE 00 OR "INDEXED FLAG-BYTE". 00350000
  366. LA R9,FSTL40 SET 'SWITCH' FOR NO SPECIFIC MODE GIVEN 00351000
  367. CLI PLMOD(R2),C'A' CHECK MODE FOR A LETTER OF ALPHABET 00352000
  368. BL LESSA CAREFUL IF LESS THAN A 00353000
  369. CLI PLMOD(R2),C'Z' OR 00354000
  370. BH MOREZ MORE THAN Z 00355000
  371. L R15,=V(DMSLAD) SET R15 TO POINT TO ADTLKP 00356000
  372. CLI PLMOD+1(R2),C'0' IS THERE A MODE NO. (FROM 0 UP) ? 00357000
  373. BL FSTL02 BL IF NOT (PRESUMABLY BLANK) 00358000
  374. LA R9,FSTL38 IF YES (0 UP), SET SWITCH TO CHECK MODE-NO 00359000
  375. * 00360000
  376. FSTL02 LTR R2,R2 CHECK PARAMETER-LIST POINTER, 00361000
  377. BP FSTL04 IF PLUS, GO CALL ADTLKP 00362000
  378. USING ADTSECT,R11 REFERENCE ACTIVE DISK TABLE 00363000
  379. LM R4,R5,ADTCHBA R4 = A(CURRENT HYPERBLOCK), 00364000
  380. AR R5,R4 R5 NOW = A(CURRENT FST-ENTRY) 00365000
  381. B FSTL06 JOIN CODE BELOW. 00366000
  382. * 00367000
  383. FSTL03 TM ADTFLG1,*-* CHECK FOR READ-ONLY AND/OR READ-WRITE DISK 00368000
  384. * 00369000
  385. FSTL04 BALR R14,R15 CALL 'ADTLKP' (OR 'ADTNXT') 00370000
  386. BNZ NOTFOUND GIVE UP IF COULDN'T FIND DISK-TABLE 00371000
  387. LR R11,R1 IF OK, LET R11 POINT TO ACTIVE-DISK-TABLE 00372000
  388. FSTL04A SR R4,R4 R4=0 MEANS 'START AT BEGINNING' 00373000
  389. EX R10,FSTL03 CHECK FOR READ-ONLY AND/OR READ-WRITE DISK 00374000
  390. BNZ FSTL04B BRANCH IF ONE OF THE ABOVE @V201105 00375100
  391. TM ADTFLG2,ADTFROS IS THIS AN OS DISK? @V201105 00375150
  392. BNO FSTL23 NO, CONTINUE SEARCH @V201105 00375200
  393. CLC DISK$SEG+R14*4+1(3),VDMSSTTR+1 CALLED BY STT ? @V201105 00375250
  394. BNE FSTL23 CONTINUE SEARCH @V201105 00375300
  395. CH R10,=X'0020' IS R10 SET FOR JUST R/W DISKS ? @VA14929 00375310
  396. BNE FSTL04B NO - SKIP OS R/W SEARCH @VA14929 00375320
  397. CLI ADTFLG3,ADTFRWOS IS THIS AN OS R/W DISK ?? @VA14929 00375330
  398. BNE FSTL23 NO - CONTINUE SEARCH @VA14929 00375340
  399. FSTL04B EQU * @V201105 00375350
  400. CLI PLMOD(R2),ALLBUT WERE ALL DISKS BUT THIS ONE WANTED ? 00377000
  401. BE JS2 TRF IF YES - "ALLBUT" SPECIFIED. 00378000
  402. CLI ADTM,C'S' IS THIS THE S-DISK ? 00379000
  403. BE CKOPTN YES, CHECK SPECIAL OPTIONS @VA11527 00379100
  404. CLI ADTMX,C'S' IS IT EXTENSION OF S DISK @VA11527 00379200
  405. BNE FSTL06 TRF IF NOT - WE'RE ALL SET. 00380000
  406. CKOPTN EQU * @VA11527 00380100
  407. CLI PLMOD(R2),FIRSTUSR IF YES, WAS "FIRSTUSR" WANTED ? 00381000
  408. BE FSTL23 YES, SKIP 'S' DISK SEARCH @VA11527 00382000
  409. CLC ALLUSERD,PLMOD(R2) OR "ALL USER DISKS" ? 00383000
  410. BNE FSTL06 TRF IF NOT - GO SEARCH S-DISK. 00384000
  411. B FSTL23 YES, SKIP 'S' DISK SEARCH @VA11527 00385000
  412. * 00386000
  413. JS2 CLC ADTM,PLMOD+1(R2) FOR "ALLBUT" IS THIS THE 00387000
  414. BE FSTL23 FORBIDDEN DISK - SKIP IT IF YES. 00388000
  415. * 00389000
  416. FSTL06 TM ADTFLG2,ADTFROS OS ADT @V201105 00390010
  417. BNO FSTL06A NO @V201105 00390020
  418. L R15,ADMSROS CALLL DMSROS TO SEARCH OS DISK @V201105 00390030
  419. BAL R14,4(R15) SECOND ENTRY POINT IN DMSROS @V201105 00390040
  420. CH R15,=H'88' DATA SET NOT FOUND @V201105 00390050
  421. BE FSTL23 YES, TIME FOR ANOTHER ADT @V201105 00390060
  422. LTR R15,R15 OTHER ERROR @V201105 00390070
  423. BNZ FSTL41A YES @V201105 00390080
  424. LR R1,R5 OS FST ADDR TO R1 @V201105 00390090
  425. B FSTL41 FOUND @V201105 00390100
  426. FSTL06A L R15,REGSAV0 CHECK SPECIAL INDEX FLAG BYTE @V201105 00390110
  427. LTR R15,R15 ... 00391000
  428. BZ FSTL07 IF = 0, WE'LL HAVE TO CHECK THIS DISK. 00392000
  429. TM ADTFLG2,ADTPSTM FST CHAIN MODIFIED BY AUX DIR @VA05274 00392065
  430. BO FSTL07 YES, HAVE TO DO FRUITFUL SEARCH @VA05274 00392130
  431. N R15,ADTFTYP-3 DOES THIS DISK HAVE A MATCHING FILETYPE? 00393000
  432. BZ FSTL20 TRF IF NOT (SAVE TIME OF FRUITLESS SEARCH) 00394000
  433. FSTL07 LA R6,40 40 INTO R6 FOR GENERAL USE 00395000
  434. LM R0,R1,PLNAM(R2) FILENAME INTO R0-R1, 00396000
  435. L R3,ADTFDA GET ADDRESS OF FIRST HYPERBLOCK @V305032 00397250
  436. L R8,FOUR(,R3) AND SIZE OF BLOCK (E.G. 800) @V305032 00397500
  437. SR R8,R6 LESS 40 = LIMIT FOR BXLE @V305032 00397750
  438. ST R8,REGSAV0+FOUR SAVE R8 IN LOW-LEVEL SAVE AREA @V305032 00398000
  439. CLI PLNAM(R2),C'*' IS NAME '*' MEANING ACCEPT ANY ? 00399000
  440. BE FSTL08 YES - GO CHECK FILETYPE ALSO @V305032 00400200
  441. LA R15,FSTL16 NO - SET R15 TO CHECK FILENAME @V305032 00400400
  442. CLI PLTYP(R2),STAR WAS "ANY" FILETYPE ACCEPTABLE ? @V305032 00400600
  443. BE FSTL09 YES - GO SET R14 ACCORDINGLY. @V305032 00400800
  444. * FILENAME AND FILETYPE ARE BOTH SPECIFIC: 00401000
  445. LA R14,FSTL18 SET R14 TO CHECK FILETYPE @V305032 00401200
  446. TM ADTFLG3,ADTFSORT ARE FST'S ON THE DISK SORTED ? @V305032 00401400
  447. BZ FSTL10 NO - DO IT "THE OLD WAY" @V305032 00401600
  448. TM ADTFLG2,ADTPSTM FST CHAIN MODIFIED BY AUX. DIR.@VA04896 00401665
  449. BO FSTL10 YES, HAVE TO DO IT THE OLD WAY @VA04896 00401730
  450. LTR R4,R4 STARTING AT BEGINNING ? @V305032 00401800
  451. BZ FSTLFAST YES - OK TO USE FAST SEARCH. @V305032 00402000
  452. B FSTL11 NO - PICK UP WHERE WE LEFT OFF. @V305032 00402200
  453. SPACE 00402400
  454. * FILENAME = '*' - CHECK FILETYPE: 00402600
  455. FSTL08 LA R15,FSTL18 SET R15 TO ACCEPT ANY FILENAME @V305032 00402800
  456. CLI PLTYP(R2),STAR IS FILETYPE ALSO '*' = "ANY" ? @V305032 00403000
  457. BNE FSTL10 NO - R15 OK; R14 IMMATERIAL. @V305032 00403200
  458. * FILENAME AND FILETYPE ARE BOTH '*': 00403400
  459. LA R15,FSTL36 SET R15 FOR ANY FILENAME & TYPE @V305032 00403600
  460. B FSTL10 (R14 IS IMMATERIAL) GO CHECK R4. @V305032 00403800
  461. * FILENAME = SPECIFIC, BUT FILETYPE = '*': 00404000
  462. FSTL09 LA R14,FSTL36 SET R14 TO ACCEPT ANY FILETYPE @V305032 00404200
  463. FSTL10 EQU * CONTINUE (R14 & R15 ALL SET): @V305032 00404400
  464. LTR R4,R4 START AT BEGINNING OR WHERE WE LEFT OFF ? 00409000
  465. BZ FSTL12 BZ IF START AT BEGINNING. 00410000
  466. FSTL11 LA R7,0(R4,R8) R4 + R8 INTO R7 FOR BXLE-LIMIT, @V305032 00411100
  467. SR R8,R8 R8=0 (TO CHECK FOR NULL FILE) 00412000
  468. LA R3,BXLE56 SET R3 FOR BCR'S IN LOOP, AND JUMP INTO 00413000
  469. BR R3 LOOP AT BXLE56 TO START WITH 'NEXT' ENTRY 00414000
  470. * 00415000
  471. DS 0D (FORCE MAIN SEARCH LOOP DBL-WORD ALIGNED) 00416000
  472. * 00417000
  473. FSTL12 LA R5,8(,R3) START AT BEGINNING OF INFORMATION 00418000
  474. FSTL13 LR R4,R5 REMEMBER BEGINNING OF CURRENT BLOCK 00419000
  475. LA R7,0(R5,R8) R7 POINTS TO LAST ITEM. 00420000
  476. SR R8,R8 R8=0 (TO CHECK FOR NULL FILE) 00421000
  477. LA R3,BXLE56 SET R3 FOR BCR'S IN LOOP. 00422000
  478. * 00423000
  479. * MAIN SEARCH-LOOP ... 00424000
  480. FSTL15 C R8,0(,R5) IS NAME = 0 (NULL FILE) ? 00425000
  481. BCR 8,R3 'BE BXLE56' IF YES (FORGET THIS ONE). 00426000
  482. BR R15 ACCEPT NAME IF '*' WAS GIVEN, OR ... 00427000
  483. FSTL16 CL R0,0(,R5) DOES NAME (1ST HALF) MATCH ? 00428000
  484. BCR 7,R3 TRF TO BXLE56 IF NOT. 00429000
  485. CL R1,4(,R5) IF YES, DOES 2ND HALF OF NAME MATCH ? 00430000
  486. BCR 7,R3 'BNE BXLE56' IF NOT. 00431000
  487. FSTL17 BR R14 GO TO FSTL36 IF '*' WAS GIVEN, OR ... 00432000
  488. FSTL18 CLC PLTYP(8,R2),8(R5) DOES TYPE MATCH ? 00433000
  489. BE FSTL34 IF YES, WE'VE FOUND IT. 00434000
  490. BXLE56 BXLE R5,R6,FSTL15 ITERATE THRU CURRENT HYPERBLOCK 00435000
  491. LM R3,R4,0(R5) GET POINTER TO NEW HYPERBLOCK & NEXT WORD 00436000
  492. LTR R5,R3 (ALSO IN R5) AND CHECK ITS EXISTENCE 00437000
  493. BZ FSTL20 BZ IF NO MORE HYPERBLOCKS FOR THIS DISK. 00438000
  494. L R8,REGSAV0+4 RESTORE R8 (WE NEED IT AT FSTL13) 00439000
  495. TM ADTFLG1,ADTFFSTV ARE THEY VARIABLE LENGTH (SSTAT) ? 00440000
  496. BZ FSTL13 IF NOT, START WITH NEXT BLOCK FORTHWITH. 00441000
  497. FSTL19 L R8,FOUR(,R5) IF YES (SSTAT), GET NEW SIZE, @V305032 00442100
  498. SR R8,R6 (SUBTRACTING 40 FOR LAST ITEM FOR BXLE) 00443000
  499. LTR R4,R4 IS "STATEXT+4" = 0 ? 00444000
  500. BNP FSTL12 IF YES, SEARCH SSTAT-EXTENSIONS ON THIS DISK. 00445000
  501. LR R11,R4 BUT IF > 0, RESUME SEARCH WITH GIVEN DISK! 00446000
  502. B FSTL12 LET CODE AT FSTL12 ADD 8, ETC. 00447000
  503. * 00448000
  504. * IF MODE IS LESS THAN CHARACTER 'A' ... 00449000
  505. LESSA LA R14,FSTL05 (FOR BCR'S TO SAVE SPACE) 00450000
  506. CLI PLMOD(R2),00 00 IS ACCEPTABLE 00451000
  507. BCR 8,R14 'BE' IF 00 00452000
  508. CLI PLMOD(R2),C'*' ASTERISK ALSO OK 00453000
  509. BCR 8,R14 'BE' IF '*' 00454000
  510. CLI PLMOD(R2),C' ' BLANK ALSO OK 00455000
  511. BCR 8,R14 'BE' IF A BLANK 00456000
  512. CLI PLMOD(R2),ALLBUT ALLOW "ALLBUT" CHARACTER JS 00457000
  513. BCR 8,R14 ... 00458000
  514. CLI PLMOD(R2),C'(' LEFT PAREN OK DL 00459000
  515. BCR 8,R14 BE IF '(' DL 00460000
  516. ERROR2 EQU * ANYTHING ELSE = PARAMETER-LIST ERROR 00461000
  517. LA R15,2 MAKE THAT ERROR 2, AND 00462000
  518. B SR00 GO EXIT ON ERROR-RETURN. 00463000
  519. * 00464000
  520. MOREZ CLI PLMOD(R2),X'FF' IF MORE THAN Z, MUST BE X'FF' 00465000
  521. BE FSTL05 ... 00466000
  522. CLI PLMOD(R2),FIRSTUSR OR ALLOW "FIRSTUSR" CHARACTER JS 00467000
  523. BNE ERROR2 ERROR IF OTHERWISE. 00468000
  524. * 00469000
  525. FSTL05 SR R1,R1 START WITH FIRST ADT TABLE, 00470000
  526. L R15,=V(DMSLADN) SET R15 -> ADTNXT INSTEAD OF ADTLKP 00471000
  527. B FSTL02 NOW GO CHECK PARAMETER-LIST-POINTER. 00472000
  528. * 00473000
  529. * FILE-TYPE MATCHES EXPLICITLY ... 00474000
  530. FSTL34 CLI PLNAM(R2),C'*' WAS 'ANY' FILE-NAME WANTED ? 00475000
  531. BNE FSTL40 IF NOT, MATCH OF NAME & TYPE IS ENOUGH. 00476000
  532. FSTL36 EQU * IF NAME AND/OR TYPE WAS '*', CHECK MODE IF GIVEN 00477000
  533. BR R9 ACCEPT FILE IF MODE WASN'T GIVEN, OR 00478000
  534. FSTL38 CLC 25(1,R5),PLMOD+1(R2) DOES MODE-NUMBER MATCH P-LIST ? 00479000
  535. BCR 7,R3 'BNE BXLE56' IF IT DOES NOT. 00480000
  536. * 00481000
  537. * SUCCESS - WE FOUND DESIRED 40-BYTE ITEM. 00482000
  538. FSTL40 LR R1,R5 R1 = POINTER TO DESIRED 40-BYTE ITEM, 00483000
  539. SR R5,R4 DISPLACEMENT OF CURRENT ITEM, 00484000
  540. STM R4,R5,ADTCHBA STORE INFORMATION IN CASE RE-ENTERED 00485000
  541. FSTL41 LR R0,R11 R0 = POINTER TO ACTIVE DISK TABLE 00486000
  542. SR R15,R15 CLEAR RETURN CODE (& C.C.) 00487000
  543. FSTL41A LM R2,R14,GPR2 RETORE REGS 2-14 @V201105 00488100
  544. BR R14 AND RETURN TO CALLER. 00489000
  545. EJECT 00490000
  546. * COMES HERE IF FILE NOT FOUND ON A LOGGED-IN DISK: 00491000
  547. * 00492000
  548. FSTL20 DS 0H IF DESIRED 40-BYTE ITEM NOT FOUND IN CORE 00493000
  549. CLI PLMOD(R2),FIRSTUSR WAS "FIRST USER DISK" SPECIFIED ? 00494000
  550. BE NOTFOUND TRF IF YES - QUIT SEARCHING. 00495000
  551. LR R1,R11 START WITH PREVIOUS TABLE, 00496000
  552. FSTL23 L R15,=V(DMSLADN) CALL ADTNXT TO CHECK NEXT TABLE 00497000
  553. BALR R14,R15 ... 00498000
  554. BNZ NOTFOUND GIVE UP IF NO MORE TABLES 00499000
  555. LR R11,R1 IF OK, LET R11 POINT TO ACTIVE-DISK-TABLE 00500000
  556. CLI PLMOD(R2),C'A' WAS MODE SPECIFIED ? 00501000
  557. BL FSTL04A IF NOT, TRY THIS TABLE 00502000
  558. CLI PLMOD(R2),C'Z' (ALSO CHECK FOR > Z) 00503000
  559. BH FSTL04A ... 00504000
  560. CLC PLMOD+1(1,R2),PLMOD(R2) IS IT A "DOUBLE-LETTER" MODE ? 00505000
  561. BE NOTFOUND TRF IF YES - QUIT SEARCHING. 00506000
  562. CLC ADTMX,PLMOD(R2) IS IT AN EXTENSION ? 00507000
  563. BE FSTL04A WORTH TRYING IF YES 00508000
  564. BNE FSTL23 IF NOT, TRY NEXT TABLE (R1 ALREADY SET). 00509000
  565. SPACE 3 00510000
  566. * SPECIAL CONSTANTS AND EQUATES FOR DEFINING DISK-SEARCHING: 00511000
  567. * 00512000
  568. ALLUSERD DC C'*U' = "ALL USER DISKS" (FSTLKP) 00513000
  569. * OR "ALL READ-WRITE DISKS" (FSTLKW) 00514000
  570. * 00515000
  571. FIRSTUSR EQU C'1' = "FIRST USER DISK" (FSTLKP) 00516000
  572. * OR "FIRST READ-WRITE DISK" (FSTLKW) 00517000
  573. * 00518000
  574. ALLBUT EQU C'-' = "ALL DISKS EXECPT THIS ONE" 00519000
  575. * E.G. "-S" MEANS ALL DISKS EXCEPT S-DISK 00520000
  576. EJECT 00521000
  577. FINDZERO LR R11,R0 ACCESS ACTIVE DISK TABLE 00522000
  578. LA R5,1 GET A '1', 00523000
  579. LM R2,R3,ADTLHBA ACCESS LAST BLOCK AND ITEM 00524000
  580. AR R3,R2 ADDRESS OF LAST ITEM 00525000
  581. CL R1,0(,R3) IS IT EMPTY (E.G. FROM PREVIOUS ERASE) 00526000
  582. BE LR13 BE (BZ) IF YES, WE'RE ALL SET TO EXIT. 00527000
  583. LA R4,800(,R2) POINT R4 TO END OF BLOCK 00528000
  584. LA R3,40(,R3) ADVANCE 40 BYTES TO NEXT ITEM, 00529000
  585. CR R3,R4 ARE WE STILL WITHIN BLOCK ? 00530000
  586. BL LR13 BL IF YES, GOOD SHOW. 00531000
  587. DMSFREE DWORDS=101,TYPCALL=BALR,TYPE=NUCLEUS GET 800 BYTES 00532000
  588. LR R3,R1 REFERENCE IT VIA R3, 00533000
  589. XC 0(208,R3),0(R3) CLEAR 804 BYTES IN SAME 00534000
  590. MVC 208(200,R3),0(R3) ... 00535000
  591. MVC 408(200,R3),0(R3) ... 00536000
  592. MVC 608(196,R3),0(R3) ... 00537000
  593. ST R3,800(,R2) STORE POINTER TO THIS BLOCK IN OLD BLOCK, 00538000
  594. ST R2,804(,R3) AND BACKPOINTER TO OLD BLOCK IN THIS ONE. 00539000
  595. L R2,ADTHBCT ADD 1 TO FST HYPERBLOCK COUNT 00540000
  596. AR R2,R5 ... 00541000
  597. ST R2,ADTHBCT AND REPLACE. 00542000
  598. LH R2,ADTRES ADD 1 TO 00543000
  599. AR R2,R5 RESERVE-COUNT 00544000
  600. STH R2,ADTRES AND REPLACE 00545000
  601. LR R2,R3 R2 AND R3 POINT TO NEW BLOCK 00546000
  602. LR13 LR R1,R3 POINTER TO EMPTY ITEM INTO R1, 00547000
  603. SR R3,R2 R3 A DISPLACEMENT 00548000
  604. STM R2,R3,ADTLHBA STORE NEW LAST-BLOCK & ITEM INFO. 00549000
  605. * 00550000
  606. * INCREMENTING OF ADTFSTC (NO. OF FILES) REMOVED FROM HERE AND 00551000
  607. * PUT INTO WRBUF. NEEDS TO BE THERE IF ERASE IS TO DO THE RIGHT 00552000
  608. * THING WITH OPEN FILES. OTHERWISE ERASING OPEN FILES DECREMENTS 00553000
  609. * THE COUNT INDEFINITELY UNTIL EVENTUALLY WRBUF COMPLAINS. 00554000
  610. * 00555000
  611. B FSTL41 AND GO EXIT WITH R0 & R1 ALL SET UP. 00556000
  612. SPACE 3 00557000
  613. NOTFOUND LA R15,1 ERROR 1 = DISK-TABLE OR FILE NOT FOUND... 00558000
  614. SR00 SR R0,R0 CLEAR R0 00559000
  615. L R1,SB ZERO WITH SIGN-BIT ON INTO R1, 00560000
  616. LM R2,R14,GPR2 RESTORE R2 THRU R14, 00561000
  617. LTR R15,R15 SET CONDITION-CODE FOR CONVENIENCE OF CALLER 00562000
  618. BR R14 AND RETURN TO CALLER. 00563000
  619. EJECT 00566000
  620. *********************************************************************** 00567000
  621. * 00568000
  622. * "TYPSRCH" 00569000
  623. * 00570000
  624. * QUICK FILETYPE SEARCH SUBROUTINE 00571000
  625. * 00572000
  626. * CHECKS FILETYPE TO DETERMINE IF IT IS 00573000
  627. * ONE OF UP TO EIGHT HEAVILY USED FILETYPES. 00574000
  628. * IF SO, EXITS WITH INDEXED FLAG-BYTE. 00575000
  629. * 00576000
  630. * (CALLED BY FSTLKP, FINIS, READFST, & ALTER) 00577000
  631. * 00578000
  632. * CALLING SEQUENCE: 00579000
  633. * 00580000
  634. * R0-R1 (TOGETHER) HOLD FILETYPE 00581000
  635. * R13 = V(FVS) SAVE AREA 00582000
  636. * R15 = V(TYPSRCH) 00583000
  637. * 00584000
  638. * BALR R14,R15 00585000
  639. * 00586000
  640. * EXIT CONDITIONS: 00587000
  641. * 00588000
  642. * FILETYPE NOT FOUND IN TABLE: 00589000
  643. * R15 = 0 (AND CONDITION-CODE = 0) 00590000
  644. * 00591000
  645. * FILETYPE WAS FOUND IN TABLE: 00592000
  646. * R15 (BITS 24-31) HOLDS INDEXER TO WHICH FILETYPE FOUND 00593000
  647. * (I.E. = X'80', OR X'40', OR X'20', ETC.) 00594000
  648. * 00595000
  649. *********************************************************************** 00596000
  650. * 00597000
  651. USING *,R15 ADDRESSABILITY 00598000
  652. USING FVSECT,R13 (MUST BE IN EFFECT) 00599000
  653. TYPSRCH STM R3,R5,REGSAV0+12 SAVE R3-R5 IN LOW-LEVEL SAVE-AREA 00600000
  654. SR R3,R3 INITIALIZE R3-R4-R5 FOR BXLE LOOP 00601000
  655. LA R4,8 ... 00602000
  656. LA R5,(AFTRLAST-8-TYPTABLE) 00603000
  657. * 00604000
  658. CHKTYLP CL R0,TYPTABLE(R3) CHECK FILETYPE AGAINST TABLE 00605000
  659. BE CHEK2ND TRF IF AN APPARENT MATCH. 00606000
  660. BXLE R3,R4,CHKTYLP ITERATE LOOP 00607000
  661. * 00608000
  662. NTFND SR R5,R5 RETURN-CODE WILL = 0. 00609000
  663. * 00610000
  664. LTR155 LTR R15,R5 RETURN-CODE (0 OR FLAG) INTO R15, 00611000
  665. LM R3,R5,REGSAV0+12 RESTORE R3-R5 00612000
  666. BR R14 RETURN TO CALLER. 00613000
  667. * 00614000
  668. CHEK2ND CL R1,TYPTABLE+4(R3) CHECK 2ND HALF 00615000
  669. BNE NTFND IF NO MATCH, FORGET IT. 00616000
  670. SRL R3,3 DIVIDE TABLE-INDEXER BY 8, 00617000
  671. LA R5,X'80' START WITH X'80' 00618000
  672. SRL R5,0(R3) SHIFT 0, 1, .. , 7 PLACES 00619000
  673. B LTR155 GO PLACE R5 IN R15 AND EXIT. 00620000
  674. * 00621000
  675. TYPTABLE DS 0F TABLE OF HEAVILY USED FILETYPES (NO MORE THAN 8 !) 00622000
  676. DC CL8'EXEC' 1ST 00623000
  677. DC CL8'MODULE' 2ND 00624000
  678. DC CL8'MACLIB' ETC. 00625000
  679. DC CL8'TXTLIB' ... 00626000
  680. DC CL8'TEXT' 00627000
  681. DC CL8'ASSEMBLE' 00628000
  682. DC CL8'FORTRAN' 00629000
  683. DC CL8'PLI' 8TH (AND LAST). 00630000
  684. * 00631000
  685. * 00632000
  686. AFTRLAST EQU * (KEEP AFTER THE LAST ONE !!!) 00633000
  687. SPACE 00634100
  688. DROP R15 REVERT TO R12 ADDRESSABILITY @V305032 00635100
  689. EJECT 00636100
  690. * FILENAME AND FILETYPE ARE BOTH SPECIFIC; DISK IS ALL "SORTED", 00637100
  691. * AND WE'RE "STARTING AT THE BEGINNING" (R4 = 0): 00638100
  692. SPACE 00639100
  693. * ENTRY CONDITIONS: 00640100
  694. * R0-R1 HOLD FILENAME 00641100
  695. * R2 HOLDS POINTER TO ORIGINAL P-LIST 00642100
  696. * R3 = ADDRESS OF FIRST HYPERBLOCK 00643100
  697. * R4 = 0 00644100
  698. * R8 = SIZE OF <FIRST> BLOCK MINUS 40 00645100
  699. * R6 = 40 00646100
  700. SPACE 00647100
  701. * NOTE: SUPPORT CODE FOR THIS SECTION = @V305032 00648100
  702. SPACE 00649100
  703. FSTLFAST DS 0H DO A "FAST" SEARCH: @V305032 00650100
  704. LR R5,R8 BLOCK SIZE -40 INTO R5 WHERE NEEDED, @V305032 00651100
  705. STM R2,R5,REGSAV0+EIGHT SAVE R2 THRU R5 @V305032 00652100
  706. LA R4,EIGHT(,R3) LET R4 POINT TO 1ST BLOCK OF FSTS@V305032 00653100
  707. LM R2,R3,PLTYP(R2) GET FILETYPE INTO R2-R3 @V305032 00654100
  708. LA R14,FSTL51 SET R14 TO "GET THE NEXT BLOCK" @V305032 00655100
  709. LA R15,FSTL55 SET R15 TO "IN THE RIGHT BLOCK" @V305032 00656100
  710. TM ADTFLG1,ADTFFSTV VARIABLE LENGTH (E.G. "SSTAT") @V305032 00657100
  711. BOR R15 YES - GO TO FSTL55 TO LOOK AT 1 BLK. @V305032 00658100
  712. L R7,ADTHBCT NO - GET FST HYPERBLOCK COUNT @V305032 00659100
  713. BCT R7,FSTL50 LESS ONE & BRANCH IF THERE ARE > ONE @V305032 00660100
  714. B FSTL52 HANDLE ONE HYPERBLOCK AS IF THE LAST. @V305032 00661100
  715. SPACE 00662100
  716. DS 0D SEARCH ALL HYPERBLOCKS BUT THE LAST: @V305032 00663100
  717. * TIGHT LOOP TO NARROW THE FST DOWN TO THE RIGHT HYPERBLOCK: 00664100
  718. FSTL50 CL R0,FN1(R4,R5) CHECK FILENAME AGAINST LAST FST @V305032 00665100
  719. BNH FSTL60 IF NOT HIGH, CHECK FURTHER. @V305032 00666100
  720. FSTL51 L R4,FORTY(R4,R5) IF "HIGH", GET NEXT HYPERBLOCK @V305032 00667100
  721. BCT R7,FSTL50 AND KEEP LOOKING. @V305032 00668100
  722. * 00669100
  723. FSTL52 EQU * HANDLE LAST (OR ONLY) HYPERBLOCK: @V305032 00670100
  724. L R5,ADTLFST GET DISP. OF LAST FST IN LAST @V305032 00671100
  725. * HYPERBLOCK. CONTINUE ... 00672100
  726. SPACE 00673100
  727. * WE HAVE FOUND THE RIGHT BLOCK (OR THIS IS THE LAST OR ONLY BLOCK): 00674100
  728. FSTL55 AR R5,R6 TOTAL BLOCK SIZE INTO R5, @V305032 00675100
  729. BAL R8,BINSERCH TRY TO FIND THE FST ENTRY @V305032 00676100
  730. * RETURNS IF NOT FOUND ... 00677100
  731. LM R2,R5,REGSAV0+EIGHT RESTORE R2 THRU R5 @V305032 00678100
  732. TM ADTFLG1,ADTFFSTV VARIABLE LENGTH (E.G. "SSTAT")?@V305032 00679100
  733. BZ FSTL20 IF NOT, TRY NEXT DISK (IF ANY). @V305032 00680100
  734. LA R5,FORTY8(R3,R5) POINT TO END OF <SSTAT> BLOCK, @V305032 00681100
  735. LM R3,R4,0(R5) PNTRS TO NEW HYPERBLOCK & NEXT WORD @V305032 00682100
  736. LTR R5,R3 (ALSO IN R5) AND CHECK ITS EXISTENCE @V305032 00683100
  737. BZ FSTL20 IF 0, NO MORE HYPERBLOCKS FOR THIS DISK @V305032 00684100
  738. LA R15,FSTL16 SET R15 AND R14 AGAIN @V305032 00685100
  739. LA R14,FSTL18 (AS NEEDED), @V305032 00686100
  740. LA R6,FORTY RESTORE R6=40, AND @V305032 00687100
  741. B FSTL19 GO CHECK EXTENSION TO "SSTAT". @V305032 00688100
  742. EJECT 00689100
  743. * FST MAY POSSIBLY BE LOCATED IN THIS BLOCK: 00690100
  744. FSTL60 BLR R15 IF LESS, IT'S THE RIGHT BLOCK. @V305032 00691100
  745. CL R1,FN2(R4,R5) IF =, CHECK 2ND HALF OF FILENAME @V305032 00692100
  746. BLR R15 IF LESS, IT'S THE RIGHT BLOCK. @V305032 00693100
  747. BHR R14 IF MORE, GET THE NEXT BLOCK. @V305032 00694100
  748. CL R2,FT1(R4,R5) IF =, CHECK 1ST HALF OF FILETYPE @V305032 00695100
  749. BLR R15 IF LESS, IT'S THE RIGHT BLOCK. @V305032 00696100
  750. BHR R14 IF MORE, GET THE NEXT BLOCK. @V305032 00697100
  751. CL R3,FT2(R4,R5) IF =, CHECK 2ND HALF OF FILETYPE @V305032 00698100
  752. BLR R15 IF LESS, IT'S THE RIGHT BLOCK. @V305032 00699100
  753. BHR R14 IF MORE, GET THE NEXT BLOCK. @V305032 00700100
  754. LA R1,0(R4,R5) IF MATCH, RETURN ADDR OF FST ENTRY @V305032 00701100
  755. STM R4,R5,ADTCHBA STORE ADDRESS & DISP. IN CASE @V305032 00702100
  756. B FSTL41 RE-ENTERED AND "GO EXIT". @V305032 00703100
  757. SPACE 2 00704100
  758. * NEEDED EQUATES: 00705100
  759. STAR EQU C'*' ASTERISK MEANS 'ALL' @V305032 00706100
  760. ONE EQU 1 @V305032 00707100
  761. FOUR EQU 4 @V305032 00708100
  762. EIGHT EQU 8 @V305032 00709100
  763. FORTY EQU 40 LENGTH OF ONE FST ENTRY @V305032 00710100
  764. FORTY8 EQU 48 ABOVE + 8 @V305032 00711100
  765. FN1 EQU 0 1ST HALF OF FILENAME @V305032 00712100
  766. FN2 EQU 4 2ND HALF OF FILENAME @V305032 00713100
  767. FT1 EQU 8 1ST HALF OF FILETYPE @V305032 00714100
  768. FT2 EQU 12 2ND HALF OF FILETYPE @V305032 00715100
  769. EJECT 00716100
  770. * BINSERCH = BINARY SEARCH INTERNAL SUBROUTINE 00717100
  771. SPACE 00718100
  772. * ENTRY CONDITIONS: 00719100
  773. * R0-R1 HOLD FILENAME 00720100
  774. * R2-R3 HOLD FILETYPE 00721100
  775. * R4 = ADDRESS OF BLOCK TO BE SEARCHED 00722100
  776. * R5 = SIZE OF BLOCK TO BE SEARCHED (IN BYTES) 00723100
  777. * R8 = RETURN REGISTER 00724100
  778. SPACE 00725100
  779. * INTERNAL REGISTER USAGE 00726100
  780. * R0-R1 HOLD FILENAME 00727100
  781. * R2-R3 HOLD FILETYPE 00728100
  782. * R4 = ADDRESS OF BEGINNING OF BLOCK 00729100
  783. * R5 = "INDEXER" FOR SEARCHING THE BLOCK 00730100
  784. * R6 = "ADJUSTER" FOR BINARY SEARCH TECHNIQUE 00731100
  785. * R7 = COUNTER FOR BINARY SEARCH LOOP 00732100
  786. * R14 & R15 USED FOR WORK REGISTERS 00733100
  787. SPACE 00734100
  788. * EXIT CONDITIONS: 00735100
  789. * IF FILE WAS FOUND: 00736100
  790. * R1 HOLDS ADDRESS OF FST ENTRY FOUND 00737100
  791. * ADDRESS & DISPLACEMENT OF FST STORED IN ADTCHBA/ADTCFST 00738100
  792. * EXITS VIA CODE AT FSTL41. 00739100
  793. * IF FILE WAS NOT FOUND: 00740100
  794. * RETURNS VIA R8. 00741100
  795. * R0-R4 STILL INTACT 00742100
  796. * R5-R7 AND R14-R15 NOT PRESERVED 00743100
  797. SPACE 00744100
  798. * NOTE: SUPPORT CODE FOR THIS SUBROUTINE = @V305032 00745100
  799. SPACE 00746100
  800. DS 0D @V305032 00747100
  801. BINSERCH C R5,=F'800' BLOCK SIZE PERCHANCE = 800 ? @V305032 00748100
  802. BE BINSUB2 YES (QUITE LIKELY) - SET DEFAULTS@V305032 00749100
  803. LA R6,FORTY NO - START WITH ADJUSTER = FST SIZE, @V305032 00750100
  804. SR R7,R7 CLEAR "NUMBER OF TRIES" COUNTER @V305032 00751100
  805. LA R15,ONE NEED A "1" AVAILABLE @V305032 00752100
  806. BINSUB1 AR R6,R6 DOUBLE THE ADJUSTER @V305032 00753100
  807. AR R7,R15 INCREMENT "NUMBER OF TRIES" COUNTER @V305032 00754100
  808. CR R6,R5 COMPARE WITH BLOCK SIZE @V305032 00755100
  809. BNH BINSUB1 ITERATE LOOP UNTIL IT IS GREATER.@V305032 00756100
  810. SRL R6,ONE THEN HALVE THE ADJUSTER, @V305032 00757100
  811. SR R5,R6 INDEXER = BLOCK SIZE MINUS ADJUSTER @V305032 00758100
  812. SRL R6,ONE HALVE THE ADJUSTER ONCE MORE @V305032 00759100
  813. B BINSUB3 FINISH INITIALIZATION & START SEARCH @V305032 00760100
  814. SPACE 00761100
  815. * SET R5/R6/R7 FOR (DEFAULT) BLOCK SIZE OF 800 BYTES: 00762100
  816. CNOP 4,8 (DBL-WORD ALIGN BINARY SEARCH LOOP) @V305032 00763100
  817. BINSUB2 LA R5,ONESIXTY SET INDEXER = 160,, @V305032 00764100
  818. LA R6,THREE20 ADJUSTER = 320, AND @V305032 00765100
  819. LA R7,NUMTRIES "NUMBER OF TRIES" COUNTER = 5; @V305032 00766100
  820. * CONTINUE TO BINSUB3 ... 00767100
  821. EJECT 00768100
  822. BINSUB3 LA R14,BINSUB5 SET R14 TO TRANSFER IF "TOO LOW" @V305032 00769100
  823. LA R15,BINSUB4 SET R15 TO TRANSFER IF "TOO HIGH"@V305032 00770100
  824. SPACE 00771100
  825. * FAST "BINARY SEARCH LOOP" TO FIND DESIRED FST IN BLOCK (IF IT EXISTS) 00772100
  826. BINSUBLP CL R0,FN1(R4,R5) COMPARE FIRST HALF OF FILENAME @V305032 00773100
  827. BLR R14 TRANSFER IF "TOO LOW" IN BLOCK @V305032 00774100
  828. BHR R15 TRANSFER IF "TOO HIGH" IN BLOCK @V305032 00775100
  829. CL R1,FN2(R4,R5) IF =, COMPARE 2ND HALF OF FNAME @V305032 00776100
  830. BLR R14 TRANSFER IF "TOO LOW" IN BLOCK @V305032 00777100
  831. BHR R15 TRANSFER IF "TOO HIGH" IN BLOCK @V305032 00778100
  832. CL R2,FT1(R4,R5) IF =, COMPARE 1ST HALF OF FTYPE @V305032 00779100
  833. BLR R14 TRANSFER IF "TOO LOW" IN BLOCK @V305032 00780100
  834. BHR R15 TRANSFER IF "TOO HIGH" IN BLOCK @V305032 00781100
  835. CL R3,FT2(R4,R5) IF =, COMPARE 2ND HALF OF FTYPE @V305032 00782100
  836. BLR R14 TRANSFER IF "TOO LOW" IN BLOCK @V305032 00783100
  837. BHR R15 TRANSFER IF "TOO HIGH" IN BLOCK @V305032 00784100
  838. LA R1,0(R4,R5) IF MATCH RETURN ADDR OF FST ENTRY@V305032 00785100
  839. STM R4,R5,ADTCHBA STORE ADDRESS & DISP. IN CASE @V305032 00786100
  840. B FSTL41 RE-ENTERED AND "GO EXIT". @V305032 00787100
  841. SPACE 00788100
  842. * "TOO HIGH" IN THE BLOCK - INCREMENT THE INDEXER: 00789100
  843. BINSUB4 AR R5,R6 ADD ADJUSTER TO INDEXER @V305032 00790100
  844. SRL R6,ONE HALVE ADJUSTER (FOR NEXT TIME) @V305032 00791100
  845. BCT R7,BINSUBLP AND ITERATE BINARY SEARCH LOOP. @V305032 00792100
  846. BR R8 IF NOT FOUND, RETURN TO CALLER. @V305032 00793100
  847. SPACE 00794100
  848. * "TOO LOW" IN THE BLOCK - DECREMENT THE INDEXER: 00795100
  849. BINSUB5 SR R5,R6 SUBTRACT ADJUSTER FROM INDEXER @V305032 00796100
  850. BM BINSUB6 BEWARE MINUS = RUNNING OFF FRONT OF BLK @V305032 00797100
  851. SRL R6,ONE OK - HALVE ADJUSTER (FOR NEXT TIME) @V305032 00798100
  852. BCT R7,BINSUBLP AND ITERATE BINARY SEARCH LOOP. @V305032 00799100
  853. BR R8 IF NOT FOUND, RETURN TO CALLER. @V305032 00800100
  854. SPACE 00801100
  855. * IF INDEXER GOES MINUS, DON'T "RUN OFF THE FRONT OF THE BLOCK": 00802100
  856. BINSUB6 SR R5,R5 SET INDEXER = 0; @V305032 00803100
  857. SRL R6,ONE HALVE ADJUSTER (FOR NEXT TIME) @V305032 00804100
  858. BCT R7,BINSUBLP AND ITERATE BINARY SEARCH LOOP. @V305032 00805100
  859. BR R8 IF NOT FOUND, RETURN TO CALLER. @V305032 00806100
  860. SPACE 00807100
  861. * ADDITIONAL NEEDED EQUATES: 00808100
  862. ONESIXTY EQU 160 INITIAL INDEXER FOR AN 800-BYTE BLOCK @V305032 00809100
  863. THREE20 EQU 320 INITIAL ADJUSTER FOR AN 800-BYTE BLOCK@V305032 00810100
  864. NUMTRIES EQU 5 INITIAL NO. OF TRIES FOR 800-BYTE BLK @V305032 00811100
  865. EJECT 00812100
  866. LTORG @V305032 00813100
  867. SPACE 00814100
  868. * OTHER CONSTANTS AND DEFINITIONS ... 00815100
  869. DS 0F @V305032 00816100
  870. SB DC X'80000000' ZERO WITH SIGN-BIT ON @V305032 00817100
  871. VDMSSTTR DC V(DMSSTTR) VCON TO CHECK FOR STATE CALL @V305032 00818100
  872. SPACE 00819100
  873. * PARAMETER-LIST (R2) DISPLACEMENTS 00820100
  874. PLNAM EQU 8 FILENAME @V305032 00821100
  875. PLTYP EQU 16 FILETYPE @V305032 00822100
  876. PLMOD EQU 24 FILEMODE @V305032 00823100
  877. EJECT 00824100
  878. FVS , @V305032 00825100
  879. GPR2 EQU DISK$SEG+EIGHT SAVED REGISTERS FROM R2 UP @V305032 00826100
  880. EJECT 00827100
  881. REGEQU , @V305032 00828100
  882. NUCON , @V305032 00829100
  883. ADT , @V305032 00830100
  884. SVCSECT , @V305032 00831100
  885. END 00832100