User Tools

Site Tools


plato:source:plaopl:diskfio

DISKFIO

Table Of Contents

  • [00005] VARIOUS DISK FILE I/O COMMANDS
  • [00117] VARIOUS DATA NEEDED FOR DISKFIO ROUTINES
  • [00155] -ACTF- ACTIVATE FILE IF IN INACTIVE TABLE
  • [00228] -NEWACTF- ASSIGN NEW FILE AS ACTIVE FILE
  • [00331] -CLSACTF- CLOSE CURRENTLY ACTIVE FILE
  • [00442] -COPIACT- REACTIVATE LAST INACTIVE FILE
  • [00489] -CLSALLF- CLOSE ALL ACTIVE/INACTIVE FILES
  • [00522] -TDSINIT- INITIALIZE DATA/NAMESET INFO
  • [00545] -FILTYPE- GET FILETYPE TO B1
  • [00604] -READTF- READ TUTOR FILE NODE
  • [00665] -NAMBIAS- CALCULATE NAME BIASES
  • [00767] -GENCOMP- GENERIC COMPARISON OF TWO WORDS
  • [00801] NAMREC CONVERT RELATIVE RECORD TO ABSOLUTE
  • [00844] NXTLINK
  • [00884] READDS
  • [00937] SETFIO SET FILE I/O ACTIVITY
  • [00995] CLRFIO CLEAR FILE I/O ACTIVITY
  • [01057] READFTB
  • [01101] READNAM โ€“ READ CURRENT USER NAME
  • [01103] READNAM - READ CURRENT NAME ENTRY
  • [01234] NAMESET BINARY/GENERIC SEARCH
  • [01421] FINDRES โ€“ SEARCH SIGNON RESERVATION TABLE
  • [01506] LJUSTC LEFT JUSTIFY CODEWORD
  • [01541] MASTERFILE FUNCTIONS
  • [01543] RMFSIZE - READ MASTERFILE DIRECTORY SIZE.
  • [01605] Sโ€œMF$โ€ - RETURN *MF$* FOR A SPECIFIC MASTERFILE.

Source Code

