Table of Contents

EXEC4

Table Of Contents

  • [00008] EXEC4 OVERLAYS FOR COMMAND EXECUTION
  • [00040] MACROS
  • [00093] -STATS- COMMAND (CODE = 202)
  • [00431] EXSTATV - TURN LESSON EXECUTION STATS ON/OFF
  • [00453] ONOFF - TURN EXECUTION STATISTICS ON OR OFF
  • [00514] DRPEXEC - CLEAR STATS BUFFER WHEN EXECUTOR DROPS
  • [00527] CLEARBUF - ZERO LESSON EXECUTION STATISTICS BUFFER
  • [00569] ALLOCOV ALLOCATE DISK SPACE
  • [00934] DEALLOV RELEASE DISK SPACE
  • [01100] RENAMOV CHANGE NAME OF DISK FILE
  • [01359] RETYPE - CHANGE FILE TYPE
  • [01454] DIOGOV DISK I/O PROCESSING
  • [01593] FBIT COMMAND
  • [01682] -TERMSET-
  • [01718] LOCATE
  • [01833] -ATTACHF- AND -FILEF-
  • [02098] -DETACHF-
  • [02317] -READF-/-WRITEF-
  • [02615] -FILENAM- COMMAND
  • [02707] -NVERS- COMMAND
  • [02751] -SYSFILE- EXECUTION OVERLAY
  • [03424] NEWSRCH - SEARCH NEW DISK SYSTEM FOR FILE
  • [03748] SYSFRST - RESTORE OVDATAS FOR -SYSFILE-
  • [03787] SYSFSAV - SAVE OVDATAS FOR -SYSFILE-
  • [04051] SETPF - SET TO PLATO PACK AND FILE
  • [04104] SETPACK - IMITATION -SETPACK- COMMAND
  • [04862] FIP CONVERSIONS
  • [04865] FIELD - MOVE BIT FIELD BETWEEN REGISTERS
  • [04904] NEWFIPV - CONVERT OLD FORMAT FIP TO NEW FORMAT
  • [04966] OLDFIPV - CONVERT NEW FORMAT FIP TO OLD FORMAT
  • [05020] -SYSLOC- COMMAND EXECUTION OVERLAY
  • [05084] DISK COMMANDS
  • [05100] -RENAMEF- AND -RETYPEF- TUTOR COMMANDS
  • [05225] PLATO NETWORK REQUEST PROCESSING
  • [05622] NETIOF - TEMPORARY NETIO ROUTINE.
  • [05733] NETIOT - TEMPORARY NETIO ROUTINE.
  • [05813] NETIOR - RELEASE FIXED -NETIO- BUFFER.
  • [05844] PUT PLF REQUEST
  • [05992] DROP LINK

Source Code

EXEC4.txt
  1. EXEC4
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK EXEC4 00 000 78/12/18 21.22
  4. IDENT PLAT3$
  5. LCC OVERLAY(PLATO,1,0)
  6. END
  7. IDENT EXEC4
  8. TITLE EXEC4 OVERLAYS FOR COMMAND EXECUTION
  9. *
  10. *
  11. CST
  12. *
  13. *
  14. EXEC4$ OVFILE
  15. *
  16. *
  17. EXT ECSPRTY
  18. EXT PROCESS,PROC,CKPROC,RETPROC
  19. EXT PDWRITE
  20. EXT DIOREQ,DIOREQ1
  21. EXT WINDOW
  22. EXT ILOC
  23. EXT RNETSF,RNETSN,LNETSF,LNETSN
  24. EXT REQCHK
  25. EXT SAVKEY,RESTKEY
  26. EXT SAVLES,RESTLES
  27. EXT S=MAS
  28. EXT FIPCHK
  29. *
  30. CONV$ EQU 0 GENERATE ERROR CODE CONV. TABLE
  31. LIST X
  32. *CALL PLASMRC
  33. *
  34. * NEEDED TO DEFINE QUALIFIED CODE
  35. *
  36. *CALL PLASFIP
  37. *
  38. LIST *
  39. * /--- BLOCK MACROS 00 000 76/05/10 00.23
  40. TITLE MACROS
  41. *
  42. *
  43. PURGMAC CLRBIT
  44. CLRBIT MACRO INDEX,TABLE
  45. LOCAL A,K
  46. SX1 INDEX
  47. SA2 K LOAD DIVIDE LITERAL
  48. PX3 X1
  49. FX2 X2*X3 INDEX/48
  50. UX2 X2 X2 = WORD POSITION
  51. SX3 48
  52. DX3 X2*X3 COMPUTE REMAINDER
  53. IX3 X1-X3
  54. SB2 X3 B2 = SHIFT COUNT
  55. MX3 1
  56. LX3 60-12 FORM MASK FOR SINGLE BIT
  57. AX3 X3,B2
  58. SB2 TABLE
  59. SA2 X2+B2 LOAD APPROPRIATE WORD
  60. BX6 -X3*X2 CLEAR BIT
  61. SA6 A2
  62. EQ A EXIT
  63. K DATA 17170125252525252526B 1/48*2**-48
  64. A BSS 0
  65. ENDM
  66. *
  67. *
  68. *
  69. PURGMAC SETBIT
  70. SETBIT MACRO INDEX,TABLE
  71. LOCAL A,K
  72. SX1 INDEX
  73. SA2 K LOAD DIVIDE LITERAL
  74. PX3 X1
  75. FX2 X2*X3 INDEX/48
  76. UX2 X2 X2 = WORD POSITION
  77. SX3 48
  78. DX3 X2*X3 COMPUTE REMAINDER
  79. IX3 X1-X3
  80. SB2 X3 B2 = SHIFT COUNT
  81. MX3 1
  82. LX3 60-12 FORM MASK FOR SINGLE BIT
  83. AX3 X3,B2
  84. SB2 TABLE
  85. SA2 X2+B2 LOAD APPROPRIATE WORD
  86. BX6 X3+X2 SET BIT
  87. SA6 A2
  88. EQ A EXIT
  89. K DATA 17170125252525252526B 1/48*2**-48
  90. A BSS 0
  91. ENDM
  92. * /--- BLOCK STATS 00 000 75/04/02 03.38
  93. TITLE -STATS- COMMAND (CODE = 202)
  94.  
  95. ** -STATS- COMMAND EXECUTION OVERLAY
  96. *
  97. * STATS ARG,LESSON
  98. * STATS ARG,ACCOUNT';LESSON
  99. * STATS ARG,'OLD';LESSON
  100. * STATS ARG,(N1)';(N2)
  101. * STATS ARG,(N2)
  102. * STATS ARG,0 $$ ALL LESSONS
  103. * STATS ARG $$ ALL LESSONS
  104. *
  105. * ARG = 1 = CONDENSING STATS OFF
  106. * 0 = EXECUTION STATS OFF
  107. * -1 = EXECUTION STATS ON
  108. * -2 = CONDENSOR STATS ON
  109. * -3 = MAXIMUM-TIME EXECUTION STATS ON
  110. *
  111. * GETVAR CODE 1 = ARG AS DEFINED ABOVE
  112. * 2 = ACCOUNT NAME
  113. * 3 = LESSON NAME
  114. *
  115. * ENTRY (X5) = NEG. IF LESSON NAME/ACCOUNT OMITTED
  116. *
  117. *
  118. * -STATS- COMMAND OVERVIEW
  119. *
  120. * THE -STATS- COMMAND FIRST PROCESSES THE ARGUMENT
  121. * (-3, -2, -1, 0, 1) AND THE OPTIONAL FILE NAME AND
  122. * CHECKS TO SEE THAT THE FIRST ARGUMENT IS LEGAL.
  123. * IT THEN POSTS A REQUEST TO ALL EXECUTORS OR
  124. * CONDENSORS.
  125. *
  126. * REQUESTS TO EXECUTORS ARE POSTED BY (1) PLACING
  127. * THREE WORDS OF PARAMETERS IN ECS, (2) POSTING AN
  128. * INTER-EXECUTOR REQUEST TO OTHER EXECUTORS, AND
  129. * (3) POSTING AN ACTION REQUEST TO YOURSELF.
  130. *
  131. * (EXSTPRM) CONTAINS THE ADDRESS OF THE THREE WORDS
  132. * OF ECS PARAMETERS FOR COMMAND EXECUTION STATS,
  133. * WHICH CONTAIN THE FOLLOWING DATA --
  134. *
  135. *T 60/0 TO TURN OFF, 1 FOR NORMAL, 2 FOR MAXIMUM TIME
  136. *T, 42/ACCOUNT NAME,18/ATTRIBUTES
  137. *T, 60/FILE NAME
  138. *
  139. * THE FORMAT OF AN INTER-EXECUTOR REQUEST TO TURN
  140. * COMMAND EXECUTION STATISTICS ON OR OFF IS --
  141. *
  142. *T 42/0, 18/XR.STAT
  143. *
  144. * THE FORMAT AN ACTION-REQUEST TO TURN COMMAND
  145. * EXECUTION STATS ON OR OFF IS --
  146. *
  147. *T 42/0, 18/RQSTAT
  148. *
  149. *
  150. * UPON RECEIVING A REQUEST TO TURN COMMAND EXECUTION
  151. * STATS ON OR OFF, AN EXECUTOR CALLS THE *EXSTATV*
  152. * OVERLAY IN DECK *EXEC4* WITH (OVARG1) = 1. THIS
  153. * OVERLAY THEN EVALUATES THE THREE WORDS IN ECS AND
  154. * TAKES THE APPROPRIATE ACTION --
  155. *
  156. * IF STATS WERE PREVIOUSLY OFF AND ARE NOW
  157. * BEING TURNED ON, THE TIME-SLICE LENGTH IS
  158. * INCREASED BY 25 PERCENT.
  159. *
  160. * (SCOMFLG) IS SET TO 0 IF STATS ARE OFF, 1
  161. * FOR NORMAL STATS, 2 FOR MAXIMUM TIME STATS.
  162. *
  163. * IF STATS ARE BEING TURNED ON, (SCOMACT) IS
  164. * SET TO THE ACCOUNT NAME OR 0, (SCOMLES) IS
  165. * SET TO THE LESSON NAME OR 0, AND THE STATS
  166. * BUFFER FOR THAT EXECUTOR IS ZEROED.
  167. *
  168. * IF EXECUTION STATS WERE PREVIOUSLY ON AND
  169. * /--- BLOCK STATS 00 000 75/04/02 03.38
  170. * ARE NOW BEING TURNED OFF, THE ORIGINAL
  171. * TIME-SLICE LENGTH IS RESTORED.
  172. *
  173. * THE PLATO EXECUTOR WILL NOW RECORD COMMAND EXECU-
  174. * TION STATISTICS. EACH EXECUTOR HAS ITS OWN STATS
  175. * BUFFER, THE ADDRESS OF WHICH IS (ACMNDEX)+(EXID).
  176. * THERE IS ONE CELL PER COMMAND NUMBER (512 TOTAL).
  177. *
  178. * FOR NORMAL STATISTICS, EACH CELL CONTAINS --
  179. *
  180. *T 30/TOTAL OCCURRENCES, 30/TOTAL TIME
  181. *
  182. * FOR MAXIMUM EXECUTION TIMES, EACH CELL CONTAINS --
  183. *
  184. *T 60/MAXIMUM TIME
  185. *
  186. * A COUPLE OTHER CELLS ARE ALSO MAINTAINED IN
  187. * /STATCOM/ SO THAT THE STATS OF ANY EXECUTOR CAN
  188. * BE ACCESSED --
  189. *
  190. * (SCOMNDT) = TOTAL TIME FOR ALL COMMANDS
  191. * (SCOMNDN) = TOTAL COMMANDS
  192. *
  193. * THE *EXSTATV* OVERLAY IS ALSO INVOKED ON A COUPLE
  194. * OTHER OCCASIONS --
  195. *
  196. * WITH (OVARG1) = 2 TO INITIALIZE STATS FOR
  197. * A NEWLY-LOADED EXECUTOR
  198. *
  199. * WITH (OVARG1) = 3 TO CLEAR THE STATS BUFFER
  200. * WHEN AN EXECUTOR IS ABOUT TO BE DROPPED
  201. *
  202. * IN PLATO INITIALIZATIONS (DECK *MSUBS*), STATS
  203. * BUFFERS ARE DE-ALLOCATED (1) FOR UNUSED EXECUTORS
  204. * AND (2) FOR ALL EXECUTORS IF ESTAT=OFF IN THE
  205. * CONFIG FILE.
  206. *
  207. * COMMAND CONDENSE STATISTICS ARE HANDLED IN A
  208. * SOMEWHAT DIFFERENT MANNER. IN THE EXECUTOR
  209. * (ACDSTAT) CONTAINS THE ADDRESS OF THE STATS BUFFER
  210. * FOR THE ORDINAL 0 CONDENSOR. WHEN A CONDENSOR
  211. * IS BEING INITIALIZED, THIS ADDRESS IS ADJUSTED SO
  212. * THAT (ACDSTAT) IN A CONDENSOR POINTS TO THE STATS
  213. * BUFFER FOR THAT INDIVIDUAL CONDENSOR.
  214. *
  215. * A STATS BUFFER FOR A CONDENSOR CONTAINS THE
  216. * FOLLOWING --
  217. *
  218. *T 60/1 IF STATS ARE ON, 0 IF OFF
  219. *T, 60/1 IF BUFFER SHOULD BE ZEROED, 0 IF NOT
  220. *T, 42/ACCOUNT NAME,18/ATTRIBUTES
  221. *T, 60/LESSON NAME
  222. *T, 60/TOTAL COMMAND COUNT
  223. *T, 60/TOTAL TIME
  224. *T, CMNDMAX*60/ONE CELL PER COMMAND
  225. *
  226. * EACH CELL CONTAINS THE FOLLOWING INFO --
  227. *
  228. *T 30/TOTAL OCCURRENCES, 30/TOTAL TIME
  229. *
  230. * THE INITIALIZATIONS THAT ARE DONE IN *COVLAY2*
  231. * WHEN A LESSON IS ABOUT TO BE CONDENSED CHECK
  232. * TO SEE IF STATISTICS ARE TURNED ON AND, IF ON,
  233. * IF STATS FOR THE CURRENT LESSON SHOULD BE TAKEN;
  234. * IF STATS ARE TO BE COLLECTED FOR THE CURRENT
  235. * LESSON, A FLAG (*SCOMFG1*) IS SET, AND THE BUFFER
  236. * AND TOTALS ARE ZEROED IF REQUESTED.
  237.  
  238. STATOV OVRLAY
  239.  
  240. CALL MXTEST,-1,XR.THR CHECK FOR REQ. OVERFLOW
  241. NG X6,=XRETRNZ IF TOO MANY INTER-EXECUTOR REQ
  242.  
  243. SA1 AOUTLOC (X1) = CURRENT ACTION REQ PTR
  244. * /--- BLOCK STATS 00 000 75/04/02 03.38
  245. SX1 X1+1-AOUTLTH NEED 1 WORD FOR STATS REQUEST
  246. PL X1,=XRETRNZ IF NOT ENOUGH ROOM
  247.  
  248. * PROCESS GETVAR CODES.
  249.  
  250. NGETVAR (X1) = ARGUMENT
  251. BX6 X1
  252. SA6 ST.ARG
  253.  
  254. SX6 0
  255. SA6 VARBUF PRESET FOR ZERO ACCOUNT NAME
  256. SA6 VARBUF+1 PRESET FOR ZERO FILE NAME
  257.  
  258. SA5 A5+0 RESTORE COMMAND WORD
  259. NG X5,STATS1 IF ACCOUNT';FILE OMITTED
  260.  
  261. BX6 X5
  262. LX6 XCODEL (X6) = 20/ACCT GETVAR, 40/TRASH
  263. SA6 VARBUF STORE GETVAR CODE FOR ACCT NAME
  264. AX5 XCMNDL POSITION POINTER
  265. MX1 -XSPTRL
  266. BX1 -X1*X5 (X1) = EXTRA STORAGE POINTER
  267. SA1 X1+B5 (X1) = 20/FILE GETVAR, 40/TRASH
  268. BX6 X1
  269. SA6 VARBUF+1
  270.  
  271. STATS1 CALL ACCFILE,VARBUF,ST.ACCT,0
  272.  
  273. * JUMP ON FIRST ARGUMENT.
  274.  
  275. SA1 ST.ARG (X1) = ARGUMENT
  276. SX3 3
  277. IX2 X1+X3 (X2) = JUMP TABLE INDEX
  278. NG X2,=XERXVAL ERROR IF (ST.ARG) .LT. -3
  279. SX3 2
  280. IX3 X1-X3
  281. PL X3,=XERXVAL ERROR IF (ST.ARG) .GT. 1
  282. SB1 X2 (B1) = JUMP TABLE INDEX
  283. JP B1+*+1
  284.  
  285. + SX6 2 -3 = MAXIMUM EXECUTION STATS ON
  286. EQ EXECSTS
  287.  
  288. + SX6 1 -2 = CONDENSE STATS ON
  289. EQ CNDSTAT
  290.  
  291. + SX6 1 -1 = EXECUTION STATS ON
  292. EQ EXECSTS
  293.  
  294. + SX6 0 0 = EXECUTION STATS OFF
  295. EQ EXECSTS
  296.  
  297. + SX6 0 1 = CONDENSE STATS OFF
  298. EQ CNDSTAT
  299.  
  300. CNDSTAT SPACE 5,15
  301. ** CNDSTAT -- TURN COMMAND CONDENSE STATS ON/OFF
  302. *
  303. * ENTRY (X6) = 1 TO TURN ON, 0 TO TURN OFF
  304. * (ST.ACCT) = ACCOUNT NAME OR 0
  305. * (ST.LESS) = LESSON NAME OR 0
  306. *
  307. * EXIT REQUEST POSTED TO ALL CONDENSORS IF STATS
  308. * BUFFER HAS BEEN ALLOCATED
  309.  
  310. CNDSTAT SA1 ACDSTAT (X1) = ECS ADDR OF BUFFER
  311. ZR X1,=XPROCESS EXIT IF NO BUFFER
  312.  
  313. BX0 X1 (X0) = ECS ADDR OF BUFFER
  314. SA0 CNDSTATS (A0) = CM COPY OF REQUEST
  315. RE /CSTAT/SCOMNDP READ BACK LAST REQUEST
  316. RJ ECSPRTY
  317.  
  318. SA6 CNDSTATS+/CSTAT/SCOMFG1 STORE ON/OFF FLAG
  319. ZR X6,CNDSTAT1 IF TURNING STATS OFF
  320.  
  321. SA2 ST.ACCT (X2) = ACCOUNT NAME
  322. SA3 ST.LESS (X3) = LESSON NAME
  323. BX6 X2
  324. BX7 X3
  325. SA6 CNDSTATS+/CSTAT/SCOMACT
  326. SA7 CNDSTATS+/CSTAT/SCOMLES
  327.  
  328. * /--- BLOCK STATS 00 000 75/04/02 03.38
  329. SX6 1
  330. SA6 CNDSTATS+/CSTAT/SCOMZER ZERO REQ BUFFER
  331.  
  332. * PASS THE REQUEST TO ALL THE CONDENSORS.
  333.  
  334. CNDSTAT1 SX2 /CSTAT/SCOMNDH+CMNDMAX (X2) = BUFFER LTH
  335. SB1 0 (B1) = CURRENT CONDENSOR
  336. SB2 NCONDEN-1 (B2) = LAST CONDENSOR ORDINAL
  337. IX0 X1-X2 PRESET FOR BUFFER -1
  338. CNDSTAT2 IX0 X0+X2 INCREMENT BUFFER ADDRESS
  339. WE /CSTAT/SCOMNDP WRITE REQUEST TO ECS
  340. RJ ECSPRTY
  341. SB1 B1+1
  342. LE B1,B2,CNDSTAT2 DO FOR NEXT CONDENSOR
  343. EQ =XPROCESS
  344.  
  345. EXECSTS SPACE 5,15
  346. ** EXECSTS -- TURNS EXECUTION STATS ON/OFF
  347. *
  348. * ENTRY (X6) = 2 FOR MAXIMUM EXECUTION STATS, 1 FOR
  349. * NORMAL STATS, 0 TO TURN THEM OFF
  350. * (ST.ACCT) = ACCOUNT NAME OR 0
  351. * (ST.LESS) = LESSON NAME (0 FOR ALL LESSONS)
  352. *
  353. * EXIT TO *PROCESS*
  354. * EXECUTION STATS PARAMETERS IN ECS UPDATED
  355. * REQUEST POSTED TO ALL EXECUTORS
  356. *
  357. * CALLS ECSPRTY, MXRQALL
  358. *
  359. * MACROS CALL
  360.  
  361. * UPDATE EXECUTION STATS PARAMETERS IN ECS.
  362.  
  363. EXECSTS SA6 ST.ARG SAVE STATS ON/OFF PARAMETER
  364. SA1 EXSTPRM (X1) = ECS ADDR OF PARAMETERS
  365. BX0 X1
  366. SA0 A6 (A0) = CM ADDR OF PARAMETERS
  367. WE 3 WRITE PARAMETERS TO ECS
  368. RJ ECSPRTY
  369.  
  370. * REQUEST OTHER EXECUTORS TO TURN LESSON EXECUTION
  371. * STATISTICS ON OR OFF.
  372.  
  373. SX6 XR.STAT (X6) = INTER-EXECUTOR REQ. CODE
  374. SA6 MASRQ
  375. CALL MXRQALL POST REQUEST TO OTHER EXECUTORS
  376.  
  377. * POST REQUEST TO THIS EXECUTOR, TOO.
  378.  
  379. SA1 AOUTLOC (X1) = ACTION REQUEST POINTER
  380. SX6 RQSTAT (X6) = ACTION REQUEST CODE
  381. SA6 ACTOUT+X1 STORE REQUEST CODE
  382. SX6 X1+1 INCREMENT POINTER
  383. SA6 A1 STORE UPDATED POINTER
  384.  
  385. * EXIT.
  386.  
  387. EQ =XPROCESS
  388.  
  389. * DATA FIELDS (THE FIRST THREE MUST ALWAYS BE
  390. * CONSECUTIVE).
  391.  
  392. ST.ARG OVDATA 1 1ST COMMAND ARGUMENT
  393. ST.ACCT OVDATA 1 ACCOUNT NAME
  394. ST.LESS OVDATA 1 LESSON NAME
  395.  
  396. * WHEN COMMAND CONDENSE STATISTICS ARE TURNED ON IN
  397. * THE CONFIGURATION FILE, EACH CONDENSOR HAS A
  398. * STATISTICS BUFFER (SCOMNDH + CMNDMAX) WORDS LONG.
  399. *
  400. * THE FOLLOWING SYMBOLS DEFINE OFFSETS WITHIN ONE
  401. * OF THESE STATISTICS BUFFERS.
  402. *
  403. * THESE DEFINITIONS ARE REPEATED IN COTEXT, EXEC4,
  404. * AND MSUBS. IN PLATO (EXEC4 AND MSUBS) THEY ARE
  405. * QUALIFIED BY /CSTAT/.
  406.  
  407. QUAL CSTAT
  408.  
  409. * /--- BLOCK STATS 00 000 75/04/02 03.38
  410. SCOMFG1 EQU 0 CONDENSE STATISTICS FLAG
  411. SCOMZER EQU 1 NON-ZERO IF BUFFER TO BE ZEROED
  412. SCOMACT EQU 2 ACCOUNT FOR LESSON
  413. SCOMLES EQU 3 LESSON TO COLLECT STATS ON
  414.  
  415. SCOMNDP EQU SCOMLES-SCOMFG1+1 LTH OF PARMS FROM PLATO
  416.  
  417. SCOMNDN EQU 4 TOTAL COMMAND COUNT
  418. SCOMNDT EQU 5 TOTAL TIME
  419.  
  420. SCOMNDH EQU SCOMNDT-SCOMFG1+1 HEADER LENGTH
  421.  
  422. SCOMNDS EQU 6 STATS BUFFER *CMNDMAX* WDS LONG
  423.  
  424. QUAL *
  425.  
  426. CNDSTATS OVDATA /CSTAT/SCOMNDH CM COPY OF BUFFER HEADER
  427.  
  428. ENDOV
  429.  
  430. EXSTATV SPACE 5,15
  431. ** EXSTATV - TURN LESSON EXECUTION STATS ON/OFF
  432. *
  433. * ENTRY (OVARG1) = 1 IF -STATS- COMMAND REQUEST
  434. * 2 IF INITIALIZING NEW EXECUTOR
  435. * 3 IF EXECUTOR IS DROPPING
  436. *
  437. * EXIT LESSON EXECUTION STATISTICS TURNED ON OR
  438. * OFF AND EXECUTOR'7S STATS BUFFER
  439. * ZEROED IF NECESSARY (SEE BELOW)
  440.  
  441. EXSTATV OVRLAY
  442.  
  443. SA1 OVARG1 (X1) = OVERLAY ARGUMENT
  444. SB1 X1+
  445. JP B1+*+1 JUMP TO APPROPRIATE ROUTINE
  446.  
  447. + EQ *+1S17 0 = IMPOSSIBLE
  448. + EQ ONOFF 1 = TURN STATS ON/OFF
  449. + EQ ONOFF 2 = SAME FOR A NEW EXECUTOR
  450. + EQ DRPEXEC 3 = IF EXECUTOR DROPPING
  451.  
  452. ONOFF SPACE 5,15
  453. ** ONOFF - TURN EXECUTION STATISTICS ON OR OFF
  454. *
  455. * LESSON EXECUTION STATISTICS WILL BE TURNED ON OR
  456. * OFF BASED ON THE PARAMETERS IN ECS. IF THE
  457. * STATISTICS ARE BEING TURNED ON, THE STATISTICS
  458. * BUFFER FOR THIS EXECUTOR WILL ALSO BE ZEROED.
  459. *
  460. * CALLS CLEARBUF, ECSPRTY
  461. *
  462. * MACROS CALL, RETURN
  463.  
  464. ONOFF SA1 EXSTPRM (X1) = ECS ADDR OF STATS PARMS
  465. BX0 X1
  466. SA0 ST.ARG (A0) = CM ADDR OF STATS PARMS
  467. RE 3 READ PARAMETERS TO CM
  468. RJ ECSPRTY
  469.  
  470. SA1 ST.ARG (X1) = NEW ON/OFF FLAG
  471. SA2 SCOMFLG (X2) = CURRENT ON/OFF STATS
  472. ZR X1,OFF IF TURNING STATS OFF
  473.  
  474. * TURN LESSON EXECUTION STATISTICS ON.
  475.  
  476. NZ X2,ON1 IF ALREADY ON
  477.  
  478. SA2 ITIMESL ADD QUARTER-TIME-SLICE TO ALL
  479. BX6 X2 TIME-SLICES
  480. AX6 2
  481. IX6 X2+X6
  482. SA6 TIMESL (TIME-SLICE) = 1.25(TIME-SLICE)
  483.  
  484. ON1 CALL CLEARBUF ZERO STATISTICS BUFFER
  485. SA1 ST.ARG
  486. BX6 X1 (X6) = 1 FOR NORMAL, 2 FOR MAX.
  487. BX7 X1
  488. AX7 1 (X7) = 0 FOR NORMAL, 1 FOR MAX.
  489. * /--- BLOCK STATS 00 000 78/12/18 21.23
  490. SA6 SCOMFLG MARK EXECUTION STATS ON
  491. SA7 SCOMNDT SET MAXIMUM TIME FLAG
  492. SA1 ST.ACCT (X1) = ACCOUNT NAME
  493. SA2 ST.LESS (X2) = LESSON NAME
  494. BX6 X1
  495. BX7 X2
  496. SA6 SCOMACT SET ACCOUNT NAME
  497. SA7 SCOMLES SET LESSON NAME
  498. RETURN
  499.  
  500. * TURN LESSON EXECUTION STATISTICS OFF.
  501.  
  502. OFF ZR X2,OFF1 IF ALREADY OFF
  503.  
  504. SA1 ITIMESL RESTORE NORMAL TIME-SLICE LTH
  505. BX6 X1
  506. SA6 TIMESL
  507.  
  508. SX6 0 TURN EXECUTION STATS OFF
  509. SA6 SCOMFLG
  510.  
  511. OFF1 RETURN
  512.  
  513. DRPEXEC SPACE 5,15
  514. ** DRPEXEC - CLEAR STATS BUFFER WHEN EXECUTOR DROPS
  515. *
  516. * IF AN EXECUTOR IS DROPPED, ITS LESSON EXECUTION
  517. * STATISTICS BUFFER MUST BE ZEROED.
  518. *
  519. * CALLS CLEARBUF
  520. *
  521. * MACROS CALL, RETURN
  522.  
  523. DRPEXEC CALL CLEARBUF
  524. RETURN
  525.  
  526. CLEARBUF SPACE 5,15
  527. ** CLEARBUF - ZERO LESSON EXECUTION STATISTICS BUFFER
  528. *
  529. * THIS ROUTINE IS CALLED TO RESET COMMAND EXECUTION
  530. * STATISTICS WHEN THE STATISTICS ARE TURNED ON OR
  531. * AN EXECUTOR IS DROPPED.
  532. *
  533. * USES A - 0, 1, 2
  534. * B - NONE
  535. * X - 0, 1, 2
  536. *
  537. * CALLS NONE
  538. *
  539. * MACROS NONE
  540.  
  541. CLEARBUF EQ *
  542. SA1 EXID (X1) = EXECUTOR ID
  543. SA1 ACMNDEX+X1 (X1) = ECS ADDR OF STATS BUFFER
  544. ZR X1,CLEARBUF IF NO BUFFER PRESENT
  545. ZERO ZBUFFER,SCOMLTH ZERO CM BUFFER
  546. BX0 X1 (X0) = ECS ADDR. OF STAT BUFFER
  547. WE SCOMLTH ZERO STATS BUFFER
  548. RJ ECSPRTY
  549. EQ CLEARBUF EXIT
  550.  
  551. * DATA FIELDS (THE FIRST THREE MUST ALWAYS BE
  552. * CONSECUTIVE).
  553.  
  554. ST.ARG OVDATA 1 1ST COMMAND ARGUMENT
  555. ST.ACCT OVDATA 1 ACCOUNT NAME
  556. ST.LESS OVDATA 1 LESSON NAME
  557.  
  558. * DEFINE A CM BUFFER TO BE ZEROED. THIS
  559. * BUFFER WILL THEN BE USED TO INITIALIZE STATISTICS
  560. * BUFFERS. EXISTING CM BUFFERS LIKE *WORK* AND
  561. * *INFO* CAN NOT BE USED SINCE THIS OVERLAY IS
  562. * EXECUTED DURING INITIALIZATIONS AND THE INITIALI-
  563. * ZATION CODE IS OVERLAYED ON THOSE BUFFERS.
  564.  
  565. ZBUFFER OVDATA SCOMLTH CM BUFFER FOR ZEROING
  566.  
  567. ENDOV
  568. * /--- BLOCK ALLOCOV 00 000 76/11/12 03.15
  569. TITLE ALLOCOV ALLOCATE DISK SPACE
  570. *
  571. *
  572. *
  573. * -ALLOCOV- -CREATE- COMMAND OVERLAY
  574. *
  575. * ON ENTRY -
  576. * OVARG1 = FILE NAME
  577. * OVARG2 = DISK SPACE ALLOCATION REQUEST WORD
  578. * 36 BITS = 0
  579. * 12 BITS = ADDITIONAL INFO
  580. * 6 BITS = FILE TYPE NUMBER
  581. * 6 BITS = NUMBER OF SPACES
  582. *
  583. * ON EXIT -
  584. * *TERROR* = -1 = FILE CREATION SUCCESSFUL
  585. * 0 = ERROR--PACK NAME (NOT LOADED)
  586. * 1 = ERROR--FILE NAME (ALREADY EXISTS)
  587. * 2 = ERROR--IMPROPER REQUEST
  588. * 3 = ERROR--NO ROOM FOR MORE FILES
  589. * 4 = ERROR--CANNOT FIND ENOUGH SPACE
  590. *
  591. * ++ NOTE ++ 'THE CM BUFFER *WORK* IS USED IN
  592. * UPDATING THE ECS FILE TABLES.
  593. *
  594. * /--- BLOCK ALLOCOV 00 000 76/03/10 20.15
  595. *
  596. ALLOCOV OVRLAY
  597. CALL PACKCHK,TDISKU CHECK DIRECTORY INTACT
  598. SA1 OVARG1 LOAD FILE NAME
  599. NG X1,AERR2A EXIT IF BAD FILE NAME
  600. ZR X1,AERR2A
  601. BX7 X1 SAVE FILE NAME
  602. SA7 AFNAME
  603. CALL FNDFILE,TDISKU,TPNAME
  604. * ON EXIT - X6 = FILE INDEX, X7 = 1 IF NOT FOUND
  605. * PINF = BASIC PACK INFO
  606. BX7 -X7 CHECK IF FILE ALREADY EXISTS
  607. SX7 X7 CHANGE -0 TO +0
  608. SA7 TERROR PRESET ERROR FLAG
  609. ZR X7,AERR0 EXIT IF PACK NOT LOADED
  610. PL X7,AERR1 EXIT IF DUPLICATE FILE NAME
  611. SA7 TRETURN ALSO SET *ZRETURN*
  612. SA6 AINDEX SAVE FILE INDEX
  613. SA1 TDISKU
  614. SA2 PITS+X1 ECS ADDRESS OF PACK INFO TABLE
  615. SA3 PINF+4 LENGTH OF PIT
  616. BX0 X2
  617. SB2 X3
  618. SA0 PINF
  619. + RE B2 READ COMPLETE PIT FROM ECS
  620. RJ ECSPRTY
  621. * /--- BLOCK ALLOCOV 00 000 77/08/17 03.53
  622. SB1 1 B1 = 1 (STANDARD INCREMENT)
  623. SA1 OVARG2 X1 = ALLOCATION REQUEST WORD
  624. MX0 -6
  625. BX5 -X0*X1 X5 = NUMBER OF SPACES REQUESTED
  626. BX7 X1
  627. LX7 24 RE-POSITION FILE INFO
  628. SA7 FINF SAVE IN *FINF*
  629. AX1 6
  630. BX2 -X0*X1 GET FILE TYPE NUMBER
  631. ZR X2,AERR2B EXIT IF NO FILE TYPE SPECIFIED
  632. MX2 -18 ALLOW 12 MORE INFO BITS
  633. BX1 X2*X1
  634. NZ X1,AERR2C EXIT IF JUNK IN WORD
  635. SB2 X5-1 B2 = SPACE COUNT - 1
  636. NG B2,AERR2D EXIT IF SPACE REQUESTED = 0
  637. SX2 B2-63
  638. PL X2,AERR2D EXIT IF SPACE REQUESTED GT 77B
  639. SA3 PINF+3 FILE COUNT WORD
  640. SX2 X3 CURRENT NUMBER OF FILES
  641. AX3 18
  642. SX3 X3 FILE LIMIT
  643. IX1 X2-X3
  644. PL X1,AERR3 EXIT IF FILE TABLE FULL
  645. SA2 PINF+2 SPACE ALLOCATION COUNT WORD
  646. SX1 X2 CURRENT NUMBER OF SPACES IN USE
  647. AX2 18
  648. SX2 X2 TOTAL SPACES ON PACK
  649. IX1 X2-X1 SPACES AVAILABLE
  650. IX1 X1-X5 COMPARE WITH REQUEST
  651. NG X1,AERR4 EXIT IF INSUFFICIENT SPACE
  652. * /--- BLOCK ALLOCATE 00 000 79/12/07 16.21
  653. EJECT
  654. *
  655. *
  656. *
  657. * SEARCH FILE SPACE BIT TABLE TO LOCATE ADEQUATE
  658. * FREE SPACE FOR AMOUNT REQUESTED
  659. *
  660. * ALLOCATION SEARCH ROUTINE WILL ACCEPT SPACES OF
  661. * THE FOLLOWING SIZES IN THE PRECEDENCE SPECIFIED -
  662. *
  663. * 1. EXACT MATCH WITH AMOUNT REQUESTED
  664. * 2. SMALLEST FREE SPACE FOUND WHICH IS AT LEAST
  665. * TWO PARTS LARGER THAN AMOUNT REQUESTED
  666. * 3. FIRST SPACE WHICH WILL LEAVE 1 UN-ALLOCATED
  667. * PART
  668. *
  669. *
  670. BX6 X5 SAVE AMOUNT OF SPACE REQUIRED
  671. SA6 ASPACE
  672. *
  673. * INITIALIZE FOR SPACE BIT TABLE SEARCH
  674. *
  675. SB3 X5 B3 = AMOUNT OF SPACE REQUIRED
  676. MX0 12 X0 = MASK FOR COEF^FICIENT
  677. BX0 -X0
  678. SA1 PINF+5-1 X1 = CURRENT BIT TABLE WORD
  679. MX4 0 X4 = BEST FIND POINTER
  680. MX5 0 X5 = LENGTH OF BEST FIND
  681. MX6 12 X6 = MASK FOR CLEARING SET BITS
  682. *
  683. * SEARCH FOR NEXT FREE SPACE
  684. *
  685. A200 SA1 A1+1 LOAD NEXT WORD OF BIT TABLE
  686. ZR X1,A300
  687. *
  688. A210 UX2 X1,B2 BITS IN WORD NOT CHECKED YET
  689. SX7 -B2 SAVE FOR LATER SUBTRACTION
  690. NX1 X1,B2 FIND NEXT SET BIT
  691. * B2 = WIDTH OF ZEROS FIELD
  692. ZR X1,A200
  693. BX2 X0-X1 COMPLEMENT COEFFICIENT
  694. NX2 X2,B1 FIND END OF SET BITS
  695. * B1 = WIDTH OF ONES FIELD
  696. AX3 X6,B1
  697. BX2 X0*X3 FORM MASK FOR SET BITS
  698. BX1 -X2*X1 CLEAR BITS
  699. SA3 A1
  700. BX3 X1 SAVE A1,X1 OF AREA
  701. SB2 B1+B2 WIDTH OF THIS PAIR OF FIELDS
  702. SB2 X7+B2 WIDTH OF REMAINDER OF WORD
  703. NZ B2,A250 IF NEXT WORD NOT CONTIGUOUS
  704. *
  705. * /--- BLOCK ALLOCATE 00 000 79/12/07 16.21
  706. *
  707. * SEARCH THROUGH CONTIGUOUS SPACE OVERLAPING WORD
  708. * BOUNDARIES
  709. *
  710. A220 SA1 A1+1 LOAD NEXT BIT TABLE WORD
  711. ZR X1,A250
  712. NX2 X1,B2 FIND NEXT SET BIT
  713. NZ B2,A250 JUMP IF NOT CONTIGUOUS
  714. ZR X2,A250 JUMP IF NO SET BITS
  715. BX1 X2
  716. BX2 X0-X1 COMPLEMENT COEFFICIENT
  717. NX2 X2,B2 FIND END OF SET BITS
  718. SB1 B1+B2 INCREMENT TOTAL SPACES FOUND
  719. AX2 X6,B2
  720. ZR X2,A220 CHECK NEXT WORD CONTIGUOUS
  721. BX2 X0*X2 FORM MASK FOR SET BITS
  722. BX1 -X2*X1 CLEAR BITS
  723. *
  724. * CHECK IF THIS IS BEST FIND SO FAR
  725. *
  726. A250 LT B1,B3,A260 JUMP IF NOT ENOUGH SPACE
  727. EQ B1,B3,A310 JUMP IF FOUND EXACT AMOUNT
  728. SB2 B1-B3 COMPUTE AMOUNT OF EXTRA SPACE
  729. SB2 B2-1
  730. + NZ B2,*+1 JUMP IF NOT SINGLE EXTRA SPACE
  731. NZ X5,A260 JUMP IF A SPACE ALREADY FOUND
  732. + ZR X5,A255 JUMP IF NO PREVIOUS FIND
  733. SB2 X5-1
  734. SB2 B2-B3 CHECK SIZE OF PREVIOUS FIND
  735. ZR B2,A255 JUMP IF PREVIOUS LEAVES 1 EXTRA
  736. SB2 X5
  737. GE B1,B2,A260 JUMP IF PREVIOUS SPACE SMALLER
  738. *
  739. A255 SA4 A3 SAVE ADDR/WORD OF BEST FIND
  740. BX4 X3
  741. SX5 B1 SAVE SIZE OF FIND
  742. *
  743. A260 NZ X1,A210 JUMP IF NOT END OF TABLE
  744. EQ A300
  745. *
  746. * /--- BLOCK ALLOCATE 00 000 76/03/10 21.24
  747. *
  748. * COMPUTE INDEX OF BEST SPACE FOUND
  749. *
  750. A300 SA3 A4 A3 = TABLE ADDRESS OF BEST FIND
  751. BX3 X4
  752. ZR X5,A990 EXIT IF INADEQUATE SPACE
  753. *
  754. A310 SX4 PINF+5 X4 = BEGIN ADDRESS OF BIT TABLE
  755. SX2 A3 ADDRESS OF STARTING WORD
  756. IX2 X2-X4 COMPUTE WORD BIAS INTO TABLE
  757. SX1 48
  758. DX6 X1*X2 CONVERT TO BIT BIAS
  759. UX2 X3,B1
  760. SB2 48 COMPUTE BIT BIAS WITHIN WORD
  761. SX1 B2-B1
  762. IX6 X1+X6 COMPUTE INDEX OF SPACE FOUND
  763. SA6 ITEMP SAVE SPACE INDEX
  764. *
  765. * CLEAR APPROPRIATE BITS FROM BIT TABLE
  766. *
  767. SX1 X6 X1 = INDEX TO CURRENT BIT
  768. *
  769. A400 CLRBIT X1,PINF+5 CLEAR NEXT BIT
  770. SX1 X1+1
  771. SB3 B3-1 END TEST
  772. GT B3,B0,A400
  773. SA1 ASPACE
  774. BX5 X1 X5 = AMOUNT OF SPACE REQUESTED
  775. SA1 ITEMP
  776. SA2 FINF ATTACH SPACE INDEX TO INFO WORD
  777. BX6 X1+X2
  778. SA6 A2 *FINF* = FILE INFO WORD
  779. EQ AUPDATE
  780. *
  781. * ERROR EXIT IF INSUFFICIENT SPACE AVALIABLE
  782. *
  783. A990 EQ AERR4 EXIT IF SPACE NOT AVAILABLE
  784. *
  785. *
  786. * /--- BLOCK AUPDATE 00 000 76/03/10 20.42
  787. EJECT
  788. *
  789. *
  790. * UPDATE THE PACK INFORMATION TABLE IN ECS.
  791. *
  792. * ON ENTRY - X5 = AMOUNT OF SPACE REQUESTED
  793. *
  794. AUPDATE SB1 1 B1 = 1
  795. SA1 PINF+2
  796. IX7 X1+X5 INC COUNT OF SPACES ALLOCATED
  797. SA7 A1
  798. SA2 PINF+3
  799. SX6 B1 X6 = 1 (USED LATER ALSO)
  800. IX7 X2+X6 INCREMENT COUNT OF FILES USED
  801. SA7 A2 *** NOTE--X7 USED LATER
  802. SA1 TDISKU
  803. SA2 PITS+X1 ECS ADDRESS OF PACK INFO TABLE
  804. SA3 PINF+4 LENGTH OF PIT
  805. BX0 X2
  806. SB2 X3
  807. SA0 PINF
  808. + WE B2 WRITE UPDATED PIT TO ECS
  809. RJ ECSPRTY
  810. * /--- BLOCK AUPDATE 00 000 76/03/10 19.52
  811. *
  812. * UPDATE THE FILE NAME TABLE IN ECS.
  813. *
  814. SA0 WORK A0 = ADDRESS OF TRANSFER BUFFER
  815. SX5 WORKLTH X5 = LENGTH OF TRANSFER BUFFER
  816. SA2 AINDEX INDEX TO NEW FILE
  817. SA3 TDISKU X3 = DISK UNIT
  818. SA4 FNTS+X3 ECS ADDRESS OF FILE NAME TABLE
  819. SX1 X7 EXTRACT UPDATED FILE COUNT
  820. IX1 X1-X6 X1 = OLD FILE COUNT
  821. IX2 X1-X2 X2 = LENGTH TO MOVE
  822. IX0 X4+X1 ADDRESS AFTER END OF TABLE
  823. SB2 X2 PRE-SET LENGTH
  824. IX4 X0-X2 PRE-SET ECS ADDRESS
  825. IX7 X2-X5 X7 = LENGTH LEFT TO DO
  826. NG X7,AUPFNT2
  827. IX0 X0-X5 SET ECS ADDRESS
  828. *
  829. AUPFNT1 RE WORKLTH READ FILE NAMES
  830. RJ ECSPRTY
  831. SB2 X7 LENGTH IF DONE NEXT TIME
  832. IX4 X0-X7 ECS ADDRESS IF DONE NEXT TIME
  833. IX7 X7-X5 DECREMENT LENGTH TO DO
  834. IX0 X0+X6 ADD 1
  835. + WE WORKLTH WRITE BACK 1 WORD DOWN
  836. RJ ECSPRTY
  837. IX0 X0-X6 SUBTRACT 1 BACK
  838. IX0 X0-X5 NEXT ECS ADDRESS IF NOT DONE
  839. PL X7,AUPFNT1
  840. *
  841. AUPFNT2 BX0 X4 GET SAVED ECS ADDRESS
  842. SA4 AFNAME X4 = FILE NAME
  843. NG X4,"CRASH" IF BAD FILE NAME
  844. SA0 A0+B1 LEAVE ROOM FOR IT
  845. + RE B2 READ FILE NAMES THAT SHOULD
  846. RJ ECSPRTY FOLLOW NEW FILE NAME
  847. BX7 X4
  848. SA0 A0-B1 BACK UP
  849. SA7 A0 PUT NEW FILE NAME AT START
  850. SB2 B2+B1 INCREMENT LENGTH BY 1
  851. + WE B2 WRITE BACK WITH NEW FILE NAME
  852. RJ ECSPRTY
  853. * /--- BLOCK AUPDATE 00 000 76/05/17 22.07
  854. *
  855. * UPDATE THE FILE INFORMATION TABLE IN ECS.
  856. *
  857. SA4 FITS+X3 ECS ADDRESS OF FILE INFO TABLE
  858. IX0 X4+X1 ADDRESS AFTER END OF TABLE
  859. SB2 X2 PRE-SET LENGTH
  860. IX4 X0-X2 PRE-SET ECS ADDRESS
  861. IX7 X2-X5 X7 = LENGTH LEFT TO DO
  862. NG X7,AUPFIT2
  863. IX0 X0-X5 SET ECS ADDRESS
  864. *
  865. AUPFIT1 RE WORKLTH READ FILE INFO WORDS
  866. RJ ECSPRTY
  867. SB2 X7 LENGTH IF DONE NEXT TIME
  868. IX4 X0-X7 ECS ADDRESS IF DONE NEXT TIME
  869. IX7 X7-X5 DECREMENT LENGTH TO DO
  870. IX0 X0+X6 ADD 1
  871. + WE WORKLTH WRITE BACK 1 WORD DOWN
  872. RJ ECSPRTY
  873. IX0 X0-X6 SUBTRACT 1 BACK
  874. IX0 X0-X5 NEXT ECS ADDRESS IF NOT DONE
  875. PL X7,AUPFIT1
  876. *
  877. AUPFIT2 BX0 X4 GET SAVED ECS ADDRESS
  878. SA4 FINF X4 = FILE INFO WORD
  879. SA0 A0+B1 LEAVE ROOM FOR IT
  880. + RE B2 READ FILE INFO WORDS THAT
  881. RJ ECSPRTY SHOULD FOLLOW NEW ONE
  882. BX7 X4
  883. SA0 A0-B1 BACK UP
  884. SA7 A0 PUT NEW FILE INFO WORD AT START
  885. SB2 B2+B1 INCREMENT LENGTH BY 1
  886. + WE B2 WRITE BACK WITH NEW INFO WORD
  887. RJ ECSPRTY
  888. *
  889. * FORM NEW PACK DIRECTORY SUM-CHECK.
  890. *
  891. CALL PACKSUM,TDISKU
  892. EQ ALLOCX
  893. *
  894. *
  895. AERR0 SX6 3 *ZRETURN* = 3 = PACK NOT LOADED
  896. EQ AERRX1 *ERROR* IS ALREADY SET
  897. *
  898. AERR1 SX6 11 *ZRETURN = 11 = DUP. FILE NAME
  899. EQ AERRX1 *ERROR* IS ALREADY SET
  900. *
  901. AERR2A SX6 4 ZRETURN = 4 = BAD FILE NAME
  902. EQ AERR2
  903. AERR2B SX6 12 ZRETURN = 12 = BAD FILE TYPE
  904. EQ AERR2
  905. AERR2C SX6 13 ZRETURN = 13 = BAD DIR. INFO
  906. EQ AERR2
  907. AERR2D SX6 14 *ZRETURN* = 14 = BAD FILE LTH
  908. AERR2 SX7 2 IMPROPER ALLOCATION REQUEST
  909. EQ AERRX
  910. *
  911. AERR3 SX7 3 FILE LIMIT
  912. SX6 15 *ZRETURN* = 15 = PACK DIR FULL
  913. EQ AERRX
  914. *
  915. AERR4 SX7 4 SPACE NOT AVAILABLE
  916. SX6 16 *ZRETURN* = 16 = NOT ENUF ROOM
  917. EQ AERRX
  918. *
  919. AERRX SA7 TERROR STORE ERROR FLAG
  920. AERRX1 SA6 TRETURN ALSO SET *ZRETURN*
  921. EQ ALLOCX EXIT
  922. *
  923. *
  924. AINDEX BSS 1 INDEX TO FILE
  925. AFNAME BSS 1 NAME OF FILE
  926. ASPACE BSS 1 AMOUNT OF SPACE REQUESTED
  927. *
  928. *
  929. ALLOCX RETURN
  930. *
  931. *
  932. ENDOV
  933. * /--- BLOCK DEALLOV 00 000 77/08/17 03.47
  934. TITLE DEALLOV RELEASE DISK SPACE
  935. *
  936. *
  937. *
  938. * -DEALLOV- -DESTROY- COMMAND OVERLAY
  939. *
  940. * ON ENTRY -
  941. * OVARG1 = FILE NAME
  942. *
  943. * ON EXIT -
  944. * *TERROR* = -1 = FILE DESTRUCTION SUCCESSFUL
  945. * 0 = ERROR--PACK NAME (NOT LOADED)
  946. * 1 = ERROR--FILE NAME (NOT ON PACK)
  947. * 2 = ERROR--IMPROPER REQUEST
  948. *
  949. * ++ NOTE ++ 'THE CM BUFFER *WORK* IS USED IN
  950. * UPDATING THE ECS FILE TABLES.
  951. *
  952. *
  953. DEALLOV OVRLAY
  954. CALL PACKCHK,TDISKU CHECK DIRECTORY INTACT
  955. SA1 OVARG1 FILE NAME
  956. NG X1,DERR1 EXIT IF BAD FILE NAME
  957. ZR X1,DERR1
  958. CALL FNDFILE,TDISKU,TPNAME
  959. * ON EXIT - X6 = FILE INDEX, X7 = 1 IF NOT FOUND
  960. * PINF = BASIC PACK INFO
  961. SA7 TERROR SET ERROR FLAG
  962. ZR X7,DERR0 EXIT IF PACK NOT LOADED
  963. PL X7,DERR1A EXIT IF FILE NOT FOUND
  964. SA7 TRETURN SET *ZRETURN* TOO
  965. SA6 DINDEX SAVE FILE INDEX
  966. * /--- BLOCK DEALLOV 00 000 76/03/10 21.31
  967. EJECT
  968. *
  969. *
  970. * RELEASE SPACE FOR THIS FILE IN ALLOCATION TABLE
  971. *
  972. SA1 A0 GET FILE INFORMATION WORD
  973. MX0 -15
  974. BX3 -X0*X1 X3 = SPACE INDEX
  975. AX1 24
  976. MX0 -6
  977. BX5 -X0*X1 X5 = NUMBER OF SPACES ALLOCATED
  978. SA1 TDISKU
  979. SA1 PITS+X1 ECS ADDRESS OF PACK INFO TABLE
  980. SA4 PINF+4 LENGTH OF PIT
  981. BX0 X1
  982. SB2 X4
  983. SA0 PINF
  984. + RE B2 READ COMPLETE PIT FROM ECS
  985. RJ ECSPRTY
  986. BX1 X3 X1 = INDEX OF FILE SPACE
  987. SB3 X5 B3 = NUMBER OF SPACES
  988. *
  989. R100 SETBIT X1,PINF+5 SET NEXT BIT
  990. SX1 X1+1
  991. SB3 B3-1 END TEST
  992. GT B3,B0,R100
  993. EQ DUPDATE
  994. *
  995. *
  996. * /--- BLOCK DUPDATE 00 000 76/03/10 21.22
  997. EJECT
  998. *
  999. *
  1000. * UPDATE THE PACK INFORMATION TABLE IN ECS.
  1001. *
  1002. DUPDATE SA1 PINF+2
  1003. IX7 X1-X5 DEC COUNT OF SPACES ALLOCATED
  1004. SA7 A1
  1005. SA2 PINF+3
  1006. SX6 1 X6 = 1 (USED LATER ALSO)
  1007. IX7 X2-X6 DECREMENT COUNT OF FILES USED
  1008. SA7 A2 *** NOTE--X7 USED LATER
  1009. SA1 TDISKU
  1010. SA2 PITS+X1 ECS ADDRESS OF PACK INFO TABLE
  1011. SA3 PINF+4 LENGTH OF PIT
  1012. BX0 X2
  1013. SB2 X3
  1014. SA0 PINF
  1015. + WE B2 WRITE UPDATED PIT TO ECS
  1016. RJ ECSPRTY
  1017. *
  1018. * UPDATE ECS FILE NAME TABLE
  1019. *
  1020. SA0 WORK A0 = ADDRESS OF TRANSFER BUFFER
  1021. SX5 WORKLTH X5 = LENGTH OF TRANSFER BUFFER
  1022. SA2 DINDEX INDEX TO OLD FILE
  1023. SA3 TDISKU X3 = DISK UNIT
  1024. SA4 FNTS+X3 ECS ADDRESS OF FILE NAME TABLE
  1025. SX1 X7 EXTRACT UPDATED FILE COUNT
  1026. IX1 X1-X2 X1 = LENGTH TO MOVE
  1027. IX2 X2+X6 X2 = STARTING INDEX
  1028. IX0 X4+X2 STARTING ECS ADDRESS
  1029. SB2 X1 PRE-SET LENGTH
  1030. IX7 X1-X5 X7 = LENGTH LEFT TO DO
  1031. NG X7,DUPFNT2
  1032. *
  1033. DUPFNT1 RE WORKLTH READ FILE NAMES
  1034. RJ ECSPRTY
  1035. SB2 X7+0 LENGTH IF DONE NEXT TIME
  1036. IX7 X7-X5 DECREMENT LENGTH TO DO
  1037. IX0 X0-X6 SUBTRACT 1
  1038. + WE WORKLTH WRITE BACK 1 WORD UP
  1039. RJ ECSPRTY
  1040. IX0 X0+X6 ADD 1 BACK
  1041. IX0 X0+X5 NEXT ECS ADDRESS
  1042. PL X7,DUPFNT1
  1043. * /--- BLOCK DUPDATE 00 000 77/08/17 03.50
  1044. *
  1045. DUPFNT2 RE B2 READ NAMES FOLLOWING OLD ONE
  1046. RJ ECSPRTY
  1047. IX0 X0-X6
  1048. + WE B2 WRITE BACK OVER OLD FILE NAME
  1049. RJ ECSPRTY
  1050. *
  1051. * UPDATE THE FILE INFORMATION TABLE IN ECS.
  1052. *
  1053. SA4 FITS+X3 ECS ADDRESS OF FILE INFO TABLE
  1054. IX0 X4+X2 STARTING ECS ADDRESS
  1055. SB2 X1 PRE-SET LENGTH
  1056. IX7 X1-X5 X7 = LENGTH LEFT TO DO
  1057. NG X7,DUPFIT2
  1058. *
  1059. DUPFIT1 RE WORKLTH READ FILE INFO WORDS
  1060. RJ ECSPRTY
  1061. SB2 X7+0 LENGTH IF DONE NEXT TIME
  1062. IX7 X7-X5 DECREMENT LENGTH TO DO
  1063. IX0 X0-X6 SUBTRACT 1
  1064. + WE WORKLTH WRITE BACK 1 WORD UP
  1065. RJ ECSPRTY
  1066. IX0 X0+X6 ADD 1 BACK
  1067. IX0 X0+X5 NEXT ECS ADDRESS
  1068. PL X7,DUPFIT1
  1069. *
  1070. DUPFIT2 RE B2 READ WORDS FOLLOWING OLD ONE
  1071. RJ ECSPRTY
  1072. IX0 X0-X6
  1073. + WE B2 WRITE BACK OVER OLD INFO WORD
  1074. RJ ECSPRTY
  1075. CALL PACKSUM,TDISKU
  1076. EQ DEALLX
  1077. *
  1078. *
  1079. DERR0 SX6 3 *ZRETURN* = 3 = PACK NOT LOADED
  1080. EQ DERRX1 *ERROR* IS ALREADY SET
  1081. DERR1 SX7 1 NO SUCH FILE
  1082. SX6 4 *ZRETURN* = 4 = BAD FILE NAME
  1083. EQ DERRX
  1084. DERR1A SX6 0 *ZRETURN* = 0 = FILE NOT FOUND
  1085. EQ DERRX1 *ERROR* IS ALREADY SET
  1086. *
  1087. DERRX SA7 TERROR STORE ERROR FLAG
  1088. DERRX1 SA6 TRETURN ALSO SET *ZRETURN*
  1089. EQ DEALLX --- ERROR EXIT
  1090. *
  1091. *
  1092. DINDEX BSS 1 INDEX TO FILE
  1093. *
  1094. *
  1095. DEALLX RETURN
  1096. *
  1097. *
  1098. ENDOV
  1099. * /--- BLOCK RENAMOV 00 000 75/06/22 16.52
  1100. TITLE RENAMOV CHANGE NAME OF DISK FILE
  1101. * RENAMOV
  1102. *
  1103. * 'THIS ROUTINE RENAMES A FILE ON AN 844 DISK PACK.
  1104. * 'IT IS USED BY THE -RENAME- COMMAND (FILE IOPUT).
  1105. *
  1106. * 'ON ENTRY, IT REQUIRES--
  1107. * OVARG1 = CURRENT FILE NAME
  1108. * OVARG2 = NEW FILE NAME
  1109. *
  1110. * 'ON EXIT, *TERROR* IS SET AS FOLLOWS--
  1111. * -1 = FILE RENAMED SUCCESSFULLY
  1112. * 0 = ERROR--PACK NAME (NO LONGER LOADED)
  1113. * 1 = ERROR--OLD FILE NAME (NOT ON PACK)
  1114. * 2 = ERROR--NEW FILE NAME (ALREADY EXISTS)
  1115. * 3 = ERROR--NEW FILE NAME (IMPROPER NAME)
  1116. *
  1117. * 'THE FILE NAME AND INFO TABLES IN ECS ARE
  1118. * UPDATED IF THE RENAMING IS SUCCESSFUL.
  1119. *
  1120. * ++ NOTE ++ 'THE CM BUFFER *WORK* IS USED IN
  1121. * UPDATING THE ECS FILE TABLES.
  1122. *
  1123. *
  1124. RENAMOV OVRLAY
  1125. *
  1126. * 'CHECK IF PACK DIRECTORY IS STILL INTACT.
  1127. *
  1128. CALL PACKCHK,TDISKU
  1129. *
  1130. SA1 OVARG1 OLD FILE NAME
  1131. NG X1,RERR1 --- ERROR IF OLD NAME NEGATIVE
  1132. ZR X1,RERR1 --- ERROR IF NO OLD NAME
  1133. CALL FNDFILE,TDISKU,TPNAME X1=OLD FILE NAME, X6=FILE INDEX
  1134. SA7 TERROR PRESET ERROR FLAG
  1135. ZR X7,RERR0 --- ERROR IF PACK NOT LOADED
  1136. PL X7,RERR1A --- ERROR IF FILE NOT FOUND
  1137. SA7 TRETURN SET *ZRETURN* TOO
  1138. SA6 RINDEX SAVE OLD INDEX
  1139. SA1 OVARG2 NEW FILE NAME
  1140. NG X1,RERR3 --- ERROR IF NEW NAME NEGATIVE
  1141. ZR X1,RERR3 --- ERROR IF NO NEW NAME
  1142. CALL FNDFILE,TDISKU,TPNAME X1=NEW FILE NAME, X6=FILE INDEX
  1143. NG X7,RERR2 --- ERROR IF NEW FILE NAME ALREADY EXISTS
  1144. SA2 RINDEX X2 = OLD INDEX
  1145. BX7 X1
  1146. SA7 RFNAME SAVE NEW FILE NAME
  1147. IX7 X2-X6 OLD INDEX - NEW INDEX
  1148. ZR X7,RSAME JUMP IF NEW NAME IN SAME SPOT
  1149. PL X7,RBEFORE JUMP IF NEW NAME BEFORE OLD
  1150. SX6 1 X6 = 1 (USED LATER ALSO)
  1151. BX7 -X7
  1152. IX7 X7-X6 SUBTRACT 1 TO GET LENGTH
  1153. ZR X7,RSAME JUMP IF IN SAME SPOT
  1154. EQ RAFTER JUMP IF NEW NAME AFTER OLD
  1155. *
  1156. *
  1157. RERR0 SX6 3 *ZRETURN* = 3 = PACK NOT LOADED
  1158. EQ RERRX1 *ERROR* IS ALREADY SET
  1159. RERR1 SX7 1 IMPROPER OLD FILE NAME
  1160. SX6 4 *ZRETURN* = 4 = BAD FILE NAME
  1161. EQ RERRX
  1162. RERR1A SX6 0 *ZRETURN* = 0 = FILE NOT FOUND
  1163. EQ RERRX1 *ERROR* IS ALREADY SET
  1164. RERR2 SX7 2 NEW FILE NAME ALREADY EXISTS
  1165. SX6 11 *ZRETURN* = 11 = DUP. FILE NAME
  1166. EQ RERRX
  1167. * /--- BLOCK RENAMOV 00 000 75/06/22 16.52
  1168. RERR3 SX7 3 IMPROPER NEW FILE NAME
  1169. SX6 4 *ZRETURN* = 4 = BAD FILE NAME
  1170. EQ RERRX
  1171. *
  1172. RERRX SA7 TERROR STORE ERROR FLAG
  1173. RERRX1 SA6 TRETURN SET *ZRETURN* TOO
  1174. EQ RENAMX --- ERROR EXIT
  1175. *
  1176. *
  1177. RINDEX BSS 1 STORAGE FOR INDEX
  1178. RFNAME BSS 1 NEW NAME FOR FILE
  1179. RFINFO BSS 1 STORAGE FOR FILE INFO WORD
  1180. * /--- BLOCK RAFTER 00 000 75/04/03 03.03
  1181. *
  1182. *
  1183. * 'NEW FILE NAME GOES AFTER OLD ONE.
  1184. *
  1185. RAFTER IX1 X2+X6 X1 = STARTING INDEX FOR MOVE (OLD INDEX+1)
  1186. BX2 X7 X2 = LENGTH TO BE MOVED
  1187. *
  1188. * 'UPDATE THE FILE NAME TABLE IN ECS.
  1189. *
  1190. SA0 WORK A0 = ADDRESS OF TRANSFER BUFFER
  1191. SX5 WORKLTH X5 = LENGTH OF TRANSFER BUFFER
  1192. SA3 TDISKU X3 = DISK UNIT
  1193. SA4 FNTS+X3 ECS ADDRESS OF FILE NAME TABLE
  1194. SB2 X2 PRE-SET LENGTH
  1195. IX0 X4+X1 SET ECS ADDRESS
  1196. IX7 X2-X5 X7 = LENGTH LEFT TO DO
  1197. NG X7,RAFNT2
  1198. *
  1199. RAFNT1 RE WORKLTH READ FILE NAMES
  1200. RJ =XECSPRTY
  1201. SB2 X7+0 LENGTH IF DONE NEXT TIME
  1202. IX7 X7-X5 DECREMENT LENGTH TO DO
  1203. IX0 X0-X6 -1
  1204. WE WORKLTH WRITE BACK 1 WORD UP
  1205. RJ =XECSPRTY
  1206. IX0 X0+X6 +1
  1207. IX0 X0+X5 NEXT ECS ADDRESS
  1208. PL X7,RAFNT1
  1209. RAFNT2 RE B2 READ FILE NAMES THAT SHOULD PRECEDE NEW ONE
  1210. RJ =XECSPRTY
  1211. SA4 RFNAME NEW NAME
  1212. NG X4,"CRASH" IF BAD FILE NAME
  1213. BX7 X4
  1214. SA7 A0+B2 STORE NEW NAME AT END
  1215. IX0 X0-X6 -1
  1216. SB2 B2+1 ADD 1 TO LENGTH
  1217. WE B2 WRITE BACK WITH NEW FILE NAME
  1218. RJ =XECSPRTY
  1219. *
  1220. * 'UPDATE THE FILE INFORMATION TABLE IN ECS.
  1221. *
  1222. SA4 FITS+X3 ECS ADDRESS OF FILE INFO TABLE
  1223. SB2 X2 PRE-SET LENGTH
  1224. IX0 X4+X1 SET ECS ADDRESS
  1225. IX0 X0-X6 ADDRESS BEFORE 1ST INFO WORD TO MOVE
  1226. SA0 RFINFO
  1227. RE 1 READ INFO WORD FOR THIS FILE
  1228. RJ =XECSPRTY
  1229. SA0 WORK
  1230. IX0 X0+X6 RESET ECS ADDRESS
  1231. IX7 X2-X5 X7 = LENGTH LEFT TO DO
  1232. NG X7,RAFIT2
  1233. *
  1234. RAFIT1 RE WORKLTH READ FILE INFO WORDS
  1235. RJ =XECSPRTY
  1236. SB2 X7+0 LENGTH IF DONE NEXT TIME
  1237. IX7 X7-X5 DECREMENT LENGTH TO DO
  1238. IX0 X0-X6 -1
  1239. WE WORKLTH WRITE BACK 1 WORD UP
  1240. RJ =XECSPRTY
  1241. IX0 X0+X6 +1
  1242. IX0 X0+X5 NEXT ECS ADDRESS
  1243. PL X7,RAFIT1
  1244. RAFIT2 RE B2 READ INFO WORDS THAT SHOULD PRECEDE THIS
  1245. RJ =XECSPRTY
  1246. SA4 RFINFO FILE INFO WORD
  1247. BX7 X4
  1248. SA7 A0+B2 STORE THIS INFO WORD AT END
  1249. IX0 X0-X6 -1
  1250. SB2 B2+1 ADD 1 TO LENGTH
  1251. WE B2 WRITE BACK WITH THIS INFO WORD
  1252. RJ =XECSPRTY
  1253. * /--- BLOCK RAFTER 00 000 75/04/03 03.03
  1254. EQ RPSUM --- GET NEW SUMCHECK AND EXIT
  1255. * /--- BLOCK RBEFORE 00 000 75/01/29 03.41
  1256. *
  1257. *
  1258. * 'NEW FILE NAME GOES BEFORE OLD ONE.
  1259. *
  1260. RBEFORE BX1 X6 X1 = STARTING INDEX FOR MOVE
  1261. BX2 X7 X2 = LENGTH TO BE MOVED
  1262. *
  1263. * 'UPDATE THE FILE NAME TABLE IN ECS.
  1264. *
  1265. SB1 1 B1 = 1 (STANDARD INCREMENT)
  1266. SA0 WORK A0 = ADDRESS OF TRANSFER BUFFER
  1267. SX5 WORKLTH X5 = LENGTH OF TRANSFER BUFFER
  1268. SA3 TDISKU X3 = DISK UNIT
  1269. SA4 FNTS+X3 ECS ADDRESS OF FILE NAME TABLE
  1270. SX6 B1 X6 = 1
  1271. SB2 X2 PRE-SET LENGTH
  1272. IX4 X4+X1 PRE-SET ECS ADDRESS
  1273. IX0 X4+X2 ADDRESS AFTER LAST NAME TO MOVE
  1274. IX7 X2-X5 X7 = LENGTH LEFT TO DO
  1275. NG X7,RBFNT2
  1276. IX0 X0-X5 SET ECS ADDRESS
  1277. *
  1278. RBFNT1 RE WORKLTH READ FILE NAMES
  1279. RJ =XECSPRTY
  1280. SB2 X7 LENGTH IF DONE NEXT TIME
  1281. IX4 X0-X7 ECS ADDRESS IF DONE NEXT TIME
  1282. IX7 X7-X5 DECREMENT LENGTH TO DO
  1283. IX0 X0+X6 ADD 1
  1284. WE WORKLTH WRITE BACK 1 WORD DOWN
  1285. RJ =XECSPRTY
  1286. IX0 X0-X6 SUBTRACT 1 BACK
  1287. IX0 X0-X5 NEXT ECS ADDRESS IF NOT DONE
  1288. PL X7,RBFNT1
  1289. RBFNT2 BX0 X4 GET SAVED ECS ADDRESS
  1290. SA4 RFNAME X4 = NEW NAME
  1291. NG X4,"CRASH" IF BAD FILE NAME
  1292. SA0 A0+B1 LEAVE ROOM FOR IT
  1293. RE B2 READ FILE NAMES THAT SHOULD FOLLOW NEW ONE
  1294. RJ =XECSPRTY
  1295. BX7 X4
  1296. SA0 A0-B1 BACK UP
  1297. SA7 A0 PUT NEW FILE NAME AT START
  1298. SB2 B2+B1 INCREMENT LENGTH BY 1
  1299. WE B2 WRITE BACK WITH NEW FILE NAME
  1300. RJ =XECSPRTY
  1301. * /--- BLOCK RBFIT 00 000 76/05/17 22.11
  1302. *
  1303. * 'UPDATE THE FILE INFORMATION TABLE IN ECS.
  1304. *
  1305. SA4 FITS+X3 ECS ADDRESS OF FILE INFO TABLE
  1306. SB2 X2 PRE-SET LENGTH
  1307. IX4 X4+X1 PRE-SET ECS ADDRESS
  1308. IX0 X4+X2 ADDRESS AFTER LAST INFO WORD TO MOVE
  1309. IX7 X2-X5 X7 = LENGTH LEFT TO DO
  1310. SA0 RFINFO STORAGE FOR FILE INFO WORD
  1311. RE 1 READ INFO WORD FOR THIS FILE
  1312. RJ =XECSPRTY
  1313. SA0 WORK
  1314. NG X7,RBFIT2
  1315. IX0 X0-X5 SET ECS ADDRESS
  1316. *
  1317. RBFIT1 RE WORKLTH READ FILE INFO WORDS
  1318. RJ =XECSPRTY
  1319. SB2 X7 LENGTH IF DONE NEXT TIME
  1320. IX4 X0-X7 ECS ADDRESS IF DONE NEXT TIME
  1321. IX7 X7-X5 DECREMENT LENGTH TO DO
  1322. IX0 X0+X6 ADD 1
  1323. WE WORKLTH WRITE BACK 1 WORD DOWN
  1324. RJ =XECSPRTY
  1325. IX0 X0-X6 SUBTRACT 1 BACK
  1326. IX0 X0-X5 NEXT ECS ADDRESS IF NOT DONE
  1327. PL X7,RBFIT1
  1328. RBFIT2 BX0 X4 GET SAVED ECS ADDRESS
  1329. SA4 RFINFO X4 = FILE INFO WORD
  1330. SA0 A0+B1 LEAVE ROOM FOR IT
  1331. RE B2 READ INFO WORDS THAT SHOULD FOLLOW THIS ONE
  1332. RJ =XECSPRTY
  1333. BX7 X4
  1334. SA0 A0-B1 BACK UP
  1335. SA7 A0 PUT THIS INFO WORD AT START
  1336. SB2 B2+B1 INCREMENT LENGTH BY 1
  1337. WE B2 WRITE BACK WITH THIS INFO WORD
  1338. RJ =XECSPRTY
  1339. EQ RPSUM --- GET NEW SUMCHECK AND EXIT
  1340. *
  1341. *
  1342. RSAME SA3 TDISKU
  1343. SA4 FNTS+X3 ECS ADDRESS OF FILE NAME TABLE
  1344. SA0 RFNAME
  1345. IX0 X4+X2
  1346. WE 1 WRITE NEW NAME IN PLACE OF OLD
  1347. RJ =XECSPRTY
  1348. *
  1349. * 'FORM NEW PACK DIRECTORY SUM-CHECK.
  1350. *
  1351. RPSUM CALL PACKSUM,TDISKU
  1352. *
  1353. *
  1354. RENAMX RETURN
  1355. *
  1356. *
  1357. ENDOV
  1358. * /--- BLOCK RETYPOV 00 000 77/11/03 02.35
  1359. TITLE RETYPE - CHANGE FILE TYPE
  1360. RETYPOV OVRLAY
  1361. *
  1362. * RETYPOV
  1363. *
  1364. * ROUTINE REPLACES THE 6-BIT FILE TYPE FIELD IN FIW
  1365. *
  1366. *
  1367. * ON ENTRY'; OVARG1 = FILE NAME
  1368. * OVARG2 = NEW FILE TYPE
  1369. *
  1370. * ON EXIT'; *TERROR* IS SET AS FOLLOWS';
  1371. * -1 OPERATION COMPLETED W/O PROBLEMS
  1372. * 0 ERROR -- PACK NOT LOADED
  1373. * 1 ERROR -- FILE DOES NOT ON PACK
  1374. * 2 ERROR -- NEW FILE TYPE FIELD INVALID
  1375. *
  1376. * USES A/X 1-3, 6-7
  1377. *
  1378. *
  1379. * BEFORE STARTING, CHECK PACK SUMCHECK
  1380. *
  1381. CALL PACKCHK,TDISKU
  1382. *
  1383. SA1 OVARG1 GET FILE NAME
  1384. NG X1,RTERR1 -- FILE NAME LEGALITY
  1385. ZR X1,RTERR1 --
  1386. *
  1387. * FIND FILE ON PACK SET BY TDISKU/TPNAME, RETURNS';
  1388. * X1 = FILE NAME, X6 = FILE INDEX, X7 = *ERROR* RETURN
  1389. *
  1390. CALL FNDFILE,TDISKU,TPNAME
  1391. SA7 TERROR PRESET ERROR RETURN
  1392. ZR X7,RTERR0 -- PACK NOT LOADED
  1393. PL X7,RTERR1A -- FILE NOT FOUND
  1394. SA7 TRETURN SET *ZRETURN* TOO
  1395. *
  1396. SA3 OVARG2 GET NEW FILE TYPE
  1397. MX1 -6 MASK FIELD (COMPLEMENT)
  1398. BX2 -X1*X3 X2 _ 6 BITS (FILE TYPE)
  1399. BX3 X1*X3 X3 _ REST OF INPUT ARGUMENT
  1400. NZ X3,RTERR2 -- UNUSED FIELD NOT EMPTY
  1401. ZR X2,RTERR2 -- USED FIELD EMPTY
  1402. *
  1403. SA3 TDISKU GET DISK UNIT NUMBER
  1404. SA3 FITS+X3 GET ECS ADDR OF FILE INFO TABLE
  1405. IX0 X3+X6 ADDR + FILE INDEX = ECS PTR
  1406. SA0 RTFINFO CM BUFFER FOR FIW (1 WD)
  1407. *
  1408. + RE 1 READ FILE INFO WORD FROM ECS
  1409. RJ =XECSPRTY
  1410. *
  1411. SA3 A0 READ WORD FROM CM BUFFER
  1412. LX1 30 MOVE MASK TO PROPER POSITION
  1413. BX1 X1*X3 CLEAR FILE TYPE FIELD IN FIW
  1414. LX2 30 MOVE NEW TYPE TO SAME POSITION
  1415. BX6 X1+X2 UNION NEW FILE TYPE INTO FIW
  1416. SA6 A0 PUT NEW FIW IN CM TO ECS WORD
  1417. *
  1418. + WE 1 WRITE OUT NEW FILE INFO WORD
  1419. RJ =XECSPRTY
  1420. *
  1421. * MODIFY COMPLETE, GET NEW PACK DIRECTORY CHECKSUM, EXIT
  1422. *
  1423. CALL PACKSUM,TDISKU
  1424. *
  1425. RETYPX RETURN --- EXIT TO CALLING PROGRAM
  1426. *
  1427. *
  1428. RTERR0 SX6 3 *ZRETURN* = 3 = PACK NOT LOADED
  1429. EQ RTERRX1 *ERROR* IS ALREADY SET
  1430. *
  1431. RTERR1 SX7 1 FILE DOES NOT EXIST
  1432. SX6 4 *ZRETURN* = 4 = BAD FILE NAME
  1433. EQ RTERRX
  1434. *
  1435. RTERR1A SX6 0 *ZRETURN* = 0 = FILE NOT FOUND
  1436. EQ RTERRX1 *ERROR* IS ALREADY SET
  1437. *
  1438. RTERR2 SX7 2 INVALID NEW TYPE FIELD
  1439. * /--- BLOCK RETYPOV 00 000 77/11/03 02.35
  1440. SX6 12 *ZRETURN* = 12 = BAD FILE TYPE
  1441. EQ RTERRX
  1442. * /--- BLOCK RETYPOV 00 000 77/11/03 02.35
  1443. *
  1444. RTERRX SA7 TERROR PASS *ERROR* RETURN
  1445. RTERRX1 SA6 TRETURN SET *ZRETURN* TOO
  1446. EQ RETYPX
  1447. *
  1448. *
  1449. RTFINFO BSS 1 STORAGE FOR FILE INFO WORD
  1450. *
  1451. *
  1452. ENDOV
  1453. * /--- BLOCK DIOGOV 00 000 77/08/17 04.45
  1454. TITLE DIOGOV DISK I/O PROCESSING
  1455. * DIOGOV
  1456. *
  1457. * 'THIS OVERLAY PROCESSES DISK I/O REQUESTS FROM
  1458. * THE FOLLOWING COMMANDS--
  1459. * -DREAD-
  1460. * -DWRITE-
  1461. * -DSKREAD-
  1462. * -DSKWRIT-
  1463. * 'IT IS CALLED FROM ROUTINE *DIOGO* (FILE IOPUT)
  1464. *
  1465. * 'ON ENTRY--
  1466. * OVARG1 = BLOCK SIZE (BLKLTH=320, DBSIZE=64)
  1467. *
  1468. *
  1469. DIOGOV OVRLAY
  1470. SA5 A5 GUARANTEE X5 INTACT
  1471. LX5 18 POSITION EXTRA STORAGE POINTER
  1472. SA1 X5+B5
  1473. BX5 X1 TO X5 FOR -NGETVAR-
  1474. BX6 X1
  1475. SA6 DIOSAVE
  1476. NGETVAR GET BLOCK NUMBER
  1477. SX6 X1
  1478. NG X6,DIOERR2 --- ERROR IF BLOCK NUMBER NEGATIVE
  1479. SA6 DIOBLK SAVE STARTING BLOCK NUMBER
  1480. SA1 DIOSAVE SET UP NEXT -GETVAR- CODE
  1481. BX5 X1
  1482. LX5 XCODEL
  1483. NGETVAR GET ECS ADDRESS
  1484. SX6 X1-1
  1485. NG X6,DIOERR3 --- ERROR IF ECS ADDRESS NOT POSITIVE
  1486. SA6 DIOECS SAVE RELATIVE ECS ADDRESS
  1487. SA1 DIOSAVE SET UP NEXT -GETVAR- CODE
  1488. BX5 X1
  1489. LX5 2*XCODEL
  1490. NGETVAR GET BLOCK COUNT
  1491. SX6 X1-1 X6 = BLOCK COUNT-1
  1492. NG X6,DIOERR2 --- ERROR IF BLOCK COUNT NOT POSITIVE
  1493. SA1 TDISKU X1 = DISK UNIT
  1494. SA2 TPNAME
  1495. SA3 PNAMES+X1 CURRENT PACK ON THAT UNIT
  1496. BX4 X2-X3
  1497. ZR X3,DIOERR0 --- ERROR IF NO PACK LOADED
  1498. NZ X4,DIOERR0 --- ERROR IF PACK NAME NON-AGREEMENT
  1499. SA1 TFINFO X1 = FILE INFORMATION WORD
  1500. ZR X1,DIOERR1 --- ERROR IF FILE INFO WORD NOT SET
  1501. SA2 DIOBLK X2 = STARTING BLOCK NUMBER
  1502. BX3 X1
  1503. AX3 24
  1504. MX0 -6
  1505. BX3 -X0*X3 DISK SPACE COUNT
  1506. SX4 DSBLKS*BLKLTH WORDS PER DISK SPACE
  1507. IX3 X3*X4 X3 = NUMBER OF WORDS IN FILE
  1508. SA4 OVARG1 X4 = BLOCK SIZE
  1509. IX7 X2*X4 STARTING WORD
  1510. IX7 X7-X3
  1511. PL X7,DIOERR2 --- ERROR IF STARTING WORD TOO BIG
  1512. IX7 X2+X6 ENDING BLOCK NUMBER
  1513. IX7 X7*X4 ENDING WORD
  1514. IX7 X7-X3
  1515. PL X7,DIOERR2 --- ERROR IF ENDING WORD TOO BIG
  1516. SX6 X6+1
  1517. SA6 DIOSAVE SAVE BLOCK COUNT
  1518. SA3 TDISKU X3 = DISK UNIT
  1519. * /--- BLOCK DIOGOV 00 000 77/08/17 04.25
  1520. *---
  1521. SA4 OVARG1 BLOCK SIZE
  1522. SX4 X4-BLKLTH
  1523. ZR X4,DIOGO1 JUMP IF OLD BLOCK SIZE
  1524. *---
  1525. *
  1526. * X1 = FILE INFO WORD
  1527. * X2 = SECTOR NUMBER
  1528. * X3 = DISK UNIT
  1529. *
  1530. CALL DSKADDR SETS *DISKINF* TO DISK ADDRESS
  1531. *
  1532. *-----
  1533. EQ DIOGO2
  1534. *
  1535. * X1 = FILE INFO WORD
  1536. * X2 = BLOCK NUMBER
  1537. * X3 = DISK UNIT
  1538. *
  1539. DIOGO1 BSS 0
  1540. CALL DISKADD SETS *DISKINF* TO DISK ADDRESS
  1541. *
  1542. DIOGO2 BSS 0
  1543. *-----
  1544. SA1 TBXSTOR
  1545. CALL SETSTOR SET UP *STORWRD*
  1546. SA1 DIOECS X1 = RELATIVE ECS ADDRESS
  1547. SA4 STORWRD X4 = EXTRA STORAGE ECS POINTERS
  1548. NG X4,SERXECS --- SYSTEM ERROR IF ECS BASE NEGATIVE
  1549. AX4 18 POSITION ECS LENGTH FOR STATION AT RIGHT
  1550. SA2 DIOSAVE X2 = NUMBER OF BLOCKS
  1551. SA3 OVARG1 BLOCK SIZE
  1552. IX0 X2*X3
  1553. SX3 X4 LENGTH OF STORAGE
  1554. IX3 X3-X0
  1555. IX3 X3-X1 LENGTH-N*SIZE-(START-1)
  1556. NG X3,DIOERR3 --- FINAL ECS ADDRESS TOO BIG
  1557. AX4 18 X4 = BASE OF ECS FOR THIS STATION
  1558. IX6 X4+X1 ADD OFFSET FOR THIS REQUEST
  1559. LX6 36 POSITION ECS ADDRESS
  1560. SA1 DISKINF RETRIEVE OTHER DISK INFO
  1561. BX6 X6+X1
  1562. SA6 A1 STORE DISK INFORMATION PACKAGE
  1563. SX7 -1 I/O REQUEST OK
  1564. SA7 TERROR
  1565. SA1 DIOTYPE X1 = DISK I/O REQUEST TYPE
  1566. * X2 = NUMBER OF BLOCKS
  1567. EQ DIOREQ1 --- EXIT TO MAKE DISK I/O REQUEST
  1568. *
  1569. SERXECS BX1 X4
  1570. EXECERR 918 SYSTEM ERROR, BAD ECS LOCATION.
  1571. *
  1572. *
  1573. DIOERR0 SX7 0 PACK NOT LOADED
  1574. EQ DIOERRX
  1575. DIOERR1 SX7 1 FILE INFO WORD NOT SET
  1576. EQ DIOERRX
  1577. DIOERR2 SX7 2 BLOCK NUMBER OUT OF RANGE
  1578. EQ DIOERRX
  1579. DIOERR3 SX7 3 ECS ADDRESS OUT OF RANGE
  1580. EQ DIOERRX
  1581. *
  1582. DIOERRX SA7 TERROR STORE ERROR FLAG
  1583. EQ =XCKPROC --- ERROR RETURN
  1584. *
  1585. *
  1586. DIOBLK BSS 1 STARTING BLOCK NUMBER
  1587. DIOECS BSS 1 STARTING ECS ADDRESS (RELATIVE)
  1588. DIOSAVE BSS 1 (EVENTUALLY HOLDS BLOCK COUNT)
  1589. *
  1590. *
  1591. ENDOV
  1592. * /--- BLOCK FBIT 00 000 77/10/18 02.34
  1593. TITLE FBIT COMMAND
  1594. *
  1595. * -FBIT- COMMAND
  1596. * SETS OR UNSETS -BACKUP- BIT IN FILE INFO WORD
  1597. *
  1598. * (OVARG1) = -1 IF -SYSFILE-, 0 IF -FBIT-
  1599. *
  1600. * FOR -SYSFILE-, (TBINTSV) = FILE NAME
  1601. * (TBINTSV+1) = 0 IF OFF, 1 IF ON
  1602. * (TBINTSV+3) = ADDRESS OF FIP
  1603. *
  1604. *
  1605. FBITOV OVRLAY
  1606. INTLOK X,I.DDIR,W INTERLOCK DISK DIRECTORIES
  1607. CALL S=UDSKR READ DISK PARAMETERS
  1608. SA1 OVARG1 CHECK IF -FBIT- OR -SYSFILE-
  1609. ZR X1,FBIT1 --- IF -FBIT-
  1610. SA1 TBINTSV (X1) = FILE NAME
  1611. CALL FNDFILE,TDISKU,TPNAME
  1612. PL X7,FBERR EXIT IF FILE NOT FOUND
  1613. BX6 X0
  1614. SA6 FBWK SAVE ECS ADDRESS OF INFO WORD
  1615. SA1 A0
  1616. BX6 X1 SAVE FILE INFO WORD
  1617. SA6 FBWK1
  1618. SA1 TBINTSV+1 (X1) = 0 FOR OFF, 1 FOR ON
  1619. EQ FBIT2
  1620.  
  1621. FBIT1 BSS 0
  1622. CALL GETFILE GET FILE INFO WORD
  1623. PL X7,FBERR EXIT IF FILE NOT FOUND
  1624. BX6 X0
  1625. SA6 FBWK SAVE ECS ADDRESS OF INFO WORD
  1626. SA1 A0
  1627. BX6 X1 SAVE FILE INFO WORD
  1628. SA6 FBWK1
  1629. SA5 A5
  1630. LX5 XCODEL POSITION NEXT -GETVAR- CODE
  1631. NGETVAR GET -OFF- OR -ON-
  1632. FBIT2 BSS 0
  1633. MX6 1
  1634. ZR X1,FBITOFF JUMP IF -OFF-
  1635. SA1 FBWK1 LOAD FILE INFO WORD
  1636. BX6 X1+X6
  1637. SA6 A1 STORE WITH BIT SET
  1638. EQ FBIT10
  1639. *
  1640. FBITOFF SA1 FBWK1 LOAD FILE INFO WORD
  1641. BX6 -X6*X1
  1642. SA6 A1 STORE WITH BIT CLEAR
  1643. *
  1644. FBIT10 SA0 FBWK1
  1645. SA1 FBWK ECS ADDRESS OF FILE INFO WORD
  1646. BX0 X1
  1647. + WE 1 RE-WRITE FILE INFO WORD
  1648. RJ ECSPRTY
  1649. MX6 0 MARK NO ERROR
  1650. SA6 TERROR
  1651. MX7 -1 ZRETURN WILL BE -1 IF -SYSFILE-
  1652. FBEXIT SA1 OVARG1 CHECK IF -FBIT- OR -SYSFILE-
  1653. ZR X1,FBEXIT2 --- IF -FBIT-
  1654. SA7 TRETURN SET ZRETURN IF -SYSFILE-
  1655. PL X7,FBEXIT2 --- IF FILE WAS NOT FOUND
  1656. SA1 TBINTSV+3 (X1) = ADDRESS OF FIP
  1657. SA1 X1+/FIP/MFF (X1) = MISC. FIP FIELDS
  1658. MX6 1
  1659. LX6 1+/MFF/S.FBIT SHIFT MASK TO POSITION
  1660. SA2 TBINTSV+1 (X2) = 0 IF CLEARED, 1 IF SET
  1661. ZR X2,FBEXIT1 --- IF BACKUP BIT WAS CLEARED
  1662. BX6 X1+X6 SET BIT IN FIP
  1663. SA6 A1 STORE
  1664. EQ FBEXIT2
  1665.  
  1666. FBEXIT1 BX6 -X6*X1 CLEAR BIT IN FIP
  1667. SA6 A1 STORE
  1668.  
  1669. FBEXIT2 INTCLR X,I.DDIR RELEASE DIRECTORY INTERLOCK
  1670. * /--- BLOCK FBIT 00 000 77/10/18 02.34
  1671. EQ PROCESS --- EXIT
  1672.  
  1673. FBERR MX6 -1 ERROR = -1 IF FILE NOT FOUND
  1674. MX7 0 ZRETURN WILL BE 0 IF -SYSFILE-
  1675. EQ FBEXIT
  1676.  
  1677. FBWK OVDATA
  1678. FBWK1 OVDATA
  1679.  
  1680. ENDOV
  1681. * /--- BLOCK TERMSET 00 000 74/03/12 01.48
  1682. TITLE -TERMSET-
  1683. *
  1684. *
  1685. * -TERMSET-
  1686. * SETS UP A CALL TO GETUNIT TO GET THE TERM TABLE,
  1687. * WHICH IS UNIT NUMBER ZERO IN THE UNIT LOC TABLE.
  1688. *
  1689. * RETURNS UNIT TO BRANCH TO IN ARG WHICH IS POINTED
  1690. * TO BY (OVARG1) AT ENTRY.
  1691. * THIS ARG IS -1 IF THE TERM IS NOT FOUND.
  1692. *
  1693. EXT GETUNIT
  1694. *
  1695. *
  1696. TERMSET OVRLAY
  1697. SA1 OVARG1 LOAD ARGUMENT ADDRESS
  1698. BX6 X1
  1699. SA6 ARG SAVE ARG
  1700. MX5 0 UNIT=0
  1701. RJ GETUNIT
  1702. SB2 B5 ADDRESS OF TERM TABLE (UNIT) TO B2
  1703. SA1 ARG
  1704. SB1 X1
  1705. SB3 B1 SET UP ARGS FOR SEARCH
  1706. SA1 B1
  1707. AX1 12
  1708. MX0 12
  1709. BX6 -X0*X1 LEFT JUSTIFY TERM, AND CLEAN EXTRA BITS
  1710. SA6 B1
  1711. RJ LOCATE FIND TERM
  1712. EQ TERMEX EXIT
  1713. *
  1714. ARG BSS 1
  1715. *
  1716. *
  1717. * /--- BLOCK LOCATE 00 000 76/05/29 00.21
  1718. TITLE LOCATE
  1719. * LOCATE
  1720. *
  1721. * DOES BINARY CHOP SEARCH TO FIND TERM.
  1722. *
  1723. * UPON ENTRY,
  1724. * (B1) = ADDRESS OF TERM, WHICH IS RIGHT JUSTIFIED
  1725. * (B2) = ADDRESS OF TERM TABLE
  1726. * (B3) = ADDRESS OF RETURN VARIABLE
  1727. *
  1728. * UPON EXIT,
  1729. * CONTENTS OF RETURN VARIABLE';
  1730. *
  1731. * + UNIT NUMBER TO BRANCH TO IF TERM FOUND,
  1732. * 0 IF TERM NOT FOUND
  1733. * - COMPLEMENT OF UNIT NUMBER TO BRANCH TO FOR
  1734. * CATCH-ALL TERM
  1735. *
  1736. *
  1737. * BREAK EVEN POINT FOR STRAIGHT SEARCH VS BINARY CHOP
  1738. BKEVEN EQU 10
  1739. *
  1740. *
  1741. *
  1742. *
  1743. LOCATE EQ *
  1744. SA2 B1 TERM TO FIND TO X2
  1745. SA5 B2 NO. OF TERMS TO X5
  1746. ZR X2,NOTFND --- EXIT IF NO TERM ENTERED
  1747. ZR X5,NOTFND EXIT IF NO TERMS TO SEARCH
  1748. SB1 1 UIC TO B1
  1749. SB7 X5 NO. TERMS TO B7
  1750. MX0 12 UNIT POINTER MASK
  1751. SB6 X5-BKEVEN
  1752. NG B6,SHORT DO STRAIGHT SEARCH IF IT WILL BE FASTER
  1753. AX5 1
  1754. BX7 X5 FIRST CHOP OFFSET TO X7
  1755. SB2 B2+B1 ADDRESS OF TERM TABLE TO B2
  1756. *
  1757. * BINARY CHOP LOOP
  1758. *
  1759. BCLOOP SA1 B2+X7 LOAD TERM FROM TABLE
  1760. BX3 -X0*X1 CLEAR UNIT POINTER
  1761. IX3 X2-X3 COMPARE TERMS
  1762. ZR X3,FINDEX TERM FOUND
  1763. AX5 1
  1764. ZR X5,ENDGO
  1765. NG X3,NGSET BRANCH TO MOVE BACK IN TABLE
  1766. IX7 X7+X5 NEW POINTER TO TABLE TO X7
  1767. SB6 B1 FLAG THAT LAST MOVE FORWARD TO B6
  1768. EQ BCLOOP
  1769. *
  1770. NGSET IX7 X7-X5 NEW TABLE INDEX TO X7
  1771. SB6 -B1 FLAG THAT LAST MOVE BACKWARD TO B6
  1772. EQ BCLOOP
  1773. *
  1774. *
  1775. *
  1776. ENDGO NG X3,NGEND
  1777. NG B6,LOSTEX NOT FOUND IF REVERSAL IN SINGLE STEP
  1778. SX7 X7+B1
  1779. SB4 X7
  1780. EQ B4,B7,LOSTEX NOT FOUND IF RUNS OFF END
  1781. SB6 B1 FLAG LAST MOVE FORWARD
  1782. EQ BCLOOP
  1783. *
  1784. NGEND PL B6,LOSTEX
  1785. SX7 X7-1
  1786. NG X7,LOSTEX NOT FOUND IF RUN OFF TABLE
  1787. SB6 -B1 FLAG THAT LAST MOVE BACKWARD
  1788. EQ BCLOOP
  1789. *
  1790. *
  1791. *
  1792. * TERM FOUND
  1793. *
  1794. FINDEX BX6 X1*X0 GET UNIT POINTER
  1795. LX6 12 RIGHT JUSTIFY
  1796. SA6 B3 STORE UNIT NUMBER,
  1797. EQ LOCATE --- EXIT
  1798. *
  1799. *
  1800. * FASTEST SEARCH STRAIGHT, DUE TO SHORT UNIT TABLE LENGTH
  1801. *
  1802. SHORT SB4 B0
  1803. * /--- BLOCK LOCATE 00 000 76/05/28 21.23
  1804. SLOOP SB4 B4+B1 INCREMENT
  1805. SA1 B2+B4
  1806. BX3 -X0*X1
  1807. BX3 X3-X2 CHECK IF FOUND
  1808. ZR X3,FINDEX DONE IF TERM FOUND
  1809. NE B4,B7,SLOOP LOOP IF MORE LIST
  1810. SB2 B2+B1 ADDRESS OF TERM TABLE TO B2
  1811. *
  1812. * TERM REQUESTED NOT FOUND, CHECK FOR CATCH-ALL TERM
  1813. *
  1814. LOSTEX SA1 B2 GET FIRST ENTRY IN TABLE
  1815. BX3 -X0*X1 MASK OFF UNIT
  1816. NZ X3,NOTFND NO BLANK TERM
  1817. BX6 X1*X0 GET UNIT POINTER
  1818. LX6 12 RIGHT JUSTIFY
  1819. BX6 -X6 COMPLEMENT FOR CATCH-ALL TERM
  1820. SA6 B3
  1821. EQ LOCATE ---EXIT
  1822. *
  1823. NOTFND SX6 0
  1824. SA6 B3 STORE AS NOT FOUND TERM
  1825. EQ LOCATE ---EXIT
  1826. *
  1827. *
  1828. TERMEX RETURN
  1829. *
  1830. *
  1831. ENDOV
  1832. * /--- BLOCK -ATTACHF- 00 000 79/11/15 20.58
  1833. TITLE -ATTACHF- AND -FILEF-
  1834. *
  1835. * -ATTACHF- (CODE = 449, OVARG1 = 0)
  1836. * -FILEF- (CODE = 471, OVARG1 = 1)
  1837. *
  1838. * ATTACHF FIP;KEYWORD,VALUE;KEYWORD,VALUE;
  1839. * KEYWORD;VALUE
  1840. *
  1841. * THE FIRST ARGUMENT SPECIFIES A FILE INFOR-
  1842. * MATION PACKET (FIP), WHICH CONTAINS THE FILE
  1843. * NAME, AN OPTIONAL PACK NAME, A LOCATION FOR
  1844. * INFO RETURNED FROM MASTOR, AND A LOCATION FOR
  1845. * THE FILE INFORMATION WORD. THE OPTIONAL KEYWORDS
  1846. * ARE AS FOLLOWS --
  1847. *
  1848. * PACK PACK NAME
  1849. * FILE FILE NAME
  1850. * MODE 0 = R/O = DEFAULT, -1 = R/W
  1851. *
  1852. * ONLY THE *PACK* AND *FILE* TAGS ARE VALID
  1853. * WITH -FILEF-
  1854. *
  1855. * /--- BLOCK -ATTACHF- 00 000 79/11/15 20.46
  1856. *
  1857. * MASTOR REQUEST FORMAT --
  1858. * MASRQ+2 - FILE NAME
  1859. * MASRQ+3 - OPTIONAL PACK NAME OR ZERO
  1860. * MASRQ+4 - 1/ATTACH TYPE(READ=0,WRITE=1)
  1861. * 1/COMMAND(0=ATTACHF,1=FILEF)
  1862. * 58/UNUSED
  1863. * MASRQ+5 - UNUSED(NEEDED FOR REPLY ONLY)
  1864. * MASRQ+6 - STATION NUMBER PLUS 1 OF ATTACHER
  1865. *
  1866. * MASTOR REPLY FORMAT --
  1867. * MASRQ+2 - FILE NAME
  1868. * MASRQ+3 - PACK NAME
  1869. * MASRQ+4 - 1/ATTACH TYPE
  1870. * 1/COMMAND(0=ATTACHF,1=FILEF),
  1871. * 31/UNUSED,
  1872. * 9/UNIT NO.,18/POINTER TO FILE INFO WORD
  1873. * MASRQ+5 - FILE INFO WORD
  1874. * MASRQ+6 - ATTACHED STATION + 1
  1875. * MASRQ+7 - ERROR CODE OR -1 IF ALL OKAY
  1876. *
  1877. * THE PACK NAME IS RETURNED TO THE SECOND WORD OF
  1878. * THE FIP FOLLOWING A SUCCESSFUL ATTACH.
  1879. *
  1880. * MASRQ+4 IS RETURNED TO THE THIRD WORD OF THE
  1881. * FIP FOLLOWING A SUCCESSFUL ATTACH.
  1882. *
  1883. * THE FILE INFO WORD IS RETURNED TO THE FOURTH WORD
  1884. * OF THE FIP FOLLOWING A SUCCESSFUL ATTACH.
  1885. *
  1886. * ON COMPLETION *TRETURN* IS SET AS FOLLOWS
  1887. * -2 = REDUNDANT ATTACH
  1888. * -1 = ATTACH SUCCESSFUL OR REDUNDANT
  1889. * 0 = ERROR -- FILE DOES NOT EXIST
  1890. * 1 = ERROR -- FILE ATTACHED TO ANOTHER STATION
  1891. * (SEE *TERROR* FOR STATION NUMBER)
  1892. * 2 = ERROR -- IMPROPER MASTOR REQUEST
  1893. * 3 = ERROR -- BAD PACK NAME
  1894. * 4 = ERROR -- BAD FILE NAME
  1895. *
  1896. * *TERROR* IS SET TO THE STATION NUMBER OF THE
  1897. * ATTACHED STATION WHEN *TRETURN* IS 4, OTHERWISE
  1898. * UNUSED.
  1899. *
  1900. * /--- BLOCK SETUP 00 000 80/02/07 04.19
  1901. ATTFOV OVRLAY
  1902. *
  1903. * * SAVE ATTACHF/FILEF FLAG
  1904. *
  1905. SA1 OVARG1 X1 = ATTACHF/FILEF FLAG
  1906. NG X1,TAGSDONE --- IF -SYSFILE- COMMAND
  1907. BX6 X1
  1908. SA6 SAVETYP
  1909. *
  1910. * * CHECK REQUEST BUFFERS FOR SPACE AND SAVE *KEY*
  1911. *
  1912. CALLX REQCHK
  1913. CALL RESTKEY RESTORE *KEY*
  1914. *
  1915. * * UNPACK ARGUMENTS INTO *VARBUF*
  1916. *
  1917. SX6 63 X6 = MAX. NUMBER OF ARGUMENTS
  1918. SA5 A5 RETRIEVE COMMAND WORD
  1919. CALL GETARGS MOVE GETVAR CODES TO *VARBUF*
  1920. SA6 NUMARGS STORE NUMBER OF ARGUMENTS
  1921. *
  1922. * * PROCESS FIRST ARGUMENT (FIP)
  1923. *
  1924. SA1 VARBUF X1 = FIRST GETVAR CODE
  1925. BX5 X1
  1926. NGETVAR A1 = ADDR. OF FIP
  1927.  
  1928. SX6 A1
  1929. SA6 FIPADDR SAVE IT
  1930.  
  1931. SX1 0 MARK NOT IN -CALC- FOR FIPCHK
  1932. CALL FIPCHK CHECKS BOUNDS ON FIP
  1933.  
  1934. SX6 1
  1935. SA6 ARGSDONE FIRST ARG HAS BEEN PROCESSED
  1936. * /--- BLOCK TAGS 00 000 80/02/07 04.54
  1937. *
  1938. * * LOOP TO PROCESS TAGS
  1939. *
  1940. TAGLOOP SA1 ARGSDONE
  1941. SA2 NUMARGS
  1942. IX2 X1-X2
  1943. ZR X2,TAGSDONE --- IF ALL TAGS PROCESSED
  1944.  
  1945. SX6 X1+2 INCREMENT COUNT OF ARGS DONE
  1946. SA6 A1 STORE INCREMENTED COUNT
  1947.  
  1948. SA1 VARBUF+X1 X1 = NEXT GETVAR CODE
  1949. LX1 XCODEL SHIFT CODE TO BITS 0-19
  1950. SB1 X1 B1 = TAG NUMBER
  1951.  
  1952. SA1 A1+1 X1 = NEXT GETVAR CODE
  1953. BX5 X1
  1954. JP TAGTAB+B1 --- PROCESS THIS TAG
  1955. *
  1956. * * JUMP TABLE FOR KEYWORD ARGUMENTS
  1957. *
  1958. TAGTAB BSS 0
  1959.  
  1960. + EQ FILENAM 0 = FILE NAME
  1961. + EQ PACKNAM 1 = PACK NAME
  1962. + EQ ACCMODE 2 = ACCESS MODE
  1963. *
  1964. * * GET FILE NAME
  1965. *
  1966. FILENAM X GETFILV,ARGSDONE,ACCT,FILE
  1967. SA1 FILE X1 = FILE NAME
  1968. BX6 X1
  1969. SA1 FIPADDR X1 = ADDR OF FIP
  1970. SA6 X1+/FIP/FILE STORE FILE NAME IN FIP
  1971. EQ TAGLOOP --- PROCESS NEXT TAG
  1972. *
  1973. * * GET PACK NAME
  1974. *
  1975. PACKNAM NGETVAR X1 = PACK NAME
  1976. BX6 X1
  1977. SA1 FIPADDR X1 = ADDR. OF FIP
  1978. SA6 X1+/FIP/DIR STORE PACK NAME IN FIP
  1979. EQ TAGLOOP --- PROCESS NEXT TAG
  1980. *
  1981. * * GET ACCESS MODE
  1982. *
  1983. ACCMODE NGETVAR X1 = -1 FOR R/W, 0 FOR R/O
  1984. SX6 MA.READ PRESET FOR R/O ACCESS
  1985. PL X1,ACCMOD1 --- IF R/O ACCESS
  1986. SX6 MA.RW SET FOR R/W ACCESS
  1987. ACCMOD1 BSS 0
  1988. SA1 FIPADDR X1 = ADDR. OF FIP
  1989. SA1 X1+/FIP/MFF (X1) = MISC. FIP FIELDS
  1990. MX0 -/MFF/M.ATTACH (X0) = MASK FOR ATTACH MODE
  1991. LX0 /MFF/S.ATTACH SHIFT MASK TO POSITION
  1992. BX1 X0*X1 CLEAR OLD ATTACH MODE
  1993. LX6 /MFF/S.ATTACH POSITION NEW ATTACH MODE
  1994. BX6 X1+X6
  1995. SA6 A1 STORE IN FIP
  1996. EQ TAGLOOP --- PROCESS NEXT TAG
  1997. * /--- BLOCK PREPARE 00 000 80/02/07 04.19
  1998. *
  1999. * * PREPARE MASTOR REQUEST
  2000. *
  2001. TAGSDONE SA1 FIPADDR X1 = ADDR. OF FIP
  2002.  
  2003. SX6 MS.AFFS X6 = -ATTACH- MASTOR REQ. CODE
  2004. SA6 MASRQ SET REQUEST CODE
  2005.  
  2006. SA2 X1+/FIP/FILE (X2) = FILE NAME
  2007. ZR X2,ATTFE4 --- IF FILE NAME IS BAD
  2008. NG X2,ATTFE4 --- IF FILE NAME IS BAD
  2009. BX6 X2 (X6) = FILE NAME
  2010. SA6 MASRQ+2 STORE FILE NAME IN REQUEST
  2011.  
  2012. SA2 X1+/FIP/DIR (X2) = PACK NAME
  2013. NG X2,ATTFE3 --- IF PACK NAME IS BAD
  2014. BX6 X2 (X6) = PACK NAME
  2015. SA6 MASRQ+3 STORE PACK NAME IN MASTOR REQ.
  2016.  
  2017. SA2 SAVETYP X2 = 0 IF ATTACHF, 1 IF FILEF
  2018. NZ X2,TAGSDON2 --- IF EXECUTING -FILEF-
  2019.  
  2020. CALL ZFILACC,X1 (X1) = -1 FOR R/W, 0 FOR R/O
  2021. MX0 1 X0 = MASK FOR SIGN BIT
  2022. BX6 X0*X1 X6 = SIGN BIT = ACCESS MODE
  2023. EQ TAGSDON3
  2024.  
  2025. TAGSDON2 MX6 1 SET -FILEF- BIT
  2026. LX6 59 SHIFT TO BIT 58
  2027.  
  2028. TAGSDON3 SA6 MASRQ+4 STORE ACCESS MODE/FILEF FLAGS
  2029.  
  2030. SA1 STATION X1 = STATION NUMBER
  2031. SX6 X1+1 X6 = STATION + 1
  2032. SA6 MASRQ+6 STORE STATION NO. IN REQUEST
  2033. * /--- BLOCK REQUEST 00 000 80/02/07 04.54
  2034. *
  2035. * * SAVE COMMON, STORAGE, ETC. AND POST REQUEST
  2036. *
  2037. CALL SAVKEY
  2038. CALL SAVLES
  2039. CALL S=MAS,MASRQ,STATION
  2040. *
  2041. * * WAIT FOR REQUEST TO COMPLETE
  2042. *
  2043. ATTFX2 TUTIM -1,,IOKEY
  2044.  
  2045. SA1 KEY
  2046. SX1 X1-IOKEY
  2047. NZ X1,ATTFX2 --- IF NOT IOKEY
  2048. *
  2049. * * RETURN COMPLETION STATUS TO REQUESTOR
  2050. *
  2051. SA1 MASRQ+7 X1 = MASTOR STATUS WORD
  2052. BX6 X1
  2053. SA6 TRETURN *ZRETURN* = COMPLETION STATUS
  2054. *
  2055. * * RETURN NUMBER OF ATTACHED STATION
  2056. *
  2057. SA1 MASRQ+6 X1 = ATTACHED STATION + 1
  2058. SX6 X1-1 GET EXACT STATION NUMBER
  2059. SA6 TERROR *ERROR* = ATTACHED STATION
  2060. *
  2061. * * RESTORE COMMON, LESSON, ETC.
  2062. *
  2063. CALL RESTKEY RESTORE *KEY*
  2064. CALL RESTLES RESTORE COMMON, LESSON, ETC.
  2065. *
  2066. * * RETURN FIP TO CALLER
  2067. *
  2068. SA1 FIPADDR X1 = ADDR. OF FIP
  2069. X NEWFIPV,(MASRQ+2),X1 CONVERT TO NEW FORMAT
  2070. *
  2071. * * EXIT
  2072. *
  2073. EQ CKPROC --- PROCESS NEXT COMMAND
  2074. *
  2075. * * ERROR -- BAD PACK NAME
  2076. *
  2077. ATTFE3 SX6 3
  2078. EQ ATTFE
  2079. *
  2080. * * ERROR -- BAD FILE NAME
  2081. *
  2082. ATTFE4 SX6 4
  2083. *
  2084. * * SET ERROR CODES AND EXIT
  2085. *
  2086. ATTFE SA6 TRETURN SET *ZRETURN*
  2087. EQ PROCESS
  2088.  
  2089. FIPADDR EQU TBINTSV ADDR. OF FIP
  2090. NUMARGS EQU TBINTSV+1 NO. OF GETVAR CODES
  2091. ARGSDONE EQU TBINTSV+2 NO. OF GETVAR CODES PROCESSED
  2092. SAVETYP EQU TBINTSV+3 TO SAVE FILEF/ATTACHF FLAG
  2093. ACCT EQU TBINTSV+4 ACCOUNT NAME
  2094. FILE EQU TBINTSV+5 FILE NAME
  2095.  
  2096. ENDOV
  2097. * /--- BLOCK -DETACHF- 00 000 79/11/11 23.30
  2098. TITLE -DETACHF-
  2099. *
  2100. * -DETACHF- (CODE = 454)
  2101. *
  2102. * DETACHF FIP;KEYWORD,VALUE;KEYWORD,VALUE;
  2103. * KEYWORD
  2104. *
  2105. * THE FIRST ARGUMENT SPECIFIES A FOUR WORD FILE
  2106. * INFORMATION PACKET (FIP). THE OPTIONAL KEYWORDS
  2107. * MAY BE USED TO SPECIFY --
  2108. *
  2109. * FILE,N1 - FILE NAME
  2110. * PACK,N1 - PACK NAME
  2111. * STATION - DETACH ONLY IF THIS STATION HAS THE
  2112. * FILE ATTACHED (DEFAULT)
  2113. * MASTER - DETACH NO MATTER WHAT STATION HAS THE
  2114. * FILE ATTACHED
  2115. *
  2116. * MASTOR REQUEST FORMAT --
  2117. * MASRQ+2 - FILE NAME
  2118. * MASRQ+3 - OPTIONAL PACK NAME OR ZERO
  2119. * MASRQ+4 - 1/ATTACH TYPE(READ=0,WRITE=1),59/UNUSED
  2120. * MASRQ+5 - UNUSED(NEEDED FOR REPLY ONLY)
  2121. * MASRQ+6 - STATION NUMBER PLUS 1 OF ATTACHER
  2122. * MASRQ+7 - DETACH TYPE(0=STATION,1=MASTER)
  2123. *
  2124. * MASTOR REPLY FORMAT --
  2125. * MASRQ+2 - FILE NAME
  2126. * MASRQ+3 - PACK NAME
  2127. * MASRQ+4 - 1/ATTACH TYPE,32/UNUSED
  2128. * 9/UNIT NO.,18/POINTER TO FILE INFO WORD
  2129. * MASRQ+5 - FILE INFO WORD
  2130. * MASRQ+6 - STATION+1 THAT WAS ATTACHED
  2131. * MASRQ+7 - ERROR CODE OR -1 IF ALL OKAY
  2132. *
  2133. * ON COMPLETION *TRETURN* IS SET AS FOLLOWS
  2134. * -2 = FILE NOT ATTACHED
  2135. * -1 = DETACH SUCCESSFUL
  2136. * 0 = ERROR -- FILE DOES NOT EXIST
  2137. * 1 = ERROR -- FILE ATTACHED TO ANOTHER STATION
  2138. * 2 = ERROR -- IMPROPER MASTOR REQUEST
  2139. * 3 = ERROR -- BAD PACK NAME
  2140. * 4 = ERROR -- BAD FILE NAME
  2141. *
  2142. * ON COMPLETION *ERROR* CONTAINS THE NUMBER OF THE
  2143. * STATION WHICH HAD THE FILE ATTACHED.
  2144. *
  2145. * /--- BLOCK SETUP 00 000 79/12/28 16.21
  2146. DETFOV OVRLAY
  2147. SA1 OVARG1
  2148. NG X1,TAGSDONE --- IF -SYSFILE- COMMAND
  2149. *
  2150. * * CHECK REQUEST BUFFERS FOR SPACE AND SAVE *KEY*
  2151. *
  2152. CALLX REQCHK
  2153. CALL RESTKEY RESTORE *KEY*
  2154. *
  2155. * * UNPACK ARGUMENTS INTO *VARBUF*
  2156. *
  2157. SX6 63 X6 = MAX. NUMBER OF ARGUMENTS
  2158. SA5 A5 RETRIEVE COMMAND WORD
  2159. CALL GETARGS MOVE GETVAR CODES TO *VARBUF*
  2160. SA6 NUMARGS STORE NUMBER OF ARGUMENTS
  2161. *
  2162. * * PROCESS FIRST ARGUMENT (FIP)
  2163. *
  2164. SA1 VARBUF X1 = FIRST GETVAR CODE
  2165. BX5 X1
  2166. NGETVAR A1 = ADDR. OF FIP
  2167.  
  2168. SX6 A1
  2169. SA6 FIPADDR SAVE IT
  2170.  
  2171. SX1 0 MARK NOT IN -CALC- FOR FIPCHK
  2172. CALL FIPCHK CHECKS BOUNDS ON FIP
  2173.  
  2174. SX6 1
  2175. SA6 ARGSDONE FIRST ARG HAS BEEN PROCESSED
  2176.  
  2177. SX6 0 DEFAULT TO *STATION* -DETACHF-
  2178. SA6 SMCODE (RATHER THAN *MASTER*)
  2179. * /--- BLOCK TAGS 00 000 80/02/07 04.54
  2180. *
  2181. * * LOOP TO PROCESS TAGS
  2182. *
  2183. TAGLOOP SA1 ARGSDONE
  2184. SA2 NUMARGS
  2185. IX2 X1-X2
  2186. ZR X2,TAGSDONE --- IF ALL TAGS PROCESSED
  2187.  
  2188. SX6 X1+2 INCREMENT COUNT OF ARGS DONE
  2189. SA6 A1 STORE INCREMENTED COUNT
  2190.  
  2191. SA1 VARBUF+X1 X1 = NEXT GETVAR CODE
  2192. LX1 XCODEL SHIFT CODE TO BITS 0-19
  2193. SB1 X1 B1 = TAG NUMBER
  2194.  
  2195. SA1 A1+1 X1 = NEXT GETVAR CODE
  2196. BX5 X1
  2197. JP TAGTAB+B1 --- PROCESS THIS TAG
  2198. *
  2199. * * JUMP TABLE FOR KEYWORD ARGUMENTS
  2200. *
  2201. TAGTAB BSS 0
  2202.  
  2203. + EQ FILENAM 0 = FILE NAME
  2204. + EQ PACKNAM 1 = PACK NAME
  2205. + SX6 0 2 = STATION
  2206. EQ STAMAST
  2207. + SX6 1 3 = MASTER
  2208. EQ STAMAST
  2209. *
  2210. * * GET FILE NAME
  2211. *
  2212. FILENAM X GETFILV,ARGSDONE,ACCT,FILE
  2213. SA1 FILE X1 = FILE NAME
  2214. BX6 X1
  2215. SA1 FIPADDR X1 = ADDR OF FIP
  2216. SA6 X1+/FIP/FILE STORE FILE NAME IN FIP
  2217. EQ TAGLOOP --- PROCESS NEXT TAG
  2218. *
  2219. * * GET PACK NAME
  2220. *
  2221. PACKNAM NGETVAR X1 = PACK NAME
  2222. BX6 X1
  2223. SA1 FIPADDR X1 = ADDR. OF FIP
  2224. SA6 X1+/FIP/DIR STORE PACK NAME IN FIP
  2225. EQ TAGLOOP --- PROCESS NEXT TAG
  2226. *
  2227. * * STATION/MASTER FLAG
  2228. *
  2229. STAMAST SA6 SMCODE STORE FLAG (0=STATION,1=MASTER)
  2230. SA1 ARGSDONE BACK UP RUNNING GETVAR COUNTER
  2231. SX6 X1-1
  2232. SA6 A1
  2233. EQ TAGLOOP --- PROCESS NEXT TAG
  2234. * /--- BLOCK PREPARE 00 000 79/11/11 23.32
  2235. *
  2236. * * PREPARE MASTOR REQUEST
  2237. *
  2238. TAGSDONE SA1 FIPADDR X1 = ADDR. OF FIP
  2239.  
  2240. SX6 MS.DFFS DETACHF MASTOR REQUEST
  2241. SA6 MASRQ SET REQUEST CODE
  2242.  
  2243. SA2 X1+/FIP/FILE (X2) = FILE NAME
  2244. ZR X2,DETFE4 --- IF FILE NAME IS BAD
  2245. NG X2,DETFE4 --- IF FILE NAME IS BAD
  2246.  
  2247. SA2 X1+/FIP/DIR (X2) = PACK NAME
  2248. NG X2,DETFE3 --- IF PACK NAME IS BAD
  2249.  
  2250. X OLDFIPV,X1,(MASRQ+2) CONVERT TO OLD FORMAT
  2251.  
  2252. SA1 STATION X1 = STATION NUMBER
  2253. SX6 X1+1 STATION PLUS 1 FOR -DETACHF-
  2254. SA6 MASRQ+6 STORE IN REQUEST
  2255.  
  2256. SA1 SMCODE X1 = STATION/MASTOR INDICATOR
  2257. BX6 X1
  2258. SA6 MASRQ+7 STORE IN REQUEST
  2259. * /--- BLOCK REQUEST 00 000 80/02/07 04.55
  2260. *
  2261. * * SAVE COMMON, STORAGE, ETC. AND POST REQUEST
  2262. *
  2263. CALL SAVLES
  2264. CALL SAVKEY
  2265. CALL S=MAS,MASRQ,STATION
  2266. *
  2267. * * WAIT FOR REQUEST TO COMPLETE
  2268. *
  2269. DETFX2 TUTIM -1,,IOKEY
  2270.  
  2271. SA1 KEY
  2272. SX1 X1-IOKEY
  2273. NZ X1,DETFX2 IGNORE IF NOT IOKEY
  2274. *
  2275. * * RETURN COMPLETION STATUS TO REQUESTOR
  2276. *
  2277. SA1 MASRQ+7 X1 = COMPLETION STATUS
  2278. BX6 X1
  2279. SA6 TRETURN *ZRETURN* = COMPLETION STATUS
  2280. *
  2281. * * RETURN STATION NUMBER IN CASE *ZRETURN* IS 4
  2282. *
  2283. SA1 MASRQ+6 X1 = STATION NUMBER + 1
  2284. SX6 X1-1 GET EXACT STATION NUMBER
  2285. SA6 TERROR *ERROR* = STATION NUMBER
  2286. *
  2287. * * RESTORE COMMON, LESSON, ETC., AND EXIT
  2288. *
  2289. CALL RESTKEY RESTORE *KEY*
  2290. CALL RESTLES RESTORE COMMON, LESSON, ETC.
  2291.  
  2292. EQ CKPROC --- PROCESS NEXT COMMAND
  2293. *
  2294. * * ERROR -- BAD PACK NAME
  2295. *
  2296. DETFE3 SX6 3
  2297. EQ DETFE
  2298. *
  2299. * * ERROR -- BAD FILE NAME
  2300. *
  2301. DETFE4 SX6 4
  2302. *
  2303. * * SET ERROR CODE AND EXIT
  2304. *
  2305. DETFE SA6 TRETURN
  2306. EQ PROCESS
  2307.  
  2308. FIPADDR EQU TBINTSV ADDR. OF FIP
  2309. NUMARGS EQU TBINTSV+1 NO. OF GETVAR CODES
  2310. ARGSDONE EQU TBINTSV+2 NO. OF GETVAR CODES PROCESSED
  2311. SMCODE EQU TBINTSV+3 STATION/MASTER INDICATOR
  2312. ACCT EQU TBINTSV+4 ACCOUNT NAME
  2313. FILE EQU TBINTSV+5 FILE NAME
  2314.  
  2315. ENDOV
  2316. * /--- BLOCK -READF- 00 000 79/11/11 23.33
  2317. TITLE -READF-/-WRITEF-
  2318. *
  2319. * READF/WRITEF (CODE = 450/451)
  2320. *
  2321. * READF FIP,STARTING BLOCK,STORAGE<,NO. OF BLOCKS>
  2322. * WRITEF FIP,STARTING BLOCK,STORAGE<,NO. OF BLOCKS>
  2323. *
  2324. * READ/WRITE 64 WORD DISK BLOCKS
  2325. *
  2326. * THE FIRST ARGUMENT IS THE ADDRESS OF THE FILE
  2327. * INFORMATION PACKET WHICH IS FOUR WORDS LONG.
  2328. * THE FIP CONTAINS THE FOLLOWING INFORMATION -
  2329. * FILE NAME, PACK NAME, A POINTER WORD WHICH
  2330. * CAN BE USED TO LOCATE THE FILE INFO WORD
  2331. * IN THE PACK DIRECTORY, AND THE FILE INFO WORD.
  2332. * THE FIP IS SETUP BY THE -ATTACHF- COMMAND. THE
  2333. * 2ND ARGUMENT SPECIFIES THE STARTING BLOCK NUMBER
  2334. * THE 3RD THE ECS ADDRESS, AND THE 4TH THE NUMBER
  2335. * OF BLOCKS TO READ.
  2336. *
  2337. * MASTOR REQUEST FORMAT --
  2338. * MASRQ = MASTOR FUNCTION CODE
  2339. * MASRQ+2 = FILE NAME
  2340. * MASRQ+3 = PACK NAME
  2341. * MASRQ+4 = 1/ATTACH TYPE,32/UNUSED
  2342. * 9/UNIT NO,18/PTR TO FILE INFO WORD
  2343. * MASRQ+5 = UNUSED
  2344. * MASRQ+6 = 12/STATION+1,18/UNUSED
  2345. * 18/NO. OF SECTORS TO TRANSFER,
  2346. * 12/IO TYPE(READ=3,WRITE=4)
  2347. * MASRQ+7 = 24/ABS ECSFWA,18/UNUSED,
  2348. * 18/STARTING SECTOR
  2349. *
  2350. * MASTOR REPLY FORMAT --
  2351. * MASRQ+2 - FILE NAME
  2352. * MASRQ+3 - PACK NAME
  2353. * MASRQ+4 - SAME AS REQUEST
  2354. * MASRQ+5 - FILE INFO WORD
  2355. * MASRQ+6 - SAME AS REQUEST
  2356. * MASRQ+7 - ERROR CODE OR -1 IF ALL OKAY
  2357. *
  2358. * ON COMPLETION *TRETURN* IS SET AS FOLLOWS
  2359. * -1 = I/O COMPLETE SUCCESSFULLY
  2360. * 0 = FILE DOES NOT EXIST
  2361. * 1 = FILE NOT ATTACHED TO THIS STATION
  2362. * 2 = BAD MASTOR REQUEST
  2363. * 3 = BAD PACK NAME
  2364. * 4 = BAD FILE NAME
  2365. * 5 = BAD STARTING BLOCK NUMBER
  2366. * 6 = NUMBER OF BLOCKS IS BAD
  2367. * 7 = TRANSFER LENGTH TOO LONG FOR STORAGE
  2368. * 8 = BAD ECS ADDRESS
  2369. * 9 = I/O TRANSFER LENGTH PAST END OF FILE
  2370. * 10 = SYSTEM DISK ERROR (SEE *TERROR*)
  2371. *
  2372. * ON COMPLETION *TERROR* IS SET AS FOLLOWS-
  2373. * -1 = NO SYSTEM DISK ERROR
  2374. * N = SYSTEM DISK ERROR CODE
  2375. *
  2376. * /--- BLOCK SETUP 00 000 79/11/30 07.29
  2377. FIOV OVRLAY
  2378.  
  2379. SA1 OVARG1 X1 = 3 TO READ, 4 TO WRITE
  2380. NG X1,FIOX0 --- IF -SYSFILE- COMMAND
  2381. BX6 X1
  2382. SA6 IOTYPE SAVE I/O TYPE
  2383. *
  2384. * * CHECK REQUEST BUFFERS FOR SPACE AND SAVE *KEY*
  2385. *
  2386. CALLX REQCHK
  2387. CALL RESTKEY RESTORE *KEY*
  2388. *
  2389. * * GET ADDRESS OF FIP
  2390. *
  2391. NGETVAR A1 = ADDR. OF FIP
  2392. SX6 A1
  2393. SA6 FIPADDR SAVE ADDR. OF FIP
  2394.  
  2395. SX1 0 MARK NOT IN -CALC- FOR FIPCHK
  2396. CALL FIPCHK CHECKS BOUNDS ON FIP
  2397. *
  2398. * * GET STARTING BLOCK NUMBER
  2399. *
  2400. SA5 A5 RETRIEVE COMMAND WORD
  2401. LX5 XCODEL SHIFT TO 2ND GETVAR CODE
  2402. NGETVAR X1 = NO. OF FIRST BLOCK
  2403. SX2 X1
  2404. NG X2,FIOE5 --- ERROR IF BAD NUMBER
  2405. NG X1,FIOE5 --- ERROR IF NEGATIVE BLOCK NO.
  2406. BX6 X1
  2407. SA6 FRSTBLK SAVE STARTING BLOCK NO.
  2408. *
  2409. * * GET ECS ADDRESS
  2410. *
  2411. SA5 A5 RETRIEVE COMMAND WORD
  2412. MX0 -XSPTRL X0 = MASK FOR STORAGE POINTER
  2413. AX5 XCMNDL SHIFT OFF COMMAND CODE
  2414. BX5 -X0*X5 X5 = EXTRA STORAGE PTR.
  2415. SA1 B5+X5 X1 = EXTRA STORAGE WORD
  2416. BX5 X1 SET UP FOR GETVAR ROUTINES
  2417. BX6 X1
  2418. SA6 TEMP SAVE A COPY FOR LATER USE
  2419. NGETVAR X1 = STORAGE ADDRESS
  2420. SX6 1
  2421. IX6 X1-X6
  2422. NG X6,FIOE8 --- ERROR IF ECS ADDR. &lt;= 0
  2423. SA6 ECSADDR SAVE ECS ADDRESS
  2424. *
  2425. * * GET NUMBER OF BLOCKS
  2426. *
  2427. SA1 TEMP X1 = EXTRA STORAGE WORD
  2428. BX5 X1 SET UP FOR GETVAR CALL
  2429. LX5 XCODEL SHIFT TO NEXT GETVAR CODE
  2430. NGETVAR X1 = NUMBER OF BLOCKS
  2431. SX2 X1
  2432. NG X2,FIOE6 --- ERROR IF BAD NUMBER
  2433. NG X1,FIOE6 --- ERROR IF NEGATIVE
  2434. ZR X1,FIOE6 --- ERROR IF ZERO
  2435. BX6 X1
  2436. SA6 NUMBLKS SAVE NO. OF BLOCKS
  2437. * /--- BLOCK PREPARE 00 000 79/11/11 23.34
  2438. *
  2439. * * PREPARE MASTOR REQUEST
  2440. *
  2441. FIOX0 BSS 0
  2442. SX6 MS.NFIO X6 = READF/WRITEF REQ. CODE
  2443. SA6 MASRQ STORE MASTOR REQUEST CODE
  2444.  
  2445. SA1 FIPADDR X1 = ADDR. OF FIP
  2446.  
  2447. SA2 X1+/FIP/FILE (X2) = FILE NAME
  2448. NG X2,FIOE4 --- IF FILE NAME IS BAD
  2449. ZR X2,FIOE4 --- IF FILE NAME IS BAD
  2450.  
  2451. SA2 X1+/FIP/DIR (X2) = PACK NAME
  2452. NG X2,FIOE3 --- IF PACK NAME IS BAD
  2453. ZR X2,FIOE3 --- IF PACK NAME IS BAD
  2454.  
  2455. X OLDFIPV,X1,(MASRQ+2) CONVERT TO OLD FORMAT
  2456.  
  2457. SA1 NUMBLKS X2 = NO. OF BLOCKS
  2458. LX1 12 POSITION TRANSFER LENGTH
  2459. SA2 IOTYPE I/O TYPE (3 = READ, 4 = WRITE)
  2460. BX6 X1+X2
  2461. SA1 STATION X1 = STATION NUMBER
  2462. SX1 X1+1 ADD ONE TO STATION NUMBER
  2463. LX1 48 POSTION IT
  2464. BX6 X1+X6 COMBINE
  2465. SA6 MASRQ+6 STORE IN REQUEST
  2466.  
  2467. SA1 TBXSTOR X1 = STORAGE INFO
  2468. CALL SETSTOR SETS UP *STORWRD*
  2469. SA4 STORWRD X4 = 24/ECS ADDR,18/LENGTH,18/0
  2470. AX4 18 SHIFT TO STORAGE LENGTH
  2471. SA1 ECSADDR X1 = STARTING ECS ADDR.
  2472. SX0 DBSIZE X0 = WORDS/DISK SECTOR
  2473. SA2 NUMBLKS NO. BLOCKS TO READ/WRITE
  2474. IX0 X0*X2 X0 = TOTAL WORDS TO READ/WRITE
  2475. SX3 X4 X3 = STORAGE LENGTH
  2476. IX3 X3-X0 SUBTRACT I/O LENGTH
  2477. IX3 X3-X1 SUBTRACT STARTING ADDRESS
  2478. NG X3,FIOE7 --- ERROR IF OUT OF RANGE
  2479. AX4 18 X4 = ABS. ADDR. OF STORAGE
  2480. IX6 X4+X1 X6 = ABS. STARTING ADDRESS
  2481. LX6 36 SHIFT TO TOP
  2482. SA1 FRSTBLK X1 = NO. OF FIRST BLOCK
  2483. BX6 X1+X6 MERGE ADDR. AND STARTING BLOCK
  2484. SA6 MASRQ+7 STORE IN REQUEST
  2485. * /--- BLOCK REQUEST 00 000 79/11/12 23.45
  2486. *
  2487. * * COLLECT STATISTICS INFO
  2488. *
  2489. SA2 NUMBLKS X2 = NO. OF BLOCKS
  2490. SB4 0 SET USER TYPE TO SYSTEM
  2491. SB2 SDEATTS B2 = ADDR. OF STATISTICS CELLS
  2492. SA1 IOTYPE X1 = I/O TYPE
  2493. CALL DSKST UPDATE STATS
  2494. *
  2495. * * UNLOAD COMMON/STORAGE AND SAVE LESSON POINTERS
  2496. *
  2497. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  2498. CALL SAVKEY SAVE *KEY*
  2499. *
  2500. * * MARK STORAGE AS NON-RELOCATABLE AND NON-DELETABLE
  2501. *
  2502. CALL IOLESSN,TBXSTOR,4000B
  2503. *
  2504. * * SET *SDINFO* SO PLATO IGNORES DISK ERRORS
  2505. *
  2506. MX6 -1
  2507. SA6 SDINFO
  2508. * /--- BLOCK REQUEST 00 000 79/11/12 23.47
  2509. *
  2510. * * POST REQUEST TO MASTOR
  2511. *
  2512. CALL S=MAS,MASRQ,STATION
  2513. *
  2514. * * INCREMENT NUMBER OF DISK REQUESTS POSTED
  2515. *
  2516. SA1 POSTED
  2517. SX6 X1+1
  2518. SA6 A1
  2519. *
  2520. * * WAIT FOR REQUEST TO BE COMPLETED
  2521. *
  2522. FIOX1 TUTIM -1,,IOKEY
  2523. SA1 KEY
  2524. SX1 X1-IOKEY
  2525. NZ X1,FIOX1 --- IF NOT = *IOKEY*
  2526. *
  2527. * * DECREMENT NUMBER OF DISK REQUESTS POSTED
  2528. *
  2529. SA1 POSTED
  2530. SX6 X1-1
  2531. SA6 A1
  2532. *
  2533. * * FREE STORAGE FOR RELOCATION
  2534. *
  2535. SA1 TBXSTOR
  2536. SX1 X1
  2537. ZR X1,FIOX2 JUMP IF NO STORAGE
  2538. CALL IOLESSN,TBXSTOR,-4000B
  2539. *
  2540. * * RESTORE COMMON, LESSON, ETC.
  2541. *
  2542. FIOX2 CALL RESTLES
  2543. CALL RESTKEY
  2544. *
  2545. * * RETURN SYSTEM DISK STATUS IN *ERROR*
  2546. *
  2547. SA1 MASRQ+6
  2548. SX6 X1
  2549. SA6 TERROR RETURN TO USER IN *ERROR*
  2550. *
  2551. * * CHECK FOR ERROR TO RETURN IN *ZRETURN*
  2552. *
  2553. SA1 MASRQ+7
  2554. BX6 X1
  2555. SA6 TRETURN SET *ZRETURN*
  2556. PL X6,CKPROC --- PROCESS NEXT COMMAND
  2557. *
  2558. * * IF NO ERROR, RETURN PACK NAME, FIW POINTER,
  2559. * * AND FIW
  2560. *
  2561. SA1 FIPADDR X1 = ADDR. OF FIP
  2562.  
  2563. X NEWFIPV,(MASRQ+2),X1 CONVERT TO NEW FORMAT
  2564.  
  2565. EQ CKPROC --- PROCESS NEXT COMMAND
  2566. * /--- BLOCK ERRORS 00 000 80/12/02 02.00
  2567. *
  2568. * * BAD PACK NAME
  2569. *
  2570. FIOE3 SX6 3
  2571. EQ FIOERRX
  2572. *
  2573. * * BAD FILE NAME
  2574. *
  2575. FIOE4 SX6 4
  2576. EQ FIOERRX
  2577. *
  2578. * * BAD STARTING BLOCK
  2579. *
  2580. FIOE5 SX6 5
  2581. EQ FIOERRX
  2582. *
  2583. * * BAD NO. OF BLOCKS
  2584. *
  2585. FIOE6 SX6 6
  2586. EQ FIOERRX
  2587. *
  2588. * * TRANSFER LENGTH IS TOO LONG FOR STORAGE
  2589. *
  2590. FIOE7 SX6 7
  2591. EQ FIOERRX
  2592. *
  2593. * * BAD ECS ADDRESS
  2594. *
  2595. FIOE8 SX6 8
  2596. *
  2597. * * SET *ZRETURN* AND *ERROR*
  2598. *
  2599. FIOERRX SA6 TRETURN SET *ZRETURN*
  2600.  
  2601. SX6 -1
  2602. SA6 TERROR SET *ERROR* TO -1 (NO DISK ERR)
  2603.  
  2604. EQ PROCESS
  2605.  
  2606. FIPADDR EQU TBINTSV ADDR. OF FIP
  2607. FRSTBLK EQU TBINTSV+1 STARTING BLOCK NO.
  2608. NUMBLKS EQU TBINTSV+2 NO. OF BLOCKS
  2609. IOTYPE EQU TBINTSV+3 3 = READ, 4 = WRITE
  2610. ECSADDR EQU TBINTSV+4 STARTING STORAGE ADDRESS
  2611. TEMP EQU TBINTSV+5 SCRATCH VAR
  2612.  
  2613. ENDOV
  2614. * /--- BLOCK FILENAM 00 000 80/12/02 02.00
  2615. TITLE -FILENAM- COMMAND
  2616. *
  2617. * -FILENAM- HAS TWO POSSIBLE FORMS --
  2618. *
  2619. * FILENAM ACCOUNT';FILE,ONEWORD (FORM 0)
  2620. * FILENAM ONEWORD,ACCOUNT';FILE (FORM 1)
  2621. *
  2622. * THE FIRST GETVAR CODE IS SET UP AS A FAKE ARGUMENT
  2623. * TO INDICATE WHICH FORM IS USED.
  2624. *
  2625. * NOTE -- AFTER THE ACCOUNT NAME/NUMBER CONVERSION
  2626. * IS AVAILABLE SOME ERROR CHECKING SHOULD BE ADDED
  2627. * TO ZERO THE RESULT IN CASE OF AN INCONVERTIBLE
  2628. * FILE NAME.
  2629. *
  2630. *
  2631. FILNAMV OVRLAY
  2632.  
  2633. SX6 4
  2634. CALL GETCODX UNPACK 4 GETVAR CODES TO VARBUF
  2635. SA1 VARBUF GET FIRST GETVAR CODE
  2636. MX0 XCODEL
  2637. BX1 X0*X1 CLEAR OFF OTHER JUNK
  2638. NZ X1,FN100 IF ONE-WD TO TWO-WD CONVERSION
  2639. *
  2640. *
  2641. * TWO-WORD TO ONE-WORD CONVERSION
  2642. *
  2643. *
  2644. SA1 VARBUF+1 GET ACCOUNT ARGUMENT
  2645. BX5 X1
  2646. NGETVAR
  2647. CALL LJUST,(1R ),0
  2648. BX6 X1
  2649. SA6 FNBUF SAVE ACCOUNT WORD
  2650.  
  2651. SA1 VARBUF+2 GET FILE NAME ARGUMENT
  2652. BX5 X1
  2653. NGETVAR
  2654. CALL LJUST,(1R ),0
  2655.  
  2656. SA2 FNBUF RETRIEVE ACCOUNT NAME
  2657. SA3 KOLD
  2658. IX3 X2-X3
  2659. ZR X3,FN50 IF ALREADY A ONE-WORD NAME
  2660.  
  2661. BX6 X1
  2662. SA6 FNBUF+1 SAVE FILE WORD
  2663. CALL ACCFILC,FNBUF CONVERT ACCOUNT KEYWORDS
  2664. CALL FSQUISH,FNBUF COMPRESS FILE NAME
  2665.  
  2666. FN50 BX6 X1 (X6) = ONE-WORD NAME
  2667. SA1 VARBUF+3 GET RETURN VARIABLE
  2668. BX5 X1
  2669. NPUTVAR
  2670. EQ PROCESS
  2671. *
  2672. *
  2673. * ONE-WORD TO TWO-WORD CONVERSION
  2674. *
  2675. *
  2676. FN100 BSS 0
  2677.  
  2678. SA1 VARBUF+1 GET ONE-WORD FILENAME ARGUMENT
  2679. BX5 X1
  2680. NGETVAR
  2681. BX6 X1 (X6) = ONE-WORD NAME
  2682. SA6 FNBUF+1
  2683. SA1 KOLD SPECIAL FOR OLD-STYLE FILES
  2684. PL X6,FN150 IF NAME NOT COMPRESSED
  2685.  
  2686. CALL FEXPAND,FNBUF PERFORM CONVERSION
  2687. SA1 FNBUF (X1) = ACCOUNT NAME
  2688.  
  2689. FN150 SA2 VARBUF+2 GET FIRST RETURN VARIABLE
  2690. BX6 X1 (X6) = ACCOUNT NAME
  2691. BX5 X2 (X5) = GETVAR CODE
  2692. NPUTVAR
  2693.  
  2694. SA1 FNBUF+1 GET FILE NAME
  2695. * /--- BLOCK FILENAM 00 000 80/12/02 01.59
  2696. SA2 VARBUF+3 GET SECOND RETURN VARIABLE
  2697. BX6 X1 (X6) = FILE NAME
  2698. BX5 X2 (X5) = GETVAR CODE
  2699. NPUTVAR
  2700.  
  2701. EQ PROCESS
  2702.  
  2703. KOLD DATA 0L'OLD SPECIAL ACCOUNT KEYWORD
  2704. FNBUF OVDATA 2 TEMPORARY BUFFER FOR FILE NAME
  2705.  
  2706. ENDOV
  2707. TITLE -NVERS- COMMAND
  2708. *
  2709. * -NVERS- COMMAND
  2710. *
  2711. * NVERS ACCOUNT';FILE,ACCOUNT';FILE
  2712. *
  2713. * CONVERTS SPECIFIED FILE NAME TO ITS N-VERSION FORM.
  2714. *
  2715. NVERSV OVRLAY
  2716.  
  2717. SX6 4 UNPACK 4 ARGUMENTS
  2718. CALL GETCODX UNPACK ARGUMENTS TO VARBUF
  2719. CALL ACCFILE,VARBUF,VARBUF,0
  2720.  
  2721. CALL NVERSC,VARBUF,NVNAM
  2722.  
  2723. SA1 VARBUF+2 GET RETURN ACCOUNT ARGUMENT
  2724. MX0 XCODEL
  2725. BX5 X0*X1
  2726. ZR X5,NVONE IF NO ACCOUNT ARG
  2727. SA1 NVNAM
  2728. CALL ACNOUT MAKE ACCOUNT NAME DISPLAYABLE
  2729. BX6 X1 (X6) = N-VERSION ACCOUNT
  2730. NPUTVAR
  2731.  
  2732. SA1 NVNAM+1 (X1) = N-VERSION FILE NAME
  2733.  
  2734. NVFRET SA2 VARBUF+3 GET RETURN FILE ARGUMENT
  2735. BX5 X2
  2736. BX6 X1 (X6) = N-VERSION FILE NAME
  2737. NPUTVAR
  2738. EQ PROCESS
  2739.  
  2740. * IF NO RETURN ACCOUNT ARGUMENT SPECIFIED,
  2741. * SQUISH FILE NAME INTO ONE WORD.
  2742.  
  2743. NVONE CALL FSQUISH,NVNAM (X1) = ONE-WORD NAME
  2744. EQ NVFRET
  2745.  
  2746. NVNAM OVDATA 2 TEMPORARY FOR N-VERSION NAME
  2747.  
  2748. ENDOV
  2749.  
  2750. * /--- BLOCK SYSFILE 00 000 80/12/02 02.00
  2751. TITLE -SYSFILE- EXECUTION OVERLAY
  2752. *
  2753. * -SYSFILE-
  2754. *
  2755. * COMMAND FOR SYSTEM FILE OPERATIONS (ATTACH, READ,
  2756. * WRITE, CREATE, ETC.)
  2757. *
  2758. * SOME POSSIBLE FORMS ARE --
  2759. *
  2760. * SYSFILE FIP;ATTACH; $$ ATTACH FILE
  2761. * PACK,N1;FILE,N2;MODE,N3
  2762. *
  2763. * SYSFILE FIP;CHECK; $$ CHECK EXISTENCE
  2764. * PACK,N1;FILE,N2
  2765. *
  2766. * SYSFILE FIP;DETACH; $$ DETACH FILE
  2767. * PACK,N1;FILE,N2;STATION
  2768. *
  2769. * SYSFILE FIP;READ,0,1 $$ READ BLOCK 0
  2770. *
  2771. * SYSFILE FIP;WRITE,0,1 $$ WRITE BLOCK 0
  2772. *
  2773. * SYSFILE FIP;CREATE; $$ CREATE FILE
  2774. * PACK,N1;FILE,N2;TYPE,',A',;LENGTH,5
  2775. *
  2776. * SYSFILE FIP;DESTROY; $$ DESTROY FILE
  2777. * PACK,N1;FILE,N2
  2778. *
  2779. * SYSFILE FIP;RENAME; $$ CHANGE FILE NAME
  2780. * PACK,N1;FILE,N2;NEW NAME,N3
  2781. *
  2782. * SYSFILE FIP;RETYPE; $$ CHANGE FILE TYPE
  2783. * PACK,N1;FILE,N2;TYPE,',E',
  2784. *
  2785. * SYSFILE FIP;FBIT;ON $$ SET BACKUP BIT
  2786. * SYSFILE FIP;FBIT;OFF $$ CLEAR BACKUP BIT
  2787. *
  2788. * SYSFILE FIP;RECREATE $$ RE-CREATE FILE
  2789. * FILE,N1';N2;TYPE,N3;LENGTH,N4
  2790. *
  2791. * FIPS (FILE INFO PACKETS) ARE IDENTICAL TO THOSE
  2792. * USED FOR -ATTACHF-, ETC.
  2793. *
  2794. * AFTER EXECUTION OF A -SYSFILE- COMMAND, *ZRETURN*
  2795. * IS SET AS FOLLOWS --
  2796. *
  2797. * -2 = REDUNDANT ATTACH / UNNECESSARY DETACH
  2798. * -1 = FILE OPERATION SUCCESSFUL
  2799. * 0 = FILE DOES NOT EXIST
  2800. * 1 = FILE NOT ATTACHED TO THIS STATION AND/OR
  2801. * FILE ATTACHED TO OTHER STATION
  2802. * 2 = BAD MASTOR REQUEST
  2803. * 3 = BAD PACK NAME / PACK NOT LOADED
  2804. * 4 = BAD FILE NAME
  2805. * 5 = STARTING BLOCK NUMBER IS BAD
  2806. * 6 = NUMBER OF BLOCKS TO READ OR WRITE IS BAD
  2807. * 7 = TRANSFER LENGTH IS TOO LONG FOR STORAGE
  2808. * 8 = BAD EXTENDED MEMORY ADDRESS
  2809. * 9 = ATTEMPT TO TRANSFER PAST END OF FILE
  2810. * 10 = SYSTEM DISK ERROR
  2811. * 11 = DUPLICATE FILE NAME
  2812. * 12 = BAD FILE TYPE
  2813. * 13 = BAD FILE DIRECTORY PARAMETERS
  2814. * 14 = BAD FILE LENGTH
  2815. * 15 = NO ROOM FOR MORE FILES
  2816. * 16 = NOT ENOUGH DISK SPACE
  2817. * 17 = ILLEGAL I/O CODE
  2818. * 18 = ILLEGAL MS.FILE FUNCTION
  2819. * 19 = MORE THAN ONE FILE MEETS SPECS
  2820. * 20 = NON-EXISTANT DIRECTORY
  2821. * 21 = AFT POINTER INVALID
  2822. * 22 = ACCOUNT ATTACHED
  2823. * 23 = NO SUCH ACCOUNT FILE
  2824. * 24 = ACCOUNT FILE IS TURNED OFF
  2825. * 25 = ILLEGAL ATTACH CODE PROVIDED
  2826. * 26 = ILLEGAL ATTACH SIGNATURE GIVEN
  2827. * /--- BLOCK SYSFILE 00 000 80/12/02 02.00
  2828. * 27 = INSUFFICIENT SPACE IN ACCOUNT
  2829. * 28 = INSUFFICIENT SPACE IN SUB-ACCOUNT
  2830. * 29 = NO SUCH SUB-ACCOUNT
  2831. * 30 = ACCOUNT FILE IS FULL
  2832. * 31 = DIRECTORY FILE IS FULL
  2833. * 32 = CHECKSUM ERROR
  2834. * 33 = BLOCK NAME IN ERROR
  2835. * 34 = NOT ENOUGH ROOM FOR HEADER
  2836. * 35 = HEADER PARAMETERS IN ERROR
  2837. * 36 = FILE VERSION MISMATCH
  2838. * 37 = ILLEGAL NAME ORDERING
  2839. * 38 = DUPLICATE ACCOUNT NUMBERS
  2840. * 39 = ACCOUNT NUMBER TOO LARGE
  2841. * 40 = PACK OR ACCOUNT NOT LOADED
  2842. * 41 = A SYSTEM ERROR OCCURRED
  2843. * 42 = COULD NOT ATTACH THE FILE
  2844. *
  2845. * THE SYSTEM RESERVED WORD *ERROR* IS ALSO SET
  2846. * OCCASIONALLY --
  2847. *
  2848. * IF AN ATTACH OPTION FAILS BECAUSE A FILE IS
  2849. * ATTACHED ELSEWHERE, *ERROR* CONTAINS THE NUMBER
  2850. * OF THE STATION WHICH HAS THE FILE ATTACHED.
  2851. *
  2852. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  2853. * AFTER THE DETACH OPTION IS USED, *ERROR*
  2854. * CONTAINS THE NUMBER OF THE STATION WHICH HAD
  2855. * THE FILE ATTACHED. THIS WORKS ONLY FOR THE OLD
  2856. * DISK SYSTEM.
  2857. *
  2858. * THE READ AND WRITE OPTIONS LEAVE THE SYSTEM
  2859. * DISK ERROR STATUS (-1 IF NO ERROR) IN *ERROR*.
  2860. *
  2861. * THE CREATE, DESTROY, RENAME AND RETYPE OPTIONS
  2862. * MAY SET *ERROR* IF THE FILE IS CREATED OR FOUND
  2863. * ON THE OLD DISK SYSTEM (DO NOT RELY ON THIS).
  2864. *
  2865.  
  2866. SYSFILV OVRLAY
  2867.  
  2868. * SYSFDBG EQU 0 DEBUG CODE ENABLED IF DEFINED
  2869.  
  2870. * CHECK FOR IMPENDING MASTOR REQUEST BUFFER
  2871. * OVERFLOW.
  2872.  
  2873. CALLX REQCHK CHECK FOR MASTER REQ OVERFLOW
  2874. CALL RESTKEY RESTORE *KEY*
  2875.  
  2876. * INITIALIZE SOME CELLS SO GARBAGE VALUES WILL
  2877. * NOT BE USED IF THE CORRESPONDING TAGS ARE NOT
  2878. * SPECIFIED.
  2879.  
  2880. SX6 0
  2881. SA6 MSGADDR ADDRESS OF ERROR MESSAGE BUFFER
  2882. SA6 SMCODE STATION/MASTER DETACH FLAG
  2883. SA6 NFILE NEW FILE NAME
  2884. SA6 NACCT NEW ACCOUNT NAME
  2885. SA6 F.TYP FILE TYPE
  2886. SA6 F.LTH FILE LENGTH
  2887. SA6 F.DIR SIZE OF DIRECTORY (IN SECTORS)
  2888. SA6 F.RMT SIZE/16 OF RMT (WORDS)
  2889. SA6 NPDWRIT PACK DIRECTORY CHECKPOINT FLAG
  2890. SA6 OLDPACK CLEAR *OLDPACK* FLAG
  2891. SA6 PACK CLEAR PACK NAME
  2892. SA6 DIRECT CLEAR DIRECTORY NAME
  2893. SA6 NEWFBIT NEW BACKUP BIT VALUE
  2894. SA6 ACCTRES ACCOUNT OF RESIDENCE
  2895. SA6 SUBACCT SUB-ACCOUNT
  2896. SA6 ATTRIBS ATTRIBUTE BITS
  2897.  
  2898. * UNPACK COMMAND ARGUMENTS TO *VARBUF*.
  2899.  
  2900. SX6 63 (X6) = MAX. NUMBER OF ARGUMENTS
  2901. SA5 A5+0 RETRIEVE COMMAND WORD
  2902. CALL GETARGS MOVE GETVAR CODES TO *VARBUF*
  2903. SA6 NUMARGS STORE NUMBER OF ARGUMENTS
  2904.  
  2905. * PROCESS FIP (FILE INFO PACKET) ARGUMENT.
  2906.  
  2907. SA1 VARBUF (X1) = FIRST GETVAR CODE
  2908. BX5 X1
  2909. NGETVAR (A1) = ADDRESS OF FIP
  2910. SX6 A1
  2911. SA6 FIPSAVE SAVE IT
  2912. MX1 0 MARK NOT IN -CALC- FOR *FIPCHK*
  2913. CALL FIPCHK CHECK BOUNDS ON FIP
  2914.  
  2915. * GET PRIMARY COMMAND OPTION.
  2916.  
  2917. SA1 VARBUF+1 (X1) = OPTION (ATTACH, ETC.)
  2918. LX1 XCODEL RIGHT-JUSTIFY GETVAR CODE
  2919. SX6 X1
  2920. SA6 TYPSAVE SAVE PRIMARY OPTION NUMBER
  2921.  
  2922. * PRESET FILE NAME FOR OLD-DISK-SYSTEM
  2923. * DESTROY/RENAME/RETYPE/FBIT FUNCTIONS.
  2924.  
  2925. SA1 FIPSAVE (A1) = ADDRESS OF FIP
  2926. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  2927. SA1 X1+/FIP/FILE (A1) = FILE NAME
  2928. BX6 X1
  2929. SA6 FILE PRESET FILE NAME
  2930.  
  2931. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  2932. SA1 TBLESAC
  2933. SA2 TBLESSN
  2934. SA3 TUNAME
  2935. SA4 TUNAMEC
  2936. MX6 42
  2937. BX6 X6*X1
  2938. BX7 X2
  2939. SA6 DEBUGM1B+1
  2940. SA7 DEBUGM1C+1
  2941. MX1 48
  2942. BX6 X1*X3
  2943. LX4 12
  2944. BX7 X1*X4
  2945. SA6 DEBUGM1D+1
  2946. SA7 DEBUGM1E+1
  2947. SA1 TYPSAVE (X1) = PRIMARY OPTION
  2948. SB6 A5 SAVE A5
  2949. CALL S=OTOA
  2950. SA5 B6 RESTORE A5
  2951. SA7 DEBUGM1F+2 STORE OCTAL IN MESSAGE
  2952. CALL S=MSG,DEBUGM1A
  2953. CALL S=MSG,DEBUGM1B
  2954. CALL S=MSG,DEBUGM1C
  2955. CALL S=MSG,DEBUGM1D
  2956. CALL S=MSG,DEBUGM1E
  2957. CALL S=MSG,DEBUGM1F
  2958. CALL S=MSG,FIPMSG
  2959. SA1 FIPSAVE
  2960. CALL OCTDUMP,X1,FIPLTH
  2961. EQ DEBUG1
  2962. DEBUGM1A DIS ,/***********************************/
  2963. DEBUGM1B DIS ,* ACCT - XXXXXXXXXX*
  2964. DEBUGM1C DIS ,* LESSON - XXXXXXXXXX*
  2965. DEBUGM1D DIS ,* M UNIT - XXXXXXXXXX*
  2966. DEBUGM1E DIS ,* C UNIT - XXXXXXXXXX*
  2967. DEBUGM1F DATA 20HSYSFILE OPTION
  2968. DATA 0,0
  2969. DEBUG1 BSS 0
  2970. .1 ENDIF
  2971.  
  2972.  
  2973. * PRESET PACK AND DIRECTORY NAMES.
  2974.  
  2975. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  2976. SA2 X1+/FIP/MFF (X2) = MISC. FIP FIELDS
  2977. LX2 59-/MFF/S.OLD SEE IF OLD-DISK-SYSTEM FIP
  2978. SA3 X1+/FIP/DIR
  2979. BX6 X3 (X6) = PACK/DIRECTORY NAME
  2980. NG X2,SYSFIL1 IF OLD-DISK-SYSTEM FIP
  2981. SA6 DIRECT NEW-DISK-SYSTEM DIRECTORY NAME
  2982. EQ SYSFIL2
  2983.  
  2984. SYSFIL1 SA6 PACK OLD-DISK-SYSTEM PACK NAME
  2985.  
  2986. * IF ATTACH OPTION AND NO ATTACH MODE IS LEFT OVER
  2987. * IN THE FIP, SET IT TO R/O AS DEFAULT.
  2988.  
  2989. SYSFIL2 SA1 TYPSAVE (X1) = PRIMARY OPTION
  2990. SX1 X1-F.ATTACH
  2991. NZ X1,SYSFIL3 IF NOT ATTACH
  2992. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  2993. SA1 X1+/FIP/MFF
  2994. MX2 -/MFF/M.ATTACH (X2) = MASK FOR ATTACH MODE
  2995. LX2 /MFF/S.ATTACH POSITION MASK
  2996. BX2 -X2*X1 (X2) = ATTACH MODE IN FIP
  2997. NZ X2,SYSFIL3 IF ALREADY SET
  2998. SX6 MA.RO DEFAULT TO READ/ONLY
  2999. LX6 /MFF/S.ATTACH
  3000. BX6 X1+X6
  3001. SA6 A1 STORE IN FIP
  3002.  
  3003. * CHECK FOR READ AND WRITE SECONDARY OPTIONS, WHICH
  3004. * DO NOT USE NORMAL SECONDARY KEYWORD PROCESSING.
  3005.  
  3006. SYSFIL3 SA1 TYPSAVE (X1) = PRIMARY OPTION
  3007. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3008. SX2 X1-F.READ
  3009. ZR X2,SPECIAL IF READ OPTION
  3010. SX2 X1-F.WRITE
  3011. ZR X2,SPECIAL IF WRITE OPTION
  3012. EJECT
  3013.  
  3014. * PROCESS SECONDARY KEYWORDS
  3015.  
  3016.  
  3017. SX6 2
  3018. SA6 ARGSDONE TWO ARGUMENTS ARE PROCESSED
  3019.  
  3020. TAGLOOP SA1 ARGSDONE (X1) = NO. ARGUMENTS PROCESSED
  3021. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3022. SA2 NUMARGS (X2) = TOTAL ARGUMENTS
  3023. IX2 X1-X2
  3024. ZR X2,TAGSDONE --- IF ALL TAGS PROCESSED
  3025.  
  3026. SX6 X1+2 INCREMENT COUNT OF ARGS DONE
  3027. SA6 A1+0 STORE UPDATED COUNT
  3028. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3029. SA1 VARBUF+X1 (X1) = NEXT GETVAR CODE
  3030. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3031. LX1 XCODEL SHIFT CODE TO BITS 0-19
  3032. SB1 X1 (B1) = TAG NUMBER
  3033. SA1 A1+1 (X1) = NEXT GETVAR CODE
  3034. BX5 X1
  3035. JP TAGTAB+B1 PROCESS THIS TAG
  3036.  
  3037. * JUMP TABLE FOR KEYWORD ARGUMENTS.
  3038.  
  3039. TAGTAB BSS 0
  3040.  
  3041. + EQ FILENAM 0 = FILE NAME
  3042.  
  3043. + EQ PACKNAM 1 = PACK NAME
  3044.  
  3045. + EQ DIRNAM 2 = DIRECTORY NAME
  3046.  
  3047. + EQ ACCMODE 3 = ACCESS MODE
  3048.  
  3049. + MX6 0 4 = STATION DETACH
  3050. EQ STAMAST
  3051.  
  3052. + SX6 1 5 = MASTER DETACH
  3053. EQ STAMAST
  3054.  
  3055. + EQ FILETYP 6 = FILE TYPE
  3056.  
  3057. + EQ FILELTH 7 = FILE LENGTH
  3058.  
  3059. + MX6 -1 8 = PACK DIR. WRITE FLAG
  3060. EQ PDWFLAG
  3061.  
  3062. + EQ NEWFNAM 9 = NEW FILE NAME
  3063.  
  3064. + EQ DIRSIZE 10 = FILE DIR. SIZE
  3065.  
  3066. + EQ RMTSIZE 11 = FILE RMT SIZE
  3067.  
  3068. + SX6 1 12 = SET BACKUP BIT
  3069. EQ SETFBIT
  3070.  
  3071. + MX6 0 13 = CLEAR BACKUP BIT
  3072. EQ SETFBIT
  3073.  
  3074. + EQ OLDPN 14 = OLD SYSTEM PACK NAME
  3075.  
  3076. + EQ MESSAG 15 = DISPLAYABLE ERROR MESSAGE
  3077.  
  3078. + EQ NOATTACH 16 = OK TO READ W/O ATTACH
  3079.  
  3080. + EQ ACCRES 17 = ACCOUNT OF RESIDENCE
  3081.  
  3082. + EQ SUBACC 18 = SUB-ACCOUNT
  3083.  
  3084. + EQ ORIGNAL 19 = ORIGINAL FILE FLAG
  3085.  
  3086. * GET FILE NAME (KEYWORD NO. 0).
  3087.  
  3088. FILENAM X GETFILV,ARGSDONE,ACCT,FILE
  3089. EQ TAGLOOP --- PROCESS NEXT TAG
  3090.  
  3091. * GET PACK NAME (KEYWORD NO. 1).
  3092.  
  3093. PACKNAM NGETVAR (X1) = PACK NAME
  3094. BX6 X1
  3095. MX7 0
  3096. SA6 PACK STORE PACK NAME
  3097. SA7 OLDPACK CLEAR *OLDPACK* FLAG
  3098. .1 IF DEF,SYSFDBG
  3099. * SX7 -1
  3100. * SA7 OLDPACK ALL OLD PACKS FOR NOW
  3101. .1 ENDIF
  3102. EQ TAGLOOP --- PROCESS NEXT TAG
  3103.  
  3104. * GET DIRECTORY NAME (KEYWORD NO. 2).
  3105.  
  3106. DIRNAM NGETVAR (X1) = DIRECTORY NAME
  3107. BX6 X1
  3108. SA6 DIRECT STORE DIRECTORY NAME
  3109. EQ TAGLOOP --- PROCESS NEXT TAG
  3110.  
  3111. * GET ACCESS MODE (KEYWORD NO. 3).
  3112.  
  3113. ACCMODE NGETVAR (X1) = -1 FOR R/W, 0 FOR R/O
  3114. SX6 MA.READ PRESET FOR R/O ACCESS
  3115. PL X1,ACCMOD1 --- IF R/O ACCESS
  3116. SX6 MA.RW SET FOR R/W ACCESS
  3117. ACCMOD1 BSS 0
  3118. SA1 FIPSAVE (X1) = ADDR. OF FIP
  3119. SA1 X1+/FIP/MFF (X1) = MISC. FIP FIELDS
  3120. MX0 -/MFF/M.ATTACH (X0) = MASK FOR ATTACH MODE
  3121. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3122. LX0 /MFF/S.ATTACH SHIFT MASK TO POSITION
  3123. BX1 X0*X1 CLEAR OLD ATTACH MODE
  3124. LX6 /MFF/S.ATTACH POSITION NEW ATTACH MODE
  3125. BX6 X1+X6
  3126. SA6 A1 STORE IN FIP
  3127. EQ TAGLOOP --- PROCESS NEXT TAG
  3128.  
  3129. * SET STATION/MASTER FLAG (KEYWORDS 4-5).
  3130.  
  3131. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3132. STAMAST SA6 SMCODE STORE FLAG (0=STATION,1=MASTER)
  3133. SA1 ARGSDONE BACK UP RUNNING GETVAR COUNTER
  3134. SX6 X1-1
  3135. SA6 A1+0
  3136. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3137. EQ TAGLOOP --- PROCESS NEXT TAG
  3138.  
  3139. * GET FILE TYPE (KEYWORD 6).
  3140.  
  3141. FILETYP NGETVAR (X1) = FILE TYPE CODE
  3142. MX0 -6
  3143. BX2 X0*X1 TOP 54 BITS MUST BE ZERO
  3144. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3145. NZ X2,SYSFE12 --- ERROR IF GARBAGE PRESENT
  3146. SX6 X1+0 (X6) = FILE TYPE
  3147. SA6 F.TYP
  3148. EQ TAGLOOP --- PROCESS NEXT TAG
  3149.  
  3150. * GET FILE LENGTH (KEYWORD 7).
  3151.  
  3152. FILELTH NGETVAR (X1) = FILE TYPE WORD
  3153. MX0 -6
  3154. BX2 X0*X1 TOP 54 BITS MUST BE ZERO
  3155. NZ X2,SYSFE14 --- ERROR IF GARBAGE PRESENT
  3156. SX6 X1+0 (X6) = FILE LENGTH
  3157. SA6 F.LTH
  3158. EQ TAGLOOP --- PROCESS NEXT TAG
  3159.  
  3160. * INHIBIT RETURN OF PACK DIRECTORY (KEYWORD 8).
  3161.  
  3162. PDWFLAG SA6 NPDWRIT
  3163. SA1 ARGSDONE BACK UP RUNNING GETVAR COUNTER
  3164. SX6 X1-1
  3165. SA6 A1+0
  3166. EQ TAGLOOP
  3167.  
  3168.  
  3169. * GET NEW FILE NAME (KEYWORD NO. 9)
  3170.  
  3171. NEWFNAM X GETFILV,ARGSDONE,NACCT,NFILE
  3172. EQ TAGLOOP --- PROCESS NEXT TAG
  3173.  
  3174. * GET DIRECTORY SIZE (KEYWORD 10).
  3175.  
  3176. DIRSIZE NGETVAR (X1) = DIRECTORY SIZE (SECTORS)
  3177. MX0 -6
  3178. BX2 X0*X1 TOP 54 BITS MUST BE ZERO
  3179. NZ X2,SYSFE13 --- ERROR IF GARBAGE PRESENT
  3180. SX6 X1+0 (X6) = DIRECTORY SIZE
  3181. SA6 F.DIR
  3182. EQ TAGLOOP --- PROCESS NEXT TAG
  3183.  
  3184. * GET RECORD MANAGEMENT TABLE SIZE (KEYWORD 11).
  3185.  
  3186. RMTSIZE NGETVAR (X1) = RMT SIZE / 16 WORDS
  3187. MX0 -6
  3188. BX2 X0*X1 TOP 54 BITS MUST BE ZERO
  3189. NZ X2,SYSFE13 --- ERROR IF GARBAGE PRESENT
  3190. SX6 X1+0 (X6) = RMT SIZE
  3191. SA6 F.RMT
  3192. EQ TAGLOOP --- PROCESS NEXT TAG
  3193.  
  3194. * SET/CLEAR BACKUP BIT (KEYWORDS 12-13).
  3195.  
  3196. SETFBIT SA6 NEWFBIT
  3197. SA1 ARGSDONE BACK UP RUNNING GETVAR COUNTER
  3198. SX6 X1-1
  3199. SA6 A1+0
  3200. EQ TAGLOOP
  3201.  
  3202. * GET PACK NAME THAT WILL BE USED ONLY IF A
  3203. * FILE IS BEING CREATED ON THE OLD DISK
  3204. * SYSTEM (KEYWORD 14).
  3205.  
  3206. OLDPN NGETVAR (X1) = OLD SYSTEM PACK NAME
  3207. BX6 X1
  3208. MX7 -1
  3209. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  3210. SA6 X1+/FIP/DIR
  3211. SA7 OLDPACK SET *OLDPACK* FLAG
  3212. EQ TAGLOOP --- PROCESS NEXT TAG
  3213.  
  3214. * PROCESS ADDRESS OF BUFFER TO RECEIVE DISPLAYABLE
  3215. * MESSAGE IN CASE OF ERROR.
  3216.  
  3217. MESSAG NGETVAR (A1) = ADDRESS OF BUFFER
  3218. SX6 A1
  3219. SA6 MSGADDR SAVE THE ADDRESS
  3220. SA0 X6 (A0) = ADDRESS OF BUFFER
  3221. SX1 5 (X1) = LENGTH OF BUFFER
  3222. CALL BOUNDS CHECK BOUNDS ON BUFFER
  3223. EQ TAGLOOP PROCESS NEXT TAG
  3224.  
  3225. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3226. * FLAG THAT IT IS OK TO READ A FILE WITHOUT
  3227. * FIRST ATTACHING IT.
  3228.  
  3229. NOATTACH SA1 FIPSAVE (X1) = ADDRESS OF FIP
  3230. SA1 X1+/FIP/MFF (X1) = MISC. FIP FIELDS
  3231. MX6 1
  3232. LX6 1+/MFF/S.NOATT
  3233. BX6 X1+X6 SET NO ATTACH BIT IN FIP
  3234. SA6 A1
  3235. SA1 ARGSDONE BACK UP RUNNING GETVAR COUNTER
  3236. SX6 X1-1
  3237. SA6 A1
  3238. EQ TAGLOOP
  3239.  
  3240. * PROCESS *ACCOUNT OF RESIDENCE* (KEYWORD 17)
  3241.  
  3242. ACCRES NGETVAR
  3243. SA0 ACCTRES
  3244. EQ ALFINT -- PROCESS ALPHA OR INTEGER
  3245.  
  3246. * PROCESS *SUB-ACCOUNT* (KEYWORD 18)
  3247.  
  3248. SUBACC NGETVAR
  3249. SA0 SUBACCT
  3250. EQ ALFINT -- PROCESS ALPHA OR INTEGER
  3251.  
  3252. * PROCESS ALPHA OR INTEGER IDENTIFIER FOR *ACCOUNT
  3253. * OF RESIDENCE* OR *SUB-ACCOUNT* KEYWORDS. NOTE
  3254. * THAT THE RESULT ALWAYS OCCUPIES THE UPPER 42 BITS
  3255. * OF THE CELL DESIGNATED BY *A0* ON ENTRY. (SO THE
  3256. * INTEGER FIELD IS SHIFTED BEFORE STORING). *X1*
  3257. * CONTAINS THE USER'7S INPUT ON ENTRY.
  3258.  
  3259. ALFINT MX0 42 MASK TO SPLIT ALPHA/INTEGERS
  3260. BX6 X0*X1 X6 = ALPHA FIELD
  3261. NZ X6,ALFINT1 -- ALPHA FIELD DESIGNATED
  3262. BX6 -X0*X1 X6 = INTEGER FIELD
  3263. LX6 18 (SHIFT INTEGER FIELD)
  3264. ALFINT1 SA6 A0 STORE IN SPECIFIED CELL
  3265. EQ TAGLOOP -- EXIT TO NEXT KEYWORD
  3266.  
  3267. * PROCESS ORIGINAL FILE FLAG (KEYWORD 19)
  3268.  
  3269. ORIGNAL NGETVAR (X1) = FLAG STATUS (0/NON-0)
  3270. SA2 ATTRIBS GET ATTRIBUTE FLAGS WORD
  3271. SX6 200000B ORIGINAL FILE FLAG BIT (LX 59)
  3272. ZR X1,ORIGN0 -- BRANCH IF TURNING IT OFF
  3273. BX6 X2+X6 ELSE UNION ORIGINAL FLAG IN
  3274. SA6 A2 STORE NEW ATTRIBUTES FLAG
  3275. EQ TAGLOOP -- PROCESS NEXT TAG
  3276. ORIGN0 BX6 -X6*X2 CLEAR ORIGINAL FILE FLAG
  3277. SA6 A2 STORE NEW ATTRIBUTES FLAG
  3278. EQ TAGLOOP -- PROCESS NEXT TAG
  3279.  
  3280. EJECT
  3281.  
  3282. * SPECIAL HANDLING FOR READ/WRITE OPTIONS -- TWO
  3283. * GETVAR CODES (STARTING BLOCK NUMBER AND STORAGE
  3284. * INDEX) ARE ALWAYS PRESENT. 'THE THIRD GETVAR
  3285. * CODE (NUMBER OF BLOCKS) MAY BE PRESENT OR MARKED
  3286. * AS OMITTED; IN THE LATTER CASE A VALUE OF ONE (1)
  3287. * IS ASSUMED.
  3288. *
  3289. * THE FOURTH GETVAR CODE IS OPTIONAL. IF PRESENT IT
  3290. * IS THE FIRST WORD OF A 5-WORD BUFFER TO RECEIVE
  3291. * DISPLAYABLE ERROR MESSAGES.
  3292.  
  3293. SPECIAL SA1 NUMARGS (X1) = NUMBER OF GETVAR CODES
  3294. SX1 X1-2-4 SEE IF 4TH CODE PRESENT
  3295. NZ X1,SPECIAL1 IF 4TH GETVAR CODE NOT PRESENT
  3296. SA1 VARBUF+5
  3297. BX5 X1
  3298. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3299. NGETVAR (A1) = ADDRESS OF MSG BUFFER
  3300. SX6 A1
  3301. SA6 MSGADDR
  3302. SA0 X6 (A0) = ADDRESS OF BUFFER
  3303. SX1 5 (X1) = LENGTH OF BUFFER
  3304. CALL BOUNDS CHECK BOUNDS ON BUFFER
  3305. SPECIAL1 SA1 VARBUF+2 (X1) = 3RD GETVAR CODE
  3306. BX5 X1
  3307. NGETVAR (X1) = STARTING BLOCK NUMBER
  3308. SX6 X1
  3309. NG X6,SYSFE5 --- ERROR IF BAD NUMBER
  3310. NG X1,SYSFE5 --- ERROR IF NEG. BLOCK NUMBER
  3311. BX6 X1
  3312. SA6 START
  3313.  
  3314. SA1 VARBUF+3 (X1) = 4TH GETVAR CODE
  3315. BX5 X1
  3316. NGETVAR (X1) = STORAGE INDEX
  3317. SX6 1
  3318. IX6 X1-X6
  3319. NG X6,SYSFE8 --- ERROR IF &lt; 0
  3320. SA6 STORAGE
  3321.  
  3322. SX6 1 PRESET TO READ/WRITE ONE BLOCK
  3323. SA1 VARBUF+4 (X1) = 5TH GETVAR CODE
  3324. BX5 X1
  3325. LX1 1 SHIFT OMITTED ARG. BIT TO SIGN
  3326. NG X1,SPECIAL2 --- IF DEFAULT NUMBER OF BLOCKS
  3327. NGETVAR (X1) = NUMBER OF BLOCKS
  3328. SX6 X1
  3329. NG X6,SYSFE6 --- ERROR IF BAD NUMBER
  3330. NG X1,SYSFE6 --- ERROR IF NEGATIVE
  3331. ZR X1,SYSFE6 --- ERROR IF ZERO
  3332. BX6 X1
  3333. SPECIAL2 SA6 NUMBER
  3334.  
  3335. EJECT
  3336.  
  3337. * DETERMINE THE DISK SYSTEM ON WHICH THE OPERATION
  3338. * SHOULD TAKE PLACE.
  3339. *
  3340. * FOR OPTIONS WHICH REQUIRE THAT A FILE BE ATTACHED,
  3341. * WE CAN SIMPLY CHECK THE OLD DISK SYSTEM BIT IN THE
  3342. * FIP.
  3343.  
  3344. .MDS IFNE *F,0
  3345. TAGSDONE SA1 TYPSAVE (X1) = PRIMARY OPTION
  3346. SA1 ATTRTAB+X1 (X1) = OPTION ATTRIBUTES
  3347. LX1 R.AFIP
  3348. PL X1,TAGSD0 --- IF ATTACH NOT REQUIRED
  3349.  
  3350. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  3351. SA1 X1+/FIP/MFF (X1) = MISC. FIP FIELDS
  3352. LX1 59-/MFF/S.OLD
  3353. NG X1,OLDDSYS --- IF OLD DISK SYSTEM FILE
  3354. EQ NEWDSYS --- IF NEW DISK SYSTEM FILE
  3355.  
  3356. * SPECIAL RIGHT-JUSTIFIED DIRECTORY NAMES OF *OLD*
  3357. * AND *NEW* ARE USED TO FORCE FILE OPERATIONS TO THE
  3358. * OLD AND NEW DISK SYSTEMS, RESPECTIVELY. ANY OTHER
  3359. * NON-ZERO DIRECTORY NAMES WILL ALWAYS SELECT THE
  3360. * NEW DISK SYSTEM.
  3361.  
  3362. TAGSD0 SA1 DIRECT (X1) = DIRECTORY NAME
  3363. NZ X1,TAGSD1 IF DIRECTORY SPECIFIED
  3364. SA1 TYPSAVE (X1) = PRIMARY OPTION
  3365. SX1 X1-F.RECRE CHECK FOR RE-CREATE OPTION
  3366. NZ X1,TAGSD1 IF NOT RE-CREATE
  3367. SX6 3RNEW
  3368. SA6 DIRECT FORCE RE-CREATE TO NEW SYSTEM
  3369.  
  3370. TAGSD1 SA1 DIRECT (X1) = DIRECTORY NAME
  3371. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3372. ZR X1,TAGSD2 IF NO DIRECTORY SPECIFIED
  3373. SX2 3ROLD
  3374. BX2 X1-X2 TEST FOR 3ROLD
  3375. ZR X2,OLDDSYS IF FORCING OLD DISK SYSTEM
  3376. SX2 3RNEW
  3377. BX2 X1-X2 TEST FOR 3RNEW
  3378. NZ X2,NEWDSYS IF NOT DEFAULT DIRECTORY
  3379. SX6 0
  3380. SA6 DIRECT CHANGE 3RNEW TO DEFAULT DIR.
  3381. EQ NEWDSYS USE NEW DISK SYSTEM
  3382.  
  3383. * CHECK THE VALUE OF *DEFDS* (DEFAULT DISK SYSTEM).
  3384. * IF IT IS 0 OR 3, THE OLD OR NEW DISK SYSTEM,
  3385. * RESPECTIVELY, MUST BE CHOSEN.
  3386.  
  3387. TAGSD2 SX1 DEFDS (X1) = DEFAULT DISK SYSTEM
  3388. ZR X1,OLDDSYS --- IF OLD DISK SYSTEM ALWAYS
  3389. SX1 DEFDS-3
  3390. ZR X1,NEWDSYS --- IF NEW DISK SYSTEM ALWAYS
  3391.  
  3392. * IF *DEFDS* IS 1 OR 2, BOTH DISK SYSTEMS MUST BE
  3393. * SEARCHED.
  3394.  
  3395. SX1 DEFDS-2 CHECK FOR DEFDS .EQ. 2
  3396. ZR X1,TAGSD3 IF NEW DISK SYSTEM FIRST
  3397.  
  3398. RJ OLDSRCH SEARCH OLD DISK SYSTEM
  3399. SB1 -1 MARK OLD DISK SYSTEM SEARCHED
  3400. RJ SEARCHED CREATE/RENAME OPTION CHECKS
  3401. NG X6,OLDDSYS TO OLD DISK SYSTEM IF FOUND
  3402.  
  3403. TAGSD3 RJ NEWSRCH SEARCH NEW DISK SYSTEM
  3404. SB1 0 MARK NEW DISK SYSTEM SEARCHED
  3405. RJ SEARCHED CREATE/RENAME OPTION CHECKS
  3406. NG X6,NEWDSYS TO NEW DISK SYSTEM IF FOUND
  3407.  
  3408. SX1 DEFDS-1 CHECK FOR DEFAULT = OLD
  3409. ZR X1,TAGSD4 IF OLD ALREADY SEARCHED
  3410.  
  3411. RJ OLDSRCH SEARCH OLD DISK SYSTEM
  3412. SB1 -1 MARK OLD DISK SYSTEM SEARCHED
  3413. RJ SEARCHED CREATE/RENAME OPTION CHECKS
  3414. NG X6,OLDDSYS TO OLD DISK SYSTEM IF FOUND
  3415.  
  3416. TAGSD4 SA1 TYPSAVE CHECK PRIMARY OPTION
  3417. SX1 X1-F.CREATE CHECK FOR CREATE OPTION
  3418. NZ X1,SYSFE0 IF NOT CREATE AND NOT FOUND
  3419. SX1 DEFDS-1
  3420. ZR X1,OLDDSYS CREATE ON OLD DISK SYSTEM
  3421. EQ NEWDSYS CREATE ON NEW DISK SYSTEM (2)
  3422.  
  3423. NEWSRCH SPACE 4,15
  3424. ** NEWSRCH - SEARCH NEW DISK SYSTEM FOR FILE
  3425. *
  3426. * ENTRY (FILE) = FILE NAME.
  3427. * (PACK) = PACK NAME OR ZERO.
  3428. *
  3429. * EXIT (X6) = -1 IF FILE FOUND, 0 IF NOT.
  3430. *
  3431. * USES A - 1, 2, 6, 7.
  3432. * B - 1, 2, 3, 4.
  3433. * X - 1, 2, 6, 7.
  3434. *
  3435. * CALLS INITDRQ, OVRUP, REQCHK, RESTKEY, RESTLES,
  3436. * SAVLES, SYSFRST, SYSFSAV, S=MAS.
  3437. *
  3438. * MACROS CALL, TUTIM.
  3439.  
  3440. NEWSRCH EQ * MUST BE AN -EQ-, SEE *RJSAVE*
  3441.  
  3442. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3443. CALL S=MSG,DEBUGM2
  3444. EQ DEBUG2
  3445. DEBUGM2 DIS ,* SEARCHING NEW DISK SYSTEM.*
  3446. DEBUG2 BSS 0
  3447. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3448. .1 ENDIF
  3449.  
  3450. NEWSRCH0 RJ SYSFSAV SAVE OVDATAS OVER INTERRUPT
  3451. CALLX REQCHK CHECK FOR MASTOR REQ. OVERFLOW
  3452. RJ SYSFRST RESTORE OVDATAS
  3453.  
  3454. RJ =XINITDRQ INITIALIZE *MS.FILE* REQUEST
  3455. SX6 MF.ATT PRIMARY OPTION = ATTACH
  3456. SX7 MA.NONE ATTACH TYPE = NONE
  3457. LX7 36 POSITION ATTACH TYPE
  3458. BX6 X6+X7 MERGE
  3459. SA6 MASRQ+FP.FUNC
  3460. SA1 ACCT (X1) = ACCOUNT NAME
  3461. SA2 FILE (X2) = FILE NAME
  3462. BX6 X1
  3463. BX7 X2
  3464. SA6 MASRQ+FP.ACCO STORE ACCT NAME IN REQUEST
  3465. SA7 MASRQ+FP.FNAME STORE FILE NAME IN REQUEST
  3466. SA1 DIRECT (X1) = DIRECTORY NAME
  3467. SA2 PACK (X2) = PACK NAME OR TYPE
  3468. BX6 X1
  3469. BX7 X2
  3470. SA6 MASRQ+FP.DNAME STORE DIR. NAME IN REQUEST
  3471. SA1 OLDPACK CHECK *OLDPACK* FLAG
  3472. NG X1,NEWSRCH1 IF FOR OLD DISK SYSTEM ONLY
  3473. SA7 MASRQ+FP.PACK STORE PACK NAME IN REQUEST
  3474. NEWSRCH1 SA1 NEWSRCH SAVE RJ TRAIL
  3475. AX1 30 MOVE RETURN ADDRESS TO LOW END
  3476. SX6 X1 EXTRACT RETURN ADDRESS
  3477. SA6 RJSAVE
  3478. RJ SYSFSAV SAVE OVDATAS OVER INTERRUPT
  3479. RJ =XSAVLES SAVE LESSON, COMMON, ETC.
  3480.  
  3481. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3482. CALL S=MSG,DEBUGM4
  3483. EQ DEBUG4
  3484. DEBUGM4 DIS ,/ POSTING REQUEST FOR *NEWSRCH*./
  3485. DEBUG4 CALL OCTDUMP,MASRQ,MS.RDIM
  3486. .1 ENDIF
  3487.  
  3488. CALL S=MAS,MASRQ,STATION POST REQUEST TO MASTOR
  3489. NEWSRCH2 TUTIM -1,,IOKEY
  3490. SA1 KEY CHECK FOR *IOKEY*
  3491. SX1 X1-IOKEY
  3492. NZ X1,NEWSRCH2 IF WRONG KEY
  3493.  
  3494. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3495. CALL S=MSG,DEBUGM5
  3496. EQ DEBUG5
  3497. DEBUGM5 DIS ,/ REPLY RECEIVED FOR *NEWSRCH*./
  3498. DEBUG5 CALL OCTDUMP,MASRQ,MS.RDIM
  3499. .1 ENDIF
  3500.  
  3501. RJ =XRESTKEY RESTORE *KEY*
  3502. RJ =XRESTLES RESTORE LESSON, COMMON, ETC.
  3503. RJ SYSFRST RESTORE OVDATAS
  3504. SA2 NEWSRCH USE ENTRY POINT FOR MODEL -EQ-
  3505. MX1 6 MASK OFF THE OP-CODE
  3506. BX2 X1*X2 X2 = FORCED-UPPER -EQ- OP-CODE
  3507. SA1 RJSAVE RETRIEVE 18-BIT RETURN ADDRESS
  3508. LX1 30 SHIFT TO OPERAND FIELD FOR -EQ-
  3509. BX6 X1+X2 FORM COMPLETE RETURN INSTRUCT.
  3510. SA6 NEWSRCH
  3511. SA1 MASRQ+FR.ERR CHECK ERROR RETURN
  3512. SX2 X1-/ERRCODE/BUSY
  3513. ZR X2,NEWSRCH0 REPEAT IF BUSY CONDITION
  3514. PL X1,NEWSRCH3 IF FILE NOT FOUND
  3515. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3516. MX6 -1 (X6) = -1 = FILE FOUND
  3517.  
  3518. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3519. RJ YFOUND
  3520. .1 ENDIF
  3521.  
  3522. EQ NEWSRCH
  3523.  
  3524. NEWSRCH3 MX6 0 (X6) = 0 = FILE NOT FOUND
  3525.  
  3526. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3527. RJ NFOUND
  3528. .1 ENDIF
  3529.  
  3530. EQ NEWSRCH
  3531. OLDSRCH SPACE 4,14
  3532. ** OLDSRCH -- SEARCH OLD DISK SYSTEM FOR FILE
  3533. *
  3534. * ENTRY (FILE) = FILE NAME.
  3535. * (PACK) = PACK NAME OR ZERO.
  3536. *
  3537. * EXIT (X6) = -1 IF FILE FOUND, 0 IF NOT.
  3538. *
  3539. * USES A - 1, 2, 6, 7.
  3540. * B - 1, 2.
  3541. * X - 1, 2, 3, 6, 7.
  3542. *
  3543. * CALLS FINDFN, FNDFILE.
  3544. *
  3545. * MACROS CALL.
  3546.  
  3547. OLDSRCH EQ *
  3548.  
  3549. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3550. CALL S=MSG,DEBUGM3
  3551. EQ DEBUG3
  3552. DEBUGM3 DIS ,* SEARCHING OLD DISK SYSTEM.*
  3553. DEBUG3 BSS 0
  3554. .1 ENDIF
  3555.  
  3556. SA1 PACK (X1) = PACK TO SEARCH
  3557. NG X1,OLDSRCH4 NOT FOUND IF BAD PACK NAME
  3558. ZR X1,OLDSRCH3 IF SHOULD SEARCH ALL PACKS
  3559.  
  3560. * IF SEARCHING ONE PACK, LOCATE PACK IN PACK NAME
  3561. * TABLE AND CALL ROUTINE (*FNDFILE*) TO SEARCH ONE
  3562. * PACK.
  3563.  
  3564. SB1 0 (B1) = CURRENT DISK UNIT
  3565. SB2 NDSUS (B2) = NUMBER OF DISK UNITS
  3566. OLDSRCH1 SA2 PNAMES+B1 CHECK NEXT PACK NAME
  3567. BX3 X1-X2 SEE IF NAMES MATCH
  3568. ZR X3,OLDSRCH2 IF PACK NAMES MATCHED
  3569. SB1 B1+1 INCREMENT CURRENT UNIT
  3570. LT B1,B2,OLDSRCH1 IF MORE NAMES TO CHECK
  3571. EQ OLDSRCH4 IF SPECIFIED PACK NOT MOUNTED
  3572.  
  3573. OLDSRCH2 SX6 B1 (X6) = DISK UNIT
  3574. BX7 X2 (X7) = PACK NAME
  3575. SA6 OLDSRCHA
  3576. SA7 OLDSRCHB
  3577. SA1 FILE (X1) = FILE NAME
  3578. CALL FNDFILE,OLDSRCHA,OLDSRCHB SEARCH ONE PACK
  3579. NG X7,OLDSRCH5 IF FILE FOUND
  3580. EQ OLDSRCH4 IF FILE NOT FOUND
  3581.  
  3582. * SEARCH ALL PACKS.
  3583.  
  3584. OLDSRCH3 SA1 FILE
  3585. RJ =XFINDFN
  3586. PL X7,OLDSRCH5 IF FILE FOUND
  3587.  
  3588. * MARK FILE NOT FOUND
  3589.  
  3590. OLDSRCH4 MX6 0 (X6) = 0 = FILE NOT FOUND
  3591.  
  3592. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3593. RJ NFOUND
  3594. .1 ENDIF
  3595.  
  3596. EQ OLDSRCH
  3597.  
  3598. * MARK FILE FOUND.
  3599.  
  3600. OLDSRCH5 MX6 -1 (X6) = -1 = FILE FOUND
  3601.  
  3602. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3603. RJ YFOUND
  3604. .1 ENDIF
  3605.  
  3606. EQ OLDSRCH
  3607.  
  3608. OLDSRCHA OVDATA DISK UNIT
  3609. OLDSRCHB OVDATA PACK NAME
  3610.  
  3611. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3612. SEARCHED SPACE 4,15
  3613. ** SEARCHED -- INITIAL CHECKS AFTER LOOKING FOR FILE
  3614. *
  3615. * ENTRY (X6) = -1 IF FILE FOUND, 0 IF NOT.
  3616. * (B1) = -1 IF OLD DISK SYSTEM SEARCHED, 0 IF
  3617. * NEW DISK SYSTEM SEARCHED
  3618. * (TYPSAVE) = PRIMARY KEYWORD OPTION.
  3619. *
  3620. * EXIT TO *SYSFE11* IF CREATE OPTION AND FILE
  3621. * ALREADY EXISTS OR IF RENAME OPTION AND THE
  3622. * OLD NAME EXISTS ON ONE DISK SYSTEM AND THE
  3623. * NEW NAME EXISTS ON THE OTHER DISK SYSTEM.
  3624. *
  3625. * USES A - 1, 2, 6.
  3626. * B - NONE.
  3627. * X - 1, 2, 6.
  3628. *
  3629. * CALLS NEWSRCH, OLDSRCH, SWAPFNS.
  3630. *
  3631. * MACROS NONE.
  3632.  
  3633. SEARCHED EQ * MUST BE AN -EQ-, SEE *RJSAVE1*
  3634. ZR X6,SEARCHED EXIT IF FILE WAS NOT FOUND
  3635. SA1 TYPSAVE (X1) = PRIMARY KEYWORD OPTION
  3636. SX2 X1-F.RENAME CHECK FOR RENAME OPTION
  3637. ZR X2,SEARCHD1 IF RENAME OPTION
  3638. SX2 X1-F.CREATE CHECK FOR CREATE OPTION
  3639. NZ X2,SEARCHED EXIT IF NOT CREATE OPTION
  3640.  
  3641. * IF CREATE OPTION AND FILE WAS FOUND ON EITHER DISK
  3642. * SYSTEM, RETURN A DUPLICATE FILE ERROR.
  3643.  
  3644. EQ SYSFE11 DUPLICATE FILE NAME ERROR
  3645.  
  3646. * IF RENAME OPTION AND FILE IS FOUND ON ONE DISK
  3647. * SYSTEM, CHECK THE OTHER DISK SYSTEM FOR A DUPLI-
  3648. * CATE NAME. DUPLICATE NAMES ON THE SAME DISK
  3649. * DISK SYSTEM WILL BE DETECTED WHEN YOU TRY TO
  3650. * RENAME THE FILE.
  3651.  
  3652. SEARCHD1 SA1 SEARCHED SAVE RJ TRAIL
  3653. AX1 30 SHIFT RETURN ADDRESS TO LOW END
  3654. SX6 X1 EXTRACT 18-BIT RETURN ADDRESS
  3655. SA6 RJSAVE1
  3656. RJ SWAPFNS SWAP OLD AND NEW FILE NAMES
  3657. PL B1,SEARCHD2 IF FOUND ON NEW DISK SYSTEM
  3658. RJ NEWSRCH SEARCH NEW DISK SYSTEM
  3659. NG X6,SYSFE11 DUPLICATE FILE ERROR IF FOUND
  3660. EQ SEARCHD3 IF NOT FOUND
  3661.  
  3662. SEARCHD2 RJ OLDSRCH SEARCH OLD DISK SYSTEM
  3663. NG X6,SYSFE11 DUPLICATE FILE ERROR IF FOUND
  3664.  
  3665. SEARCHD3 RJ SWAPFNS SWAP FILE NAMES BACK
  3666. SA2 SEARCHED USE ENTRY POINT FOR MODEL -EQ-
  3667. MX1 6 MASK OFF THE OP-CODE
  3668. BX2 X1*X2 X2 = FORCED-UPPER -EQ- OP-CODE
  3669. SA1 RJSAVE1 RETRIEVE 18-BIT RETURN ADDRESS
  3670. LX1 30 SHIFT TO OPERAND FIELD FOR -EQ-
  3671. BX6 X1+X2 FORM COMPLETE RETURN INSTRUCT.
  3672. SA6 SEARCHED RESTORE RETURN INSTRUCTION
  3673. SX6 -1 RESTORE (X6) = -1 = FILE FOUND
  3674. EQ SEARCHED -- EXIT
  3675.  
  3676. SWAPFNS SPACE 4,10
  3677. ** SWAPFNS -- SWAP OLD AND NEW FILE NAMES
  3678. *
  3679. * SWAP OLD AND NEW ACCOUNT AND FILE NAMES IN ORDER
  3680. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3681. * TO CHECK FOR A DUPLICATE FILE NAME ON A DIFFERENT
  3682. * DISK SYSTEM BEFORE RENAMING A FILE.
  3683. *
  3684. * USES A - 1, 2, 6, 7.
  3685. * B - NONE.
  3686. * X - 1, 2, 6, 7.
  3687. *
  3688. * CALLS NONE.
  3689. *
  3690. * MACROS NONE.
  3691. *
  3692.  
  3693. SWAPFNS EQ *
  3694. SA1 ACCT (X1) = ACCOUNT NAME
  3695. SA2 NACCT (X2) = NEW ACCOUNT NAME
  3696. BX6 X1
  3697. BX7 X2
  3698. SA6 A2
  3699. SA7 A1
  3700. SA1 FILE (X1) = FILE NAME
  3701. SA2 NFILE (X2) = NEW FILE NAME
  3702. BX6 X1
  3703. BX7 X2
  3704. SA6 A2
  3705. SA7 A1
  3706. EQ SWAPFNS
  3707.  
  3708. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3709. NFOUND EQ *
  3710. CALL S=MSG,NFOUNDA
  3711. RJ FILACCTL
  3712. MX6 0
  3713. EQ NFOUND
  3714. NFOUNDA DIS ,* FILE NOT FOUND.*
  3715.  
  3716. YFOUND EQ *
  3717. CALL S=MSG,YFOUNDA
  3718. RJ FILACCTL
  3719. MX6 -1
  3720. EQ YFOUND
  3721. YFOUNDA DIS ,* FILE FOUND.*
  3722.  
  3723. FILACCTL EQ *
  3724. SA1 FILE
  3725. SB6 A5 SAVE A5
  3726. CALL S=OTOA
  3727. SA5 B6 RESTORE A5
  3728. SA6 FILEMSG+1
  3729. SA7 FILEMSG+2
  3730. CALL S=MSG,FILEMSG
  3731. SA1 ACCT
  3732. SB6 A5 SAVE A5
  3733. CALL S=OTOA
  3734. SA5 B6 RESTORE A5
  3735. SA6 ACCTMSG+1
  3736. SA7 ACCTMSG+2
  3737. CALL S=MSG,ACCTMSG
  3738. EQ FILACCTL
  3739.  
  3740. FILEMSG DATA 10H FILE -
  3741. DATA 0,0,0
  3742. ACCTMSG DATA 10H ACCT -
  3743. DATA 0,0,0
  3744. .1 ENDIF
  3745.  
  3746.  
  3747. SYSFRST SPACE 4,13
  3748. ** SYSFRST - RESTORE OVDATAS FOR -SYSFILE-
  3749. *
  3750. * ENTRY NONE.
  3751. *
  3752. * EXIT OVDATA VARIABLES RESTORED FROM *TBINTSV*.
  3753. *
  3754. * USES A - 1, 6.
  3755. * B - 1, 2, 3.
  3756. * X - 1, 6.
  3757. *
  3758. * CALLS NONE.
  3759. *
  3760. * MACROS NONE.
  3761.  
  3762. SYSFRST EQ *
  3763.  
  3764. SB1 SAVE60L-1 (B1) = NO. OF 60-BIT FIELDS - 1
  3765. SYSFRST1 SA1 TBINTSV+B1 (X1) = NEXT FIELD TO RESTORE
  3766. BX6 X1
  3767. SA6 SAVE60+B1 RESTORE IT
  3768. SB1 B1-1 END TEST
  3769. PL B1,SYSFRST1 IF MORE TO RESTORE
  3770.  
  3771. SB1 SAVE18L-1 (B1) = WORDS TO RESTORE - 1
  3772. SB2 0 COUNT OF SAVED WORDS RESTORED
  3773. SYSFRST2 SA1 TBINTSV+SAVE60L+B2 (X1) = NEXT 3 FIELDS
  3774. SB3 3 (B3) = NO. FIELDS / WORD
  3775. SYSFRST3 LX1 18 POSITION NEXT 18-BIT FIELD
  3776. SX6 X1 (X6) = NEXT 18-BIT FIELD
  3777. SA6 SAVE18+B1 RESTORE THE FIELD
  3778. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3779. SB1 B1-1 END TEST
  3780. NG B1,SYSFRST RETURN IF ALL DONE
  3781. SB3 B3-1 SEE IF MORE FIELDS IN X1
  3782. NZ B3,SYSFRST3 IF MORE IN X1
  3783. SB2 B2+1 INCREMENT SAVED WORDS RESTORED
  3784. EQ SYSFRST2
  3785.  
  3786. SYSFSAV SPACE 4,13
  3787. ** SYSFSAV - SAVE OVDATAS FOR -SYSFILE-
  3788. *
  3789. * ENTRY NONE.
  3790. *
  3791. * EXIT OVDATA VARIABLES SAVED IN *TBINTSV*.
  3792. *
  3793. * USES A - 1, 6.
  3794. * B - 1, 2, 3, 4.
  3795. * X - 0, 1, 6.
  3796. *
  3797. * CALLS NONE.
  3798. *
  3799. * MACROS NONE.
  3800.  
  3801. SYSFSAV EQ *
  3802.  
  3803. SB1 SAVE60L-1 (B1) = NO. OF 60-BIT FIELDS - 1
  3804. SYSFSAV1 SA1 SAVE60+B1 (X1) = NEXT FIELD TO SAVE
  3805. BX6 X1
  3806. SA6 TBINTSV+B1 SAVE IT
  3807. SB1 B1-1 END TEST
  3808. PL B1,SYSFSAV1 IF MORE TO SAVE
  3809.  
  3810. SB1 SAVE18L (B1) = NO. OF 18-BIT FIELDS
  3811. SB2 B0 (B2) = COUNTER FOR WORDS STORED
  3812. MX0 -18 (X0) = MASK FOR 18-BIT FIELDS
  3813. SYSFSAV2 SB3 18+18+6 (B3) = SHIFT COUNT
  3814. SX6 B0 PRESET NEXT 3 FIELDS TO ZERO
  3815. SB4 B0 FLAG NOTHING IN X6 YET
  3816. SYSFSAV3 SB1 B1-1 END TEST
  3817. NG B1,SYSFSAV4 IF NO MORE TO SAVE
  3818. SA1 SAVE18+B1 (X1) = NEXT FIELD TO SAVE
  3819. BX1 -X0*X1 LIMIT TO 18 BITS
  3820. LX1 X1,B3 SHIFT TO POSITION
  3821. BX6 X1+X6 MERGE
  3822. SB4 -1 FLAG SOMETHING IN X6
  3823. SB3 B3-18 ADJUST SHIFT-COUNT
  3824. PL B3,SYSFSAV3 IF ROOM FOR MORE IN X6
  3825. SYSFSAV4 PL B4,SYSFSAV IF NOTHING IN X6
  3826. SA6 TBINTSV+SAVE60L+B2 STORE NEXT WORD
  3827. NG B1,SYSFSAV RETURN IF ALL DONE
  3828. SB2 B2+1 INCREMENT COUNT OF WORDS STORED
  3829. EQ SYSFSAV2
  3830. .MDS ELSE
  3831. TAGSDONE BSS 0
  3832. .MDS ENDIF
  3833. EJECT
  3834.  
  3835. * FINISH PREPARATIONS NEEDED FOR THE PRIMARY
  3836. * OPTIONS (ATTACH, DETACH, ETC.) AND BRANCH TO
  3837. * THE APPROPRIATE ROUTINE.
  3838. *
  3839. * THE FOLLOWING CODE HANDLES TRANSACTIONS ON THE
  3840. * OLD DISK SYSTEM.
  3841.  
  3842. OLDDSYS SA1 FILE (X1) = FILE NAME
  3843.  
  3844. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3845. CALL S=MSG,ONOLD
  3846. SA1 FILE
  3847. EQ ONOLD2
  3848. ONOLD DIS ,* USING OLD DISK SYSTEM.*
  3849. ONOLD2 BSS 0
  3850. .1 ENDIF
  3851.  
  3852. SA2 PACK (X2) = PACK NAME
  3853. BX6 X1
  3854. BX7 X2
  3855. SA3 FIPSAVE (X3) = ADDRESS OF FIP
  3856. SA6 X3+/FIP/FILE SET FILE NAME IN FIP
  3857. SA7 X3+/FIP/DIR SET PACK NAME IN FIP
  3858.  
  3859. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  3860.  
  3861. CALL S=MSG,FIPMSG
  3862. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3863. SA1 FIPSAVE
  3864. CALL OCTDUMP,X1,FIPLTH
  3865. .1 ENDIF
  3866.  
  3867.  
  3868. SA1 TYPSAVE (X1) = PRIMARY OPTION
  3869. SB1 X1+0
  3870. JP B1+TYPJTAB --- JUMP ON PRIMARY OPTION
  3871.  
  3872. TYPJTAB BSS 0
  3873.  
  3874. + SX6 0 0 = ATTACH FILE
  3875. EQ O.ATTACH
  3876.  
  3877. + SA1 FIPSAVE 1 = DETACH FILE
  3878. EQ O.DETACH
  3879.  
  3880. + SX6 1 2 = CHECK EXISTENCE OF A FILE
  3881. EQ O.ATTACH
  3882.  
  3883. + SX6 3 3 = READ FILE
  3884. EQ O.RW
  3885.  
  3886. + SX6 4 4 = WRITE FILE
  3887. EQ O.RW
  3888.  
  3889. + SA1 FIPSAVE 5 = CREATE FILE
  3890. EQ O.CREATE
  3891.  
  3892. + SA1 FIPSAVE 6 = DESTROY FILE
  3893. EQ O.DEST
  3894.  
  3895. + SA1 FIPSAVE 7 = RENAME FILE
  3896. EQ O.RENAME
  3897.  
  3898. + SA1 FIPSAVE 8 = CHANGE FILE TYPE
  3899. EQ O.RETYPE
  3900.  
  3901. + SA1 FIPSAVE 9 = SET/CLEAR BACKUP BIT
  3902. EQ O.FBIT
  3903.  
  3904. + EQ SYSFE99 10 = RECREATE FILE (CANNOT DO)
  3905.  
  3906.  
  3907. * ATTACH OPTION AND CHECK EXISTENCE OF A
  3908. * FILE -- SET/CLEAR THE -FILEF- FLAG AND EXECUTE
  3909. * THE -ATTACHF- OVERLAY.
  3910.  
  3911. O.ATTACH SA6 /ATTFOV/SAVETYP SET/CLEAR -FILEF- FLAG
  3912. SX6 -1
  3913. SA6 OVARG1 FLAG FROM -SYSFILE- COMMAND
  3914. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  3915. SX6 X1+0
  3916. SA6 /ATTFOV/FIPADDR
  3917. EXEC EXEC4,ATTFOV
  3918.  
  3919. * DETACH OPTION -- SET THE STATION/MASTER FLAG AND
  3920. * EXECUTE THE -DETACHF- OVERLAY.
  3921.  
  3922. O.DETACH SX6 X1 (X6) = ADDRESS OF FIP
  3923. SA6 /DETFOV/FIPADDR
  3924. SA1 SMCODE
  3925. BX6 X1
  3926. MX7 -1
  3927. SA6 /DETFOV/SMCODE
  3928. SA7 OVARG1 FLAG FROM -SYSFILE- COMMAND
  3929. EXEC EXEC4,DETFOV
  3930.  
  3931. * READ/WRITE OPTIONS -- MOVE STARTING BLOCK, STORAGE
  3932. * INDEX, NUMBER OF BLOCKS AND I/O TYPE TO THE PROPER
  3933. * CELLS AND EXECUTE THE -READF-/-WRITEF- OVERLAY.
  3934.  
  3935. O.RW SA6 /FIOV/IOTYPE SET I/O TYPE
  3936. SA1 START (X1) = STARTING BLOCK NUMBER
  3937. SA2 STORAGE (X2) = STORAGE INDEX
  3938. BX6 X1
  3939. BX7 X2
  3940. SA6 /FIOV/FRSTBLK
  3941. SA7 /FIOV/ECSADDR
  3942. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3943. SA1 NUMBER (X1) = NUMBER OF BLOCKS
  3944. BX6 X1
  3945. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  3946. MX7 -1
  3947. SA6 /FIOV/NUMBLKS
  3948. * /--- BLOCK SYSFILE 00 000 80/12/02 03.41
  3949. SA7 OVARG1 FLAG FROM -SYSFILE- COMMAND
  3950. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  3951. SX6 X1+0
  3952. SA6 /FIOV/FIPADDR
  3953. EXEC EXEC4,FIOV
  3954.  
  3955.  
  3956. * CREATE OPTION -- DO -SETPACK- EQUIVALENT AND PLACE
  3957. * THE DESIRED FILE NAME, SPACE ALLOCATION INFO AND
  3958. * PACK DIRECTORY RETURN FLAG IN THE PROPER CELLS.
  3959.  
  3960. O.CREATE SX6 X1 (X6) = ADDRESS OF FIP
  3961. SA6 /CREATE/FIPADDR
  3962. RJ SETPACK
  3963. SA1 F.LTH (X1) = FILE LENGTH
  3964. SA2 F.TYP (X2) = FILE TYPE
  3965. SA3 F.DIR (X3) = DIRECTORY SIZE
  3966. SA4 F.RMT (X4) = RMT SIZE
  3967. LX2 6 SHIFT FIELDS TO POSITION
  3968. LX3 12
  3969. LX4 18
  3970. BX6 X1+X2 MERGE
  3971. BX6 X6+X3
  3972. BX6 X6+X4
  3973. SA6 /CREATE/INFO STORE SPACE ALLOC. INFO WORD
  3974. SA1 FILE (X1) = DESIRED FILE NAME
  3975. SA2 NPDWRIT (X2) = PACK DIR. CHECKPT FLAG
  3976. BX6 X1 (X6) = DESIRED FILE NAME
  3977. BX7 X2
  3978. SA6 /CREATE/FILE
  3979. SA7 /CREATE/CHECKPT
  3980. EQ =XCREATE1 --- JUMP TO -CREATE- COMMAND
  3981.  
  3982. * DESTROY OPTION -- DO -SETPACK- EQUIVALENT AND
  3983. * PLACE THE FILE NAME IN THE CORRECT CELL
  3984.  
  3985. O.DEST SX6 X1 (X6) = ADDRESS OF FIP
  3986. SA6 /DESTROY/FIPADDR
  3987. RJ SETPF SET TO PACK AND FILE
  3988. SA1 FILE (X1) = DESIRED FILE NAME
  3989. BX6 X1
  3990. SA6 /DESTROY/FILE
  3991. EQ =XDESTRY1 --- JUMP TO -DESTROY- COMMAND
  3992.  
  3993. * /--- BLOCK SYSFILE 00 000 80/12/02 04.00
  3994. * RENAME OPTION -- DO -SETPACK- EQUIVALENT AND
  3995. * PLACE THE FILE NAME AND DESIRED NEW NAME IN THE
  3996. * PROPER CELLS.
  3997.  
  3998. O.RENAME SX6 X1 (X6) = ADDRESS OF FIP
  3999. SA6 /RENAME/FIPADDR
  4000. RJ SETPF SET TO PACK AND FILE
  4001. SA1 FILE (X1) = FILE NAME
  4002. SA2 NFILE (X2) = NEW NAME
  4003. BX6 X1
  4004. BX7 X2
  4005. SA6 /RENAME/FILE
  4006. SA7 /RENAME/NFILE
  4007. SX6 0
  4008. SA6 /RENAME/FLAG SET -RENAMEF-/-RETYPEF- FLAG
  4009. *
  4010. RENAME1 MX6 0 CLEAR OVERLAY STACK
  4011. SA6 OVRSTAK
  4012. X DSKCOV,3 EXECUTE -RENAMEF- COMMAND CODE
  4013.  
  4014.  
  4015. * RETYPE OPTION -- DO -SETPACK- EQUIVALENT AND
  4016. * PLACE THE FILE NAME AND NEW FILE TYPE IN THE
  4017. * PROPER CELLS.
  4018.  
  4019. O.RETYPE SX6 X1 (X6) = ADDRESS OF FIP
  4020. SA6 /RETYPE/FIPADDR
  4021. RJ SETPF SET TO PACK AND FILE
  4022. SA1 FILE (X1) = FILE NAME
  4023. SA2 F.TYP (X2) = NEW FILE TYPE
  4024. BX6 X1
  4025. BX7 X2
  4026. SA6 /RETYPE/FILE
  4027. SA7 /RETYPE/TYPE
  4028. SX6 -1
  4029. SA6 /RETYPE/FLAG SET -RENAMEF-/-RETYPEF- FLAG
  4030. EQ RENAME1
  4031.  
  4032. * FBIT OPTION -- DO -SETPACK- EQUIVALENT AND PLACE
  4033. * THE FILE NAME AND ON/OFF FLAG IN THE APPROPRIATE
  4034. * CELLS.
  4035.  
  4036. O.FBIT SX6 X1 (X6) = ADDRESS OF FIP
  4037. SA6 /FBIT/FIPADDR
  4038. RJ SETPF
  4039. SA1 FILE (X1) = FILE NAME
  4040. SA2 NEWFBIT (X2) = NEW BACKUP BIT
  4041. BX6 X1
  4042. BX7 X2
  4043. SA6 /FBIT/FILE
  4044. SA7 /FBIT/NEWFBIT
  4045. SX6 -1
  4046. SA6 OVARG1 FLAG FROM -SYSFILE- COMMAND
  4047. EXEC EXEC4,FBITOV
  4048. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4049.  
  4050. EJECT
  4051. ** SETPF - SET TO PLATO PACK AND FILE
  4052. *
  4053. * THIS SUBROUTINE IMITATES THE ACTION OF -SETPACK-
  4054. * AND -SETFILE- COMMANDS.
  4055. *
  4056. * IF A PACK NAME IS PROVIDED, *SETPACK* IS CALLED
  4057. * SET TO THAT SPECIFIC PACK.
  4058. *
  4059. * IF NO PACK NAME IS PROVIDED, *FINDFN* IS CALLED
  4060. * TO SEARCH ALL ACTIVE PACKS.
  4061. *
  4062. * ENTRY (FIPSAVE) = ADDRESS OF FIP
  4063. *
  4064. * EXIT (TDISKU) = DISK UNIT IF SUCCESSFUL, ELSE 0
  4065. * (TPNAME) = PACK NAME IF SUCCESSFUL, ELSE 0
  4066. * TO *SYSFE0* IF FILE DOES NOT EXIT
  4067. * TO *SYSFE3* IF PACK NAME IS BAD
  4068. * TO *SYSFE4* IF FILE NAME IS BAD
  4069. *
  4070. * CALLS FINDFN, SETPACK
  4071. *
  4072. * USES X - 1, 2, 7.
  4073. * A - 1, 2, 7.
  4074. * B - NONE.
  4075. *
  4076.  
  4077. SETPF EQ *
  4078.  
  4079. SA2 FIPSAVE (X2) = ADDRESS OF FIP
  4080.  
  4081. SA1 X2+/FIP/FILE (X1) = FILE NAME
  4082. ZR X1,SYSFE4 --- ERROR IF BAD FILE NAME
  4083. NG X1,SYSFE4 --- ERROR IF BAD FILE NAME
  4084.  
  4085. SA2 X2+/FIP/DIR (X2) = PACK NAME
  4086. NG X2,SYSFE3 --- ERROR IF BAD PACK NAME
  4087. ZR X2,SETPF1 --- TO SEARCH ALL PACKS
  4088.  
  4089. RJ SETPACK SET TO SPECIFIED PACK
  4090. EQ SETPF --- RETURN
  4091.  
  4092. SETPF1 RJ =XFINDFN SEARCH ALL ACTIVE PACKS
  4093. NG X7,SYSFE0 --- ERROR IF FILE NOT FOUND
  4094.  
  4095. SA7 TDISKU STORE DISK UNIT NUMBER
  4096. SA1 PNAMES+X7 (X1) = PACK NAME
  4097. BX7 X1
  4098. SA7 TPNAME STORE PACK NAME
  4099.  
  4100. EQ SETPF --- RETURN
  4101.  
  4102. EJECT
  4103.  
  4104. ** SETPACK - IMITATION -SETPACK- COMMAND
  4105. *
  4106. * ENTRY (FIPSAVE) = ADDRESS OF FIP
  4107. *
  4108. * EXIT (TDISKU) = DISK UNIT IF SUCCESSFUL, ELSE 0
  4109. * (TPNAME) = PACK NAME IF SUCCESSFUL, ELSE 0
  4110. * TO *SYSFE3* IF PACK NAME IS BAD
  4111. * TO *SYSFE3* IF PACK IS NOT LOADED
  4112. *
  4113. * USES X - 1, 2, 3, 6, 7.
  4114. * A - 0, 1, 2, 6, 7.
  4115. * B - 2, 3.
  4116. *
  4117.  
  4118. SETPACK EQ *
  4119.  
  4120. SA1 TDISKU (X1) = CURRENT DISK UNIT
  4121. SA2 X1+PNAMES (X2) = CURRENT PACK NAME
  4122.  
  4123. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  4124. SA1 X1+/FIP/DIR (X1) = PACK TO SET TO
  4125. ZR X1,SETPACK2 --- ERROR IF NO PACK NAME
  4126. NG X1,SETPACK2 --- ERROR IF BAD PACK NAME
  4127. BX2 X1-X2 SEE IF ALREADY SET TO THE PACK
  4128. ZR X2,SETPACK4 --- IF ALREADY DONE
  4129.  
  4130. SB2 B0 (B2) = DISK UNIT INDEX
  4131. SB3 NDSUS (B3) = NUMBER OF DISK UNITS
  4132. SA0 PNAMES (A0) = ADDRESS OF PACK NAMES
  4133.  
  4134. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4135. SETPACK1 SA2 A0+B2 (X2) = NEXT PACK NAME
  4136. BX3 X1-X2 SEE IF THE MATCH
  4137. ZR X3,SETPACK3 --- IF PACK NAMES IDENTICAL
  4138. SB2 B2+1 INCREMENT DISK UNIT INDEX
  4139. LT B2,B3,SETPACK1 --- IF MORE PACKS TO CHECK
  4140. SETPACK2 SX6 0
  4141. SA6 TPNAME CLEAR PACK NAME
  4142. SA6 TDISKU CLEAR DISK UNIT
  4143. EQ SYSFE3 --- TO ERROR EXIT
  4144.  
  4145. SETPACK3 SX6 B2 (X6) = DISK UNIT NUMBER
  4146. BX7 X2 (X2) = PACK NAME
  4147. SA6 TDISKU
  4148. SA7 TPNAME
  4149. EQ SETPACK
  4150.  
  4151. SETPACK4 BX6 X1 (X6) = PACK NAME
  4152. SA6 TPNAME MAKE SURE PACK NAME IS CORRECT
  4153. EQ SETPACK
  4154.  
  4155. EJECT
  4156. .MDS IFNE *F,0
  4157.  
  4158. * THE FOLLOWING CODE HANDLES TRANSACTIONS ON THE
  4159. * NEW DISK SYSTEM.
  4160.  
  4161. NEWDSYS RJ SYSFSAV SAVE OVDATAS OVER INTERRUPT
  4162. CALLX REQCHK CHECK FOR MASTOR REQ. OVERFLOW
  4163. RJ SYSFRST RESTORE OVDATAS
  4164.  
  4165. SX6 0
  4166. SA6 PINNED MARK STORAGE NOT PINNED
  4167.  
  4168. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4169. CALL S=MSG,ONNEW
  4170. EQ ONNEW2
  4171. ONNEW DIS ,* USING NEW DISK SYSTEM.*
  4172. ONNEW2 BSS 0
  4173. .1 ENDIF
  4174.  
  4175.  
  4176. RJ =XINITDRQ INITIALIZE MASTOR REQUEST AREA
  4177.  
  4178. SA1 TYPSAVE (X1) = PRIMARY OPTION
  4179. SA2 X1+ATTRTAB (X2) = OPTION ATTRIBUTES
  4180. SA1 FIPSAVE (X1) = ADDR. OF FIP
  4181.  
  4182. SX6 X2 (X6) = SUB-FUNCTION CODE
  4183. ZR X6,SYSFOK IF NO-OP ON NEW DISK SYSTEM
  4184. BX0 X2 (X0) = OPTION ATTRIBUTES
  4185. LX0 R.MODE
  4186. PL X0,NEWDSYS0 IF ATTACH MODE NOT NEEDED
  4187. SA3 X1+/FIP/MFF (X3) = MISC. FIP FIELDS
  4188. LX3 60-/MFF/S.ATTACH
  4189. MX4 -/MFF/M.ATTACH
  4190. BX4 -X4*X3 (X4) = ATTACH MODE
  4191. LX4 18 POSITION ATTACH MODE
  4192. BX6 X4+X6 MERGE WITH SUB-FUNCTION CODE
  4193. NEWDSYS0 SA3 MSGADDR (X3) = ADDR OF MESSAGE BUFFER
  4194. ZR X3,NEWDS0.1 IF NO MESSAGE BUFFER
  4195. SX3 1
  4196. LX3 FO.ERROR POSITION FLAG FOR MSG. OPTION
  4197. BX6 X3+X6
  4198. NEWDS0.1 LX0 R.NOATT-R.MODE
  4199. PL X0,NEWDS0.2 IF *NOATTACH* NOT ALLOWED
  4200. SA3 X1+/FIP/MFF
  4201. LX3 59-/MFF/S.NOATT
  4202. ERRNZ /MFF/M.NOATT-1
  4203. PL X3,NEWDS0.2 IF ATTACH REQUIRED
  4204. MX3 1
  4205. LX3 1+FO.IGNA
  4206. BX6 X3+X6
  4207. NEWDS0.2 SA6 MASRQ+FP.FUNC
  4208.  
  4209. LX0 R.AFT-R.NOATT
  4210. PL X0,NEWDSYS1 IF AFT SHOULD NOT BE SPECIFIED
  4211.  
  4212. SA3 X1+/FIP/MFF (X3) = MISC. FIP FIELDS
  4213. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4214. MX0 -/MFF/M.AFT (X0) = MASK FOR AFT INDEX
  4215. BX6 -X0*X3 (X6) = AFT INDEX
  4216. SA6 MASRQ+FP.AFT
  4217.  
  4218. NEWDSYS1 SA3 FILE (X3) = FILE NAME
  4219. BX6 X3
  4220. SA6 MASRQ+FP.FNAME
  4221.  
  4222. SA3 ACCTRES SEE IF ACCT OF RES SPECIFIED
  4223. NZ X3,NEWDS1.1 USE NEW VALUE IF SPECIFIED
  4224. SA3 X1+/FIP/FAW ELSE USE VALUE FROM /FIP/
  4225. AX3 /FAW/S.ACCRES
  4226. MX0 -/FAW/M.ACCRES
  4227. BX3 -X0*X3
  4228. LX3 18
  4229. NEWDS1.1 SA4 MASRQ+FP.ACCR
  4230. BX6 X3+X4 RETAIN STATION NUMBER FIELD
  4231. SA6 A4 STORE ACCT OF RES IN MASRQ BUFF
  4232.  
  4233. SA3 ACCT (X3) = ACCOUNT NAME
  4234. BX6 X3
  4235. SA6 MASRQ+FP.ACCO
  4236.  
  4237. SA3 SUBACCT (X3) = SUB-ACCOUNT IDENTIFIER
  4238. BX6 X3
  4239. SA6 MASRQ+FP.SUBA
  4240.  
  4241. SA3 DIRECT (X3) = DIRECTORY NAME
  4242. SX6 3RNEW CHECK FOR GLOBAL DIRECTORY
  4243. IX6 X3-X6
  4244. ZR X6,NEWDS1.2 IF GLOBAL DIRECTORY DESIRED
  4245. BX6 X3
  4246. NEWDS1.2 SA6 MASRQ+FP.DNAME
  4247.  
  4248. SA3 OLDPACK IF PACK FOR OLD SYSTEM ONLY
  4249. NG X3,NOPNAME IF NOT FOR NEW DISK SYSTEM
  4250. SA3 PACK (X3) = PACK NAME OR TYPE
  4251. BX6 X3
  4252. SA6 MASRQ+FP.PACK
  4253.  
  4254. NOPNAME BX0 X2 (X0) = OPTION ATTRIBUTES
  4255. LX0 R.NAME
  4256. NG X0,NEWDSYS6 IF NEW ACCOUNT';NAME REQUIRED
  4257.  
  4258. * FOR SINGLE FILE OPERATION, UNION ATTR BITS
  4259. * INTO ACCT-OF-ORIGIN WORD FOR THAT FILE.
  4260.  
  4261. SA3 MASRQ+FP.ACCO
  4262. SA4 ATTRIBS (X4) = ATTRIBUTE BITS
  4263. LX4 1 SHIFT ATTRIBUTE BITS INTO POS.
  4264. BX6 X3+X4 UNION ATTR BITS
  4265. SA6 A3 UPDATE REQUEST BUFFER
  4266.  
  4267. MX6 0 PRE-CLEAR X6
  4268. LX0 R.LTH-R.NAME
  4269. PL X0,NEWDSYS2 IF FILE LENGTH NOT NEEDED
  4270. SA3 F.LTH (X3) = FILE LENGTH
  4271. SX4 35 (X4) = SECTORS / PART
  4272. IX3 X3*X4 (X3) = LENGTH IN SECTORS
  4273. LX3 24+18 SHIFT TO POSITION
  4274. BX6 X3+X6 MERGE
  4275.  
  4276. NEWDSYS2 LX0 R.DIR-R.LTH
  4277. PL X0,NEWDSYS3 IF DIRECTORY SIZE NOT NEEDED
  4278. SA3 F.DIR (X3) = DIRECTORY SIZE
  4279. LX3 9+18 SHIFT TO POSITION
  4280. BX6 X3+X6 MERGE
  4281.  
  4282. NEWDSYS3 LX0 R.RMT-R.DIR
  4283. PL X0,NEWDSYS4 IF RMT SIZE NOT NEEDED
  4284. SA3 F.RMT (X3) = RMT SIZE
  4285. LX3 18 SHIFT TO POSITION
  4286. BX6 X3+X6 MERGE
  4287.  
  4288. NEWDSYS4 LX0 R.TYP-R.RMT
  4289. PL X0,NEWDSYS5 IF FILE TYPE NOT NEEDED
  4290. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4291. SA3 F.TYP (X3) = DESIRED FILE TYPE
  4292. BX6 X3+X6 MERGE
  4293.  
  4294. NEWDSYS5 SA6 MASRQ+FP.INFO
  4295.  
  4296. AX2 18 POSITION I/O CODE
  4297. SX6 X2 (X6) = I/O CODE
  4298. ZR X6,NEWDSYS7 IF NO I/O INVOLVED
  4299. LX6 18+12+24 POSITION I/O CODE
  4300. SA6 MASRQ+FP.IO STORE I/O CODE
  4301.  
  4302. SA1 TBXSTOR (X1) = STORAGE INFO
  4303. CALL SETSTOR SET UP *STORWRD*
  4304. SA4 STORWRD (X4) = 24/EM ADDR,18/LTH,18/0
  4305. AX4 18 POSITION STORAGE LENGTH
  4306. SA1 STORAGE (X1) = STARTING STORAGE ADDR.
  4307. SX0 DBSIZE (X0) = WORDS / SECTOR
  4308. SA2 NUMBER (X2) = NO. BLOCKS TO READ/WRITE
  4309. IX0 X0*X2 (X0) = NO. WORDS TO READ/WRITE
  4310. SX3 X4 (X3) = STORAGE LENGTH
  4311. IX3 X3-X0 SUBTRACT I/O LENGTH
  4312. IX3 X3-X1 SUBTRACT STARTING ADDRESS
  4313. NG X3,SYSFE7 ERROR IF OUT OF RANGE
  4314. AX4 18 (X4) = ABS. STORAGE ADDRESS
  4315. IX6 X4+X1 (X6) = ABS. STARTING ADDRESS
  4316. SA1 MASRQ+FP.IO (X1) = 6/IO CODE,54/0
  4317. SA2 START (X2) = STARTING SECTOR
  4318. SA3 NUMBER (X3) = SECTORS TO READ/WRITE
  4319. LX2 12+24 POSITION STARTING SECTOR
  4320. LX3 24 POSITION NUMBER OF SECTORS
  4321. BX6 X1+X6 MERGE
  4322. BX6 X2+X6
  4323. BX6 X3+X6
  4324. SA6 MASRQ+FP.IO STORE IN MASTOR REQUEST BUFFER
  4325.  
  4326. SA2 NUMBER (X2) = NUMBER OF SECTORS
  4327. SB4 0 SET USER TYPE TO SYSTEM
  4328. SB2 SDEATTS (B2) = ADDR. OF STATS CELLS
  4329. AX6 54 (X6) = 54/0, 6/IO CODE
  4330. SX1 X6+2 (X1) = 3 TO READ, 4 TO WRITE
  4331. RJ =XDSKST UPDATE DISK STATISTICS
  4332.  
  4333. CALL IOLESSN,TBXSTOR,4000B PIN STORAGE
  4334. SX6 -1
  4335. SA6 PINNED MARK STORAGE PINNED
  4336. EQ NEWDSYS7
  4337.  
  4338. * FOR OPERATIONS INVOLVING TWO FILE NAMES,
  4339. * UNION ATTR BITS INTO THE NEW FILE NAME.
  4340. NEWDSYS6 SA1 NACCT (X1) = NEW ACCOUNT NAME
  4341. SA2 ATTRIBS (X2) = NEW ATTRIBUTES
  4342. LX2 1 SHIFT ATTR BITS INTO POS.
  4343. BX6 X1+X2
  4344. SA6 MASRQ+FP.ACCO2
  4345. SA1 NFILE (X1) = NEW FILE NAME
  4346. BX6 X1
  4347. SA6 MASRQ+FP.FNAM2
  4348.  
  4349. NEWDSYS7 RJ =XSAVLES SAVE COMMON, LESSON, ETC.
  4350. RJ SYSFSAV SAVE *OVDATA* CELLS
  4351.  
  4352. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4353. CALL S=MSG,DEBUGM6
  4354. EQ DEBUG6
  4355. DEBUGM6 DIS ,/ POSTING REQUEST FOR *NEWDSYS*./
  4356. DEBUG6 CALL OCTDUMP,MASRQ,MS.RDIM
  4357. .1 ENDIF
  4358.  
  4359. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4360. CALL S=MAS,MASRQ,STATION POST REQUEST TO MASTOR
  4361.  
  4362. NEWDSYS8 TUTIM -1,,IOKEY
  4363. SA1 KEY CHECK FOR *IOKEY*
  4364. SX1 X1-IOKEY
  4365. NZ X1,NEWDSYS8 IF WRONG KEY
  4366.  
  4367. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4368. CALL S=MSG,DEBUGM7
  4369. EQ DEBUG7
  4370. DEBUGM7 DIS ,/ REPLY RECEIVED FOR *NEWDSYS*./
  4371. DEBUG7 CALL OCTDUMP,MASRQ,MS.RDIM
  4372. .1 ENDIF
  4373.  
  4374.  
  4375. RJ SYSFRST RESTORE *OVDATA* CELLS
  4376. SA1 PINNED (X1) = -1 IF STORAGE WAS PINNED
  4377. ZR X1,NEWDSYS9 IF NOT PINNED
  4378. CALL IOLESSN,TBXSTOR,-4000B
  4379.  
  4380. NEWDSYS9 RJ =XRESTLES RESTORE LESSON, COMMON, ETC.
  4381. RJ =XRESTKEY RESTORE *KEY*
  4382.  
  4383. * CHECK FOR BUSY CONDITION.
  4384.  
  4385. SA1 MASRQ+FR.ERR (X1) = ERROR RETURN
  4386. SX1 X1-/ERRCODE/BUSY
  4387. ZR X1,NEWDSYS REPEAT IF BUSY CONDITION
  4388.  
  4389. * RETURN THE FIP.
  4390.  
  4391. ERRNZ /MFF/M.AFT-18
  4392. ERRNZ /MFF/M.STATN-18
  4393.  
  4394. SA1 FIPSAVE (X1) = ADDRESS OF FIP
  4395. SA2 X1+/FIP/MFF (X2) = MISC. FIP FIELDS
  4396. MX6 -/MFF/M.ATTACH (X6) = MASK FOR ATTACH MODE
  4397. LX6 /MFF/S.ATTACH POSITION THE MASK
  4398. BX6 -X6*X2 (X6) = ATTACH MODE
  4399. MX3 -/MFF/M.NOATT
  4400. LX3 /MFF/S.NOATT
  4401. BX3 -X3*X2 PRESERVE *NOATTACH* BIT
  4402. BX6 X3+X6 MERGE WITH ATTACH MODE FIELD
  4403. SA2 MASRQ+FR.AFT (X2) = 27/0,15/STATN,18/AFT
  4404. MX3 -18 (X3) = MASK FOR AFT POINTER
  4405. BX3 -X3*X2 (X3) = AFT POINTER
  4406. LX3 /MFF/S.AFT POSITION AFT POINTER
  4407. BX6 X3+X6 INSERT AFT POINTER INTO FIP
  4408. SA3 MASRQ+FR.ERR CHECK ERROR RETURN
  4409. SX3 X3-/ERRCODE/ATTACHED
  4410. NZ X3,NOCONFL IF NOT ALREADY ATTACHED
  4411. AX2 18 SHIFT STATION NUMBER DOWN
  4412. MX3 -15
  4413. BX3 -X3*X2 (X3) = CONFLICTING STATION
  4414. SX3 X3+1 FIP NEEDS STATION + 1
  4415. LX3 /MFF/S.STATN POSITION STATION NUMBER
  4416. BX6 X3+X6 INSERT STATION INTO FIP
  4417. NOCONFL SA6 X1+/FIP/MFF STORE FIRST WORD OF FIP
  4418. SA2 MASRQ+FR.FNAME (X2) = FILE NAME
  4419. SA3 MASRQ+FR.FAW (X3) = FAW
  4420. BX6 X2
  4421. BX7 X3
  4422. SA6 X1+/FIP/FILE
  4423. SA7 X1+/FIP/FAW
  4424. SA2 MASRQ+FR.FIW (X2) = FIW
  4425. SA3 MASRQ+FR.DNAME (X3) = DIRECTORY
  4426. NZ X3,GOTDIRN
  4427. SX3 3RNEW
  4428. GOTDIRN BX6 X2
  4429. BX7 X3
  4430. SA6 X1+/FIP/FIW
  4431. SA7 X1+/FIP/DIR
  4432.  
  4433. * SET *ZRETURN* AND *ERROR*.
  4434.  
  4435. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4436. SA1 MASRQ+FR.ERR CHECK ERROR RETURN
  4437. PL X1,NEWDONE IF ERROR OCCURRED
  4438. MX6 -1
  4439. MX7 0
  4440. SA6 TRETURN
  4441. SA7 TERROR
  4442.  
  4443.  
  4444. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4445. EQ DEBUG8
  4446. .1 ENDIF
  4447.  
  4448. EQ =XCKPROC
  4449.  
  4450. NEWDONE SA2 MSGADDR SEE IF DISPLAYABLE MSG WANTED
  4451. ZR X2,NEWDONE2 IF MESSAGE NOT DESIRED
  4452. SB1 4
  4453. NEWDONE1 SA3 MASRQ+FR.MSG+B1 (X1) = NEXT WORD OF MSG.
  4454. BX6 X3
  4455. SA6 X2+B1 STORE IN USER MESSAGE BUFFER
  4456. SB1 B1-1
  4457. PL B1,NEWDONE1
  4458.  
  4459. NEWDONE2 SX2 X1-/ERRCODE/IOFUNC DISK ERRS .LT. IOFUNC
  4460. PL X2,NEWCONV IF NOT DISK ERROR
  4461. SX6 10
  4462. SX7 X1+
  4463. SA6 TRETURN *ZRETURN* = 10 FOR DISK ERROR
  4464. SA7 TERROR RETURN *ERROR* = DISK ERROR
  4465.  
  4466. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4467. EQ DEBUG8
  4468. .1 ENDIF
  4469.  
  4470. EQ =XCKPROC
  4471.  
  4472. * CONVERT *MS.FILE* RETURN TO -SYSFILE- *ZRETURN*
  4473.  
  4474. NEWCONV SA2 CONVTAB-1
  4475. NEWCONV1 SA2 A2+1 (X2) = 24/0,18/ZRETURN,18/CODE
  4476. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4477. ZR X2,*+1S17 WEIRD ERROR, CRASH PLATO
  4478. .1 ELSE
  4479. ZR X2,SYSFE98 RETURN BAD ZRETURN
  4480. .1 ENDIF
  4481. SX3 X2
  4482. BX3 X1-X3 SEE IF ERROR CODES MATCH
  4483. NZ X3,NEWCONV1 IF NOT, TRY NEXT ONE
  4484. AX2 18
  4485. SX6 X2
  4486. SA6 TRETURN SET *ZRETURN*
  4487. SX6 0
  4488. SX2 X1-/ERRCODE/ATTACHED
  4489. NZ X2,NEWCONV2 IF NOT ATTACHED ELSEWHERE
  4490. SA2 MASRQ+FR.AFT (X2) = 27/0,15/STATN,18/AFT
  4491. AX2 18 POSITION STATION NUMBER
  4492. MX6 -15
  4493. BX6 -X6*X2 (X6) = CONFLICTING STATION NO.
  4494. NEWCONV2 SA6 TERROR SET *ERROR*
  4495.  
  4496. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4497. EQ DEBUG8
  4498. .1 ENDIF
  4499.  
  4500. EQ =XCKPROC
  4501. .MDS ENDIF
  4502. EJECT
  4503.  
  4504. * EXITS FROM THE -SYSFILE- COMMAND --
  4505.  
  4506. SYSFOK SX6 -1 -1 = ALL OK
  4507.  
  4508. SYSFEX SA6 TRETURN SET *ZRETURN*
  4509.  
  4510. .1 IF DEF,SYSFDBG IF -SYSFILE- DEBUG ON
  4511. SA7 RJSAVE SAVE MSG ADDRESS
  4512. DEBUG8 SA1 TRETURN
  4513. SB6 A5 SAVE A5
  4514. CALL S=OTOA
  4515. SA5 B6 RESTORE A5
  4516. SA6 ZRETURNM+1
  4517. SA7 ZRETURNM+2
  4518. SA1 TERROR
  4519. SB6 A5 SAVE A5
  4520. CALL S=OTOA
  4521. SA5 B6 RESTORE A5
  4522. SA6 ERRORM+1
  4523. SA7 ERRORM+2
  4524. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4525. CALL S=MSG,ZRETURNM
  4526. CALL S=MSG,ERRORM
  4527. CALL S=MSG,FIPMSG
  4528. EQ DEBUG9
  4529. ZRETURNM DATA 10HZRETURN -
  4530. DATA 0,0,0
  4531. ERRORM DATA 10HERROR -
  4532. DATA 0,0,0
  4533. FIPMSG DIS ,* FIP CONTENTS --*
  4534. DEBUG9 SA1 FIPSAVE
  4535. ZR X1,*
  4536. CALL OCTDUMP,X1,FIPLTH
  4537. SA1 TRETURN RESTORE (X6)
  4538. SX6 X1+
  4539. SA1 RJSAVE RESTORE (X7)
  4540. SX7 X1+
  4541. .1 ENDIF
  4542.  
  4543. NG X6,=XCKPROC IF NO ERROR OCCURRED
  4544. SA1 MSGADDR (X1) = ADDRESS OF MSG BUFFER
  4545. ZR X1,=XCKPROC IF NO MESSAGE DESIRED
  4546. SB1 1 (B1) = 1
  4547. SB2 4 (B2) = COUNTER FOR LOOP
  4548. SX6 0
  4549. SYSFEX1 SA6 A1+B2 PRE-CLEAR MESSAGE BUFFER
  4550. SB2 B2-B1
  4551. PL B2,SYSFEX1
  4552. MX0 -12 (X0) = MASK FOR LAST MSG WORD
  4553. SB2 0 (B2) = CURRENT WORD OF MSG.
  4554. SB3 4 (B3) = MAX. MSG. WORDS - 1
  4555. SYSFEX2 SA2 X7+B2 (X2) = NEXT WORD OF MESSAGE
  4556. BX6 X2
  4557. SA6 X1+B2 STORE NEXT WORD OF MESSAGE
  4558. BX2 -X0*X2 TEST FOR WORD ENDING IN 0000B
  4559. ZR X2,=XCKPROC IF REACHED END OF MESSAGE
  4560. EQ B2,B3,=XCKPROC IF MAX. WORDS REACHED
  4561. SB2 B2+B1 INCREMENT COUNT OF WORDS
  4562. EQ SYSFEX2 GO DO NEXT WORD
  4563.  
  4564.  
  4565. SYSFE0 SX6 0 0 = FILE NOT FOUND
  4566. SX7 MSG0
  4567. EQ SYSFEX
  4568.  
  4569. SYSFE3 SX6 3 3 = PACK NOT LOADED
  4570. SX7 MSG3
  4571. EQ SYSFEX
  4572.  
  4573. SYSFE4 SX6 4 4 = BAD FILE NAME
  4574. SX7 MSG4
  4575. EQ SYSFEX
  4576.  
  4577. SYSFE5 SX6 5 5 = BAD STARTING BLOCK
  4578. SX7 MSG5
  4579. EQ SYSFEX
  4580.  
  4581. SYSFE6 SX6 6 6 = BAD NUMBER OF BLOCKS
  4582. SX7 MSG6
  4583. EQ SYSFEX
  4584.  
  4585. SYSFE7 SX6 7 7 = TRANSFER LENGTH TOO LONG
  4586. SX7 MSG7
  4587. EQ SYSFEX
  4588.  
  4589. SYSFE8 SX6 8 8 = BAD STORAGE INDEX
  4590. SX7 MSG8
  4591. EQ SYSFEX
  4592.  
  4593. SYSFE11 SX6 11 11 = DUPLICATE FILE NAME
  4594. SX7 MSG11
  4595. EQ SYSFEX
  4596.  
  4597. SYSFE12 SX6 12 12 = BAD FILE TYPE
  4598. SX7 MSG12
  4599. EQ SYSFEX
  4600.  
  4601. SYSFE13 SX6 13 13 = BAD DIRECTORY INFO
  4602. SX7 MSG13
  4603. EQ SYSFEX
  4604.  
  4605. SYSFE14 SX6 14 14 = BAD FILE LENGTH
  4606. SX7 MSG14
  4607. EQ SYSFEX
  4608.  
  4609. SYSFE98 BX6 X1 98 = WEIRD RETURN VALUE
  4610. SA6 TERROR RETURN *ERROR* = ACTUAL VALUE
  4611. * /--- BLOCK SYSFILE 00 000 80/12/02 03.44
  4612. SX6 98
  4613. SX7 MSG98
  4614. EQ SYSFEX
  4615.  
  4616. SYSFE99 SX6 99 99 = UNSUPPORTED OPTION
  4617. SX7 MSG99
  4618. EQ SYSFEX
  4619.  
  4620. MSG0 DIS ,*FILE NOT FOUND*
  4621. MSG3 DIS ,*PACK NOT LOADED*
  4622. MSG4 DIS ,*BAD FILE NAME*
  4623. MSG5 DIS ,*BAD STARTING BLOCK*
  4624. MSG6 DIS ,*BAD NUMBER OF BLOCKS*
  4625. MSG7 DIS ,*TRANSFER LENGTH TOO LONG*
  4626. MSG8 DIS ,*BAD STORAGE INDEX*
  4627. MSG11 DIS ,*DUPLICATE FILE NAME*
  4628. MSG12 DIS ,*BAD FILE TYPE*
  4629. MSG13 DIS ,*BAD DIRECTORY PARAMETERS*
  4630. MSG14 DIS ,*BAD FILE LENGTH*
  4631. MSG98 DIS ,/WEIRD *MS.FILE* RETURN/
  4632. MSG99 DIS ,*UNSUPPORTED OPTION*
  4633. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  4634. .MDS IFEQ *F,1
  4635.  
  4636. EJECT
  4637.  
  4638.  
  4639. * THE FOLLOWING ARE USED TO SPECIFY ATTRIBUTES AND
  4640. * REQUIREMENTS OF VARIOUS SYSFILE OPTIONS. THERE IS
  4641. * ONE WORD FOR EACH OPTION. IF AN OPTION IS NOT
  4642. * AVAILABLE IN THE MASTOR DISK SYSTEM, SET THE
  4643. * FUNCTION CODE TO 0.
  4644. *
  4645. * THE CONTENTS OF AN ENTRY ARE --
  4646. *
  4647. * 1/SET IF ATTACH FIP REQUIRED
  4648. * 1/SET IF ATTACH MODE TO BE SPECIFIED
  4649. * 1/SET IF NEW FILE TYPE TO BE SPECIFIED
  4650. * 1/SET IF NEW FILE LENGTH TO BE SPECIFIED
  4651. * 1/SET IF NEW FILE NAME TO BE SPECIFIED
  4652. * 1/SET IF NEW DIRECTORY SIZE TO BE SPECIFIED
  4653. * 1/SET IF NEW RMT SIZE TO BE SPECIFIED
  4654. * 1/SET IF AFT POINTER CAN BE SPECIFIED
  4655. * 1/SET IF OK TO READ WITHOUT ATTACH
  4656. * 15/0
  4657. * 18/READ/WRITE CODE
  4658. * 18/FUNCTION CODE
  4659.  
  4660. * DEFINE SHIFTS FOR USING THE ATTRIBUTE TABLE.
  4661.  
  4662. R.AFIP EQU 0 ATTACH FIP REQUIRED (LX)
  4663. R.MODE EQU 1 ATTACH MODE REQUIRED (LX)
  4664. R.TYP EQU 2 FILE TYPE REQUIRED
  4665. R.LTH EQU 3 FILE LENGTH REQUIRED
  4666. R.NAME EQU 4 NEW ACCOUNT';NAME REQUIRED
  4667. R.DIR EQU 5 DIRECTORY SIZE REQUIRED
  4668. R.RMT EQU 6 RMT SIZE REQUIRED
  4669. R.AFT EQU 7 SET IF AFT POINTER SPECIFIED
  4670. R.NOATT EQU 8 SET IF OK TO READ W/O ATTACH
  4671.  
  4672. * DEFINE TABLE OF PRIMARY OPTION ATTRIBUTES.
  4673.  
  4674. ATTRTAB BSS 0
  4675.  
  4676. VFD 1/0,1/1,1/0,1/0,1/0,1/0,1/0,1/1 ATTACH
  4677. VFD 16/0,18/0,18/MF.ATT
  4678.  
  4679. VFD 1/0,1/0,1/0,1/0,1/0,1/0,1/0,1/1 DETACH
  4680. VFD 16/0,18/0,18/MF.DET
  4681.  
  4682. VFD 1/0,1/0,1/0,1/0,1/0,1/0,1/0,1/1 CHECK
  4683. VFD 16/0,18/0,18/MF.ATT
  4684.  
  4685. VFD 1/1,1/0,1/0,1/0,1/0,1/0,1/0,1/1 READ
  4686. VFD 1/1,15/0,18/1,18/MF.READ
  4687.  
  4688. VFD 1/1,1/0,1/0,1/0,1/0,1/0,1/0,1/1 WRITE
  4689. VFD 16/0,18/2,18/MF.WRITE
  4690.  
  4691. VFD 1/0,1/0,1/1,1/1,1/0,1/1,1/1,1/0 CREATE
  4692. VFD 16/0,18/0,18/MF.CREAT
  4693.  
  4694. VFD 1/0,1/0,1/0,1/0,1/0,1/0,1/0,1/1 DESTROY
  4695. VFD 16/0,18/0,18/MF.DESTR
  4696.  
  4697. VFD 1/0,1/0,1/0,1/0,1/1,1/0,1/0,1/0 RENAME
  4698. VFD 16/0,18/0,18/MF.RENAM
  4699.  
  4700. VFD 1/0,1/0,1/1,1/0,1/0,1/0,1/0,1/1 RETYPE
  4701. VFD 16/0,18/0,18/MF.CHANG
  4702.  
  4703. VFD 1/0,1/0,1/0,1/0,1/0,1/0,1/0,1/0 FBIT
  4704. VFD 16/0,18/0,18/0
  4705.  
  4706. VFD 1/0,1/0,1/1,1/1,1/0,1/1,1/1,1/1 RECREATE
  4707. VFD 16/0,18/0,18/MF.RECRE
  4708. .MDS ENDIF
  4709.  
  4710. * FUNCTION CODES FOR THE VARIOUS -SYSFILE- OPTIONS.
  4711.  
  4712. F.ATTACH EQU 0 ATTACH FILE
  4713. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  4714. F.DETACH EQU 1 DETACH FILE
  4715. F.CHECK EQU 2 SEE IF FILE EXISTS
  4716. F.READ EQU 3 READ FILE
  4717. F.WRITE EQU 4 WRITE FILE
  4718. F.CREATE EQU 5 CREATE FILE
  4719. F.DEST EQU 6 DESTROY FILE
  4720. F.RENAME EQU 7 CHANGE FILE NAME
  4721. F.RETYPE EQU 8 CHANGE FILE TYPE
  4722. F.FBIT EQU 9 SET/CLEAR BACKUP BIT
  4723. .MDS IFEQ *F,1
  4724. F.RECRE EQU 10 RECREATE FILE
  4725.  
  4726.  
  4727. * DEFINE TABLE USED TO CONVERT *MS.FILE* ERROR
  4728. * CODES TO -SYSFILE- *ZRETURN* CODES.
  4729.  
  4730. CONVTAB BSS 0
  4731. CONV HERE
  4732. DATA 0 MARK END OF TABLE
  4733. .MDS ENDIF
  4734.  
  4735. * DATA DEFINITIONS
  4736.  
  4737. NUMARGS OVDATA TOTAL NUMBER OF ARGUMENTS
  4738. ARGSDONE OVDATA NUMBER OF ARGUMENTS PROCESSED
  4739.  
  4740. * THE FOLLOWING FIELDS REQUIRE 60 BITS EACH WHEN
  4741. * THEY ARE SAVED OVER INTERRUPTS.
  4742.  
  4743. SAVE60 OVDATA 0 START OF 60-BIT FIELDS
  4744.  
  4745. FILE OVDATA FILE NAME
  4746. ACCT OVDATA ACCOUNT NAME
  4747. NFILE OVDATA NEW FILE NAME
  4748. NACCT OVDATA NEW ACCOUNT NAME
  4749. PACK OVDATA PACK NAME
  4750. DIRECT OVDATA DIRECTORY NAME
  4751. SUBACCT OVDATA SUB-ACCOUNT IDENTIFIER
  4752. ACCTRES OVDATA ACCOUNT OF RESIDENCE IDENT.
  4753.  
  4754. * THE FOLLOWING FIELDS REQUIRE 18 BITS EACH WHEN
  4755. * THEY ARE SAVED OVER INTERRUPTS.
  4756.  
  4757. SAVE18 OVDATA 0 START OF 18-BIT FIELDS
  4758.  
  4759. FIPSAVE OVDATA ADDRESS OF FIP
  4760. TYPSAVE OVDATA PRIMARY KEYWORD OPTION
  4761. OLDPACK OVDATA -1 IF PACK FOR OLD DISK SYSTEM
  4762. PINNED OVDATA -1 IF STORAGE PINNED, 0 IF NOT
  4763. SMCODE OVDATA STATION/MASTER DETACH FLAG
  4764. F.TYP OVDATA FILE TYPE
  4765. F.LTH OVDATA FILE LENGTH
  4766. F.DIR OVDATA SIZE OF DIRECTORY (SECTORS)
  4767. F.RMT OVDATA SIZE/16 OF RMT (WORDS)
  4768. NPDWRIT OVDATA ZERO TO CHECKPT PACK DIRECTORY
  4769. START OVDATA STARTING SECTOR
  4770. STORAGE OVDATA STORAGE INDEX
  4771. NUMBER OVDATA NUMBER OF SECTORS
  4772. MSGADDR OVDATA ADDRESS OF USER MESSAGE BUFFER
  4773. NEWFBIT OVDATA NEW BACKUP BIT
  4774. RJSAVE OVDATA -RJ- ADDRESS FOR *NEWSRCH*
  4775. RJSAVE1 OVDATA -RJ- ADDRESS FOR *SEARCHED*
  4776. ATTRIBS OVDATA ATTRIBUTE BITS
  4777.  
  4778. SAVEND OVDATA 0 END OF FIELDS TO BE SAVED
  4779.  
  4780. OVD RMT MUST BE ASSEMBLED W/OVDATA DEFS
  4781.  
  4782. * THE OVERFLOW CHECK BELOW USES *TINTSVL-1* AS THE
  4783. * MAXIMUM LENGTH AVAILABLE BECAUSE *TBINTSV+15* IS
  4784. * USED BY *REQCHK*.
  4785.  
  4786. SAVE60L EQU SAVE18-SAVE60 60-BIT FIELDS TO SAVE
  4787. TSAV18L SET SAVEND-SAVE18+2
  4788. * /--- BLOCK SYSFILE 00 000 79/10/28 01.18
  4789. TSAV18L SET TSAV18L/3 WORDS NEEDED FOR 18-BIT FIELDS
  4790. ERRNG TINTSVL-1-SAVE60L-TSAV18L OVERFLOW CHECK
  4791. ERRNZ TINTSVL-1-15 *TBINTSV+15* MUST BE LAST
  4792. TSAV18L SET SAVEND-SAVE18 RESET TO NO OF 18-BIT FIELDS
  4793. *
  4794. * THE FOLLOWING -EQU- IS NEEDED BECAUSE COMPASS NO
  4795. * LONGER RETAINS THE LAST VALUE OF THE -SET- PSEUDO
  4796. * BETWEEN PASSES 1 AND 2. THIS WOULD THEN CAUSE
  4797. * SYMBOL *SAVE18L* TO BE UNDEFINED AS IT IS
  4798. * REFERENCED BEFORE IT IS -SET- TO A VALUE.
  4799. *
  4800. * KUBAT 82/02/17
  4801. *
  4802. SAVE18L EQU TSAV18L
  4803.  
  4804. RMT
  4805.  
  4806. * PARAMETERS EXPECTED BY -CREATE-
  4807.  
  4808. QUAL CREATE
  4809.  
  4810. FILE EQU TBINTSV FILE NAME
  4811. INFO EQU TBINTSV+1 SPACE ALLOCATION REQUEST
  4812. CHECKPT EQU TBINTSV+2 NEG. IF NOT TO RETURN PACK DIR.
  4813. FIPADDR EQU TBINTSV+3 ADDRESS OF FIP
  4814.  
  4815. QUAL *
  4816.  
  4817. * PARAMETERS EXPECTED BY -DESTROY-
  4818.  
  4819. QUAL DESTROY
  4820.  
  4821. FILE EQU TBINTSV NAME OF FILE TO DESTROY
  4822. FIPADDR EQU TBINTSV+3 ADDRESS OF FIP
  4823.  
  4824. QUAL *
  4825.  
  4826. * PARAMETERS EXPECTED BY -RENAMEF-
  4827.  
  4828. QUAL RENAME
  4829.  
  4830. FILE EQU TBINTSV FILE NAME
  4831. NFILE EQU TBINTSV+1 DESIRED NEW FILE NAME
  4832. FLAG EQU TBINTSV+2 0 FOR -RENAMEF-
  4833. FIPADDR EQU TBINTSV+3 ADDRESS OF FIP
  4834.  
  4835. QUAL *
  4836.  
  4837. * PARAMETERS EXPECTED BY -RETYPEF-
  4838.  
  4839. QUAL RETYPE
  4840.  
  4841. FILE EQU TBINTSV FILE NAME
  4842. TYPE EQU TBINTSV+1 NEW FILE TYPE
  4843. FLAG EQU TBINTSV+2 -1 FOR -RETYPEF-
  4844. FIPADDR EQU TBINTSV+3 ADDRESS OF FIP
  4845.  
  4846. QUAL *
  4847.  
  4848. * PARAMETERS EXPECTED BY -FBIT-
  4849.  
  4850. QUAL FBIT
  4851.  
  4852. FILE EQU TBINTSV
  4853. NEWFBIT EQU TBINTSV+1
  4854. FIPADDR EQU TBINTSV+3
  4855.  
  4856. QUAL *
  4857.  
  4858. ENDOV
  4859. * /--- BLOCK FIPS 00 000 80/11/26 15.00
  4860. EJECT
  4861.  
  4862. TITLE FIP CONVERSIONS
  4863.  
  4864.  
  4865. ** FIELD - MOVE BIT FIELD BETWEEN REGISTERS
  4866. *
  4867. * FIELD OW,OAS,OR,NLS,NR
  4868. *
  4869. * ENTRY (OW) = WIDTH OF OLD FIELD
  4870. * (OAS) = SHIFT TO RIGHT-JUSTIFY OLD FIELD
  4871. * (OR) = X-REGISTER CONTAINING OLD FIELD
  4872. * (NOT 0 OR 4)
  4873. * (NLS) = LEFT SHIFT TO POSITION NEW FIELD
  4874. * (NR) = X-REGISTER TO CONTAIN NEW FIELD
  4875. * (NOT 0 OR 4)
  4876. *
  4877. * USES A - NONE.
  4878. * B - 4.
  4879. * X - 0, 4.
  4880. *
  4881.  
  4882. PURGMAC FIELD
  4883.  
  4884. MACREF FIELD$
  4885. FIELD MACRO OW,OAS,OR,NLS,NR
  4886. .0 IFNE OAS,0
  4887. SB4 OAS (B4) = SHIFT TO RIGHT-JUSTIFY
  4888. .0 ELSE
  4889. SB4 B0
  4890. .0 ENDIF
  4891. AX4 OR,B4 RIGHT-JUSTFY FIELD IN X4
  4892. MX0 -OW
  4893. BX4 -X0*X4 (X4) = DESIRED FIELD
  4894. .1 IFNE NLS,0
  4895. LX4 NLS SHIFT TO NEW POSITION
  4896. .1 ENDIF
  4897. B_NR X4+NR MERGE
  4898. ENDM
  4899.  
  4900.  
  4901. * /--- BLOCK FIPS 00 000 80/11/26 15.00
  4902. EJECT
  4903.  
  4904. ** NEWFIPV - CONVERT OLD FORMAT FIP TO NEW FORMAT
  4905. *
  4906. * ENTRY (OVARG1) = ADDRESS OF OLD FIP
  4907. * (OVARG2) = ADDRESS OF NEW FIP
  4908. *
  4909.  
  4910. NEWFIPV OVRLAY
  4911.  
  4912. SA1 OVARG1
  4913. SA2 OVARG2
  4914. SB1 X1 (B1) = ADDR. OF OLD FIP
  4915. SB2 X2 (B2) = ADDR. OF NEW FIP
  4916.  
  4917. SA1 B1+0 (X1) = FILE NAME
  4918. SA2 B1+1 (X2) = PACK NAME
  4919. BX6 X1
  4920. BX7 X2
  4921. SA6 B2+/FIP/FILE
  4922. SA7 B2+/FIP/DIR
  4923.  
  4924. SA1 B1+2
  4925. SA2 B1+3
  4926.  
  4927. SX6 MA.READ PRESET TO R/O ACCESS
  4928. PL X1,NEWFIP1 --- IF R/O ACCESS
  4929. SX6 MA.RW RESET TO R/W ACCESS
  4930. NEWFIP1 LX6 /MFF/S.ATTACH
  4931.  
  4932. SX4 1 SET OLD DISK SYSTEM FLAG
  4933. LX4 /MFF/S.OLD
  4934. BX6 X4+X6
  4935.  
  4936. FIELD 11,48,X2,/MFF/S.STATN,X6
  4937. FIELD 1,59,X2,/MFF/S.FBIT,X6
  4938. FIELD 1,58,X1,/MFF/S.FILEF,X6
  4939. FIELD 18,0,X1,/MFF/S.AFT,X6
  4940.  
  4941. SA6 B2+/FIP/MFF STORE MISC. FIP FIELDS
  4942.  
  4943. MX6 0
  4944.  
  4945. FIELD 6,30,X2,/FAW/S.FTYPE,X6
  4946.  
  4947. SA6 B2+/FIP/FAW STORE FILE ATTRIBUTE WORD
  4948.  
  4949. MX6 0
  4950.  
  4951. FIELD 6,36,X2,/FIW/S.NDIR,X6
  4952. FIELD 6,42,X2,/FIW/S.RMTS,X6
  4953. FIELD 6,24,X2,/FIW/S.SIZE,X6
  4954. FIELD 9,18,X1,/FIW/S.PACK,X6
  4955. FIELD 18,0,X2,/FIW/S.ALLOC,X6
  4956.  
  4957. SA6 B2+/FIP/FIW STORE FILE INFORMATION WORD
  4958.  
  4959. RETURN
  4960.  
  4961. ENDOV
  4962.  
  4963. * /--- BLOCK FIPS 00 000 80/11/26 15.13
  4964. EJECT
  4965.  
  4966. ** OLDFIPV - CONVERT NEW FORMAT FIP TO OLD FORMAT
  4967. *
  4968. * ENTRY (OVARG1) = ADDRESS OF NEW FIP
  4969. * (OVARG2) = ADDRESS OF OLD FIP
  4970. *
  4971.  
  4972. OLDFIPV OVRLAY
  4973.  
  4974. SA1 OVARG1
  4975. SA2 OVARG2
  4976. SB1 X1 (B1) = ADDRESS OF NEW FIP
  4977. SB2 X2 (B2) = ADDRESS OF OLD FIP
  4978.  
  4979. SA1 B1+/FIP/FILE (X1) = FILE NAME
  4980. SA2 B1+/FIP/DIR (X2) = PACK NAME
  4981. BX6 X1
  4982. BX7 X2
  4983. SA6 B2+0
  4984. SA7 B2+1
  4985.  
  4986. SX6 0 CLEAR UNUSED WORD
  4987. SA6 B2+4
  4988.  
  4989. RJ =XZFILACC (X1) = -1 IF R/W, 0 IF R/O
  4990. MX6 1 (X6) = MASK FOR ACCESS MODE
  4991. BX6 X6*X1 (X6) = 1/ACCESS MODE, 59/0
  4992.  
  4993. SA1 B1+/FIP/MFF (X1) = MISC. FIP FIELDS
  4994. SA2 B1+/FIP/FIW (X2) = FILE INFORMATION WORD
  4995. SA3 B1+/FIP/FAW (X3) = FILE ATTRIBUTE WORD
  4996.  
  4997. FIELD 1,/MFF/S.FILEF,X1,58,X6
  4998. FIELD 9,/FIW/S.PACK,X2,18,X6
  4999. FIELD 18,/MFF/S.AFT,X1,0,X6
  5000.  
  5001. SA6 B2+2 STORE MISC. GARBAGE
  5002.  
  5003. MX6 0
  5004.  
  5005. FIELD 1,/MFF/S.FBIT,X1,59,X6
  5006. FIELD 11,/MFF/S.STATN,X1,48,X6
  5007. FIELD 6,/FIW/S.RMTS,X2,42,X6
  5008. FIELD 6,/FIW/S.NDIR,X2,36,X6
  5009. FIELD 6,/FAW/S.FTYPE,X3,30,X6
  5010. FIELD 6,/FIW/S.SIZE,X2,24,X6
  5011. FIELD 18,/FIW/S.ALLOC,X2,0,X6
  5012.  
  5013. SA6 B2+3 STORE FIW
  5014.  
  5015. RETURN
  5016.  
  5017. ENDOV
  5018.  
  5019. * /--- BLOCK SYSLOC 00 000 80/11/26 15.13
  5020. TITLE -SYSLOC- COMMAND EXECUTION OVERLAY
  5021. * -SYSLOC- (CODE=182)
  5022. *
  5023. * RETURNS ADDRESS OF SYSTEM NAME
  5024. *
  5025. *
  5026.  
  5027. SYSLOCV OVRLAY
  5028.  
  5029. NGETVAR (X1) = SYSTEM NAME TO FIND
  5030. CALL LJUST,(1R ),0
  5031. MX6 -1 MARK INFO BUFFER USED
  5032. SA6 JJSTORE
  5033. SA2 ASYSLST ADDRESS OF SYSTEM NAME TABLE
  5034. BX0 X2
  5035. SA4 NSYSNAM LENGTH OF TABLE
  5036. SNREAD SB1 X4 SET LENGTH TO READ
  5037. SA0 INFO READ TABLE TO INFO BUFFER
  5038. SB2 INFOLTH LENGTH OF INFO BUFFER
  5039. LE B1,B2,SYSLOX1 --- IF EVERYTHING FITS
  5040. SB1 B2 DON'7T READ MORE THAN FITS
  5041. SYSLOX1 RE B1
  5042. RJ ECSPRTY
  5043. MX7 42 MASK FOR NAME PORTION
  5044. SA2 A0 GET FIRST ENTRY
  5045. EQ SNL1
  5046. *
  5047. SNLOOK SA2 A2+1 LOAD NEXT NAME
  5048. SB2 INFO+INFOLTH END OF BUFFER
  5049. SB2 A2-B2 TEST FOR END OF BUFFER
  5050. GE B2,SNNEXT PAST END - READ NEXT BUFFER
  5051. ZR X2,SYSNOT EXIT IF NAME NOT FOUND
  5052. SNL1 BX3 X7*X2 GET NAME ONLY
  5053. BX3 X1-X3 ...AND CHECK IF ITS THE ONE
  5054. NZ X3,SNLOOK KEEP LOOKING
  5055. SX6 X2 MASK OFF ADDRESS
  5056. SA6 SSLOC SAVE ADDRESS OF VARIABLE
  5057. SA5 A5
  5058. LX5 XCODEL
  5059. NGETVAR GET SECOND VARIABLE
  5060. SA2 SSLOC
  5061. BX6 X2 STORE ADDRESS IN 2ND VAR
  5062. SA6 A1
  5063. SX6 0 *ERROR* = 0 IF ALL OK
  5064. SX7 -1 *ZRETURN* = -1
  5065. SYSLEX SA6 TERROR
  5066. SA7 TRETURN
  5067. EQ PROCESS --- EXIT TO NEXT COMMAND
  5068.  
  5069. SYSNOT MX6 -1 *ERROR* = -1 IF ERROR
  5070. MX7 0 *ZRETURN* = 0 IF ERROR
  5071. EQ SYSLEX
  5072. *
  5073. SNNEXT SX3 INFOLTH BUFFER LENGTH
  5074. IX4 X4-X3 TOTAL AMOUNT LEFT
  5075. ZR X4,SYSNOT --- IF NOTHING LEFT
  5076. NG X4,SYSNOT --- IF LESS THAN NOTHING LEFT
  5077. IX0 X0+X3 ADVANCE ECS ADDRESS
  5078. EQ SNREAD READ NEXT BUFFER
  5079.  
  5080. SSLOC OVDATA ADDRESS OF VARIABLE
  5081.  
  5082. ENDOV
  5083. * /--- BLOCK DSKCOV 00 000 80/12/02 03.45
  5084. TITLE DISK COMMANDS
  5085. *
  5086. *
  5087. *
  5088. DSKCOV OVRLAY
  5089. SA1 OVARG1
  5090. SB1 X1 GET JUMP TABLE INDEX
  5091. JP B1+*+1
  5092. *
  5093. + EQ * 0 = UNUSED
  5094. + EQ RENAMFX 1 = -RENAMEF- COMMAND
  5095. + EQ RETYPFX 2 = -RETYPEF- COMMAND
  5096. + EQ RENAME1 3 = -SYSFILE- COMMAND RENAME
  5097. *
  5098. *
  5099. * /--- BLOCK RENAMEF 00 000 80/12/02 03.31
  5100. TITLE -RENAMEF- AND -RETYPEF- TUTOR COMMANDS
  5101. *
  5102. *
  5103. * RENAMEF
  5104. *
  5105. * THE 1ST ARGUMENT SPECIFIES THE CURRENT NAME
  5106. * OF THE FILE AND THE 2ND ARGUMENT SPECIFIES THE
  5107. * NEW NAME FOR THE FILE. THE DISK UNIT AND PACK
  5108. * NAME ARE ASSUMED TO BE IN *TDISKU* AND *TPNAME*.
  5109. * THE ECS FILE NAME AND INFO TABLES ARE CHANGED
  5110. * AND THE PACK DIRECTORY IS THEN WRITTEN BACK ON
  5111. * THE DISK.
  5112. *
  5113. * ON EXIT, *TERROR* IS SET AS FOLLOWS--
  5114. * -1 = FILE RENAMED SUCCESSFULLY
  5115. * 0 = ERROR--PACK NAME (NO LONGER LOADED)
  5116. * 1 = ERROR--OLD FILE NAME (NOT ON PACK)
  5117. * 2 = ERROR--NEW FILE NAME (ALREADY EXISTS)
  5118. * 3 = ERROR--NEW FILE NAME (IMPROPER NAME)
  5119. *
  5120. *
  5121. * RETYPEF
  5122. *
  5123. * FIRST ARGUMENT IS FILE NAME TO BE RETYPED.
  5124. * SECOND ARGUMENT IS NEW FILE TYPE. MOST CODE
  5125. * SHARED WITH RENAMEF, ERROR RETURNS THE SAME
  5126. * EXCEPT ERROR = 2 MEANS BAD FILE TYPE
  5127. *
  5128. *
  5129. *
  5130. RETYPFX MX6 -1 SET FLAG FOR -RETYPEF-
  5131. EQ RENATYP JUMP TO COMMON ROUTINES
  5132. *
  5133. RENAMFX MX6 0 SET FLAG FOR -RENAMEF-
  5134. RENATYP SA6 TBINTSV+2 STORE FLAG
  5135. NGETVAR X1 = OLD FILE NAME
  5136. BX6 X1
  5137. SA6 TBINTSV
  5138. SA5 A5 RETRIEVE ORIGINAL COMMAND WORD
  5139. LX5 XCODEL
  5140. NGETVAR X1 = NEW FILE NAME OR FILE TYPE
  5141. BX6 X1
  5142. SA6 TBINTSV+1
  5143. *
  5144. RENAME1 BSS 0
  5145. SA1 TDISKU
  5146. NG X1,RERR0 NO SETPACK IN EFFECT
  5147. SA2 PTYPES+X1 PACK TYPE
  5148. SA3 PDTYPES+3 BINARY
  5149. BX3 X2-X3
  5150. ZR X3,RERR0 ERROR EXIT IF BINARY PACK
  5151. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  5152. CALL SAVKEY
  5153. *
  5154. QUEUE ADCTQUE,DACT WAIT IN *DACT* QUEUE
  5155. *
  5156. * /--- BLOCK RENAMEF 00 000 80/12/02 03.30
  5157. *
  5158. * INFORM *MASTOR* OF PENDING PACK DIRECTORY CHANGE
  5159. *
  5160. INTLOK X,I.DDIR,W INTERLOCK DISK DIRECTORIES
  5161. CALL S=UDSKR READ DISK SYSTEM PARAMETERS
  5162. SA1 TDISKU
  5163. MX6 1
  5164. SA1 X1+PKSTS SET BIT IN PACK STATUS TABLE TO
  5165. BX6 X1+X6 MARK DIRECTORY CHANGE PENDING
  5166. SA6 A1
  5167. CALL S=UDSKW WRITE DISK SYSTEM PARAMETERS
  5168. INTCLR X,I.DDIR
  5169. CALL S=UDSK,STATION UPDATE DISK STATUS TABLES
  5170. *
  5171. REN120 TUTIM -1,,IOKEY WAIT REQUEST COMPLETE
  5172. SA1 KEY
  5173. SX1 X1-IOKEY CHECK *KEY* = *IOKEY*
  5174. NZ X1,REN120
  5175. *
  5176. CALL MXDSKW FORCE OTHER EXECUTOR TO RECALL
  5177. *
  5178. * EXECUTE DISK FILE RENAME OVERLAY.
  5179. *
  5180. SA1 TBINTSV SET UP OVERLAY ARGUMENTS
  5181. SA2 TBINTSV+1
  5182. BX6 X1
  5183. BX7 X2
  5184. SA6 OVARG1
  5185. SA7 OVARG2
  5186. CALL S=UDSKR READ DISK SYSTEM PARAMETERS
  5187. *
  5188. SA1 TBINTSV+2 GET RENAMEF/RETYPEF FLAG
  5189. NG X1,RETYP2 EXEC DIFF OVERLAYS DEP. ON FLAG
  5190. *
  5191. X RENAMOV -RENAMEF-
  5192. SA1 TBINTSV+1 (X1) = NEW FILE NAME
  5193. BX6 X1
  5194. SA6 TBINTSV OVERWRITE ORIGINAL NAME
  5195. EQ RENATY2
  5196. *
  5197. RETYP2 X RETYPOV -RETYPEF-
  5198. *
  5199. RENATY2 SA1 TDISKU GET DISK UNIT NUMBER
  5200. MX6 1
  5201. SA1 X1+PKSTS CLEAR DIRECTORY CHANGE BIT
  5202. BX6 -X6*X1
  5203. SA6 A1
  5204. CALL S=UDSKW WRITE DISK SYSTEM PARAMETERS
  5205. CALL MXDSKC RELEASE OTHER EXECUTOR
  5206. CALL S=UDSK,0 INFORM *MASTOR*
  5207. SA1 TERROR
  5208. NG X1,PDWRITE OK -- WRITE PACK DIRECTORY
  5209. MX6 0 CLEAR *DACT*
  5210. SA6 DACT
  5211. REPLAX DACT
  5212. CALL RESTKEY
  5213. EQ RETPROC TO PROCESS IF ERROR
  5214. *
  5215. RERR0 SX6 0 BAD PACK
  5216. SA6 TERROR
  5217. SX6 3
  5218. SA6 TRETURN ALSO SET *ZRETURN*
  5219. EQ PROCESS ERROR RETURN
  5220. *
  5221. ENDOV
  5222. *
  5223. *
  5224. * /--- BLOCK NETIO 00 000 78/08/11 21.56
  5225. TITLE PLATO NETWORK REQUEST PROCESSING
  5226. *
  5227. * NETIOV
  5228. *
  5229. * NETIO REQUEST,RESPONSE (CODE = 107)
  5230. *
  5231. * REQUEST - 2 WORD REQUEST PACKED FOR -PLF-
  5232. * RESPONSE - 2 WORD RESPONSE AREA FOR -PLF- RESPONSE
  5233. *
  5234. *
  5235. * REQUEST PACKET FROM LESSON (E.G. LINKCTL)
  5236. * WORD 1 - 04/UNUSED
  5237. * 01/NETWORK TYPE(0=DOELZ, 1=3266)
  5238. * 01/UNUSED
  5239. * 02/EOM(0=EOD, 1=EOB, 2=EOF)
  5240. * 04/UNUSED
  5241. * 12/UNUSED
  5242. * 12/UNUSED
  5243. * 12/NET ADDRESS (IF APPLICABLE)
  5244. * 12/REQUEST CODE
  5245. * WORD 2 - ESTABLISH LINK REQUEST
  5246. * 4/NUMBER OF CALL PARAMETERS
  5247. * 56/UP TO EIGHT 7 BIT CALL PARAMETERS
  5248. * WORD 2 - STORAGE ASSOCIATED REQUESTS
  5249. * 12/LENGTH OF STORAGE
  5250. * 12/NUMBER OF WORDS OF STORAGE USED
  5251. * 12/UNUSED
  5252. * 24/RELATIVE STORAGE ADDRESS
  5253. *
  5254. * REQUEST PACKET SENT TO -PLF-
  5255. * WORD 1 - 04/UNUSED
  5256. * 01/NETWORK TYPE(0=DOELZ, 1=3266)
  5257. * 01/UNUSED
  5258. * 02/EOM (EOF, EOB, EOD)
  5259. * 04/EXECUTOR NUMBER
  5260. * 12/LESSON STATION NUMBER
  5261. * 12/NUMBER OF CM WORDS IN REQUEST
  5262. * 12/NET ADDRESS (IF APPLICABLE)
  5263. * 12/REQUEST CODE
  5264. * WORD 2 - ESTABLISH LINK REQUEST
  5265. * 4/NUMBER OF CALL PARAMETERS
  5266. * 56/UP TO EIGHT 7 BIT CALL PARAMETERS
  5267. * WORD 2 - STORAGE ASSOCIATED REQUESTS
  5268. * 12/LENGTH OF STORAGE
  5269. * 12/NUMBER OF WORDS OF STORAGE USED
  5270. * 12/UNUSED
  5271. * 24/ABSOLUTE STORAGE ADDRESS
  5272. *
  5273. * /--- BLOCK NETIO 00 000 78/08/06 22.40
  5274. *
  5275. * TWO WORD RESPONSE PACKET RETURNED BY -PLF-, THEN
  5276. * RETURNED IN -RESPONSE- TO LESSON.
  5277. * WORD 1 - 04/UNUSED
  5278. * 01/NETWORK TYPE(0=DOELZ, 1=3266)
  5279. * 01/UNUSED
  5280. * 02/EOM (0=EOD, 1=EOB, 2=EOF)
  5281. * 04/EXECUTOR NUMBER
  5282. * 12/LESSON STATION NUMBER
  5283. * 12/NUMBER OF CM WORDS IN RESPONSE
  5284. * 12/NET ADDRESS (IF APPLICABLE)
  5285. * 12/RESPONSE CODE
  5286. * WORD 2 - ERROR RESPONSE
  5287. * 60/ERROR TYPE
  5288. * WORD 2 - STORAGE ASSOCIATED RESPONSE
  5289. * 12/LENGTH OF STORAGE
  5290. * 12/LENGTH OF MESSAGE
  5291. * 12/UNUSED
  5292. * 24/ABSOLUTE STORAGE ADDRESS
  5293. *
  5294. *
  5295. REQC EQU TBINTSV+9 REQUEST CODE
  5296. BORDSV EQU TBINTSV+10 FIXED BUFFER ORDINAL
  5297. LSTORSV EQU TBINTSV+11 LESSON STORAGE FWA
  5298. NETSTOP EQU TBINTSV+12 1 IF DROP LINK SENT TO PLF
  5299. * BECAUSE TIMEOUT OCCURRED OR
  5300. * STOP1 WAS PRESSED, OTHERWISE
  5301. * SET TO ZERO
  5302. RPSAV EQU TBINTSV+13 SAVE -RESPONSE- ADDRESS
  5303. STORSAV EQU TBINTSV+14 STORAGE ASSOCIATED FLAG
  5304. PLFTIM EQU TBINTSV+15 -PLF- ALIVE TIMER
  5305. * /--- BLOCK NETIO 00 000 78/07/13 22.31
  5306. NETIOV OVRLAY
  5307. *
  5308. * * * INITIALIZE STORAGE FLAG TO NO STORAGE
  5309. MX6 0
  5310. SA6 STORSAV
  5311. *
  5312. * * * SET TO NO -STOP1- RECEIVED
  5313. SA6 NETSTOP
  5314. *
  5315. * * * SAVE THE CURRENT KEY
  5316. SA1 KEY
  5317. BX6 X1
  5318. SA6 TOKEY
  5319. *
  5320. * * * GET ADDRESS OF REQUEST
  5321. NGETVAR
  5322. *
  5323. * * * MAKE SURE ALL WORDS ARE IN BOUNDS
  5324. SA0 A1
  5325. SX1 PTSIZE LENGTH OF NETWORK REQUEST
  5326. RJ =XBOUNDS
  5327. *
  5328. * * * MOVE REQUEST PACKET TO WORK VARIABLES
  5329. SA1 A1
  5330. BX6 X1
  5331. SA6 NETRQ WORD 1
  5332. SA1 A1+1
  5333. BX6 X1
  5334. SA6 NETRQ+1 WORD 2
  5335. *
  5336. * * * GET -RESPONSE- ADDRESS
  5337. SA5 A5
  5338. LX5 XCODEL
  5339. NGETVAR
  5340. *
  5341. * * * MAKE SURE -RESPONSE- IS IN BOUNDS
  5342. SA0 A1
  5343. SX1 PFSIZE LENGTH OF NETWORK RESPONSE
  5344. RJ =XBOUNDS
  5345. *
  5346. * * * SAVE -RESPONSE- ADDRESS IN STUDENT BANK
  5347. SX6 A1
  5348. SA6 RPSAV
  5349. * /--- BLOCK NETIO 00 000 79/01/30 14.57
  5350.  
  5351. * SAVE COMMON AND STORAGE INFO.
  5352.  
  5353. CALL SAVLES
  5354.  
  5355. * TEST IF DOELZ NETWORK SUPPORTED.
  5356.  
  5357. SX0 =XPLF
  5358. ZR X0,NIOE8 IF NOT SUPPORTED
  5359. *
  5360. * * * ISOLATE REQUEST CODE
  5361. MX0 -RRCM
  5362. SA1 NETRQ
  5363. BX7 -X0*X1
  5364. *
  5365. * * * MAKE SURE REQUEST IS IN RANGE
  5366. SX1 X7-MAXRQ1-1
  5367. PL X1,NIOE1 JUMP IF BAD REQUEST NUMBER
  5368. *
  5369. * * * PROCESS WORD 2 OF REQUEST IF NECESSARY
  5370. SB2 X7
  5371. SA7 REQC SAVE REQUEST CODE
  5372. JP B2+NETTB
  5373. *
  5374. * * * JUMP DEPENDING ON WHETHER REQUEST HAS
  5375. * * * ASSOCIATED STORAGE. THE -JPTAB- MACRO
  5376. * * * IS DEFINED IN -NETTEXT-.
  5377. *
  5378. NETTB JPTAB JUMP TABLE
  5379. JPTAB 0,NIOE1 NEVER USED
  5380. JPTAB IATSIM,NIOS INTERACTIVE TRUNK SIMULATION
  5381. JPTAB ESTSIM,NIONS ESTABLISH SIMULATION LINK
  5382. JPTAB SWRITE,NIOS SELECTIVE WRITE
  5383. JPTAB DLDL,NIONS
  5384. JPTAB CBST,NIOS CIRCULAR BUFFER STATISTICS
  5385. JPTAB ENDP,NIONS END -PLF-
  5386. JPTAB DIAG,NIOS DIAGNOSTIC REQUEST
  5387. JPTAB DISP,NIONS SET DISPLAY WINDOW
  5388. JPTAB ESTT,NIONS ESTABLISH TERMINAL LINK
  5389. JPTAB RNWA,NIONS RESERVE NETWORK ADDRESS
  5390. JPTAB LDSIM,NIONS LOCAL DISTRIBUTION SIMULATOR
  5391. JPTAB PLFSTS,NIOS PLF STATISTICS
  5392. JPTAB HHLBA,NIOS HOST TO HOST LOOPBACK
  5393. JPTAB ESTI,NIONS ESTABLISH LINK (IA)
  5394. JPTAB ESTLB,NIONS ESTABLISH LINK (LOOP)
  5395. JPTAB IAP,NIONS INTERACTIVE LINK PAUSE
  5396. JPTAB APTS,NIOS PERMISSION TO SEND
  5397. JPTAB ADRPL,NIONS DROP LINK
  5398. JPTAB ESTR,NIONS ESTABLISH RUNNER STATION
  5399. JPTAB DRR,NIONS DROP RUNNER STATION
  5400. JPTAB SREAD,NIOS SELECTIVE READ
  5401. JPTAB ESTD,NIONS ESTABLISH DATA LINK
  5402. JPTAB SENDD,NIOS SEND DATA
  5403. JPTAB SNAME,NIOS GET SYSTEM NAME
  5404. JPTAB ESTNAM,NIOS NODE AVAILABLE MESSAGES
  5405. JPTAB TPLFS,NIOS TEST - STORAGE
  5406. JPTAB TPLFNS,NIONS TEST - NO STORAGE
  5407. JPTAB MAXRQ1 END OF JUMP TABLE
  5408. * /--- BLOCK NETIO 00 000 79/03/08 00.15
  5409. *
  5410. * * * GET STORAGE INFO FOR THIS STATION
  5411. NIOS SA1 TBXSTOR
  5412. RJ =XSETSTOR SET UP *STORWRD*
  5413. *
  5414. * * * GET STORAGE LENGTH FROM REQUEST
  5415. MX0 ECLM
  5416. SA1 NETRQ+1
  5417. BX3 X0*X1
  5418. LX3 ECLS
  5419. ZR X3,NIOE2 JUMP IF BAD STORAGE LENGTH
  5420. *
  5421. * * * GET STORAGE ADDRESS FROM REQUEST
  5422. MX0 -ECAM
  5423. BX2 -X0*X1
  5424. BX6 X0*X1 CLEAR OLD ECS ADDR. AND SAVE
  5425. SX4 1
  5426. IX2 X2-X4
  5427. NG X2,NIOE3 JUMP IF BAD STORAGE ADDRESS
  5428. *
  5429. * * * GET LENGTH OF STORAGE FOR THIS STATION
  5430. SA4 STORWRD
  5431. AX4 18 POSITION LENGTH TO BOTTOM
  5432. SX1 X4
  5433. *
  5434. * * * CHECK STORAGE BOUNDS
  5435. IX1 X1-X3 SUBTRACT STORAGE LENGTH
  5436. IX1 X1-X2 SUBTRACT STORAGE START
  5437. NG X1,NIOE4 JUMP IF OUT OF RANGE
  5438. *
  5439. * * * CALCULATE ABSOLUTE STORAGE ADDRESS
  5440. AX4 18 STARTING ADDR. FROM -STORWRD-
  5441. IX4 X4+X2
  5442. *
  5443. * * * MERGE WITH STORAGE LENGTH AND DATA LENGTH
  5444. BX6 X4+X6
  5445. SA6 NETRQ+1
  5446. *
  5447. * * * SET FLAG TO INDICATE STORAGE ASSOCIATED REQUEST
  5448. MX6 -1
  5449. SA6 STORSAV
  5450. *
  5451. * * * LOCK THE STORAGE
  5452. CALL IOLESSN,TBXSTOR,4000B
  5453. RJ NETIOF MOVE TO FIXED BUFFER
  5454. PL X6,NETIOX IF ERRORS
  5455.  
  5456. * SAVE PLF TIMER, FOR TIME OUT.
  5457.  
  5458. NIONS SA0 PLFTIM
  5459. SA1 APLFCLK
  5460. BX0 X1
  5461. RE 1
  5462. RJ ECSPRTY
  5463. *
  5464. * * * PUT NEW REQUEST INTO -TO PLF- BUFFER
  5465. SX6 NETRQ SET -PUTPLF- ARGUMENTS
  5466. SX7 PTSIZE
  5467. SA6 OVARG1
  5468. SA7 OVARG2
  5469. X PUTPLF CALL PUTPLF
  5470. SA1 OVRET1 PICK UP RETURN ARGUMENT
  5471. NG X1,NIOE5 JUMP IF NO ROOM
  5472. * /--- BLOCK NETIO 00 000 80/07/21 21.54
  5473. EQ NETIO3 WAIT FOR RESPONSE FROM PLF
  5474.  
  5475. * CHECK FOR PLF NOT RUNNING.
  5476.  
  5477. NETIO1 SA3 PLFTIM (X3) = LAST PLF TIME
  5478. SA0 A3
  5479. SA2 APLFCLK ECS ADDRESS OF PLF CLOCK
  5480. BX0 X2
  5481. RE 1 READ CURRENT VALUE OF CLOCK
  5482. RJ ECSPRTY
  5483. *
  5484. * * * COMPARE OLD AND NEW CLOCK VALUES.
  5485. SA2 A0
  5486. IX2 X2-X3
  5487. ZR X2,NIOE6 JUMP IF PLF IS NOT RUNNING.
  5488.  
  5489. * WAIT FOR RESPONSE FROM PLF.
  5490.  
  5491. NETIO3 TUTIM PLFPTL,,ANYKEY
  5492. CALL DETUTIM DELETE TUTIM TIMING REQUEST
  5493. *
  5494. SA1 KEY
  5495. SX2 X1-TUTUP
  5496. ZR X2,NETIO1 IF -TUTUP- TIMING KEY
  5497. SX2 X1-NETKEY CHECK FOR -NETKEY-
  5498. ZR X2,NIONK JUMP IF -NETKEY-
  5499. *
  5500. * * * CHECK FOR -STOP1- KEY.
  5501. * (X1) = CURRENT KEY.
  5502. SX2 X1-STOP1
  5503. NZ X2,NETIO3 IF NOT -STOP1- KEY
  5504. *
  5505. * * * HAS -STOP1- BEEN PRESSED BEFORE.
  5506. SA1 NETSTOP
  5507. NZ X1,NETIO3 IF -STOP1- ALREADY PRESSED
  5508. *
  5509. * * * SEND DROP LINK TO PLF.
  5510. SX6 NIODRPL SET -PUTPLF- ARGUMENTS
  5511. SX7 PTSIZE
  5512. SA6 OVARG1
  5513. SA7 OVARG2
  5514. X PUTPLF CALL PUTPLF
  5515. SA1 OVRET1 PICK UP RETURN ARGUMENT
  5516. NG X1,NETIO3 LOOP IF BUFFER FULL
  5517. *
  5518. * * * SET THE -STOP1- FLAG.
  5519. SX6 1
  5520. SA6 NETSTOP
  5521. EQ NETIO3 WAIT FOR RESPONSE FROM PLF
  5522.  
  5523. * MOVE RESPONSE TO LESSON RESPONSE WORDS.
  5524.  
  5525. NIONK SA1 RPSAV ADDRESS OF -RESPONSE-
  5526. SA2 NETRP FIRST WORD OF RESPONSE
  5527. BX7 X2
  5528. SA7 X1 STORE FIRST WORD
  5529. SA2 NETRP+1 SECOND WORD OF RESPONSE
  5530. BX6 X2
  5531. SA6 X1+1 STORE SECOND WORD
  5532.  
  5533. * TEST FOR -PLF- ERROR RESPONSE.
  5534.  
  5535. MX0 -RRCM
  5536. BX0 -X0*X7
  5537. SX0 X0-ERMC
  5538. ZR X0,NIOE7 IF -PLF- ERROR RESPONSE
  5539. *
  5540. * * * SET ERROR RETURN IF DROP LINK SENT
  5541. SA1 NETSTOP
  5542. NZ X1,NIOE6
  5543. *
  5544. * * * SET FOR NORMAL RETURN
  5545. MX6 -1
  5546. EQ NETIOX
  5547. * /--- BLOCK NETIO 00 000 78/10/27 13.48
  5548. *
  5549. * * * ERROR --REQUEST NUMBER OUT OF RANGE
  5550. NIOE1 BSS 0
  5551. SX6 1
  5552. EQ NETIOX
  5553. *
  5554. * * * ERROR -- STORAGE LENGTH IS ZERO
  5555. NIOE2 BSS 0
  5556. SX6 2
  5557. EQ NETIOX
  5558. *
  5559. * * * ERROR -- STORAGE ADDRESS IS ZERO
  5560. NIOE3 BSS 0
  5561. SX6 3
  5562. EQ NETIOX
  5563. *
  5564. * * * ERROR -- STORAGE OUT OF BOUNDS
  5565. NIOE4 BSS 0
  5566. SX6 4
  5567. EQ NETIOX
  5568. *
  5569. * * * ERROR -- PLF REQUEST BUFFER IS FULL
  5570. NIOE5 BSS 0
  5571. SX6 5
  5572. EQ NETIOX
  5573. *
  5574. * * * ERROR -- NO PLF RESPONSE
  5575. NIOE6 BSS 0
  5576. SX6 6
  5577. EQ NETIOX
  5578.  
  5579. * ERROR RESPONSE RECEIVED FROM -PLF-.
  5580.  
  5581. NIOE7 SX6 7
  5582. EQ NETIOX
  5583.  
  5584. * ERROR - DOELZ NETWORK NOT SUPPORTED.
  5585.  
  5586. NIOE8 SX6 8
  5587. EQ NETIOX
  5588. *
  5589. * * * SET RETURN CODE
  5590. NETIOX SA6 TRETURN
  5591. *
  5592. * * * STORAGE ASSOCIATED WITH THIS REQUEST/RESPONSE
  5593. SA1 STORSAV
  5594. ZR X1,NETIO2 JUMP IF NOT
  5595. PL X6,NETIOX1 IF ERROR ALREADY DETECTED
  5596. SA1 REQC CHECK REQUEST CODE
  5597. SX1 X1-DIAG CHECK FOR *DIAG* REQUEST
  5598. ZR X1,NETIOX1 IF *DIAG* DO NOT WRITE STORAGE
  5599. RJ NETIOT MOVE FROM FIXED BUFFER
  5600. SA6 TRETURN SET ERROR RETURN
  5601. NETIOX1 RJ NETIOR RELEASE FIXED BUFFER
  5602. *
  5603. * * * UNLOCK STORAGE BUFFER
  5604. CALL IOLESSN,TBXSTOR,-4000B
  5605.  
  5606. * RESTORE LESSON AND COMMON/STORAGE POINTERS.
  5607.  
  5608. NETIO2 CALL RESTLES
  5609.  
  5610. * RESTORE *KEY*.
  5611.  
  5612. SA1 TOKEY
  5613. BX6 X1
  5614. SA6 KEY
  5615. EQ CKPROC
  5616. *
  5617.  
  5618. NIODRPL VFD 60/ADRPL NETWORK DROP LINK REQUEST
  5619. VFD 60/0
  5620. * /--- BLOCK NETIOF 00 000 78/09/15 01.19
  5621. SPACE 4,10
  5622. ** NETIOF - TEMPORARY NETIO ROUTINE.
  5623. *
  5624. * MOVE DATA FROM LESSON STORAGE TO A FIXED -NETIO-
  5625. * ECS BUFFER AND ALTER PLF REQUEST TO USE THIS FIXED
  5626. * ECS STORAGE BUFFER. THIS PROTECTS PLATO FROM PLF
  5627. * ERRORS DURING DEBUGGING, BECAUSE PLFS FLX CONTAINS
  5628. * THESE FIXED BUFFERS.
  5629. *
  5630. * ENTRY (NETRQ+1) = LESSON STORAGE FWA AND LENGTH.
  5631. *
  5632. * EXIT (X6) = -1, IF NO ERRORS.
  5633. * (X6) = 96, IF DATA LENGTH TOO LONG.
  5634. * (X6) = 99, IF FIXED BUFFER NOT AVAILABLE.
  5635. * (X6) = 100, IF LESSON STORAGE TOO LONG.
  5636. * (NETRQ+1) = FIXED BUFFER FWA AND LENGTH.
  5637. * (BORDSV) = FIXED BUFFER ORDINAL.
  5638. *
  5639. * USES X - 0,1,2,3,4,6,7.
  5640. * A - 0,1,4,7.
  5641. * B - 1,2,3.
  5642. *
  5643. * CALLS INTLOKW,INTCLR
  5644.  
  5645.  
  5646. NETIOF PS ENTRY/EXIT
  5647.  
  5648. * SET TO NO BUFFER ALLOCATED.
  5649.  
  5650. MX6 -1
  5651. SA6 BORDSV
  5652.  
  5653. * TEST STORAGE LENGTH.
  5654.  
  5655. SA4 NETRQ+1
  5656. MX3 ECLM
  5657. BX1 X4*X3
  5658. LX1 ECLS
  5659. SX3 X1-NETIOBL-1
  5660. SX6 100 SET LENGTH ERROR
  5661. PL X3,NETIOF RETURN IF STORAGE TOO LONG
  5662. SB2 X1 SAVE THE LENGTH
  5663.  
  5664. * TEST DATA LENGTH
  5665.  
  5666. MX3 EDLM
  5667. LX3 60-EDLS+EDLM
  5668. BX2 X4*X3
  5669. LX2 EDLS
  5670. IX3 X1-X2 STORAGE LTH - DATA LTH
  5671. SX6 96 SET DATA LENGTH ERROR
  5672. NG X3,NETIOF RETURN IF DATA LTH .GT. STORAGE
  5673.  
  5674. * ALLOCATE A FIXED BUFFER.
  5675.  
  5676. INTLOK X,I.PLFT,W INTERLOCK THE BUFFER BITS
  5677. SA1 ANETBB GET BUFFER BITS ECS ADDRESS
  5678. RX3 X1 READ BUFFER BITS FROM ECS
  5679. NX2 X3
  5680. ZR X2,NETIOF1 RETURN, IF NO BUFFERS
  5681. UX2,B1 X2 GET BUFFER ORDINAL IN *B1*
  5682. SX7 B1 SAVE BUFFER ORDINAL
  5683. SA7 BORDSV
  5684. MX6 -1 CLEAR BUFFER BIT
  5685. SB3 =XNNIOB-48
  5686. SB1 B1-B3
  5687. LX6 B1
  5688. BX6 X3*X6
  5689. WX6 X1 REPLACE BUFFER BITS
  5690. INTCLR X,I.PLFT UNLOCK BUFFER BITS
  5691. * /--- BLOCK NETIOF 00 000 78/10/27 16.49
  5692.  
  5693. * COMPUTE FIXED BUFFER FWA.
  5694.  
  5695. SX2 NETIOBL BUFFER LENGTH
  5696. IX7 X7*X2 OFFSET TO NEXT BUFFER
  5697. SA1 ANETBF ECS FWA OF BUFFERS
  5698. IX2 X1+X7 FWA OF THIS BUFFER
  5699.  
  5700. * SAVE LESSON STORAGE FWA.
  5701.  
  5702. MX6 -ECAM
  5703. BX7 -X6*X4 LESSON STORAGE ECS FWA
  5704. SA7 LSTORSV
  5705.  
  5706. * MOVE LESSON STORAGE TO FIXED BUFFER.
  5707.  
  5708. BX0 X7
  5709. SA0 WORK
  5710. + RE B2
  5711. RJ =XECSPRTY ANALYZE ECS ERROR
  5712. BX0 X2
  5713. + WE B2
  5714. RJ =XECSPRTY ANALYZE ECS ERROR
  5715.  
  5716. * REPLACE LESSON STORAGE FWA WITH FIXED BUFFER
  5717. * FWA IN THE REQUEST.
  5718.  
  5719. BX6 X4*X6 CLEAR ECS FWA
  5720. BX6 X0+X6 INSERT FIXED BUFFER FWA
  5721. SA6 NETRQ+1
  5722.  
  5723. * SET TO NO ERRORS AND RETURN.
  5724.  
  5725. SX6 -1
  5726. EQ NETIOF RETURN
  5727.  
  5728. NETIOF1 INTCLR X,I.PLFT UNLOCK BUFFER BITS
  5729. SX6 99 SET NO BUFFER ERROR
  5730. EQ NETIOF RETURN
  5731. * /--- BLOCK NETIOT 00 000 78/08/11 01.27
  5732. SPACE 4,10
  5733. ** NETIOT - TEMPORARY NETIO ROUTINE.
  5734. *
  5735. * MOVE DATA FROM A FIXED -NETIO- BUFFER TO LESSON
  5736. * STORAGE BUFFER AND ALTER PLF RESPONSE TO USE THE
  5737. * LESSON BUFFER ADDRESS. THIS PROTECTS PLATO FROM
  5738. * PLF ERRORS DURING DEBUGGING, BECAUSE PLFS FLX
  5739. * CONTAINS THESE FIXED BUFFERS.
  5740. *
  5741. * ENTRY (RPSAV) = FWA OF RESPONSE.
  5742. *
  5743. * EXIT (X6) = -1, IF NO ERRORS.
  5744. * (X6) = 98, IF STORAGE BUFFER ERROR.
  5745. * (X6) = 97, IF PLF MESSAGE TOO LONG.
  5746. * ((RPSAV)+1) = STORAGE LENGTH, MESSAGE
  5747. * LENGTH, LESSON STORAGE FWA.
  5748. *
  5749. * USES X - 0,1,2,3,4,6,7.
  5750. * A - 0,1,4,6.
  5751. * B - 1,2.
  5752. *
  5753. * CALLS INTLOKW,INTCLR,SETSTOR.
  5754.  
  5755.  
  5756. NETIOT PS ENTRY/EXIT
  5757.  
  5758. * CHECK THAT LESSON STORAGE FWA IS .LE. THE SAVED
  5759. * STORAGE FWA.
  5760.  
  5761. SA1 TBXSTOR
  5762. RJ =XSETSTOR GET LESSON STORAGE INFORMATION
  5763. SA1 STORWRD
  5764. AX1 18
  5765. SX4 X1 SAVE LESSON STORAGE LENGTH
  5766. AX1 18 GET LESSON STORAGE FWA
  5767. SA2 LSTORSV SAVED STORAGE FWA
  5768. * /--- BLOCK NETIOT 00 000 78/08/11 02.47
  5769. IX3 X2-X1
  5770. SX6 98 SET STORAGE BUFFER ERROR
  5771. NG X3,NETIOT RETURN IF STORAGE BUFFER ERROR
  5772.  
  5773. * CHECK THAT MESSAGE WILL NOT OVERFLOW LESSON
  5774. * STORAGE.
  5775.  
  5776. IX1 X1+X4 LESSON STORAGE LWA
  5777. SA3 RPSAV GET PLF MESSAGE LENGTH
  5778. SA3 X3+1
  5779. MX6 -EDLM
  5780. LX3 EDLS
  5781. BX7 -X6*X3 ISOLATE MESSAGE LENGTH
  5782. SB1 X7 SAVE MESSAGE LENGTH
  5783. IX1 X1-X7 LWA - MESSAGE LENGTH
  5784. IX1 X1-X2
  5785. SX6 97 SET MESSAGE LENGTH ERROR
  5786. NG X1,NETIOT RETURN IF MESSAGE TOO LONG
  5787.  
  5788. * MOVE MESSAGE FROM FIXED -NETIO- BUFFER TO
  5789. * LESSON STORAGE.
  5790.  
  5791. LX3 60-EDLS ISOLATE PLF STORAGE FWA
  5792. MX6 -ECAM
  5793. BX4 -X6*X3
  5794. BX0 X4
  5795. SA0 WORK
  5796. + RE B1
  5797. RJ =XECSPRTY ANALYZE ECS ERROR
  5798. BX0 X2
  5799. + WE B1
  5800. RJ =XECSPRTY ANALYZE ECS ERROR
  5801.  
  5802. * REPLACE PLF ECS FWA WITH LESSON STORAGE FWA IN
  5803. * RESPONSE.
  5804.  
  5805. BX3 X3*X6 CLEAR ECS FWA FILED
  5806. BX6 X3+X0 INSERT LESSON STORAGE FWA
  5807. SA6 A3
  5808. * /--- BLOCK NETIOT 00 000 78/09/15 01.20
  5809. MX6 -1 SET NO ERRORS
  5810. EQ NETIOT RETURN
  5811.  
  5812. SPACE 4,10
  5813. ** NETIOR - RELEASE FIXED -NETIO- BUFFER.
  5814. *
  5815. * ENTRY (BORDSV) = FIXED BUFFER ORDINAL.
  5816. *
  5817. * EXIT NONE.
  5818. *
  5819. * USES X - 0,1,2,6.
  5820. * A - 0,1,2,6.
  5821. * B - 2,3.
  5822. *
  5823. * CALLS INTLOKW,INTCLR.
  5824.  
  5825.  
  5826. NETIOR PS ENTRY/EXIT
  5827. SA1 BORDSV
  5828. NG X1,NETIOR RETURN IF NO BUFFER ALLOCATED
  5829. SB2 X1 BUFFER ORDINAL
  5830. INTLOK X,I.PLFT,W INTERLOCK BUFFER BITS
  5831. SA1 ANETBB
  5832. RX2 X1 READ BUFFER BITS
  5833. MX6 -1
  5834. SB3 =XNNIOB-48
  5835. SB2 B2-B3
  5836. LX6 B2
  5837. BX6 -X6+X2 SET BUFFER BIT
  5838. WX6 X1 WRITE BUFFER BITS
  5839. INTCLR X,I.PLFT REMOVE INTERLOCK
  5840. EQ NETIOR RETURN
  5841. * /--- BLOCK END NETIO 00 000 78/08/11 21.56
  5842. ENDOV
  5843. * /--- BLOCK PUTPLF 00 000 79/03/08 00.47
  5844. TITLE PUT PLF REQUEST
  5845. *
  5846. * * * PUTPLF
  5847. *
  5848. * ENTRY (OVARG1) = ADDRESS OF REQUEST
  5849. * (OVARG2) = LENGTH OF REQUEST
  5850. *
  5851. * EXIT (OVRET1) = -(REQUEST LENGTH) IF NO ROOM
  5852. *
  5853. * FORMAT OF REQUEST HEADER-
  5854. * 06/UNUSED
  5855. * 02/EOM TYPE
  5856. * 04/UNUSED
  5857. * 12/STATION
  5858. * 12/NUMBER OF CM WORDS IN REQUEST
  5859. * 12/SEQUENCE NUMBER
  5860. * 12/REQUEST TYPE
  5861. *
  5862. PUTPLF OVRLAY
  5863.  
  5864. * TEST IF DOELZ NETWORK SUPPORTED.
  5865.  
  5866. SX6 =XPLF
  5867. ZR X6,PPLF7 IF NOT SUPPORTED
  5868.  
  5869. * UPDATE SEQUENCE NUMBER.
  5870.  
  5871. SA1 NETSEQ
  5872. SX6 X1+1
  5873. MX0 -12
  5874. BX6 -X0*X6
  5875. SA6 A1+
  5876.  
  5877. * INSERT STATION, LENGTH AND SEQUENCE IN REQUEST.
  5878.  
  5879. SA1 STATION
  5880. SA2 OVARG1
  5881. SB2 X2 (B2) = REQUEST FWA
  5882. SA2 B2 (X2) = REQUEST WORD 0
  5883. SA4 OVARG2 (X4) = REQUEST LENGTH
  5884. SB3 X4 (B3) = REQUEST LENGTH
  5885. MX0 36
  5886. LX1 36 POSTION STATION
  5887. LX4 24 POSITION LENGTH
  5888. LX6 12 POSITION SEQUENCE
  5889. LX0 47-59 POSITION MASK
  5890. BX2 -X0*X2 CLEAR FIELDS
  5891. BX6 X2+X6 MERGE SEQUENCE
  5892. BX6 X1+X6 MERGE STATION
  5893. BX6 X4+X6 MERGE LENGTH
  5894. SA6 B2+
  5895. *
  5896. * * * INTERLOCK -TO PLF- BUFFER
  5897. INTLOK X,I.PLFT,W
  5898. *
  5899. * * * GET BUFFER ADDRESS. SAVE IN X4.
  5900. SA1 APLFTO GET BUFFER LENGTH / FWA WORD
  5901. MX0 -ECAM ISOLATE FWA IN X4
  5902. BX4 -X0*X1 ** X4 = BUFFER FWA **
  5903. *
  5904. * * * GET BUFFER LENGTH. SAVE IN B4
  5905. MX0 -BFLM ISOLATE LENGTH IN X1
  5906. LX1 BFLS
  5907. BX1 -X0*X1
  5908. SB4 X1 ** B4 = BUFFER LENGTH **
  5909. *
  5910. * * * GET BUFFER IN AND OUT POINTERS FROM ECS.
  5911. SA2 APTIN ECS ADDRESS OF POINTERS
  5912. BX0 X2
  5913. SA0 NETPTRS
  5914. + RE 2
  5915. RJ =XECSPRTY ANALYZE ECS ERROR
  5916. *
  5917. * * * COMPUTE FREE SPACE IN BUFFER.
  5918. *
  5919. * IF (IN < OUT)
  5920. * FREE SPACE = OUT - IN - 1
  5921. * ELSE
  5922. * FREE SPACE = (BUFFER LENGTH - IN) + (OUT - 1)
  5923. * ENDIF
  5924.  
  5925. * /--- BLOCK PUTPLF 00 000 79/03/08 00.47
  5926. SA2 A0 ** X2 = IN **
  5927. SA3 A0+1 GET OUT POINTER
  5928. IX0 X2-X3 (IN - OUT)
  5929. BX1 -X0 (OUT - IN)
  5930. SB6 X1-1 FREE SPACE IF IN &lt; OUT
  5931. NG X0,PPLF2 IF IN &lt; OUT
  5932. SB6 B6+B4 FREE SPACE IF IN .GE. OUT
  5933. PPLF2 BSS 0
  5934. LT B6,B3,PPLF5 IF NOT ENOUGH FREE SPACE
  5935. * /--- BLOCK PUTPLF 00 000 79/04/18 00.07
  5936. *
  5937. * * * COMPUTE THE NEW IN POINTER VALUE. SAVE IN B6.
  5938. *
  5939. * T = IN + MESSAGE LENGTH
  5940. * IF (T < BUFFER LENGTH)
  5941. * NEW IN = T
  5942. * ELSE
  5943. * NEW IN = T - BUFFER LENGTH
  5944. * ENDIF
  5945.  
  5946. SB6 X2+B3 NEW IN IF NO WRAP AROUND
  5947. LT B6,B4,PPLF3 JUMP IF NO WRAP AROUND
  5948. SB6 B4-B6 NEW IN IF WRAP AROUND
  5949. *
  5950. * * * WRAP AROUND, SO MESSAGE MUST BE WRITTEN IN
  5951. * TWO PARTS.
  5952. SA0 B2 (MESSAGE FWA)
  5953. SB1 X2 IN
  5954. SB1 B4-B1 BUFFER LTH - IN
  5955. IX0 X4+X2 (BUFFER FWA + IN)
  5956. + WE B1
  5957. RJ =XECSPRTY ANALYZE ECS ERROR
  5958. *
  5959. * * * SECOND PART.
  5960. SA0 B2+B1 (MESSAGE FWA + 1ST PART LENGTH)
  5961. BX0 X4 (BUFFER FWA)
  5962. + WE B6
  5963. RJ =XECSPRTY ANAYZE ECS ERROR
  5964. EQ PPLF4 UPDATE IN POINTER
  5965. *
  5966. * * * WRITE MESSAGE IN ONE PART.
  5967. PPLF3 BSS 0
  5968. SA0 B2 MESSAGE FWA
  5969. IX0 X2+X4 (IN + BUFFER FWA)
  5970. + WE B3
  5971. RJ =XECSPRTY ANALYZE ECS ERROR
  5972. *
  5973. * * * UPDATE IN POINTER.
  5974. PPLF4 SX6 B6 PLACE POINTER IN CM
  5975. SA1 APTIN GET IN POINTER ECS ADDRESS
  5976. WX6 X1
  5977. EQ PPLF6
  5978. *
  5979. * * * ERROR -- NO ROOM IN BUFFER
  5980. PPLF5 BSS 0
  5981. SB3 -B3
  5982. *
  5983. * * * CLEAR -PLF- BUFFER INTERLOCK
  5984. PPLF6 BSS 0
  5985. INTCLR X,I.PLFT
  5986. SX6 B3 SET RETURN WITH ERROR
  5987. SA6 OVRET1
  5988. PPLF7 RETURN RETURN FROM THIS OVERLAY
  5989. * /--- BLOCK END PUTPLF 00 000 79/03/07 19.15
  5990. ENDOV
  5991. * /--- BLOCK DRPLINK 00 000 79/04/18 00.02
  5992. TITLE DROP LINK
  5993. *
  5994. * * * DRPLINK
  5995. *
  5996. * THIS ROUTINE IS CALLED TO CHECK TO SEE IF A STATION
  5997. * IS ON THE DOELZ NETWORK LINK, AND IF SO, SEND A DROP
  5998. * LINK REQUEST TO PLF.
  5999. *
  6000. *
  6001. DRPLINK OVRLAY
  6002. *
  6003. * CHECK TO SEE IF THIS SYSTEM HAS A DOELZ NETWORK
  6004. *
  6005. SX1 =XPLF
  6006. ZR X1,DLEXIT IF DOELZ NOT SUPPORTED
  6007. *
  6008. * CHECK TO SEE IF THE STATION IS A REMOTE DOELZ STATION
  6009. *
  6010. SA1 STATION GET THE STATION NUMBER
  6011. SX2 RNETSF GET FIRST REMOTE DOELZ STATION
  6012. IX3 X1-X2
  6013. NG X3,LDLZ BRANCH IF NOT A REMOTE STATION
  6014. *
  6015. SX2 RNETSN GET NUMBER OF REMOTE STATIONS
  6016. IX3 X3-X2
  6017. PL X3,LDLZ IF NOT A REMOTE STATION
  6018. SX6 ADRPL REMOTE DROP LINK REQUEST CODE
  6019. EQ DROPL SEND REQUEST TO PLF
  6020. *
  6021. * CHECK TO SEE IF THE STATION IS A LOCAL DOELZ STATION
  6022. *
  6023. LDLZ BSS 0
  6024. SX2 LNETSF GET FIRST LOCAL DOELZ STATION
  6025. IX3 X1-X2
  6026. NG X3,DLEXIT EXIT IF NOT A LOCAL STATION
  6027. *
  6028. SX2 LNETSF GET NUMBER OF LOCAL STATIONS
  6029. IX3 X3-X2
  6030. PL X3,DLEXIT IF NOT A LOCAL STATION
  6031. SX6 DLDL LOCAL DROP LINK REQUEST CODE
  6032. *
  6033. * SEND A DROP LINK REQUEST TO PLF (X6) = REQUEST CODE.
  6034. *
  6035. DROPL BSS 0
  6036. SA6 NIODROP SET PLF REQUEST CODE
  6037. SX6 NIODROP SET -PUTPLF- ARGUMENTS
  6038. SX7 PTSIZE
  6039. SA6 OVARG1
  6040. SA7 OVARG2
  6041. X PUTPLF CALL PUTPLF
  6042. *
  6043. DLEXIT RETURN EXIT DRPLINK
  6044. *
  6045. NIODROP BSSZ 2 DROP LINK REQUEST
  6046. *
  6047. ENDOV
  6048. * /--- BLOCK END 00 000 76/07/21 20.27
  6049. *
  6050. *
  6051. OVTABLE
  6052. *
  6053. *
  6054. END EXEC4$