DISKFIO.txt
  1. DISKFIO
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK IDENT 00 000 77/11/14 19.46
  4. IDENT DISKFIO
  5. TITLE VARIOUS DISK FILE I/O COMMANDS
  6. *
  7. * GET COMMON SYMBOL TABLE
  8. *
  9. CST
  10.  
  11. *CALL PLASFIP
  12. *
  13. * /--- BLOCK EXTERNAL 00 000 80/05/18 16.30
  14.  
  15. EXT LOADOV,WHATSIN
  16. EXT SYSTEST
  17. EXT ERXUNUS
  18. EXT GETARGS
  19. EXT ECSPRTY
  20. EXT PROCESS,ECSPRTY,CKPROC,NGETVAR,RETPROC
  21. EXT ERXROLC WRITING READ-ONLY COMMON
  22. EXT ERXRAT NAMESET INTERNAL ERROR
  23. EXT ERXBREC
  24. EXT ERXOPEN
  25.  
  26. ENTRY ZWKBUFF
  27. ZWKBUFF EQU TBINTSV FOR PASSING NEW -ATTACH- FIPS
  28. *
  29. * /--- BLOCK ATTPAUS 00 000 79/08/05 01.46
  30. *
  31. ** -ATTPAUS- SUBROUTINE (INTERRUPTABLE)
  32. **
  33. ** INCREMENTS BAD -ATTACH- COUNTER AND PAUSES TO
  34. ** HINDER THEFT OF CODEWORDS AND COMPILATION OF
  35. ** LESSON NAMES
  36. *
  37. * THIS PAUSE IS SKIPPED IN FINISH UNITS BUT THE
  38. * BAD-ATTACH COUNTER IS INCREMENTED TO PREVENT USE
  39. * USE TO SEARCH FOR FILES.
  40. * THE PAUSE CANNOT BE USED IN FINISH UNITS WHEN A
  41. * BAD ATTACH IS IN A TIGHT LOOP WITH NO EXIT. THIS
  42. * WILL CAUSE THE TERMINAL TO HANG UP SINCE THERE ARE
  43. * ENOUGH PAUSES TO KEEP TIPS LOW AND THERE WILL BE
  44. * NO AUTO-BREAK TO KICK THE USER OUT.
  45. **
  46. ** SHOULD BE CALLED WHEN -ATTACH- FAILS
  47. **
  48. ** ASSUMES THAT COMMON, STORAGE, KEY, ETC. HAVE
  49. ** ALREADY BEEN SAVED AND THAT ALL INTERLOCKS HAVE
  50. ** BEEN CLEARED
  51. **
  52. ** EXIT ADDRESS IS STORED IN (TBINTSV+4), WHICH IS
  53. ** USED BY -ATTACH- TO STORE THE CODEWORD ARGUMENT
  54. ** AND NO LONGER NEEDED (FOR OBVIOUS REASONS)
  55. ** BY THE TIME THIS ROUTINE IS EXECUTED
  56. **
  57. ** DOES NOT RETURN IF STOP1 PRESSED
  58. *
  59. * /--- BLOCK ATTPAUS 00 000 79/09/02 21.42
  60. ENTRY ATTPAUS
  61. *
  62. ATTPAUS EQ *
  63. *
  64. SA1 LESSCM+LSTOUSE CHECK IF SYSTEM LESSON
  65. NG X1,ATTPAUS --- EXIT IF SYSTEM LESSON
  66. *
  67. SA1 TRETURN X1 = *ZRETURN*
  68. ZR X1,ATTPAUS1 --- BRIF IF 0 (NO SUCH FILE)
  69. *
  70. SX1 X1-1 CHECK IF 1 (CODEWORD ERROR)
  71. NZ X1,ATTPAUS --- EXIT IF NOT CODEWORD ERROR
  72. *
  73. ATTPAUS1 SA1 ATTPAUS SAVE EXIT ADDRESS
  74. BX6 X1
  75. SA6 RETADDR
  76. *
  77. SA1 TBADATT X1 = BAD -ATTACH- COUNTER
  78. SX6 X1+1 INCREMENT COUNT
  79. SA6 A1 UPDATE COUNT
  80. AX1 18 SHIFT TIME TO POSITION
  81. *
  82. SB1 50 B1 = 50 MSEC MINIMUM PENALTY
  83. SX2 X6-101 100 FREE BAD -ATTACH-ES
  84. NG X2,ATTPAUS3 --- BRIF <= 100
  85. *
  86. SX2 X6-100 X2 = NO. OVER LIMIT
  87. SX3 25 X2 = MSEC PAUSE/BAD -ATTACH-
  88. IX2 X2*X3 X2 = LENGTH OF PAUSE
  89. SX3 60000 X3 = MAXIMUM PAUSE
  90. IX3 X3-X2 SEE IF PAUSE TOO LARGE
  91. PL X3,ATTPAUS2 --- BRIF NOT TOO LARGE
  92. SX2 60000 ADJUST
  93. ATTPAUS2 IX1 X1+X2 X1 = TIME WHEN PAUSE SHOULD END
  94. SA2 SYSCLOK X2 = CURRENT MSEC CLOCK TIME
  95. IX1 X1-X2 CHECK IF ENUF TIME PASSED
  96. NG X1,ATTPAUS3 --- BRIF ENUF TIME PASSED
  97. SB1 B1+X1 ADD DIFFERENCE TO MINIMUM
  98. *
  99. ATTPAUS3 FINISH ATTPAUS4 IF IN FINISH UNIT
  100. TUTIM B1,,,ALLOW PAUSE TO KEEP '7EM HONEST
  101. *
  102. ATTPAUS4 BSS 0
  103. SA1 TBADATT X1 = BAD -ATTACH- COUNTER
  104. MX0 -18 X0 = MASK FOR NO. OF BAD ONES
  105. BX1 -X0*X1 X1 = NO. OF BAD -ATTACH-ES
  106. SA2 SYSCLOK X2 = CURRENT MSEC CLOCK TIME
  107. LX2 18 SHIFT TO POSITION
  108. BX6 X1+X2 MERGE TIME AND COUNT
  109. SA6 A1 UPDATE COUNTER
  110. *
  111. STOPCHK --- EXIT IF STOP1 PRESSED
  112. *
  113. EQ RETADDR --- RETURN
  114. *
  115. RETADDR EQU TBINTSV+4 STORE EXIT ADDR IN SAME PLACE
  116. * /--- BLOCK PARAMETERS 00 000 77/12/16 23.02
  117. TITLE VARIOUS DATA NEEDED FOR DISKFIO ROUTINES
  118. *
  119. * INACTIVE FILE TABLE EQUATES
  120. *
  121.  
  122. IACTFWA VFD 60/TIFFWA INACTIVE FILE TABLE FWA
  123. IACTLTH VFD 60/TIFLTH LENGTH OF INACTIVE FILE TABLE
  124. IACTWPF EQU TWPF WORDS PER FILE ENTRY
  125.  
  126. *
  127. * TEMPLATE LESSON BUFFER NAMES
  128. *
  129.  
  130. ENTRY TUTNODE
  131. TUTNODE BSSZ 2
  132. DATA 10LTUTOR NODE
  133. + VFD 12/10,48/0
  134.  
  135. ENTRY IOBNAME
  136. IOBNAME DATA 0
  137. DATA 10LTUTOR FILE
  138. DATA 10LI/O BUFFER
  139. + VFD 12/1,48/0
  140.  
  141. *
  142. * LESSON DIRECTORY STRUCTURE
  143. *
  144.  
  145. LFNAME EQU INFO+0
  146. LTYPE EQU INFO+1
  147. LBLOCKS EQU INFO+2
  148. EXTRAI EQU INFO+4
  149. LBINF0 EQU INFO+64
  150. LBNAM0 EQU INFO+192
  151.  
  152. *
  153. **
  154. * /--- BLOCK ACTF 00 000 78/02/03 13.07
  155. TITLE -ACTF- ACTIVATE FILE IF IN INACTIVE TABLE
  156. *
  157. * -ACTF-
  158. *
  159. * ACTIVATE THE GIVEN FILE. IF IT IS ALREADY
  160. * ACTIVE, SIMPLY EXIT. IF IT IS INACTIVE, SWAP
  161. * IT WITH THE ACTIVE FILE. IF IT IS NEITHER
  162. * ACTIVE NOR INACTIVE, THEN TAKE AN ERROR EXIT.
  163. *
  164. * ON ENTRY -- B1 = ADDRESS OF ACCOUNT';FILE NAME
  165. * EXIT -- X7 = 0 IF FILE IS NOW OPEN/ACTIVE
  166. * -1 IF FILE IS NOT OPEN
  167. *
  168.  
  169. ENTRY ACTF
  170. ACTF EQ *
  171. RJ =XFSQUISH (X1) = ONE-WORD NAME
  172.  
  173. *
  174. * SEE IF FILE IS CURRENTLY ACTIVE
  175. *
  176.  
  177. SA2 TAFNAME CURRENTLY ACTIVE FILE NAME
  178. BX7 X1-X2 COMPARE THE TWO NAMES
  179. NG X7,ACTF1 IF NO MATCH (BEWARE OF -0)
  180. ZR X7,ACTF --- EXIT IF FILE ACTIVE
  181.  
  182. *
  183. * SEARCH THE INACTIVE TABLE FOR THE DESIRED FILE
  184. *
  185.  
  186. ACTF1 SA2 IACTLTH READ LENGTH OF TABLE
  187. SB3 X2 TRANSFER TO B3
  188. SA2 IACTFWA TABLE FWA
  189. SA2 X2 PLACE ADDRESS IN A2
  190. SB2 IACTWPF NO. OF WORDS PER FILE ENTRY
  191.  
  192. MX7 -1 PRESET FOR ERROR EXIT
  193. IACTLP SB3 B3-1 DECREMENT NUMBER TO SEARCH
  194. NG B3,ACTF --- EXIT IF FILE NOT OPEN
  195. BX6 X1-X2 COMPARE THE TWO FILE NAMES
  196. ZR X6,IACTFND --- BRIF INACTIVE FILE FOUND
  197. SA2 A2+B2 INCREMENT TO NEXT ENTRY
  198. EQ IACTLP --- LOOP ON NEXT TABLE ENTRY
  199.  
  200. *
  201. * INACTIVE FILE FOUND -- SWAP WITH ACTIVE FILE AND EXIT
  202. *
  203.  
  204. IACTFND SB1 1 B1 = 1
  205. SA1 TAFNAME FWA OF OPEN FILE BUFFER
  206.  
  207. SWAPLP SB2 B2-B1 ONE LESS WORD TO SWAP
  208. NG B2,IACTZN --- BRIF DONE SWAPPING
  209. BX6 X1
  210. BX7 X2
  211. SA6 A2
  212. SA7 A1
  213. SA1 A1+B1 LOOK AT NEXT WORDS IN BOTH
  214. SA2 A2+B1
  215. EQ SWAPLP --- LOOP AND SWAP ANOTHER
  216.  
  217. *
  218. * CLEAR OUT THE CURRENTLY SELECTED NAME
  219. *
  220.  
  221. IACTZN CALL CHRMOVE,NONAME,TRECNAM,MAXNCHR
  222.  
  223. MX7 0 FLAG FILE OPEN AND ACTIVE
  224. EQ ACTF --- EXIT TO CALLER
  225. *
  226. **
  227. * /--- BLOCK NEWACTF 00 000 77/12/04 21.03
  228. TITLE -NEWACTF- ASSIGN NEW FILE AS ACTIVE FILE
  229. *
  230. * -NEWACTF-
  231. *
  232. * DESIGNATES A FILE AS THE NEW ACTIVE FILE WHILE
  233. * PLACING THE PRESENT ACTIVE FILE INTO THE INACTIVE
  234. * TABLE. ENTER WITH B1 POINTING TO A *IACTWPF* WORD
  235. * PACKAGE CONTAINING FILE INFORMATION OF THE CORRECT
  236. * FORMAT. ON EXIT, THE PACKAGE WILL HAVE BEEN
  237. * COPIED OVER TO THE ACTIVE FILE PACKAGE IN THE
  238. * STUDENT BANK. IF NO SPACE IS LEFT IN THE
  239. * INACTIVE TABLE, THE CURRENTLY ACTIVE FILE
  240. * WILL BE CLOSED TO MAKE ROOM FOR THE NEW ONE.
  241. *
  242. * ENTRY (ZWKBUFF - ZWKBUFF+2) = NEW FIP.
  243. *
  244. * *SAVLES* IS ASSUMED TO BE CALLED ON ENTRY.
  245. *
  246.  
  247. ENTRY NEWACTF
  248. NEWACTF EQ *
  249. LINK NEWACTF
  250.  
  251. *
  252. * SEE IF NO FILE CURRENTLY ACTIVE
  253. *
  254.  
  255. SB1 ZWKBUFF (B1) = BUFFER FWA
  256.  
  257. SA1 TAFNAME CURRENTLY ACTIVE FILE NAME
  258. BX7 X1
  259. NG X7,NACTSRCH IF FILE IS ACTIVE
  260. ZR X7,NACTFAKE --- SIMPLY ACTIVATE USER FIP
  261.  
  262. *
  263. * SEARCH THE INACTIVE TABLE FOR A CLEAR SLOT
  264. *
  265.  
  266. NACTSRCH SA2 IACTLTH GET LENGTH OF IACT TABLE
  267. SB3 X2 TRANSFER TO B3
  268. SA2 IACTFWA READ ADDRESS OF IACT TABLE
  269. SA2 X2 READ ADDRESS TO A2
  270. SB2 IACTWPF NO. OF WORDS PER FILE ENTRY
  271.  
  272. NACTLP SB3 B3-1 DECREMENT NUMBER TO SEARCH
  273. NG B3,IACTOVF --- IACT TABLE FULL
  274. NG X2,NACTLP1 IF SLOT IN USE
  275. ZR X2,NACTFND --- BRIF INACTIVE 0 SLOT FOUND
  276. NACTLP1 SA2 A2+B2 INCREMENT TO NEXT ENTRY
  277. EQ NACTLP --- LOOP ON NEXT TABLE ENTRY
  278.  
  279. *
  280. * CLEAR SLOT FOUND -- INSERT ACTIVE/INACTIVE FILES AND EXIT
  281. *
  282. * (A2) = FAW OF INACTIVE SLOT TO RECEIVE ACTIVE FIP
  283. * (B1) = FWA OF FIP TO PLACE IN ACTIVE SLOT
  284.  
  285. NACTFND SB3 1 B3 = 1
  286. SA1 TAFNAME FWA OF OPEN FILE BUFFER
  287. SA3 B1 FWA OF USER FILE BUFFER
  288.  
  289. XFERLP SB2 B2-B3 ONE LESS WORD TO TRANSFER
  290. NG B2,NACTZN --- BRIF DONE TRANSFERRING
  291. BX6 X1
  292. BX7 X3
  293. SA6 A2 WRITE OVER INACTIVE FILE ENTRY
  294. SA7 A1 WRITE OVER ACTIVE FILE ENTRY
  295. SA1 A1+B3
  296. SA2 A2+B3 INCREMENT BUFFER POINTERS
  297. SA3 A3+B3
  298. EQ XFERLP --- LOOP AND XFER ANOTHER
  299.  
  300. *
  301. * CLEAR OUT THE CURRENTLY SELECTED NAME
  302. *
  303.  
  304. NACTZN CALL CHRMOVE,NONAME,TRECNAM,MAXNCHR
  305.  
  306. EQ NEWACTF --- EXIT TO CALLER
  307. * /--- BLOCK NEWACTF 00 000 77/12/01 02.58
  308.  
  309. *
  310. * PROCEED TO CLOSE THE ACTIVE FILE
  311. *
  312.  
  313. IACTOVF CALL CLSACTF,(0)
  314. SB1 ZWKBUFF (B1) = BUFFER FWA
  315. EQ NACTSRCH --- TRANSFER BUFFERS
  316.  
  317. *
  318. * TRANSFER USER BUFFER TO ACTIVE FILE BUFFER
  319. *
  320.  
  321. NACTFAKE SB2 IACTWPF
  322. SA2 IACTEMP A2 = DUMMY INACTIVE BUFFER
  323. SB1 ZWKBUFF (B1) = BUFFER FWA
  324. EQ NACTFND --- TRANSFER BUFFERS
  325.  
  326. IACTEMP BSS IACTWPF TEMPORARY BUFFER
  327.  
  328. *
  329. **
  330. * /--- BLOCK CLSACTF 00 000 79/10/04 03.53
  331. TITLE -CLSACTF- CLOSE CURRENTLY ACTIVE FILE
  332. *
  333. * -CLSACTF-
  334. *
  335. * CALLS THE APPROPRIATE ROUTINE TO CLOSE AN
  336. * ACTIVE FILE.
  337. *
  338. * THIS ROUTINE WILL ALSO ATTEMPT TO COPY AN
  339. * INACTIVE FILE TO THE ACTIVE SLOT AND SHORTEN
  340. * THE INACTIVE TABLE IF POSSIBLE. ONLY IF THERE
  341. * ARE NO INACTIVE FILES WILL THIS ROUTINE EVER
  342. * LEAVE THE ACTIVE SLOT *TAFNAME* ZERO.
  343. *
  344. * ON ENTRY -- B1 = -1 TO IGNORE CLOSE ERRORS
  345. * 0 TO CAUSE EXEC ERRORS
  346. *
  347. * **** SAVLES IS ASSUMED TO BE CALLED ON ENTRY ****
  348. *
  349. * WHILE CLOSING FILE NODES, *TBINTSV* IS USED AS
  350. * FOLLOWS --
  351. *
  352. * 0 - 10 STORED ATTACH PARAMETERS
  353. * 11 - 14 FOR SAVING *CLSACTF* RJ TRAIL
  354. * 15 - 15 USED BY *DETACHP*
  355. *
  356.  
  357. ENTRY CLSACTF
  358. CLSACTF EQ *
  359. LINK CLSACTF
  360.  
  361. SA1 TAFNAME GET FILE NAME
  362. NG X1,CLSACTF1 IF ACTIVE FILE
  363. ZR X1,CLSACTF --- EXIT IF NO ACTIVE FILE
  364.  
  365. CLSACTF1 SX1 B1 (X1) = CLOSE ERRORS PARAMETER
  366. MX6 1
  367. BX6 X1*X6 SAVE SIGN BIT
  368. SA1 KEY
  369. BX6 X1+X6 (X6) = 1/ERROR FLAG,41/0,18/KEY
  370. SA1 NERROR PRESERVE EXECERR INFO
  371. MX2 -18
  372. BX1 -X2*X1 LIMIT TO 18 BITS
  373. LX1 18 (X1) = 24/0, 18/NERROR, 18/0
  374. BX6 X1+X6 (X6)=1/EF,23/0,18/NERROR,18/KEY
  375. SA6 TBINTSV+15 SAVE STUFF HERE FOR THE MOMENT
  376.  
  377. * SAVE THE RJ TRAIL IN TBINTSV+11 - TBINTSV+14.
  378.  
  379. CALL LINKS,(TBINTSV+11)
  380. SB2 B2-5 ONLY ROOM FOR 4 WORDS
  381. PL B2,"CRASH" OOPS (USED .GT. 4 WORDS)
  382.  
  383. * MOVE THE PARAMETERS WHICH WERE SAVED TEMPORARILY
  384. * IN *TBINTSV+15* (WHICH MAY BE USED BY *DETACHP*)
  385. * TO *TBINTSV+14* (THE LAST WORD FOR THE SAVED RJ
  386. * TRAIL). IF *LINKS* USED *TBINTSV+14*, IT MUST
  387. * CONTAIN A ZERO, WHICH WILL BE RESTORED LATER.
  388.  
  389. SA1 TBINTSV+15 (X1)=1/EF,23/0,18/NERROR,18/KEY
  390. BX6 X1
  391. SA6 TBINTSV+14 SAVE OVER LAST WORD OF RJ TRAIL
  392.  
  393. * /--- BLOCK CLSACTF 00 000 80/02/10 02.38
  394. * BEWARE OF STRAY INTERLOCKS -- CLEAR THEM JUST
  395. * IN CASE.
  396.  
  397. INTCLR X,I.SIGN RELEASE SIGNIN/SIGNOUT PROCESS
  398. INTCLR X,I.DS RELEASE DATASET PROCESS
  399.  
  400. *
  401. * BRANCH TO APPROPRIATE FILE CLOSE ROUTINE
  402. *
  403.  
  404. AFTJMP "CRASH",DSETCL,TUTCL
  405.  
  406. *
  407. * CALL THE DATASET/NAMESET/GROUP CLOSE PROCESSOR
  408. *
  409.  
  410. * DSETCL X CLOSEDS,TDSNAME
  411. DSETCL CALL CLOSEDS,TDSNAME
  412. SA1 TBINTSV+14 (X1)=1/EF,23/0,18/NERROR,18/KEY
  413. NG X1,COPYIACT --- BRIF IGNORE CLOSE ERRORS
  414. NG X6,COPYIACT --- FILL SPACE WITH INACT FILE
  415. ZR X1,ERXOPEN --- BRIF FILE NOT OPEN
  416. EQ ERXBREC
  417.  
  418. *
  419. * CALL THE TUTOR FILE CLOSE PROCESSOR
  420. *
  421.  
  422. * TUTCL X TCLOSE
  423. TUTCL CALL TCLOSE
  424. SA1 TBINTSV+14 (X1)=1/EF,23/0,18/NERROR,18/KEY
  425. NG X1,COPYIACT --- BRIF IGNORE CLOSE ERRORS
  426. NG X6,COPYIACT --- FILL SPACE WITH INACT FILE
  427. EQ ERXOPEN
  428. * /--- BLOCK CLSACTF 00 000 77/12/02 20.36
  429. COPYIACT CALL COPIACT
  430. *
  431. RESTRJ SA1 TBINTSV+14 (X1)=1/EF,23/0,18/NERROR,18/KEY
  432. SX6 X1
  433. MX7 0
  434. SA6 KEY RESTORE *KEY*
  435. SA7 A1+ ENSURE LAST WORD OF RJ TRAIL 0
  436. AX1 18 SHIFT SAVED *NERROR* DOWN
  437. SX6 X1+ (X6) = SAVED *NERROR*
  438. SA6 NERROR RESTORE *NERROR* FOR EXECERR
  439. CALL LINKR,(TBINTSV+11) RESTORE RJ TRAIL
  440. EQ CLSACTF
  441.  
  442. TITLE -COPIACT- REACTIVATE LAST INACTIVE FILE
  443. *
  444. * -COPIACT-
  445. *
  446. * REACTIVATES LAST FILE IN THE OPEN FILE BUFFER.
  447. * THIS IS USUALLY THE PREVIOUSLY ACTIVE FILE THAT
  448. * IS MADE INACTIVE BY AN ATTEMPT TO ATTACH ANOTHER
  449. * FILE.
  450. *
  451. ENTRY COPIACT
  452. COPIACT PS
  453.  
  454. SB1 1 B1 = 1
  455. SB2 IACTWPF NO. OF WORDS PER FILE ENTRY
  456. SA1 TAFNAME FWA OF OPEN FILE BUFFER
  457. MX7 0 PRECLEAR FOR ZEROING
  458. SA7 A1 CLEAR OUT TAFNAME JUST IN CASE
  459.  
  460. *
  461. * FIND LAST PHYSICAL INACTIVE SLOT WITH A FILE IN IT
  462. *
  463.  
  464. SX0 B2 LENGTH OF A FIP
  465. SA2 IACTLTH GET NUMBER OF FIPS
  466. SX2 X2-1 SUBTRACT ONE FOR LAST ONE
  467. IX0 X0*X2 BIAS INTO TABLE
  468. SB3 X0 BECAUSE SA A+X IS ILLEGAL
  469. SA2 IACTFWA FWA OF IACT TABLE
  470. SA2 X2 READ ADDRESS TO A2
  471. SA2 A2+B3 ADD BIAS INTO TABLE
  472. LASTLP NZ X2,COPYLP --- BRIF SOMETHING IN SLOT
  473. NG X2,COPYLP
  474. SA2 A2-IACTWPF LOOK AT SLOT PREVIOUS
  475. SX0 X0-IACTWPF SUBTRACT BIAS FOR LATER
  476. PL X0,LASTLP --- LOOP ON NEXT SLOT
  477. EQ COPIACT IF ALL DONE
  478.  
  479. COPYLP SB2 B2-B1 ONE LESS WORD TO TRANSFER
  480. NG B2,COPIACT IF COPY DONE
  481. BX6 X2
  482. *
  483. SA6 A1 WRITE OVER ACTIVE FILE ENTRY
  484. SA7 A2 CLEAR OUT INACTIVE SLOT
  485. SA1 A1+B1
  486. SA2 A2+B1 INCREMENT BUFFER POINTERS
  487. EQ COPYLP --- LOOP AND COPY ANOTHER
  488. * /--- BLOCK CLSALLF 00 000 80/02/03 05.23
  489. TITLE -CLSALLF- CLOSE ALL ACTIVE/INACTIVE FILES
  490. *
  491. * -CLSALLF-
  492. *
  493. * CLOSES ALL FILES WHETHER THEY ARE ACTIVE OR
  494. * INACTIVE. NO ERROR RETURNS WILL BE GIVEN ON
  495. * BAD CLOSES.
  496. *
  497. *
  498.  
  499. ENTRY CLSALLF
  500. CLSALLF EQ *
  501. LINK CLSALLF
  502.  
  503. CALL SAVETB SAVE *TBINTSV* CELLS
  504.  
  505. *
  506. * LOOP ON CLOSING ALL INACTIVE FILES IGNORING ERRORS
  507. *
  508.  
  509. CLSLOOP CALL CLSACTF,(-1)
  510. SA1 TAFNAME READ ACTIVE FILE NAME
  511. NG X1,CLSLOOP IF INACTIVE FILE PRESENT
  512. NZ X1,CLSLOOP --- BRIF MORE INACTIVE LEFT
  513.  
  514. CALL RESTTB RESTORE *TBINTSV* CELLS
  515.  
  516. EQ CLSALLF --- RETURN TO CALLER
  517.  
  518. *
  519. **
  520. * /--- BLOCK TDSINIT 00 000 80/08/19 01.34
  521. *
  522. TITLE -TDSINIT- INITIALIZE DATA/NAMESET INFO
  523. *
  524. * -TDSINIT-
  525. *
  526. * UNCONDITIONALLY CLEAR OUT INFO PACKETS FOR ALL
  527. * ACTIVE AND INACTIVE FILES
  528. *
  529.  
  530. ENTRY TDSINIT
  531.  
  532. TDSINIT EQ *
  533.  
  534. SB1 1
  535. SB2 TIFLTH*TWPF+TWPF TOTAL LENGTH OF PACKETS
  536. SX6 0
  537. SA0 TAFBUF START OF PACKETS
  538.  
  539. TDSINI1 SB2 B2-B1 DECREMENT COUNTER
  540. SA6 A0+B2 ZERO NEXT WORD
  541. NZ B2,TDSINI1 --- RELOOP UNTIL DONE
  542.  
  543. EQ TDSINIT --- EXIT
  544. * /--- BLOCK FILTYPE 00 000 80/07/18 03.32
  545. TITLE -FILTYPE- GET FILETYPE TO B1
  546. *
  547. * -FILTYPE-
  548. *
  549. * GETS THE FILE TYPE OF THE ACTIVE FILE TO B1
  550. *
  551. * ON ENTRY -- SOME FILE IS ACTIVE
  552. * EXIT -- B1 = 0 FOR UNRECOGNIZED TYPE
  553. * 1 FOR DATASET TYPE
  554. * 2 FOR TUTOR TYPE
  555. * X1 = 0 (FOR GETVAR)
  556. *
  557. * DESTROYS A1,X2,X1,B1 (GETVAR CONVENTIONS)
  558. *
  559. *
  560.  
  561. ENTRY FILTYPE
  562. FILTYPE EQ *
  563.  
  564. SB1 B0 PRESET B1 IN CASE OF EXIT
  565. SA1 TAFNAME GET ACTIVE FILE NAME
  566. NG X1,FILTYP1 IF ACTIVE FILE
  567. ZR X1,FILTYPE --- EXIT IF NO ACTIVE FILE
  568.  
  569. FILTYP1 RJ FILTYP2 (X1) = 6-BIT FILE TYPE CODE
  570.  
  571. ZR X1,FILTYPE --- IF NO FILE TYPE
  572.  
  573. SX2 X1-NFTYPES-1
  574. PL X2,NOTYPE --- IF OUT OF RANGE
  575.  
  576. SA1 ATTRTAB+X1 (X1) = FILE TYPE ATTRIBUTE WORD
  577. SB1 X1+1
  578. SX1 0
  579. EQ FILTYPE
  580.  
  581. NOTYPE SB1 B0
  582. MX1 0
  583. EQ FILTYPE
  584. *
  585. * -FILTYP2-
  586. *
  587. * ISOLATE 6-BIT FILE TYPE TO X1
  588. *
  589.  
  590. ENTRY FILTYP2
  591.  
  592. FILTYP2 EQ *
  593.  
  594. SA1 TAFNAME GET ACTIVE FILE NAME
  595. NG X1,FILTYP3 IF ACTIVE FILE
  596. ZR X1,FILTYP2 IF NO FILE
  597. FILTYP3 SA1 TAFINF2 READ ATTACHED FILE INFO
  598. AX1 18 SHIFT INTO POSITION
  599. MX2 -6 FORM 6 BIT FILE TYPE MASK
  600. BX1 -X2*X1 MASK TO 6 BITS
  601.  
  602. EQ FILTYP2
  603. * /--- BLOCK READTF 00 000 78/04/29 19.13
  604. TITLE -READTF- READ TUTOR FILE NODE
  605. **
  606. *
  607. * -READTF-
  608. *
  609. * ROUTINE TO READ TUTOR FILE NODE TO INFO BUFFER
  610. *
  611. * ALSO RETURNS THE FOLLOWING PARAMETERS --
  612. *
  613. * B1 = 0 IF PARTS OPTION SELECTED
  614. * CURRENT NAME BIAS IF NAME OPTION SELECTED
  615. * B2 = BIAS OF LAST BLOCK NAME IN FILE
  616. * X1 = CURRENT NAME IF ONE IS SELECTED
  617. *
  618.  
  619. ENTRY READTF
  620. READTF EQ *
  621. SA1 TAFINF2 GET ACTIVE FILE INFO
  622. CALL READLES,B0,B0 GET ECS FWA OF NODE
  623. SX1 TUTHEAD GET STANDARD HEADER LENGTH
  624. IX0 X0+X1 BIAS PAST HEADER
  625. SA0 INFO READ DIRECTORY TO *INFO* BUFFER
  626. RE BLKLTH
  627. RJ ECSPRTY
  628.  
  629. MX7 -1
  630. SA7 JJSTORE FLAG *INFO* OVERWRITTEN
  631.  
  632. SA1 LBLOCKS GET NUMBER OF BLOCKS IN FILE
  633. SB2 X1-1 ISOLATE MAXIMUM LEGAL BIAS
  634. ZEROLP SA1 LBNAM0+B2 GET NEXT BLOCK NAME
  635. NZ X1,LASTB --- BRIF LAST BLOCK FOUND
  636. NG X1,LASTB --- BRIF LAST BLOCK FOUND
  637. SB2 B2-1
  638. EQ ZEROLP --- LOOP UNTIL LAST BLOCK FOUND
  639.  
  640. LASTB SB1 0 PRESET BIAS TO 0
  641. *///
  642. */// TRAP PUT IN BY OZZIE ON 78.04.29.
  643. *///
  644. */// TRAP IF B2 IS ILLEGAL VALUE. THIS WILL HOPEFULLY
  645. */// GIVE MORE INFO ABOUT THE CAUSE OF TWO CRASHES
  646. */// IN WHICH THE ABOVE READ OF THE TUTOR FILE NODE
  647. */// READ 320 WORDS OF ZERO WHILE THE ECS STORAGE
  648. */// BUFFER APPEARED TO BE INTACT. THE FORMER CRASHES
  649. */// WERE IN ROUTINE -NAMBIAS- AND WERE CAUSED BECAUSE
  650. */// B2 WAS NEGATIVE, CAUSING A2 TO BE NEGATIVE IN A
  651. */// LOOP. TRAP HERE IF B2 IS INITIALIZED NEGATIVE.
  652. *///
  653. LT B2,B0,"CRASH"
  654. *///
  655. SA1 TAFINF1 GET BIAS INFO WORD
  656. NG X1,READTF --- EXIT IF PARTS OPTION
  657. AX1 36 SHIFT NAME BIAS INTO POSITION
  658. SB1 X1 STORE BIAS IN B1
  659. SA1 LBNAM0+B1 GET CURRENT NAME SELECTED
  660.  
  661. EQ READTF --- EXIT TO CALLER
  662. *
  663. **
  664. * /--- BLOCK NAMBIAS 00 000 79/02/08 02.08
  665. TITLE -NAMBIAS- CALCULATE NAME BIASES
  666. **
  667. *
  668. * -NAMBIAS-
  669. *
  670. * THIS ROUTINE, GIVEN THE BIAS TO ANY BLOCK,
  671. * WILL RETURN THE BIAS TO THE NAME ASSOCIATED
  672. * WITH THAT BLOCK AND THE BIAS TO THE NEXT
  673. * SEQUENTIAL NAME.
  674. *
  675. * ON ENTRY -- B1 = BIAS TO ANY BLOCK NAME
  676. * B2 = BIAS TO LAST BLOCK IN FILE
  677. * EXIT -- B1 = BIAS TO NAME FOR THAT BLOCK
  678. * B2 = SAME AS ON ENTRY
  679. * B3 = BIAS TO NEXT SEQUENTIAL NAME
  680. * -1 IF NO NEXT SEQUENTIAL NAME
  681. *
  682. * DESTROYS A1,A2,X0,X1,X2
  683. *
  684.  
  685. ENTRY NAMBIAS
  686. NAMBIAS EQ *
  687.  
  688. *
  689. * SCAN BACKWARD FOR FIRST BLOCK IN THIS NAME
  690. *
  691.  
  692. SA2 LBINF0+B1 READ BLOCK INFO WORD
  693. LX2 L.TYPE
  694. MX0 -L.TYPEL
  695. BX2 -X0*X2 ISOLATE BLOCK TYPE
  696. SB3 X2 MOVE BLOCK TYPE TO B3
  697. SB3 B0-B3 COMPLEMENT IT
  698. SA1 LBNAM0+B1 GET CURRENT BLOCK NAME
  699. ZR X2,BCKLP IGNORE BBLKS IF ITS A SORCE BLK
  700. SX0 X2-7
  701. ZR X0,BCKLP ... OR TEXT BLOCKS
  702. SX0 X2-9
  703. NZ X0,BCKLP0 ... OR LISTING BLOCKS
  704.  
  705. BCKLP SB1 B1-1 LOOK AT THE PREVIOUS NAME
  706. ZR B1,BCKDONE --- BRIF FIRST NAME IN FILE
  707.  
  708. SA2 LBINF0+B1 GET PREVIOUS BLOCK INFO WORD
  709. LX2 L.TYPE SHIFT BLOCK TYPE INTO POSITION
  710. MX0 -L.TYPEL TYPE FIELD MASK
  711. BX2 -X0*X2 ISOLATE BLOCK TYPE
  712. SX0 X2+B3 COMPARE THE BLOCK TYPES
  713. NZ X0,BCKDONE --- BRIF DIFFERENT TYPE
  714. ZR X2,BCKLP1 --- BRIF SOURCE BLOCK
  715. SX0 X2-7
  716. ZR X0,BCKLP1 --- BRIF TEXT BLOCK
  717. SX0 X2-9
  718. ZR X0,BCKLP1 --- BRIF LISTING BLOCK
  719.  
  720. * ALL NON-SOURCE/TEXT/LISTING BLOCKS GO THRU HERE
  721.  
  722. BCKLP0 SA2 LBINF0+B1 GET BLOCK INFO AGAIN
  723. LX2 L.BLKS SHIFT NO. OF BLOCKS INTO POS
  724. MX0 -L.BLKSL
  725. BX2 -X0*X2 ISOLATE NUMBER OF CONTIG BLOCKS
  726. NZ X2,FWDSRCH --- BRIF THIS IS START BLOCK
  727.  
  728. BCKLP1 SA2 LBNAM0+B1 GET PREVIOUS NAME
  729. BX0 X2-X1 COMPARE THE TWO NAMES
  730. NZ X0,BCKDONE --- BRIF DIFFERENT NAME
  731. PL X0,BCKLP --- LOOP UNTIL DIFFERENT NAME
  732.  
  733. BCKDONE SB1 B1+1 INCREMENT PAST MISMATCH
  734. FWDSRCH BSS 0 START FORWARD SEARCH
  735. * /--- BLOCK NAMBIAS 00 000 78/10/29 01.57
  736.  
  737. *
  738. * SCAN FORWARD TO DIFFERENT NAME
  739. *
  740.  
  741. SB3 B1
  742. NXTLP SB3 B3+1 LOOK AT NEXT SEQUENTIAL BLOCK
  743. GT B3,B2,LASTN --- BRIF LAST NAME IN FILE
  744.  
  745. SA2 LBNAM0+B3 GET NEXT BLOCK NAME
  746. BX0 X2-X1 COMPARE THE TWO NAMES
  747. NZ X0,NAMBIAS --- EXIT IF A DIFFERENT NAME
  748. NG X0,NAMBIAS --- EXIT IF A DIFFERENT NAME
  749.  
  750. MX0 -L.TYPEL
  751. SA2 LBINF0+B3 GET BLOCK INFO WORD AGAIN
  752. LX2 L.TYPE
  753. BX1 -X0*X2 ISOLATE BLOCK TYPE
  754. SA2 LBINF0+B1 GET OLD BLOCK TYPE
  755. LX2 L.TYPE
  756. BX2 -X0*X2 ISOLATE OLD BLOCK TYPE
  757. IX0 X1-X2 COMPARE BLOCK TYPES
  758. SA1 A1 RESTORE BLOCK NAME
  759. NZ X0,NAMBIAS --- EXIT IF BLOCK TYPES DIFFER
  760. EQ NXTLP --- LOOP UNTIL DIFFERENT NAME
  761.  
  762. LASTN SB3 -1 FLAG LAST NAME IN FILE
  763. EQ NAMBIAS --- RETURN TO CALLER
  764. *
  765. **
  766. * /--- BLOCK GENCOMP 00 000 77/12/20 00.18
  767. TITLE -GENCOMP- GENERIC COMPARISON OF TWO WORDS
  768. **
  769. *
  770. * -GENCOMP-
  771. *
  772. * PERFORMS GENERIC COMPARISON OF TWO WORDS
  773. *
  774. * ON ENTRY -- X1 CONTAINS WORD TO TEST
  775. * X2 CONTAINS WORD TO TEST AGAINST
  776. * EXIT -- X7 = 1 IF PARTIAL OR FULL MATCH
  777. * 0 IF NO MATCH
  778. * B3 = BITS IN PARTIAL MATCH - 1
  779. *
  780.  
  781. ENTRY GENCOMP
  782. GENCOMP EQ *
  783.  
  784. MX6 1 1 BIT FOR MASK FORMATION
  785. MX7 0 0 IN CASE OF GENERIC FAILURE
  786. SB3 65 INITIAL SHIFT COUNT
  787.  
  788. GENLP SB3 B3-6 MASK 1 LESS CHARACTER
  789. NG B3,GENCOMP --- EXIT IF NO GENERIC MATCH
  790. LX0 X6,-B3 FORM MASK FOR N CHARACTERS
  791. BX0 X0*X2 MASK DOWN FOR COMPARISON
  792. BX0 X0-X1 COMPARE THE TWO
  793. NZ X0,GENLP --- LOOP IF NOT THE SAME
  794. NG X0,GENLP --- LOOP IF NOT THE SAME
  795.  
  796. SX7 1 FLAG PARTIAL MATCH
  797. EQ GENCOMP --- RETURN TO CALLER
  798. *
  799. **
  800. * /--- BLOCK NAMREC 00 000 79/08/13 02.25
  801. TITLE NAMREC CONVERT RELATIVE RECORD TO ABSOLUTE
  802. *
  803. * -NAMREC-
  804. *
  805. * THIS ROUTINE CALCULATES THE ABSOLUTE RECORD
  806. * NUMBER OF THE FILE GIVEN THE RELATIVE RECORD
  807. * WITHIN THE NAME CURRENTLY SELECTED. THIS
  808. * ASSUMES THAT THE FILE NODE HEADER HAS BEEN READ
  809. * AND THAT THE DATASET PROCESS (I.DS) HAS BEEN
  810. * INTERLOCKED.
  811. *
  812. * A0 = ADDRESS OF RECORD ALLOCATION TABLE
  813. * X1 = HEADER RECORD FOR CHAIN
  814. * X2 = RELATIVE RECORD NUMBER - 1 (RELATIVE TO ZERO)
  815. *
  816. * ON EXIT,
  817. *
  818. * X1 = ABSOLUTE RECORD NUMBER
  819. * X6 = NEGATIVE IF SYSTEM ERROR (RECORD=0 OR OUT OF RANGE)
  820. * = POSITIVE IF OK
  821. *
  822. *
  823. ENTRY NAMREC
  824. *
  825. NAMREC EQ *
  826. BX3 X2 X3 = RELATIVE RECORD NUMBER
  827. MX2 -FFIELD
  828. SA4 FILINF1
  829. AX4 FMAXREC SHIFT TO MAX. RECORD NUMBER
  830. BX4 -X2*X4 X4 = MAX. POSSIBLE RECORD
  831. MX5 -1 INCREMENT FOR EACH ITERATION
  832. NAMREC2 ZR X1,NAMREC3 --- SYSTEM ERROR IF RECORD = 0
  833. IX6 X4-X1 CHECK IF RECORD NUMBER VALID
  834. NG X6,NAMREC --- SYSTEM ERROR, OUT OF RANGE
  835. ZR X3,NAMREC --- ALREADY AT CORRECT RECORD
  836. GETSEG GET NEXT RECORD IN CHAIN IN X2
  837. BX1 X2 CURRENT RECORD <- NEXT RECORD
  838. IX3 X3+X5 SUBTRACT FROM RELATIVE COUNT
  839. EQ NAMREC2
  840. *
  841. NAMREC3 SX6 -1 MARK SYSTEM ERROR
  842. EQ NAMREC
  843. * /--- BLOCK NXTLINK 00 000 79/08/13 21.59
  844. TITLE NXTLINK
  845. *
  846. * -NXTLINK-
  847. *
  848. * OBTAINS THE NEXT RECORD NUMBER IN THE CHAIN GIVEN
  849. * THE CURRENT RECORD NUMBER. THIS PERFORMS BOUNDS
  850. * CHECKING ON THE NEXT RECORD NUMBER TO MAKE SURE
  851. * THE ALLOCATION TABLE IS NOT MESSED UP.
  852. *
  853. * THE DATASET PROCESS (I.DS) SHOULD BE INTERLOCKED.
  854. *
  855. * ON ENTRY
  856. *
  857. * X1 = CURRENT RECORD NUMBER IN CHAIN
  858. * A0 = ADDRESS OF RECORD ALLOCATION TABLE
  859. *
  860. * ON EXIT
  861. *
  862. * X1 = NEXT RECORD NUMBER IN CHAIN
  863. * X6 = NEGATIVE IF SYSTEM ERROR
  864. * = POSITIVE IF OK
  865. *
  866. ENTRY NXTLINK
  867. *
  868. NXTLINK EQ *
  869. GETSEG GET LINK VALUE FOR THIS RECORD
  870. BX1 X2 CURRENT <- NEXT
  871. SA2 FILINF1
  872. AX2 FMAXREC
  873. MX6 -FFIELD
  874. BX2 -X6*X2 X2 = MAX. VALUE FOR LINK
  875. ZR X1,NXTL1 --- ERROR IF OUT OF RANGE
  876. IX6 X2-X1 CHECK IF RECORD NUMBER VALID
  877. PL X6,NXTLINK --- EXIT IF VALID NUMBER
  878. *
  879. * SYSTEM ERROR
  880. *
  881. NXTL1 SX6 -1
  882. EQ NXTLINK
  883. * /--- BLOCK READDS 00 000 79/08/13 02.28
  884. TITLE READDS
  885. *
  886. *
  887. *
  888. * -READDS-
  889. * READS THE DATASET ECS FILE NODE HEADER AND
  890. * THE NAMESET HEADER INTO CM.
  891. *
  892. * THE DATASET PROCESS (I.DS) SHOULD BE INTERLOCKED
  893. * IF THE INFO IN THE HEADER WILL BE USED AS THE
  894. * BASIS FOR DECISIONS (E.G. CHECKS TO SEE IF SOME-
  895. * THING IS RESERVED OR TO SEE IF THERE'7S ENOUGH
  896. * ROOM LEFT IN THE FILE TO ADD RECORDS)
  897. *
  898. * ENTRY (B1) = ADDR OF -ATTACH- FIP (E.G. TDSNAME)
  899. *
  900. * ON EXIT -
  901. * DSLOC = ECS ADDRESS OF FILE NODE
  902. * NAMLOC0 = ECS ADDRESS OF FIRST NAME (NAMESETS)
  903. * NAMWDS = NAME ENTRY LENGTH IN WORDS (NAMESETS)
  904. * X0 = ECS ADDRESS OF FILE NODE
  905. * X6 = ECS ADDRESS OF NAMES (ONLY FOR NAMESETS)
  906. *
  907. ENTRY READDS
  908. READDS EQ *
  909. SA1 B1+BDSPARM (X1) = 42/JUNK, 18/LESSON NO.
  910. CALL READLES,DSNODE,(DSHEAD+FPRMLTH)
  911. MX7 -12
  912. SA2 DSNODE LOAD 1ST WORD OF HEADER
  913. LX2 12
  914. BX2 -X7*X2 MASK OFF LESSON TYPE CODE
  915. SX7 X2-9
  916. NZ X7,"CRASH" EROR IF NOT DATASET FILE NODE
  917. BX7 X0
  918. SA7 DSLOC SAVE ADDRESS OF ECS BUFFER
  919. SA1 BNAMBUF GET BIAS TO NAMESET HEADER
  920. ZR X1,READDS EXIT IF NOT NAMESET
  921. IX0 X0+X1 ECS ADDRESS OF NAMESET HEADER
  922. SA0 NSH
  923. + RE NPRMLTH READ NAMESET HEADER
  924. RJ ECSPRTY
  925. SX1 NPRMLTH LENGTH OF NAMESET HEADER
  926. IX6 X0+X1 ECS ADDRESS OF NAMES
  927. SA6 NAMLOC0 SAVE ADDRESS OF NAMES
  928. BX0 X7 RETURN ECS ADDRESS OF FILE NODE
  929. SA1 FILINF2
  930. AX1 FNWORDS SHIFT TO ENTRY LENGTH
  931. MX2 -FFIELD
  932. BX7 -X2*X1 ENTRY LENGTH IN WORDS
  933. SA7 NAMWDS SAVE FOR LATER USE
  934. EQ READDS
  935. *
  936. * /--- BLOCK SETFIO 00 000 79/10/18 23.25
  937. TITLE SETFIO SET FILE I/O ACTIVITY
  938. *
  939. * SETFIO
  940. *
  941. * SETS THE FILE I/O ACTIVITY RESERVATION ENTRY.
  942. *
  943. * ENTRY (B1) = ADDR OF -ATTACH- FIP (E.G. TDSNAME)
  944. *
  945. * ON EXIT,
  946. * X6 = -1 IF OK
  947. * 0 IF FILE BUSY
  948. *
  949. * THE -CLRFIO- ROUTINE MUST BE CALLED AFTER
  950. * THE I/O IS COMPLETED (WITH OR WITHOUT ERROR).
  951. *
  952. *
  953. ENTRY SETFIO
  954. *
  955. SETFIO EQ *
  956. *
  957. SX3 B1 SAVE OVER INTLOK
  958. INTLOK X,I.DS,W INTERLOCK CHANGING FILE NODE
  959. CALL READDS,X3 READ FILE NODE HEADER
  960. *
  961. SA1 FILINF1
  962. LX1 -FIO POSITION I/O RESERVE AT RIGHT
  963. MX6 -FFIELD
  964. BX3 -X6*X1 X3 = I/O ACTIVITY MARKER
  965. *
  966. SA2 STATION RESERVING STATION NUMBER
  967. SX2 X2+1 INCR (TO ALLOW FOR CONSOLE)
  968. *
  969. NZ X3,SETFIO2 --- IF ALREADY RESERVED
  970. *
  971. BX6 X1+X2 STATION + REST OF FILINF1
  972. LX6 FIO
  973. SA6 A1
  974. *
  975. * * MODIFY FILE NODE IN ECS
  976. *
  977. SA1 DSLOC ECS ADDRESS OF FILE NODE
  978. SX2 DSHEAD LENGTH OF STANDARD HEADER
  979. IX0 X1+X2 ADDRESS OF DATASET HEADER
  980. SA0 DSH
  981. WE FPRMLTH
  982. RJ ECSPRTY
  983. *
  984. SETFIO1 INTCLR X,I.DS
  985. SX6 -1 OK
  986. EQ SETFIO --- EXIT
  987. *
  988. SETFIO2 BX3 X2-X3 CHECK IF SAME STATION NUMBER
  989. ZR X3,SETFIO1 --- OK IF RESERVED HERE
  990. *
  991. SETFE0 INTCLR X,I.DS
  992. SX6 0 FILE BUSY
  993. EQ SETFIO --- EXIT
  994. * /--- BLOCK CLRFIO 00 000 79/10/18 13.11
  995. TITLE CLRFIO CLEAR FILE I/O ACTIVITY
  996. *
  997. * CLRFIO
  998. *
  999. * CLEARS THE FILE I/O ACTIVITY RESERVATION ENTRY.
  1000. *
  1001. * ENTRY (B1) = ADDR OF -ATTACH- FIP (E.G. TDSNAME)
  1002. *
  1003. * NOTE--A CHECK IS DONE TO ASSURE THAT THE CALLING
  1004. * STATION IS THE SAME AS THE ONE WITH THE I/O
  1005. * RESERVED; NO CLEAR IS DONE IF IT IS NOT.
  1006. *
  1007. *
  1008. ENTRY CLRFIO
  1009. *
  1010. CLRFIO EQ *
  1011. *
  1012. SA1 B1+BDSNAME (X1) = NAME OF FILE
  1013. NG X1,CLRFIO1 NEG. NAME = FILE IS PRESENT
  1014. ZR X1,CLRFIO --- EXIT IF NO FILE PRESENT
  1015. CLRFIO1 SA1 B1+BDSINF (X1) = FILE INFORMATION
  1016. AX1 18
  1017. MX2 -6
  1018. BX1 -X2*X1 (X1) = FILE TYPE
  1019. ZR X1,CLRFIO --- EXIT IF NO FILE TYPE
  1020. SX2 X1-NFTYPES-1 COMPARE W/ MAXIMUM FILE TYPE
  1021. PL X2,CLRFIO --- EXIT IF TYPE OUT OF RANGE
  1022. SA1 X1+ATTRTAB (X1) = FILE ATTRIBUTE WORD
  1023. SX1 X1+ (X1) = *AFTJMP* PARAMETER
  1024. NZ X1,CLRFIO --- NEITHER DATASET NOR NAMESET
  1025.  
  1026. SX3 B1+ SAVE FIP ADDR OVER INTLOK
  1027. *
  1028. INTLOK X,I.DS,W INTERLOCK CHANGING FILE NODE
  1029. CALL READDS,X3 READ FILE NODE HEADER
  1030. SA1 FILINF1 FILE INFORMATION WORD
  1031. MX6 -FFIELD
  1032. LX6 FIO
  1033. BX7 X6*X1 CLEAR FILE I/O ACTIVITY
  1034. *
  1035. * ENSURE THAT THIS STATION IS THE ONE WITH THE RESERVATION
  1036. *
  1037. BX1 -X6*X1 EXTRACT RESERVATION ENTRY
  1038. LX1 -FIO POSITION AT RIGHT
  1039. SA2 STATION RELEASING STATION NUMBER
  1040. SX2 X2+1 INCR (TO ALLOW FOR CONSOLE)
  1041. IX6 X1-X2 COMPARE WITH RESERVATION
  1042. NZ X6,CLRDON EXIT IF NOT THE SAME STATION
  1043. SA7 A1 STORE WITH ENTRY CLEARED
  1044. *
  1045. * * MODIFY FILE NODE IN ECS
  1046. *
  1047. SA1 DSLOC
  1048. SX2 DSHEAD
  1049. IX0 X1+X2
  1050. SA0 DSH
  1051. WE FPRMLTH
  1052. RJ ECSPRTY
  1053. *
  1054. CLRDON INTCLR X,I.DS
  1055. EQ CLRFIO --- EXIT
  1056. * /--- BLOCK READFTB 00 000 79/08/13 02.29
  1057. TITLE READFTB
  1058. *
  1059. * -READFTB-
  1060. *
  1061. * THIS ROUTINE READS THE RECORD MANAGEMENT TABLE
  1062. * AND THE RECORD ALLOCATION TABLE FROM ECS INTO
  1063. * THE CM BUFFERS. THE ALLOC. TABLE IS ONLY READ
  1064. * FOR NAMESET TYPE FILES.
  1065. *
  1066. * THIS ASSUMES THAT -READDS- HAS BEEN CALLED.
  1067. *
  1068. * THE DATASET PROCESS (I.DS) SHOULD BE INTERLOCKED.
  1069. *
  1070. * ENTRY (B1) = ADDRESS OF -ATTACH- FIP.
  1071. *
  1072. * ON EXIT,
  1073. *
  1074. * RMT = RECORD MANAGEMENT TABLE
  1075. * RAT = RECORD ALLOCATION TABLE (NAMESETS ONLY)
  1076. *
  1077. ENTRY READFTB
  1078. *
  1079. READFTB EQ *
  1080. SA1 DSLOC ECS ADDRESS OF FILE NODE
  1081. SA2 BRMT BIAS TO RMT
  1082. IX0 X1+X2 ECS ADDRESS OF RMT
  1083. SA3 FILINF2
  1084. MX6 -FFIELD
  1085. AX3 FTBSIZE SHIFT TO TABLE SIZE IN WORDS
  1086. BX3 -X6*X3 GET TABLE SIZE
  1087. SA2 B1+BDSINF (X2) = 1/NAMESET,59/OTHER STUFF
  1088. SB1 X3+ (B1) = RAT/RMT SIZE IN WORDS
  1089. SA0 RMT ADDRESS OF CM BUFFER
  1090. RE B1 READ RECORD MANAGEMENT TABLE
  1091. RJ ECSPRTY
  1092. *
  1093. PL X2,READFTB --- EXIT IF NOT NAMESET
  1094. SA2 BRAT BIAS TO RAT
  1095. IX0 X1+X2 ECS ADDRESS OF RAT
  1096. SA0 RAT ADDRESS OF CM BUFFER
  1097. RE B1 READ RECORD ALLOCATION TABLE
  1098. RJ ECSPRTY
  1099. EQ READFTB --- EXIT
  1100. * /--- BLOCK READNAM 00 000 79/08/13 02.29
  1101. TITLE READNAM -- READ CURRENT USER NAME
  1102. READNAM SPACE 5,20
  1103. ** READNAM - READ CURRENT NAME ENTRY
  1104. *
  1105. * READS THE NAME ENTRY THAT THE USER IS CURRENTLY
  1106. * SET FOR INTO A SPECIFIED LOCATION.
  1107. *
  1108. * ENTRY *READDS* CALLED.
  1109. * *I.DS* (DATASET PROCESS) INTERLOCKED.
  1110. *
  1111. * ENTRY (B1) = ADDR OF -ATTACH- FIP (E.G. TDSNAME)
  1112. * (B2) = ADDR OF NAMESET NAME (E.G. TRECNAM)
  1113. *
  1114. * EXIT (X2) = >0 IF NON-SOURCE BLK IN USER LESSON.
  1115. * (X7) = -1 IF NAME FOUND, ELSE POSITIVE.
  1116. * (B1) = LENGTH OF NAME ENTRY.
  1117. *
  1118. * CALLS CHRCOMP, CHRMOVE, FINDNAM.
  1119. *
  1120. * MACROS CALL.
  1121. *
  1122. ENTRY READNAM
  1123. *
  1124. READNAM EQ *
  1125. SX6 B1 SAVE ADDR OF -ATTACH- FIP
  1126. SX7 B2 SAVE ADDR OF NAME
  1127. SA6 FIPSAVE
  1128. SA7 NAMSAVE
  1129. SA1 B2+ CHECK IF CURRENTLY SET TO NAME
  1130. ZR X1,READE0 --- ERROR IF NOTHING TO READ
  1131. *
  1132. * * READ CURRENT NAME
  1133. *
  1134. SA1 NAMLOC0 ECS ADDRESS OF NAMES
  1135. SA2 B1+BDSINF
  1136. SX2 X2 BIAS TO CURRENT NAME ENTRY
  1137. IX0 X1+X2 ECS ADDRESS OF NAME ENTRY
  1138. BX6 X0
  1139. SA6 NAMLOC SAVE ADDRESS FOR LATER USE
  1140. SA1 NAMWDS LENGTH OF NAME ENTRY
  1141. SB1 X1
  1142. SA0 NAME
  1143. RE B1 READ CURRENT NAME ENTRY
  1144. RJ ECSPRTY
  1145. *
  1146. * * CHECK IF BIAS STILL GIVES CURRENT NAME
  1147. *
  1148. SA1 FILINF2
  1149. MX7 -FFIELD
  1150. AX1 FNSIZE SHIFT TO NAME SIZE IN CHARS
  1151. BX6 -X7*X1 X6 = NAME SIZE IN CHARS
  1152. SA1 NAMSAVE (X1) = ADDRESS OF NAME
  1153. CALL CHRCOMP,X1,A0,X6
  1154. NZ X6,REFIND IF NAME MOVED SINCE LAST TIME
  1155. SA1 NAMLOC ECS ADDRESS OF NAME ENTRY
  1156. SA2 NAMWDS GET LENGTH OF ENTRY
  1157. BX0 X1 RETURN ECS ADDRESS
  1158. SB1 X2 RETURN LENGTH OF ENTRY
  1159. EQ READOK --- EXIT OK
  1160. * /--- BLOCK REFIND 00 000 79/06/27 11.47
  1161. *
  1162. * * RE-FIND THE NAME (SOMEONE SHIFTED IT)
  1163. *
  1164. REFIND SA1 NAMSAVE (X1) = ADDRESS OF NAME
  1165. CALL FINDNAM,X1 FIND THE CURRENT NAME
  1166. *
  1167. * AFTER CALL, X0 = ECS ADDRESS OF NAME, X6 HAS BIAS
  1168. * TO NAME, X5 = SIZE OF ENTRY IN WORDS, X7 = RETURN.
  1169. *
  1170. PL X7,READE0 --- JUMP IF NO LONGER EXISTS
  1171. *
  1172. * * UPDATE ECS BIAS TO CURRENT NAME
  1173. *
  1174. SA1 FIPSAVE (X1) = ADDRESS OF -ATTACH- FIP
  1175. SA1 X1+BDSINF
  1176. MX2 -18 MASK FOR NAME BIAS
  1177. BX1 X1*X2 ZERO OUT OLD BIAS
  1178. BX6 X1+X6 INSERT NEW LOCATION
  1179. SA6 A1 STORE
  1180. *
  1181. * * UPDATE ECS ADDRESS OF CURRENT NAME
  1182. *
  1183. BX6 X0 X6 = ECS ADDR. OF CURRENT NAME
  1184. SA6 NAMLOC
  1185. *
  1186. * * RE-READ CORRECT NAME ENTRY
  1187. *
  1188. SA1 NAMWDS LENGTH OF NAME ENTRY
  1189. SB1 X1
  1190. SA0 NAME
  1191. RE B1 READ NAME ENTRY
  1192. RJ ECSPRTY
  1193. *
  1194. READOK SA1 NAME-1+B1 GET EXTRA INFO WORD
  1195. BX6 X1
  1196. SA6 NAMINFO SAVE COPY FOR LATER USE
  1197. MX7 -1 RETURN FOUND
  1198. MX2 0 SET TO SOURCE OR SYSTEM LESSON
  1199. SA3 LESSCM+LSTOUSE
  1200. NG X3,READNAM --- IF SYSTEM LESSON
  1201. SA3 FFAW (X3) = FILE ATTRIBUTE WORD
  1202. LX3 60-/FAW/S.FTYPE POSITION FILE TYPE CODE
  1203. MX4 -/FAW/M.FTYPE (X4) = MASK FOR FILE TYPE
  1204. BX3 -X4*X3 (X3) = FILE TYPE
  1205. SX3 X3-GRTYPE CHECK FOR GROUP
  1206. NZ X3,READOK1 --- IF NOT GROUP
  1207. SA3 FILINF5 (X3) = FILE INFORMATION
  1208. AX3 FUPD8LV POSITION UPDATE LEVEL
  1209. MX4 -FFIELD (X4) = MASK FOR UPDATE LEVEL
  1210. BX3 -X4*X3 (X3) = UPDATE LEVEL
  1211. SX3 X3-UPD8LV6 CHECK FOR LEVEL .GE. 6
  1212. NG X3,READNAM --- EXIT IF GROUP .LE. 5
  1213. READOK1 AX1 15+15+24
  1214. MX2 -IBSUBF
  1215. BX2 -X2*X1 (X2) = 0 IF SOURCE, ELSE .GT. 0
  1216. EQ READNAM --- EXIT
  1217. *
  1218. * * CURRENT NAME WAS DELETED BY ANOTHER USER
  1219. *
  1220. READE0 SA1 NAMSAVE (X1) = ADDRESS OF NAME
  1221. CALL CHRMOVE,NONAME,X1,MAXNCHR
  1222. SA1 FIPSAVE (X1) = ADDRESS OF -ATTACH- FIP
  1223. SA1 X1+BDSINF
  1224. MX2 -18 MASK FOR NAME BIAS
  1225. BX6 X1*X2 ZERO OUT BIAS
  1226. SA6 A1 STORE
  1227. MX7 0 INDICATE NAME CANNOT BE FOUND
  1228. EQ READNAM --- EXIT
  1229.  
  1230. FIPSAVE BSS 1 ADDRESS OF -ATTACH- FIP
  1231. NAMSAVE BSS 1 ADDRESS OF NAME
  1232.  
  1233. * /--- BLOCK FINDNAM 00 000 79/08/13 02.29
  1234. TITLE NAMESET BINARY/GENERIC SEARCH
  1235. *
  1236. * -FINDNAM-
  1237. *
  1238. * THIS ROUTINE PERFORMS A BINARY CHOP SEARCH
  1239. * OF AN ECS RESIDENT NAMESET DIRECTORY. ONCE
  1240. * THE BINARY SEARCH IS DONE, A LINEAR SCAN IS
  1241. * PERFORMED TO COUNT (UP TO 2) THE NUMBER OF
  1242. * GENERIC MATCHES TO THE KEY UNTIL IT CANNOT BE
  1243. * MATCHED GENERICALLY. THE FIRST NON-ZERO 6-BIT
  1244. * CODE WHEN SCANNING FROM THE END OF THE OBJECT
  1245. * KEY FORWARD DETERMINES THE MASK USED FOR GENERIC
  1246. * COMPARISONS.
  1247. *
  1248. * THIS ASSUMES THAT -READDS- HAS BEEN CALLED.
  1249. *
  1250. * THE DATASET PROCESS (I.DS) SHOULD BE INTERLOCKED.
  1251. *
  1252. * ON ENTRY--
  1253. *
  1254. * B1 = ADDRESS OF KEY TO SEARCH FOR
  1255. *
  1256. * ON EXIT--
  1257. *
  1258. * X0 = ECS ADDRESS OF REQUESTED NAME
  1259. * X5 = LENGTH OF AN ENTRY IN WORDS
  1260. * X6 = RELATIVE ECS BIAS TO NAME
  1261. * (OR WHERE IT SHOULD BE PUT)
  1262. * X7 = -1 IF FOUND,
  1263. * ELSE COUNT OF GENERIC MATCHES (UP TO 2)
  1264. *
  1265. *
  1266. ENTRY FINDNAM
  1267.  
  1268. FINDNAM EQ *
  1269. *
  1270. * SAVE B5, B7 OVER THE ROUTINE
  1271. *
  1272. SX6 B5 SAVE B5
  1273. SA6 B5SAVE
  1274. SX6 B7 SAVE B7
  1275. SA6 NCTYPE
  1276. * /--- BLOCK FINDNAM 00 000 79/01/25 04.05
  1277. *
  1278. * * GENERATE MASK FOR LAST WORD OF ENTRY
  1279. *
  1280. SA1 FILINF2
  1281. MX7 -FFIELD
  1282. AX1 FNSIZE SHIFT TO LENGTH OF NAME (CHARS)
  1283. BX1 -X7*X1 CHARACTERS IN NAME
  1284. CALL CHRMOVE,B1,NAMKEY,X1 GET OBJECT KEY
  1285. BX4 X7 X4 = MASK FOR LAST WORD
  1286. *
  1287. * * INITIALIZE CONSTANTS
  1288. *
  1289. SA1 NAMWDS GET ENTRY LENGTH (WORDS)
  1290. BX5 X1 X5 = LENGTH OF ENTRY IN WORDS
  1291. SB6 X1-1 B6 = LENGTH OF OBJECT KEY
  1292. SB5 NAMKEY-1+B6 B5 = LWA OF OBJECT KEY
  1293. SB1 1 B1 = CONSTANT 1
  1294. SB7 59 B7 = CONSTANT 59
  1295. SA0 NAMTMP
  1296. SA1 NAMLOC0 GET ECS ADDRESS OF FIRST NAME
  1297. BX7 X1 X7 = ECS ADDRESS OF NAMES
  1298. * /--- BLOCK FINDNAM 00 000 78/02/03 03.23
  1299. *
  1300. * BEGIN EXECUTION
  1301. *
  1302. SB2 B0 B2 = BASE POSITION (REL. 0)
  1303. SA2 NNAMINF BOTTOM 18 = NAMES IN USE
  1304. SB3 X2 B3 = DOMAIN OF SEARCH
  1305. EQ NHALF1 BEGIN EXECUTION
  1306. *
  1307. NHALF2 SB2 X3+B1 ADVANCE BASE POSITION (SCAN+1)
  1308. NG X6,NHALF1 JUMP IF PREV. LENGTH WAS ODD
  1309. SB3 B3-B1 REDUCE DOMAIN BY 1 IF EVEN
  1310. *
  1311. NHALF1 ZR B3,NOTFND -- UNSUCCESSFUL EXIT
  1312. SX3 B3 GET DOMAIN IN X3
  1313. LX6 X3,B7 SAVE ODD/EVEN FLAG IN SIGN BIT
  1314. AX3 1 DIVIDE BY 2
  1315. SB3 X3 B3 = NEW DOMAIN (LAST ONE/2)
  1316. SX3 B2+B3 X3 = POSITION BEING TESTED
  1317. IX0 X3*X5 DISPLACEMENT INTO BUFFER
  1318. IX0 X7+X0 COMPUTE ECS ADDRESS
  1319. RE B6
  1320. RJ ECSPRTY
  1321.  
  1322. SA1 A0 FIRST WORD OF SCAN KEY
  1323. SB4 NAMKEY FIRST WORD OF OBJECT KEY
  1324. COMP1 SA2 B4 GET OBJECT WORD
  1325. NG X1,COMP2 JUMP IF SCAN KEY NEGATIVE
  1326. NG X2,NHALF2 OBJECT HIGHER THAN SCAN
  1327. EQ COMP3 COMPARE - BOTH HAVE SAME SIGN
  1328. *
  1329. COMP2 PL X2,NHALF1 OBJECT LESS THAN SCAN KEY
  1330. *
  1331. COMP3 LT B4,B5,COMP4 --- JUMP IF NOT LAST WORD
  1332. BX1 X4*X1 MASK OFF IRRELAVENT CHARACTERS
  1333. *
  1334. COMP4 IX1 X2-X1
  1335. NG X1,NHALF1 JUMP IF IN 1ST HALF
  1336. NZ X1,NHALF2 JUMP IF IN 2ND HALF
  1337.  
  1338. SA1 A1+B1 NEXT WORD OF SCAN KEY
  1339. SB4 B4+B1 NEXT WORD OF OBJECT KEY
  1340. LE B4,B5,COMP1 CONTINUE IF MORE WORDS LEFT
  1341.  
  1342. IX6 X3*X5 X6 = BIAS TO NAME ENTRY
  1343. IX0 X7+X6 X0 = ECS ADDRESS OF NAME
  1344. SX7 -B1 X7 = -1 (FOUND)
  1345.  
  1346. BNREST SA1 B5SAVE
  1347. SB5 X1 RESTORE B5
  1348. SA1 NCTYPE
  1349. SB7 X1 RESTORE B7
  1350. EQ FINDNAM --- EXIT
  1351. * /--- BLOCK GENSCAN 00 000 78/02/03 02.57
  1352. *
  1353. * IF THE KEY CANNOT BE FOUND, SEARCH LINEARLY
  1354. * COUNTING THE NUMBER OF GENERIC MATCHES.
  1355. *
  1356. NOTFND SB3 B0 B3 = NUMBER OF GENERIC MATCHES
  1357. SB7 2 B7 = MAXIMUM VALUE OF GENERIC COUNT
  1358. *
  1359. * FIRST, SEARCH THE OBJECT KEY FROM THE END
  1360. * OF THE KEY FORWARD LOOKING FOR THE LAST
  1361. * CHARACTER. MASK WILL BE GENERATED FROM THAT.
  1362. *
  1363. * B5 WILL = LWA OF GENERIC PORTION OF KEY
  1364. *
  1365. MX0 -6 FOR MASKING OFF LOWER 6 BITS
  1366. SB4 NAMKEY USE B4 FOR END TEST
  1367. SB5 B4+B6 START B5 AT LWA+1 OF KEY
  1368.  
  1369. MSKLP1 LE B5,B4,GENEXIT IF KEY = 0, EXIT SEARCH
  1370. SB5 B5-B1 SCAN FROM LAST TO FIRST
  1371. SA1 B5 GET WORD OF KEY
  1372. MX6 60 INITIALIZE MASK TO WHOLE WORD
  1373. MSKLP2 LX6 6 DECREASE SIZE OF MASK
  1374. BX6 X0*X6 BY 6 BITS
  1375. BX3 -X6*X1 SEE IF MASK HOLDS CONTENTS
  1376. NZ X3,MSKFIN --- IF NOT, LAST CHAR FOUND
  1377. NZ X6,MSKLP2 IF MORE CHARS LEFT, CONTINUE
  1378. EQ MSKLP1 TRY PREVIOUS WORD IN OBJECT
  1379. *
  1380. MSKFIN AX6 6 EXTEND MASK OVER LAST CHAR
  1381. MX0 6
  1382. BX6 X0+X6 IN CASE ONLY ONE CHARACTER
  1383. * /--- BLOCK GENSCAN 00 000 78/02/03 03.07
  1384. *
  1385. * BEGIN SCANNING THE NAMES
  1386. *
  1387. SA3 NNAMINF BOTTOM 18 = NAMES IN USE
  1388. SX3 X3+B1 X3 = ENTRIES + 1
  1389. GSCAN SX1 B2+B3 ENTRY TO BE TESTED
  1390. IX0 X1-X3 SEE IF END OF NAMES
  1391. PL X0,GENEXIT --- IF NO MORE NAMES, EXIT
  1392. IX0 X1*X5 DISPLACEMENT INTO BUFFER
  1393. IX0 X7+X0 COMPUTE ECS ADDRESS
  1394. RE B6
  1395. RJ ECSPRTY
  1396.  
  1397. SB4 NAMKEY START OF GENERIC KEY
  1398. SA1 A0 START OF NAME BEING SEARCHED
  1399. GCOMP SA2 B4 GET NEXT WORD OF DIRECTORY NAME
  1400. LT B4,B5,GCOMP2 --- IF LAST WORD, USE MASK
  1401. BX1 X1*X6 MASK OFF ALL BUT GENERIC PART
  1402. GCOMP2 BX1 X1-X2 COMPARE WITH GENERIC KEY
  1403. NZ X1,GENEXIT --- IF DOES NOT MATCH, EXIT
  1404. SA1 A1+B1 GET NEXT WORD OF SEARCH NAME
  1405. SB4 B4+B1 NEXT WORD OF GENERIC KEY
  1406. LE B4,B5,GCOMP --- IF NOT LAST WORD, CONTINUE
  1407.  
  1408. SB3 B3+B1 ADD TO COUNT OF GENERIC MATCHES
  1409. LT B3,B7,GSCAN --- KEEP LOOKING IF LESS THAN 2
  1410. *
  1411. GENEXIT SX6 B2 RETURN FIRST GENERIC MATCH
  1412. IX6 X6*X5 BIAS TO FIRST GENERIC MATCH
  1413. IX0 X7+X6 X0 = ECS ADDRESS OF NAME
  1414. SX7 B3 RETURN COUNT OF GENERIC MATCHES
  1415. EQ BNREST --- RESTORE REGS AND EXIT
  1416. *
  1417. NAMKEY BSS MAXNWDS KEY BEING SEARCHED FOR
  1418. NAMTMP BSS MAXNWDS+1 TABLE ENTRY BEING CHECKED
  1419. B5SAVE BSS 1 USED TO SAVE B5 OVER ROUTINE
  1420. * /--- BLOCK FINDRES 00 000 80/07/02 00.14
  1421. TITLE FINDRES -- SEARCH SIGNON RESERVATION TABLE
  1422. *
  1423. * -FINDRES-
  1424. *
  1425. * SEARCHES THE SIGNON RESERVATION TABLE IN ECS TO
  1426. * DETERMINE IF THE CURRENTLY SELECTED NAME IS SIGNED
  1427. * ON OR NOT.
  1428. *
  1429. * ENTRY (TDSNAME) = GROUP NAME
  1430. * (TRECNAM) = SIGNON NAME
  1431. *
  1432. * EXIT (X6) = -1 IF RESERVED BY A STATION
  1433. * 0 IF NOT RESERVED
  1434. * (X5) = INDEX TO ENTRY WHERE FOUND
  1435. * (X4) = PREVIOUS ENTRY IN CHAIN (-1 IF NONE)
  1436. * (X0) = ECS ADDRESS OF RESERVATION
  1437. * (SIGNCM) = RESERVATION ENTRY (3 WORDS)
  1438. *
  1439. *
  1440. ENTRY FINDRES
  1441. FINDRES EQ *
  1442. SA1 TRECNAM COMBINE NAME
  1443. SA2 TRECNAM+1
  1444. SA3 TDSNAME AND GROUP
  1445. IX1 X1+X2
  1446. IX1 X1+X3
  1447. MX6 12
  1448. BX1 -X6*X1 MASK OFF EXPONENT
  1449. PX6 X1
  1450. NX6 X6
  1451. SX2 NUMRESV SIZE OF HASH SECTION OF TABLE
  1452. PX3 X2
  1453. NX3 X3
  1454. FX6 X6/X3 INDEX/TABLESIZE
  1455. UX6 X6,B1
  1456. LX6 X6,B1 INT(INDEX/TABLESIZE)
  1457. IX6 X2*X6 TABLESIZE*INT(INDEX/TABLESIZE)
  1458. IX5 X1-X6 INDEX MOD TABLESIZE
  1459. MX4 -1 INITIALIZE PREVIOUS INDEX
  1460. * /--- BLOCK FINDRES 00 000 80/07/02 00.14
  1461. *
  1462. * * CHECK IF SIGNON ENTRY MATCHES
  1463. *
  1464. READRES SA1 ASIGNON ECS ADDRESS OF TABLE
  1465. SX2 RESVLTH SIZE OF EACH ENTRY
  1466. IX6 X5*X2 BIAS TO THIS ENTRY
  1467. IX0 X1+X6
  1468. SA0 SIGNCM
  1469. RE RESVLTH
  1470. RJ ECSPRTY
  1471. SA1 A0 PICK UP FIRST WORD
  1472. ZR X1,EMPTY --- DETECT THIS ENTRY EMPTY
  1473. SB1 1
  1474. SA1 TRECNAM
  1475. SA2 SIGNCM
  1476. BX6 X1-X2 COMPARE FIRST WORD
  1477. NZ X6,REHASH --- REHASH IF NO MATCH
  1478. SA1 A1+B1
  1479. SA2 A2+B1
  1480. BX6 X1-X2 COMPARE SECOND WORD
  1481. MX7 -12
  1482. BX6 X7*X6 MASK OFF UNUSED BITS
  1483. NZ X6,REHASH --- REHASH IF NO MATCH
  1484. SA1 TDSNAME
  1485. SA2 A2+B1
  1486. BX6 X1-X2 COMPARE THIRD WORD
  1487. BX6 X7*X6 MASK OFF UNUSED BITS
  1488. NZ X6,REHASH --- REHASH IF NO MATCH
  1489. BX3 X0 SAVE ECS ADDRESS
  1490. BX0 X3 RESTORE ECS ADDRESS
  1491. MX6 -1 -1 = FOUND
  1492. EQ FINDRES --- EXIT
  1493. *
  1494. * * SELECT NEXT ENTRY IN CHAIN
  1495. *
  1496. REHASH BX4 X5 SET PREVIOUS INDEX TO ENTRY
  1497. SA1 SIGNCM+1 PICK UP SECOND WORD OF ENTRY
  1498. MX6 -12
  1499. BX5 -X6*X1 MASK OFF INDEX TO NEXT ENTRY
  1500. NZ X5,READRES --- JUMP IF NOT END-OF-CHAIN
  1501. *
  1502. EMPTY BSS 0
  1503. MX6 0 0 = NOT FOUND
  1504. EQ FINDRES --- EXIT
  1505. * /--- BLOCK LJUSTC 00 000 77/08/17 23.07
  1506. TITLE LJUSTC LEFT JUSTIFY CODEWORD
  1507. *
  1508. * LJUSTC
  1509. *
  1510. * 'LEFT JUSTIFIES THE NAME IN X1, CHANGING ANY
  1511. * ENCLOSED ZEROS TO SPACES.
  1512. *
  1513. *
  1514. ENTRY LJUSTC
  1515. LJUSTC EQ *
  1516. ZR X1,LJUSTC --- EXIT IF ALL ZEROS (OR -0)
  1517. MX0 6 MASK FOR ONE CHARACTER
  1518. LX1 -6 ACCOUNT FOR INITIAL SHIFT
  1519. LJC1 LX1 6 GET NEXT CHAR TO TOP
  1520. BX2 X0*X1 EXTRACT
  1521. ZR X2,LJC1 ELIMINATE LEADING ZEROS
  1522. SB1 1
  1523. SB2 9
  1524. MX0 -6 SEARCH FOR LAST CHAR (NONZERO)
  1525. SX4 1R X4 = SPACE CODE FOR FILL
  1526. LJC2 BX2 -X0*X1
  1527. LX0 6 SHIFT MASK
  1528. LX4 6 SHIFT FILL CHARACTER
  1529. SB2 B2-B1
  1530. ZR X2,LJC2
  1531. NG B2,LJUSTC --- EXIT IF ONLY 1 CHAR
  1532. LJC3 BX2 -X0*X1
  1533. NZ X2,LJC4
  1534. BX1 X1+X4
  1535. LJC4 LX0 6
  1536. LX4 6
  1537. SB2 B2-B1
  1538. PL B2,LJC3
  1539. EQ LJUSTC --- EXIT
  1540. * /--- BLOCK MASTERFILE 00 000 82/10/01 17.13
  1541. TITLE MASTERFILE FUNCTIONS
  1542. RMFSIZE SPACE 4,10
  1543. ** RMFSIZE - READ MASTERFILE DIRECTORY SIZE.
  1544. *
  1545. * READS MASTERFILE DIRECTORY SIZE FROM THE MASTER-
  1546. * FILE DIRECTORY FOR A SPECIFIC MASTERFILE.
  1547. *
  1548. * ENTRY (X1) = MASTERFILE NAME OR NUMBER
  1549. *
  1550. * EXIT (X1) = NUM OF DIRECTORY BLOCKS IF MF ACTIVE
  1551. * = -1 IF MASTERFILE NOT ACTIVE
  1552. *
  1553. * USES A - 0, 1, 2.
  1554. * B - 1, 3.
  1555. * X - 0, 1, 2.
  1556. *
  1557. * CALLS NONE.
  1558. *
  1559. * MACROS NONE.
  1560.  
  1561. RMFSIZE EQ *
  1562. SA0 PNAMES (A0) = MASTERFILE NAMES FWA
  1563.  
  1564. * CHECK IF WE HAVE A NUMBER
  1565.  
  1566. NG X1,RMF10 IF A NAME (NO MF NUMBER IS NEG)
  1567. SB3 X1 (B3) = PRESET TO POSS MF NUM
  1568. SX2 NDSUS (X2) = NUMBER OF MASTERFILES
  1569. IX2 X1-X2 COMPARE PARAMETER WITH NDSUS
  1570. PL X2,RMF10 IF A NAME (NOT IN (0..NDSUS-1))
  1571. SA2 A0+B3 (X2) = THE MASTERFILE NAME
  1572. NZ X2,RMF40 IF MASTERFILE ACTIVE
  1573. EQ RMF30 MASTERFILE NOT ACTIVE
  1574.  
  1575. * LOOP THROUGH LIST FOR THIS MASTERFILE NAME
  1576.  
  1577. RMF10 BSS 0
  1578. SB3 NDSUS (B3) = NUMBER OF MASTERFILES
  1579.  
  1580. RMF20 BSS 0
  1581. SA2 A0+B3 (X2) = NEXT MASTERFILE NAME
  1582. BX2 X1-X2 COMPARE WITH SPECIFIED MF NAME
  1583. ZR X2,RMF40 IF THIS MF (IF THEY ARE SAME)
  1584. SB3 B3-B1 (B3) = NEXT ORDINAL
  1585. PL B3,RMF20 IF MORE MFS TO SEARCH THROUGH
  1586.  
  1587. RMF30 BSS 0
  1588. MX1 -1 (X1) = -1 = MF NOT ACTIVE
  1589. EQ RMFSIZE
  1590.  
  1591. * GET DIRECTORY SIZE FIELD FOR THIS MASTERFILE
  1592.  
  1593. RMF40 BSS 0
  1594. SA1 PITS+B3 (X1) = EM ADDR OF SPEC MF DIR
  1595. SX0 2 (X0) = OFFSET TO FIRST PARAMETR
  1596. IX0 X0+X1 (X0) = EM ADDR OF FRST PARAMETR
  1597. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  1598. MX0 -6 (X0) = MASK FOR DIR SIZE FIELD
  1599. LX1 60D-48D POSITION DIR SIZE TO LOW BITS
  1600. BX1 -X0*X1 (X1) = DIRECTORY SIZE FIELD
  1601. EQ RMFSIZE
  1602.  
  1603. * /--- BLOCK MASTERFILE 00 000 79/04/06 23.31
  1604. SPACE 4,10
  1605. ** S"MF$" - RETURN *MF$* FOR A SPECIFIC MASTERFILE.
  1606. *
  1607. * RETURNS THE VALUE OF MASTERFILE PARAMETER *MF$*
  1608. * FOR A SPECIFIED MASTERFILE. POSSIBLE PARAMETERS
  1609. * ARE *DCPP*, *NMFBLK*, *PITLTH*, AND *MFFILS*.
  1610. *
  1611. * ENTRY (X1) = MASTERFILE NAME OR NUMBER
  1612. *
  1613. * EXIT (X1) = *MF$* FOR THE MASTERFILE IF ACTIVE
  1614. * = -1 IF MASTERFILE NOT ACTIVE
  1615. *
  1616. * USES A - NONE.
  1617. * B - NONE.
  1618. * X - 1.
  1619. *
  1620. * CALLS RMFSIZE.
  1621. *
  1622. * MACROS NONE.
  1623.  
  1624. PURGMAC MFFUNC
  1625. MACREF MFFUNC$
  1626. MFFUNC MACRO ARG
  1627. LOCAL LAB20
  1628. MACREF MFFUNC
  1629. MF$ MICRO 1,, ARG
  1630. ENTRY S"MF$"
  1631. S"MF$" EQ *
  1632. CALL RMFSIZE
  1633. NG X1,S"MF$" IF MASTERFILE NOT ACTIVE
  1634. NZ X1,LAB20 IF NOT A 2-PART DIRECTORY MF
  1635.  
  1636. * GET PARM FOR A 2-PART DIRECTORY MASTERFILE
  1637.  
  1638. SX1 "MF$"2 (X1) = *MF$* FOR A 2-PART MF
  1639. EQ S"MF$"
  1640.  
  1641. * GET PARM FOR A 3-PART DIRECTORY MASTERFILE
  1642.  
  1643. LAB20 BSS 0
  1644. SX1 "MF$"3 (X1) = *MF$* FOR A 3-PART MF
  1645. EQ S"MF$"
  1646.  
  1647. ENDM
  1648.  
  1649.  
  1650. MFFUNC DCPP
  1651. MFFUNC NMFBLK
  1652. MFFUNC PITLTH
  1653. MFFUNC MFFILS
  1654. MFFUNC MFLTH
  1655. * /--- BLOCK END 00 000 77/11/14 19.48
  1656. *
  1657.  
  1658. END
plato/source/plaopl/diskfio.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator