Table of Contents

SFS

Table Of Contents

  • [00004] SFS - SPECIAL SYSTEM FILE SUPERVISOR.
  • [00010] SPECIAL SYSTEM FILE SUPERVISOR.
  • [00108] PROCESSOR PROGRAM COMMUNICATION AREA.
  • [00116] FUNCTION PROCESSOR CALL.
  • [00166] INPUT PROCESSING ROUTINES.
  • [00185] ASC - ASSEMBLE CHARACTERS.
  • [00277] ISB - INPUT STRING BUFFER.
  • [00326] SIN - SUBROUTINE INTERFACE.
  • [00345] KIP - KEYBOARD INPUT PROCESSOR.
  • [00421] SCI - SCAN FOR CODE IDENTIFIER.
  • [00525] READ FILE ROUTINES.
  • [00538] ANB - ADD NEXT BLOCK TO TABLE.
  • [00582] CCW - CRACK CONTROL WORD.
  • [00619] PNA - PICK NEXT ADDRESS.
  • [00677] PNE - PICK NEXT ENTRY.
  • [00763] SBT - SET BLOCK IN TABLE.
  • [00904] SPB - SET PRIMARY BLOCK.
  • [00942] TABLE MANIPULATION ROUTINES.
  • [00960] DZE - DELETE ZERO ENTRIES.
  • [00991] MWS - MULTIPLE WORD TABLE SEARCH.
  • [01060] SDF - SET DATA IN FIELD.
  • [01096] SFT - SPACE FILL TABLE.
  • [01137] STB - SORT TABLE.
  • [01179] FILE WRITE ROUTINES
  • [01197] BLD - BUILD DIRECTORY.
  • [01233] RBA - RESET BLOCK ADDRESSES.
  • [01289] UDD - UPDATE DIRECTORY.
  • [01360] WTB - WRITE BLOCK TO FILE.
  • [01539] COMMON DECKS.

Source Code

SFS.txt
  1. IDENT SFS,SFSS,,01,00
  2. ABS
  3. SST
  4. TITLE SFS - SPECIAL SYSTEM FILE SUPERVISOR.
  5. SYSCOM B1
  6. SPACE 4
  7. *COMMENT SFS - SPECIAL SYSTEM FILE SUPERVISOR.
  8. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  9. SPACE 4
  10. *** SFS - SPECIAL SYSTEM FILE SUPERVISOR.
  11. * D. A. HIVELEY. 72/05/23.
  12. SPACE 4
  13. *** SFS PROVIDES MACROS AND A FUNCTION PROCESSOR FOR COMMON
  14. * ROUTINES THAT PERFORM BASIC TABLE MANAGEMENT, DATA
  15. * MANIPULATION AND I/O PROCESSING FOR THE SPECIAL SYSTEM FILE
  16. * PROCESSORS, WHICH PROCESS TREE STRUCTURED FILES.
  17. * SFS MUST BE LOADED AS A 01,00 OVERLAY TO ONE OF THE SYSTEM
  18. * FILE PROCESSORS.
  19. SPACE 4
  20. *** SFS IS DESIGNED TO PROCESS TREE-STRUCTURED FILES OF A GIVEN
  21. * FORMAT. THE FUNCTIONS ARE DESIGNED TO PROCESS ANY NUMBER
  22. * LEVELS OF TREE STRUCTURE, HOWEVER, TABLE SPACE IS ONLY
  23. * ALLOCATED FOR A THREE-LEVEL TREE STRUCTURED FILE (3 DIRECTORY
  24. * LEVELS + 1 DATA LEVEL).
  25. *
  26. * THE FIRST WORD OF EACH RECORD ON THE FILE IS THE CONTROL WORD
  27. * CONTAINING SUFFICIENT INFORMATION TO DESCRIBE THE DATA WITHIN
  28. * THE RECORD. THE SECOND WORD IS NOT USED FOR MOST RECORDS
  29. * (LEVEL-0, RECORD 1, WORD 2 CONTAINS FILE CREATION AND UPDATE
  30. * DATES, AND A 24 BIT FIELD TO BE USED BY THE PROCESSOR PROGRAM.
  31. * THE THIRD WORD CONTAINS THE LINKAGE (RANDOM ADDRESS
  32. * POINTER) TO THE NEXT LOGICAL BLOCK ON THAT LEVEL, IF ONE IS
  33. * PRESENT. THE REMAINING WORDS IN THE RECORD ARE DIRECTORY
  34. * ENTRIES FOR DIRECTORY LEVEL RECORDS. A TOTAL OF 63 WORDS
  35. * (60 WORDS OF ENTRIES + 3 CONTROL WORDS) CAN BE USED IN EACH
  36. * RECORD IN THE DIRECTORY LEVELS. FOR THE DATA LEVEL, THE
  37. * CONTROL WORD SHOULD BE COMPATIBLE WITH THE CONTROL WORDS FOR
  38. * DIRECTORY LEVELS. THE REMAINDER CAN BE ANY LENGTH AND FORMAT
  39. * DESIRED. BECAUSE OF THIS FLEXIBLE FORMAT, THE PROCESSOR
  40. * PROGRAM MUST HANDLE I/O OF THE DATA-LEVEL RECORD. HOWEVER,
  41. * IF THE DATA-LEVEL IS CONSTRUCTED SIMILAR TO THE DIRECTORY-
  42. * LEVEL RECORDS, SFS FUNCTIONS CAN BE USED TO PERFORM THE I/O.
  43. * THE INFORMATION IN ALL LEVELS IS MAINTAINED IN
  44. * COLLATED SEQUENCE.
  45. *
  46. * CONTROL WORD FORMAT IS AS FOLLOWS -
  47. *
  48. *T 12/DL,12/WIR,12/WPE,12/NOE,12/FWAD
  49. * DL = DATA LEVEL.
  50. * WIR = WORDS IN RECORD.
  51. * WPE = WORDS PER ENTRY.
  52. * NOE = NUMBER OF ENTRIES.
  53. * FWAD = FIRST WORD ADDRESS OF DATA ENTRIES.
  54. *
  55. * THE 0 AND 1 DIRECTORY LEVELS CORRESPOND TO THE PRIMARY LEVEL
  56. * OF THE TREE. THE ENTRIES IN THE 0-LEVEL CONSIST OF THE FIRST
  57. * ENTRY (AND CORRESPONDING RANDOM ADDRESS) OF EACH 1-LEVEL
  58. * RECORD. ALL PRIMARY ENTRIES CAN BE FOUND IN THE 1-LEVEL
  59. * DIRECTORY. THIS METHOD ENABLES QUICKER ACCESS TO A GIVEN
  60. * PRIMARY ENTRY. THE FIRST SECTOR OF THE FILE IS DEFINED TO BE
  61. * THE FIRST 0-LEVEL DIRECTORY RECORD WHICH IS LINKED TO THE
  62. * NEXT 0-LEVEL RECORD. EXCEPT FOR THE PRIMARY LEVEL, THERE
  63. * EXISTS 1 DIRECTORY LEVEL FOR EACH TREE LEVEL TERMINATING
  64. * WITH THE DATA LEVEL.
  65. SPACE 4
  66. *** TREE-STRUCTURE FILE LAYOUT.
  67. *
  68. * LEVEL-0 LEVEL-1 LEVEL-2 DATA-LEVEL
  69. * RECORD 0 1 3 5
  70. * ******** ******** ******** *********
  71. * * * * * * * * *
  72. * *CH1 * *CH1 * *P1 * *CONTROL*
  73. * * 1*.......* 3*.......* 5*.......*FIELDS *
  74. * *CH7 * *CH2 * *P2 * * *
  75. * * 2*. * ... *. * ... *. *U1 *
  76. * * ... * . * ... * . * ... * . *U2 *
  77. * * ... *. . * *. . * *. . * ... *
  78. * ******** . . ******** . . ******** . . *********
  79. * . . . .
  80. * . 2 4 6
  81. * .******** ******** *********
  82. * * * * * * *
  83. * *CH7 * *P1 * *CONTROL*
  84. * * 4*.......* 6*.......*FIELDS *
  85. * *CH8 * *P2 * * *
  86. * * ... *. * ... *. *U1 *
  87. * * ... * . * ... * . *U2 *
  88. * * *. . * *. . * ... *
  89. * ******** . . ******** . . *********
  90. * . .
  91. * CHN = PRIMARY ENTRIES.
  92. * PN = SECONDARY ENTRIES RELATED TO SPECIFIC PRIMARY ENTRY.
  93. * UN = TERTIARY ENTRIES RELATED TO SPECIFIC SECONDARY ENTRY.
  94. SPACE 4
  95. *CALL COMCMAC
  96. *CALL COMCDCM
  97. *CALL COMCMTM
  98. LIST X
  99. *CALL COMSSFS
  100. LIST -X
  101. SPACE 4,10
  102. **** ASSEMBLY CONSTANTS.
  103.  
  104.  
  105. MWK$ EQU 1 DEFINE MULTIPLE WORD SORT KEY FOR *GMS*
  106. OV EQU 1 OVERLAY TYPE
  107. ****
  108. TITLE PROCESSOR PROGRAM COMMUNICATION AREA.
  109. SFSS EQU FUNC
  110.  
  111.  
  112. IDIRC INITIALIZE DIRECT CELLS
  113.  
  114.  
  115. ITAB 0,0,0,0 INITIALIZE TABLES
  116. TITLE FUNCTION PROCESSOR CALL.
  117. LOV SPACE 4
  118. ERRNG OVLA-.3-1
  119. SPACE 4
  120. ** FUNCTION PROCESSOR.
  121. *
  122. * (B5) FUNCTION NUMBER.
  123. *
  124. * USES A - 2, 7.
  125. * X - 2, 7.
  126. * B - 1, 5.
  127.  
  128.  
  129. ORG FUNC
  130. *FUNC
  131. PS ENTRY/EXIT
  132. SX2 B5-MAXT
  133. PL X2,FUNC1 IF FUNCTION NUMBER EXCEEDS MAXIMUM
  134. SA2 B5+FUNCT
  135. SB5 X2
  136. SA2 FUNC
  137. BX7 X2
  138. SA7 B5
  139. SB5 B5+B1
  140. JP B5
  141.  
  142. FUNCA DATA C* ILLEGAL SFS FUNCTION.*
  143. FUNC1 SX2 FUNCA
  144. MESSAGE X2
  145. ABORT
  146.  
  147. FUNCT INDEX CON,MAXT,( )
  148. INDEX ,ASCT,(/ASC/)
  149. INDEX ,SCIT,(/SCI/)
  150. INDEX ,ANBT,(/ANB/)
  151. INDEX ,CCWT,(/CCW/)
  152. INDEX ,SBTT,(/SBT/)
  153. INDEX ,SPBT,(/SPB/)
  154. INDEX ,PNAT,(/PNA/)
  155. INDEX ,PNET,(/PNE/)
  156. INDEX ,DZET,(/DZE/)
  157. INDEX ,MWST,(/MWS/)
  158. INDEX ,SDFT,(/SDF/)
  159. INDEX ,SFTT,(/SFT/)
  160. INDEX ,STBT,(/STB/)
  161. INDEX ,BLDT,(/BLD/)
  162. INDEX ,RBAT,(/RBA/)
  163. INDEX ,UDDT,(/UDD/)
  164. INDEX ,WTBT,(/WTB/)
  165. LOC *O
  166. TITLE INPUT PROCESSING ROUTINES.
  167. *** TO PROCESS INPUT DIRECTIVES, A CALL TO *ASC* IS ALL
  168. * THAT IS REQUIRED. *ASC* ASSEMBLES CHARACTERS UNTIL A
  169. * SEPARATOR IS ENCOUNTERED UP TO A MAXIMUM OF TEN CHARACTERS
  170. * PER CALL.
  171. * THE CONTENTS OF *B6* AND *ET* REFLECT FILE
  172. * POSITION UPON EXIT.
  173. *
  174. * DEPENDING ON STATUS OF *OP* AND *OT* DATA WILL BE
  175. * RETRIEVED FROM THE INPUT FILE, TERMINAL OR K-DISPLAY.
  176. * FOR K-DISPLAY PROCESSING, *KD* SHOULD CONTAIN THE
  177. * ADDRESS OF THE K-DISPLAY CONTROL WORD. IF K-DISPLAY
  178. * MESSAGE ADDRESSES ARE SET IN *M1* AND *M2* THESE
  179. * MESSAGE AREAS WILL BE CLEARED UPON RECEIVING INPUT.
  180. * IF *IL* IS NON-ZERO, K-DISPLAY INPUT WILL BE MOVED TO
  181. * THE ADDRESS CONTAINED IN *IL* BEFORE ISSUING THE
  182. * THE CONSOLE MACRO. THIS LOCATION WILL BE BLANK-FILLED
  183. * TO FIVE WORDS AFTER ISSUING THE CONSOLE MACRO.
  184. ASC SPACE 4
  185. ** ASC - ASSEMBLE CHARACTERS.
  186. *
  187. * ENTRY (SP) STRING BUFFER ADDRESS OF PREVIOUS CHAR.
  188. * (SM) STRING BUFFER LIMIT.
  189. * (X0) INPUT FET ADDRESS.
  190. * (X1) BIT STRING OF CHARACTERS TO PERMIT.
  191. * (X6) BIT STRING OF CHARACTERS TO SUPPRESS.
  192. * IF BIT POSITION EQUALING (SPECIAL CHARACTER DISPLAY
  193. * CODE - 45B) IS SET, THAT CHARACTER IS SUPPRESSED OR
  194. * PERMITTED AS DATA (NOT TREATED AS SEPARATOR).
  195. *
  196. * EXIT (SP) UPDATED STRING BUFFER ADDRESS.
  197. * (X6) LEFT -JUSTIFIED ASSEMBLED CHARACTERS.
  198. * (X5) RIGHT-JUSTIFIED ASSEMBLED CHARACTERS.
  199. * (X4) NUMBER OF CHARACTERS
  200. * (B5) SEPARATOR (0 IF END OF LINE).
  201. * (B6) = 0 IF ENTRY TERMINATION */*.
  202. * (B6) " 0 ASSEMBLY COMPLETE.
  203. * (ET) = -1 IF EOF.
  204. * = +1 IF */*.
  205. *
  206. * CALLS ISB.
  207. *
  208. * USES ALL REGISTERS EXCEPT A0 AND A5.
  209.  
  210.  
  211. ASC6 SX4 -B4
  212. SX4 X4+10D
  213. SX6 B2
  214. SA6 SP
  215. BX6 X6-X6
  216. SB3 B4+B4
  217. ZR X4,ASCX RETURN - NO CHARACTERS ASSEMBLED
  218. SB4 B3+B3
  219. SB4 B4+B3
  220. ZR X5,ASCX RETURN - ASSEMBLY REGISTER EMPTY
  221. LX6 X5,B4
  222.  
  223. ASC SUBR ENTRY/EXIT
  224. BX5 X5-X5
  225. SB4 10D
  226. BX7 X1
  227. SB6 B1
  228.  
  229. ASC1 SA1 SP SET STRING POINTER
  230. SB2 X1
  231. SB5 B0 SET END OF LINE INDICATOR
  232. SA1 SM SET MAXIMUM SCAN CHARACTERS
  233. SB7 SBCAL CHARACTER ASSEMBLY LIMIT
  234. SB3 X1
  235. LE B3,B7,ASC1.1 IF LINE LENGTH .LE. CHARACTER LIMIT
  236. SB3 B7
  237. ASC1.1 GE B2,B3,ASC4 IF BUFFER EMPTY
  238. ASC2 SB2 B2+B1
  239. GE B2,B3,ASC6 IF END OF STRING BUFFER
  240. SA1 B2
  241. SB5 X1 SET SEPARTOR
  242. SB7 X1-1R+
  243. LT B7,ASC3 IF NOT SPECIAL CHARACTER
  244. AX4 X6,B7
  245. LX4 59
  246. NG X4,ASC2 IF CHARACTER TO BE SUPPRESSED
  247. AX4 X7,B7
  248. LX4 59
  249. PL X4,ASC6 IF CHARACTER NOT TO BE PERMITTED
  250. ASC3 LX5 6
  251. SB4 B4-1
  252. BX5 X5+X1
  253. NE B4,ASC2 IF MORE CHARACTERS TO ASSEMBLE
  254. SB6 B1+
  255. EQ ASC6
  256.  
  257. ASC4 SA6 ASCA
  258. SA7 A6+B1
  259. SX6 B4 SAVE CHARACTER COUNT
  260. SA6 ASCB
  261. RJ ISB INPUT STRING BUFFER
  262. SA2 ASCB RESTORE CHARACTER COUNT
  263. SA1 ASCA
  264. SB4 X2
  265. BX6 X1
  266. SA1 A1+B1
  267. BX7 X1
  268. NE B6,ASC1 LOOP FOR NEXT CHARACTER
  269. SA1 SP RESET STRING POINTER
  270. SB2 X1
  271. SB5 B0 RESET END OF LINE INDICATOR
  272. EQ ASC6 RETURN - IF EOF OR NEW CHARGE NUMBER
  273.  
  274. ASCA CON 0,0 HOLD FOR SPECIAL CHARACTER BIT CODES
  275. ASCB CON 0 HOLD AREA FOR CHARACTER COUNT
  276. ISB SPACE 4
  277. ** ISB - INPUT STRING BUFFER.
  278. * IF (LP) " 0, EXECUTE LIST PROCESSOR AFTER READING SOURCE LINE
  279. * TO STRING BUFFER.
  280. *
  281. * ENTRY (X0) INPUT FET ADDRESS, IF NOT K-DISPLAY.
  282. *
  283. * EXIT (SP) BEGINNING OF STRING BUFFER.
  284. * (SM) STRING BUFFER LIMIT.
  285. * (B6) = 0 IF NEW PRIMARY ENTRY OR EOF.
  286. * (NP) " 0 IF NEW PRIMARY ENTRY.
  287. * (ET) = -1 IF EOF.
  288. * = +1 IF */*.
  289. *
  290. * CALLS KIP, RDS, SIN.
  291. *
  292. * USES ALL REGISTERS EXCEPT A0, A5, X5.
  293.  
  294.  
  295. ISB SUBR ENTRY/EXIT
  296. SA1 OP
  297. SX1 X1-KOPT
  298. NZ X1,ISB1 IF NOT K-DISPLAY
  299. RJ KIP KEYBOARD INPUT
  300. EQ ISB2
  301.  
  302. ISB1 READS X0,USBB,-NCSI READ DATA TO STRING BUFFER
  303. SX7 B6 SET LWA+1 OF CHARACTER STRING
  304. SA7 SM
  305. SX6 -B1 PRESET EOF
  306. SB6 B0
  307. NZ X1,ISB4 IF EOR OR EOF
  308. ISB2 SX7 USBB-1
  309. SA1 LP READ LIST PROCESSOR ADDRESS
  310. SA7 SP SET STRING BUFFER CHARACTER POINTER
  311. SX7 USBB SET STRING BUFFER ADDRESS
  312. SB7 X1+
  313. SA7 SB
  314. ZR X1,ISB3 IF NO LIST PROCESSOR DEFINED
  315. RJ SIN EXECUTE LIST PROCESSOR
  316. ISB3 SA3 USBB CHECK NEW ENTRY
  317. BX6 X6-X6
  318. SX7 A3
  319. SB6 X3-1R/
  320. NZ B6,ISBX RETURN - IF NOT NEW ENTRY
  321. SX6 1 FLAG *NEW ENTRY*
  322. SA7 SP
  323. ISB4 SA6 ET
  324. EQ ISBX
  325. SIN SPACE 4
  326. ** SIN - SUBROUTINE INTERFACE.
  327. *
  328. * ENTRY (B7) SUBROUTINE ADDRESS.
  329. *
  330. * EXIT TO ROUTINE WITH RETURN ADDRESS SET.
  331. *
  332. * CALLS NONE.
  333. *
  334. * USES A - 1, 6.
  335. * X - 1, 6.
  336. * B - 7.
  337.  
  338.  
  339. SIN SUBR ENTRY/EXIT
  340. SA1 SIN SET RETURN ADDRESS
  341. BX6 X1
  342. SA6 B7
  343. JP B7+1 JUMP TO ROUTINE
  344. KIP SPACE 4
  345. ** KIP - KEYBOARD INPUT PROCESSOR.
  346. *
  347. * ENTRY (IL) = ADDRESS OF KEYBOARD INPUT DISPLAY LINE.
  348. * (KD) = CONTROL ADDRESS OF DISPLAY.
  349. *
  350. * EXIT DATA MOVED TO STRING BUFFER.
  351. * KEYBOARD INPUT MOVED TO DISPLAY BUFFER.
  352. *
  353. * USES X - 1, 3, 4, 6, 7.
  354. * A - 1, 3, 4, 6, 7.
  355. * B - 2.
  356. *
  357. * CALLS USB, ZTB.
  358. *
  359. * MACROS CONSOLE, MOVE, RECALL.
  360.  
  361.  
  362. KIP SUBR ENTRY/EXIT
  363. SA4 IL
  364. ZR X4,KIP2 IF NO INPUT DISPLAY LINE
  365. SB3 5 BLANK FILL KEYBOARD INPUT
  366. SB2 B0+
  367. KIP1 SA1 KIPB+B2
  368. RJ ZTB CONVERT ZEROS TO BLANKS
  369. SA6 A1
  370. SB2 B2+B1
  371. GT B3,B2,KIP1 IF NOT END OF INPUT BUFFER
  372. MOVE 5,KIPB,X4 MOVE KEYBOARD INPUT TO DISPLAY BUFFER
  373. KIP2 SA1 KD SET DISPLAY
  374. CONSOLE X1
  375. KIP3 SA1 KD SET KEYBOARD BUFFER ADDRESS
  376. SA1 X1
  377. AX1 36
  378. SA1 X1+
  379. NZ X1,KIP4 IF INPUT PRESENT
  380. RECALL
  381. EQ KIP3 CHECK FOR INPUT
  382.  
  383. KIP4 SA3 M1 CLEAR MESSAGE LINE
  384. ZR X3,KIP5 IF NO ADDRESS
  385. MOVE 4,KIPA,X3
  386. KIP5 SA3 M2
  387. ZR X3,KIP6 IF NO ADDRESS
  388. MOVE 4,KIPA,X3
  389. KIP6 SA1 KD SET KEYBOARD BUFFER ADDRESS
  390. SA1 X1
  391. AX1 36
  392. SB2 X1
  393. MOVE 5,B2,KIPB STORE KEYBOARD INPUT
  394. RJ USB MOVE INPUT TO STRING BUFFER
  395. SX7 X6+1 SET LWA+1 OF CHARACTER STRING
  396. SA7 SM
  397. SA1 KD
  398. SA1 X1
  399. AX1 36
  400. BX6 X6-X6 CLEAR BUFFER
  401. SA6 X1
  402. EQ KIPX RETURN
  403.  
  404. * CHARACTER STRING TO BLANK OUT MESSAGE AREAS IN DISPLAYS.
  405.  
  406. KIPA DATA 40H
  407.  
  408. * BUFFER TO STORE KEYBOARD INPUT.
  409.  
  410. KIPB DATA 50H
  411.  
  412.  
  413. ** STRING BUFFER.
  414.  
  415. NCSI EQU 80 NUMBER OF CHARACTERS TO SCAN ON INPUT
  416. DATA 1R
  417. USBB BSS NCSI+10 STRING BUFFER
  418. USBBL EQU *-USBB STRING BUFFER LENGTH
  419. SBCAL EQU USBB+72 STRING BUFFER CHARACTER ASSEMBLY LIMIT
  420. SCI SPACE 4
  421. ** SCI - SCAN FOR CODE IDENTIFIER.
  422. *
  423. * ENTRY (SP) ADDRESS OF LAST CHARACTER PROCESSED.
  424. * (SM) STRING BUFFER LIMIT.
  425. * (X0) INPUT FET ADDRESS.
  426. * (X1) BIT STRING OF CHARACTERS TO PERMIT.
  427. * (X3) TABLE ADDRESS OF K-DISPLAY ENTRIES.
  428. * TABLE ENTRIES HVE FOLLOWING FORMAT,
  429. * 42/ENTRY,18/STATUS
  430. * ENTRY = DISPLAY CODE ENTRY TO SEARCH FOR.
  431. * STATUS = RETURN INFORMATION FOR CALLER.
  432. * BOTH TABLES MUST BE TERMINATED BY A ZERO WORD.
  433. * (X6) TABLE ADDRESS OF TABLE INFORMATION.
  434. * TABLE ENTRIES HAVE FOLLOWING FORMAT,
  435. * 18/I,18/M,6/U,6/S,6/F,6/P
  436. * I = IDENTIFIER.
  437. * M = ADDRESS OF MAXIMUM VALUE (0 = INFINITE).
  438. * U = UPPER BIT POSITION IN FIELD.
  439. * S = FIELD SIZE IN BITS.
  440. * F = FIRST WORD ADDRESS WITHIN DATA BLOCK.
  441. * P = PROCESSOR INDEX.
  442. *
  443. * EXIT (X1) = 0 IF ERROR.
  444. * (B5) = 0 IF SEPARATOR IS *=*.
  445. * (B6) = 0 IF ENTRY TERMINATION, */*.
  446. * (B7) PROCESSOR INDEX OR STATUS(K-DISPLAY).
  447. * (DF-DF+4) M, U, S, F, AND I ENTRIES FROM TABLE
  448. * (ET) = -1 IF EOF.
  449. * = +1 IF */*.
  450. *
  451. * CALLS ASC.
  452. *
  453. * USES ALL REGISTERS EXCEPT A5 AND A0.
  454.  
  455.  
  456. SCI SUBR ENTRY/EXIT
  457. SA6 SCIA
  458. BX6 X3
  459. LX7 X1
  460. SA6 A6+1
  461. SA7 A6+1
  462.  
  463. SCI1 SA2 SCIB CHARACTERS TO SUPPRESS
  464. SA1 SCIA+2 CHARACTERS TO PERMIT
  465. BX6 X2
  466. RJ ASC ASSEMBLE CHARACTERS
  467. SX1 B1+
  468. SB5 B5-1R=
  469. EQ B6,SCIX RETURN - IF EOF OR NEW CHARGE NUMBER
  470. ZR X4,SCI1 IF NO CHARACTERS
  471. BX1 X1-X1
  472. MX0 18
  473. NZ B5,SCI3 IF NOT IDENTIFIER SEPARATOR
  474. ZR X4,SCI1 IF NO DATA ASSEMBLED
  475. SA2 SCIA
  476. SA1 X2-1 FWA OF TABLE
  477. SCI2 SA1 A1+B1
  478. ZR X1,SCI3 IF END OF TABLE
  479. BX2 X0*X1
  480. BX2 X2-X6
  481. NZ X2,SCI2 IF IDENTIFIER NOT FOUND
  482. MX0 -6
  483. SA6 DF+4 SET IDENTIFIER
  484. BX6 -X0*X1 SET PROCESSOR ADDRESS
  485. SB7 X6
  486. LX1 54
  487. BX7 -X0*X1 SET FWA OF FIELD
  488. MX0 -24 SET MAXIMUM VALUE
  489. LX1 42
  490. BX6 -X0*X1
  491. SA2 X6
  492. BX6 X2
  493. AX0 18 SET UPPER BIT OF FIELD
  494. SA6 DF
  495. LX1 6
  496. BX6 -X0*X1
  497. SA6 A6+B1
  498. LX1 6 SET SIZE OF FIELD
  499. BX6 -X0*X1
  500. SA6 A6+B1
  501. SA7 A6+B1
  502. SX1 B1
  503. EQ SCIX RETURN
  504.  
  505. * CHECK FOR K-DISPLAY TERMINATION.
  506.  
  507. SCI3 SA2 OP
  508. SX2 X2-KOPT
  509. NZ X2,SCIX RETURN
  510. SA2 SCIA+1
  511. MX0 42
  512. SA1 X2-1
  513. SCI4 SA1 A1+B1
  514. ZR X1,SCIX IF END OF TABLE
  515. BX2 X0*X1
  516. BX2 X2-X6
  517. NZ X2,SCI4 IF NO MATCH
  518. BX2 -X0*X1
  519. SB7 X2
  520. SX1 B1
  521. EQ SCIX RETURN
  522.  
  523. SCIA CON 0,0,0 HOLD AREAS
  524. SCIB BITCON ( ) SUPPRESS CHARACTERS
  525. TITLE READ FILE ROUTINES.
  526. *** THE ROUTINES *SPB*, *SBT* AND *ANB* ARE DESIGNED FOR USE
  527. * WITH THE INQUIRE AND UPDATE OPTIONS TO SET SELECTED
  528. * BLOCKS IN THE RESPECTIVE TABLES. *ANB* ADDS THE NEXT
  529. * LINKED BLOCK TO A TABLE AND *SBT* SEARCHES FOR THE BLOCK
  530. * ASSOCIATED WITH A GIVEN ENTRY AND PLACES IT IN THE TABLE.
  531. *
  532. * *PNA* AND *PNE* ARE PROVIDED FOR USE WITH THE REFORMAT
  533. * AND SOURCE OPTIONS TO PROCESS EACH ENTRY IN THE CHAIN
  534. * OF LINKED BLOCKS.
  535. *
  536. * ALL READ FUNCTIONS REQUIRE (X0) = FET ADDRESS OF FILE.
  537. ANB SPACE 4
  538. ** ANB - ADD NEXT BLOCK TO TABLE.
  539. *
  540. * ENTRY (A0) TABLE NUMBER.
  541. * (X0) FET ADDRESS (FOR READ).
  542. * (X3) RANDOM ADDRESS OF BLOCK.
  543. *
  544. * EXIT (CW+2) ADDRESS OF LINKED BLOCK.
  545. * BLOCK ADDED TO TABLE.
  546. * LENGTH UPDATED.
  547. * (X6) = 0 IF NO ERROR.
  548. * ((A0*2)+RA0+1) ADDRESS OF READ.
  549. *
  550. * CALLS RDW, CCW, ATS.
  551. *
  552. * USES ALL REGISTERS.
  553.  
  554.  
  555. ANB SUBR ENTRY/EXIT
  556. RECALL X0
  557. BX6 X3 SET RANDOM ADDRESS
  558. SX2 A0
  559. LX2 1
  560. BX7 X3
  561. SA7 X2+RA0+1
  562. SA6 X0+6
  563. READ X0
  564. READW X0,CW,3
  565. NZ X1,ANB1 IF EOR OR EOF
  566. RJ CCW CRACK CONTROL WORD
  567. SB4 A0-B4
  568. NE B4,ANB1 IF NOT RIGHT LEVEL
  569. BX6 X6-X6
  570. SA5 A0+LTAB
  571. ZR B3,ANBX IF ZERO LENGTH
  572. ALLOC A0,B3
  573. SA3 FTAB+A0
  574. IX3 X3+X5
  575. READW X0,X3,X1
  576. BX6 X6-X6
  577. ZR X1,ANBX RETURN - IF TRANSFER COMPLETE
  578. ANB1 REWIND X0,R
  579. SX6 B1
  580. EQ ANBX RETURN
  581. CCW SPACE 4
  582. ** CCW - CRACK CONTROL WORD.
  583. *
  584. * ENTRY (CW) CONTROL WORD.
  585. *
  586. * EXIT (B2) FWA OF DATA BLOCK.
  587. * (B3) LENGTH OF DATA BLOCK.
  588. * (B4) LEVEL NUMBER.
  589. * (B5) NUMBER OF ENTRIES.
  590. * (B7) WORD COUNT/ENTRY.
  591. *
  592. * CALLS NONE.
  593. *
  594. * USES A - 1.
  595. * X - 1, 2, 6.
  596. * B - 1, 2, 3, 4, 5, 7.
  597.  
  598.  
  599. CCW SUBR ENTRY/EXIT
  600. SA1 CW
  601. MX6 -12
  602. BX2 -X6*X1 FWA
  603. SB2 X2
  604. LX1 12
  605. BX2 -X6*X1 LEVEL NUMBER
  606. SB4 X2
  607. LX1 12
  608. BX2 -X6*X1 LENGTH OF DATA BLOCK (LENGTH-FWA+1)
  609. SB3 B1-B2
  610. SB3 X2+B3
  611. LX1 12
  612. BX2 -X6*X1 WORD COUNT/ENTRY
  613. SB7 X2
  614. LX1 12
  615. BX2 -X6*X1 NUMBER OF ENTRIES
  616. SB5 X2
  617. EQ CCWX RETURN
  618. PNA SPACE 4
  619. ** PNA - PICK NEXT ADDRESS.
  620. *
  621. * ENTRY (A0) TABLE NUMBER.
  622. * (X0) FET ADDRESS (FOR READ).
  623. * ((A0)+PNAA) POINTER RO NEXT TABLE ENTRY.
  624. * ((A0*2)+RA0+1) ADDRESS OF LINKED BLOCK.
  625. *
  626. * EXIT (A3) ADDRESS OF RANDOM INDEX WORD IN ENTRY.
  627. * (X3) ADDRESS OF NEXT HIGHER-LEVEL BLOCK.
  628. * (X6) = 0 IF END OF TABLE.
  629. * ((A0)+PNAA) UPDATED.
  630. *
  631. * CALLS ANB, MSG.
  632. *
  633. * USES ALL REGISTERS.
  634.  
  635.  
  636. PNA SUBR ENTRY/EXIT
  637. PNA1 SA2 A0+LTAB TABLE LENGTH
  638. SA4 A0+PNAA
  639. SX6 A0
  640. IX3 X4-X2
  641. PL X3,PNA2 IF TABLE EXHAUSTED
  642. SA2 A0+CTAB INCREMENT TABLE POINTER
  643. IX6 X4+X2
  644. SA6 A4
  645. SA1 A0+FTAB FWA
  646. SX6 X6-1
  647. IX2 X1+X6
  648. SA3 X2
  649. EQ PNAX RETURN
  650.  
  651. PNA2 LX6 1
  652. SA3 X6+RA0+1 ADDRESS OF LINKED BLOCK
  653. BX6 X6-X6
  654. ZR X3,PNAX RETURN - IF NO LINK
  655. SA1 OP
  656. SX1 X1-ROPT
  657. ZR X1,PNA3 IF REFORMAT
  658. SA6 A2 CLEAR LENGTH
  659. SA6 A0+PNAA CLEAR TABLE POINTER
  660. PNA3 RJ ANB ADD NEXT BLOCK TO TABLE
  661. NZ X6,PNA4 IF ERROR
  662. SA1 CW+2 SET ADDRESS OF NEXT BLOCK
  663. SX2 A0
  664. BX6 X1
  665. LX2 1
  666. SA6 X2+RA0+1
  667. EQ PNA1 LOOP FOR NEXT BLOCK
  668.  
  669. PNA4 MESSAGE PNAB,3 ISSUE *DATA BASE ERROR.* MESSAGE
  670. BX3 X3-X3
  671. MX6 0
  672. EQ PNAX RETURN
  673.  
  674. PNAA BSSZ NTAB-2 TABLE POINTERS
  675. PNAB DATA C* DATA BASE ERROR.*
  676. PNE SPACE 4
  677. ** PNE - PICK NEXT ENTRY.
  678. *
  679. * ENTRY (A0) TABLE NUMBER.
  680. * (X0) FET ADDRESS (FOR READ).
  681. * (X5) FET ADDRESS (FOR WRITE).
  682. * ((A0)+PNEC) ADDRESS OF LAST BLOCK WRITTEN.
  683. *
  684. * EXIT ((A0)+PNEC) UPDATED.
  685. * IF FULL BLOCK IS PRESENT IN TABLE AND IT HAS BEEN
  686. * PROCESSED, IT IS THEN WRITTEN TO THE FILE.
  687. * (A3) ADDRESS OF RANDOM INDEX WORD IN ENTRY.
  688. * (X3) ADDRESS FROM NEXT TABLE ENTRY.
  689. * (X6) = 0 IF END OF TABLE.
  690. *
  691. * CALLS WTB, PNA.
  692. *
  693. * USES ALL REGISTERS.
  694.  
  695.  
  696. PNE SUBR ENTRY/EXIT
  697. BX7 X5 SAVE FET ADDRESS
  698. SA7 PNEF
  699. PNE1 SA1 A0+PNAA GET TABLE INDEX
  700. SA2 A0+TFBL
  701. SA3 A0+FTAB SAVE FWA TABLE
  702. IX6 X1-X2
  703. BX7 X3
  704. NG X6,PNE2 IF NOT FULL BLOCK.
  705. SA7 PNEG
  706. RJ STB SORT TABLE TO ELIMINATE ZERO ENTRIES
  707. SA3 A0+FTAB NEW FWA TABLE
  708. SA2 PNEG OLD FWA TABLE
  709. IX2 X3-X2
  710. SA1 A0+PNAA ADJUST NEXT TABLE ENTRY POINTER
  711. IX6 X1-X2
  712. SA6 A1
  713. BX1 X6
  714. NZ X2,PNE1 IF SORT DELETED ZERO ENTRIES
  715. BX7 X0 SAVE FET ADDRESS
  716. SA7 PNED
  717. IX6 X3+X1 SAVE NEW FWA
  718. SA6 PNEA
  719. SX3 A0+
  720. SA4 A0+LTAB SAVE NEW LENGTH
  721. IX6 X4-X1
  722. LX3 1
  723. SA6 PNEB
  724. BX6 X1 SET LENGTH FOR WRITE
  725. SA6 A4
  726. SA3 X3+RA0+1 SAVE LINK
  727. SA1 A0+PNEC LINK TO LAST BLOCK
  728. BX7 X3
  729. BX6 X1
  730. SA6 A3+
  731. SA7 PNEE
  732. RJ WTB WRITE BLOCK
  733. SA1 PNED RESET FET ADDRESS
  734. SA2 PNEE RESTORE LINK
  735. SX0 X1
  736. SX6 A0
  737. BX7 X2
  738. LX6 1
  739. SA1 X6+RA0+1 SAVE RANDOM ADDRESS OF WRITE
  740. SA7 A1
  741. BX7 X1
  742. SA1 PNEA RESET FWA
  743. BX6 X1
  744. SA7 A0+PNEC
  745. SA6 A0+FTAB
  746. SA2 PNEB RESET LENGTH
  747. BX7 X2
  748. BX6 X6-X6 RESET TABLE INDEX
  749. SA7 A0+LTAB
  750. SA6 A0+PNAA
  751. PNE2 RJ PNA PICK NEXT ADDRESS
  752. SA5 PNEF RESET FET ADDRESS
  753. EQ PNEX RETURN
  754.  
  755. PNEA BSSZ 1 HOLD FOR FWA
  756. PNEB BSSZ 1 HOLD FOR LENGTH
  757. PNEC BSSZ NTAB-2 TABLE INDICES
  758. PNED CON 0 FET ADDRESS HOLD AREA
  759. PNEE CON 0 HOLD FOR LINK
  760. PNEF CON 0 FET ADDRESS HOLD AREA
  761. PNEG CON 0 HOLD FOR TABLE FWA BEFORE SORT
  762. SBT SPACE 4
  763. ** SBT - SET BLOCK IN TABLE.
  764. *
  765. * ENTRY (A0) TABLE NUMBER.
  766. * (X0) ADDRESS OF FET (FOR READ).
  767. * (SE) ADDRESS OF SEARCH ELEMENT.
  768. * (B6) RANDOM ADDRESS OF FIRST SEARCH BLOCK.
  769. *
  770. * EXIT ((A0*2)+RA0) RANDOM ADDRESS OF BLOCK IN TABLE.
  771. * ((A0*2)+RA0+1) RANDOM ADDRESS OF LINKED BLOCK.
  772. * (X3) ADDRESS OF ENTRY IN TABLE(IF X4=0).
  773. * (X4) = 0 IF EXACT ENTRY FOUND.
  774. * (X5) RANDOM ADDRESS OF NEXT LEVEL BLOCK.
  775. * (X6) " 0 IF ERROR.
  776. *
  777. * CALLS ANB, MVE, MWS.
  778. *
  779. * USES ALL REGISTERS.
  780.  
  781.  
  782. SBT0 SA4 SBTA
  783. SA3 SBTD ADDRESS OF ENTRY
  784. SA1 A4+B1 RESET FET ADDRESSES
  785. BX0 X1
  786.  
  787. SBT SUBR ENTRY/EXIT
  788. BX6 X6-X6
  789. SA6 SBTE CLEAR PREVIOUS RANDOM ADDRESS
  790. BX6 X0 SAVE FET ADDRESS
  791. SA6 SBTB
  792. SBT1 SX3 B6
  793. SX5 B0
  794. ZR X3,SBT2 IF NO BLOCK ADDRESS
  795. SA1 A0+LTAB SAVE LENGTH OF TABLE
  796. BX6 X1
  797. SA6 SBTC
  798. SA1 SBTB SET FET ADDRESS
  799. SX6 B6
  800. BX0 X1
  801. SA6 SBTF SAVE CURRENT RANDOM ADDRESS
  802. RJ ANB ADD NEXT BLOCK
  803. NZ X6,SBTX IF ERROR
  804. SA5 SBTC
  805. SBT2 BX0 X5
  806. SA3 SE ENTRY BLOCK ADDRESS
  807. SB6 X3
  808. SA2 A0+LTAB LENGTH
  809. NZ X2,SBT3 IF NOT EMPTY TABLE
  810. SA1 CW+2 GET LINK
  811. SB6 X1
  812. NZ X1,SBT1 IF LINKED
  813. SBT3 IX6 X2-X0
  814. SA1 A0+FTAB FWA
  815. BX7 X2
  816. SA7 SBTC SAVE LENGTH
  817. BX7 X1
  818. SA7 A7+B1 SAVE FWA
  819. SA6 A2 SET NEW BLOCK LENGTH
  820. IX7 X1+X0
  821. SA7 A1 SET NEW BLOCK FWA
  822. RJ MWS SEARCH FOR ENTRY
  823. SA1 SBTC RESTORE TABLE LENGTH
  824. SA3 SBTE
  825. BX6 X1
  826. SA1 A1+B1 RESTORE TABLE FWA
  827. BX7 X1
  828. BX5 X5-X5
  829. SA6 A0+LTAB
  830. SA7 A0+FTAB
  831. PL X3,SBT3.1 IF NOT FORCED READ OF BLOCK
  832. SB7 B1
  833. SX2 B0
  834. SBT3.1 SA5 A0+CTAB
  835. SB3 B2-B1
  836. SA5 B3+X5
  837. SX6 B2 SAVE ADDRESS OF ENTRY
  838. SA6 SBTD
  839. BX6 X2
  840. SA6 SBTA
  841. SA1 SBTF
  842. SB6 B0
  843. BX6 X1
  844. PL B7,SBT5 IF ENTRY FOUND OR BEFORE TABLE
  845. SA2 CW+2
  846. SB6 X2
  847. SA6 A3 UPDATE PREVIOUS RANDOM ADDRESS
  848. SBT5 SA1 A0+FTAB
  849. IX1 X1-X4
  850. SX2 A0
  851. LX2 1
  852. SA2 RA0+X2
  853. SA3 A2+B1
  854. SB5 B7
  855. BX6 X3
  856. SA6 A2
  857. ZR X1,SBT7 IF FIRST BLOCK
  858. ZR B5,SBT6 IF ENTRY BEFORE BLOCK
  859. SA1 A0+LTAB SET LENGTH
  860. IX6 X1-X0
  861. SA6 A1
  862. SA3 A0+FTAB SET FWA
  863. SA2 SBTD ADJUST ENTRY ADDRESS
  864. IX7 X4-X3
  865. IX7 X2-X7
  866. SA7 A2
  867. MOVE X6,X4,X3 MOVE BLOCK DOWN
  868. EQ SBT7
  869.  
  870. SBT6 BX6 X2 RESET RANDOM ADDRESS
  871. SA6 A2
  872. BX7 X0 RESET LENGTH
  873. BX6 X6-X6
  874. SA1 SBTE
  875. SA7 A0+LTAB
  876. SB6 A0
  877. MX7 1
  878. NZ B6,SBT0 IF NOT LEVEL - 0
  879. SB6 X1
  880. SA7 A1 SET FORCED READ OF BLOCK
  881. EQ SBT1 GO READ BLOCK
  882.  
  883. SBT7 ZR B5,SBT9 IF ENTRY BEFORE BLOCK
  884. NZ B6,SBT1 IF MORE BLOCKS TO PROCESS
  885. SBT8 SX2 A0
  886. LX2 1
  887. SA1 CW+2 SET RANDOM ADDRESS OF NEXT BLOCK
  888. BX7 X1
  889. BX6 X6-X6
  890. SA7 X2+RA0+1
  891. EQ SBT0 RETURN
  892.  
  893. SBT9 SX6 B1
  894. SA6 SBTA
  895. EQ SBT8
  896.  
  897. SBTA BSSZ 1 ENTRY FOUND FLAG
  898. SBTB CON 0 FET ADDRESS HOLD AREA
  899. SBTC CON 0,0 TABLE LENGTH AND FWA HOLD AREA
  900. SBTD CON 0 ADDRESS OF ENTRY
  901. SBTE CON 0 PREVIOUS RANDOM ADDRESS
  902. SBTF CON 0 CURRENT RANDOM ADDRESS
  903. SPB SPACE 4
  904. ** SPB - SET PRIMARY BLOCK.
  905. *
  906. * ENTRY (X1) ADDRESS OF SEARCH ELEMENT.
  907. * (X0) ADDRESS OF FET(FOR READ).
  908. *
  909. * EXIT (SL) RANDOM ADDRESS OF NEXT LEVEL BLOCK.
  910. * (X3) ADDRESS OF ENTRY (IF X4=0).
  911. * (X4) = 0 IF EXACT ENTRY FOUND.
  912. * (X5) RANDOM ADDRESS OF NEXT LEVEL BLOCK.
  913. * (X6) " 0 IF ERROR.
  914. * TABLES AND POINTERS FOR UPDATE.
  915. *
  916. * CALLS SBT.
  917. *
  918. * USES ALL REGISTERS.
  919.  
  920.  
  921. SPB SUBR ENTRY/EXIT
  922. BX6 X1 SAVE ADDRESS OF SEARCH ELEMENT
  923. SA6 SE
  924. BX6 X6-X6 RESET LENGTH
  925. SA6 L.TAB0
  926. SA6 L.TAB1
  927. SA6 SL
  928. SA0 B0 TABLE 0
  929. SB6 B1
  930. RJ SBT SET BLOCK IN TABLE
  931. NZ X6,SPBX RETURN - IF ERROR
  932. ZR X5,SPB1 IF NO ENTRY
  933. SA0 B1 TABLE 1
  934. SB6 X5
  935. RJ SBT SET BLOCK IN TABLE
  936. NZ X6,SPBX RETURN - IF ERROR
  937. NZ X4,SPB1 IF ENTRY NOT FOUND
  938. BX6 X5
  939. SA6 SL
  940. SPB1 BX6 X6-X6
  941. EQ SPBX RETURN
  942. TITLE TABLE MANIPULATION ROUTINES.
  943. *** THE FOLLOWING ROUTINES ARE PROVIDED TO PERFORM VARIOUS
  944. * TABLE MANIPULATION FUNCTIONS.
  945. *
  946. * *MWS* PROVIDES A MULTIPLE WORD SEARCH WHERE WORD COUNT PER
  947. * ENTRY AND WORDS PER ENTRY TO COMPARE ON MUST BE DEFINED.
  948. *
  949. * *SDF* WILL PLACE DATA IN THE PROPER FIELD FROM THE CONTROL
  950. * INFORMATION SUPPLIED THROUGH THE IDENTIFIER TABLE USED IN
  951. * THE INPUT PROCESSING FUNCTION *SCI*.
  952. *
  953. * *SFT* REPLACES UNNEEDED TABLE AREAS WITH BLANKS IN ARDER THAT
  954. * THE DATA IS IN AN OUTPUT TYPE FORMAT. (USED MAINLY WITH THE
  955. * INQUIRE OPTION).
  956. *
  957. * *STB* SORTS A GIVEN TABLE, WHICH INCLUDES DELETING ZEROED
  958. * ENTRIES FROM THE TABLE.
  959. DZE SPACE 4
  960. ** DZE - DELETE ZERO ENTRIES.
  961. *
  962. * ENTRY (A0) TABLE NUMBER.
  963. *
  964. * EXIT LEADING ZERO ENTRIES DELETED FROM TABLE.
  965. * TABLE POINTERS UPDATED.
  966. *
  967. * CALLS NONE.
  968. *
  969. * USES A - 1, 2, 3, 4, 6.
  970. * X - 1, 2, 3, 4, 6.
  971.  
  972.  
  973. DZE SUBR ENTRY/EXIT
  974. SA1 A0+FTAB FWA
  975. SA2 A0+LTAB LENGTH
  976. SA4 A0+CTAB WORDS/ENTRY
  977. IX2 X1+X2
  978. SB3 X4
  979. DZE1 IX4 X1-X2
  980. SA3 X1
  981. SX1 X1+B3
  982. PL X4,DZE2 IF END OF TABLE
  983. ZR X3,DZE1 IF ZERO ENTRY
  984. DZE2 SX6 B3 SET FWA
  985. IX6 X1-X6
  986. SA6 A1
  987. IX6 X2-X6 SET LENGTH
  988. SA6 A2
  989. EQ DZEX RETURN
  990. MWS SPACE 4
  991. ** MWS - MULTIPLE WORD TABLE SEARCH.
  992. * IF TABLE IS INDICATED AS SORTED, ENTRIES ARE SEARCHED
  993. * ASSUMING LOWEST DISPLAY CODE VALUES ARE FIRST. (IF
  994. * VALUES ARE INTEGER VALUES, THEY WILL NOT BE SEARCHED
  995. * FOR PROPERLY.)
  996. *
  997. * ENTRY (A0) TABLE NUMBER.
  998. * (X1) = 0 IF TABLE NOT SORTED.
  999. * (B6) ENTRY BLOCK ADDRESS.
  1000. * ((A0)+CTAB) WORD COUNT/ENTRY
  1001. * ((A0)+STAB) WORD COUNT/ENTRY TO COMPARE.
  1002. *
  1003. * EXIT (X2) = 0 IF ENTRY FOUND.
  1004. * (X4) FWA OF TABLE.
  1005. * (B2) ADDRESS OF REQUIRED ENTRY.
  1006. * (B7) = - IF ENTRY BEYOND TABLE.
  1007. * = 0 IF ENTRY BEFORE TABLE.
  1008. * = + IF ENTRY IN TABLE.
  1009. *
  1010. * CALLS NONE.
  1011. *
  1012. * USES A - 2, 3, 4.
  1013. * X - 2, 3, 4.
  1014. * B - 1, 2, 3, 4, 5, 6, 7.
  1015.  
  1016.  
  1017. MWS SUBR ENTRY/EXIT
  1018. SA4 A0+FTAB FWA
  1019. SA2 A0+LTAB LENGTH
  1020. SB2 X4
  1021. SB3 X2
  1022. SA2 A0+STAB WORD COUNT/ENTRY TO COMPARE
  1023. SB4 X2-1
  1024. SA2 A0+CTAB WORD COUNT/ENTRY
  1025. SB7 X2
  1026. SB3 B2+B3 LWA
  1027. SX2 -B1
  1028. MWS1 EQ B2,B3,MWS7 IF EMPTY TABLE
  1029. SB5 -B1
  1030. MWS2 SB5 B5+B1 INDEX
  1031. SA2 B2+B5 TABLE ENTRY
  1032. SA3 B6+B5 SEARCH ENTRY
  1033. NG X2,MWS3 IF FIRST OPERAND NEGATIVE
  1034. PL X3,MWS4 IF SAME SIGN
  1035. SX2 -B1
  1036. EQ MWS5
  1037. MWS3 NG X3,MWS4 IF SAME SIGN
  1038. SX2 B1
  1039. EQ MWS5
  1040. MWS4 IX2 X2-X3
  1041. NZ X2,MWS5 IF NO MATCH
  1042. GE B5,B4,MWSX RETURN - IF END OF SEARCH
  1043. EQ MWS2
  1044.  
  1045. MWS5 ZR X1,MWS6 IF NOT SORTED
  1046. PL X2,MWS8 IF PAST ENTRY
  1047. MWS6 SB2 B2+B7 INCREMENT TABLE ENTRY
  1048. LT B2,B3,MWS1 IF MORE TABLE
  1049. SB2 B2-B7 BACK UP ONE ENTRY
  1050. MWS7 SB7 -B1
  1051. EQ MWSX RETURN
  1052.  
  1053. MWS8 SB5 X4
  1054. EQ B5,B2,MWS9 IF FIRST ENTRY
  1055. SB2 B2-B7 BACK UP ONE ENTRY
  1056. EQ B5,B2,MWSX RETURN - IF FIRST ENTRY
  1057. MWS9 SB7 B2-B5
  1058. EQ MWSX RETURN
  1059. SDF SPACE 4
  1060. ** SDF - SET DATA IN FIELD.
  1061. *
  1062. * ENTRY (DF) DATA FIELD POSITIONS (SET BY SCI).
  1063. * (X3) FIRST WORD ADDRESS OF DATA.
  1064. * (X6) DATA.
  1065. *
  1066. * EXIT DATA FIELDS SET.
  1067. *
  1068. * CALLS NONE.
  1069. *
  1070. * USES A - 1, 2, 6.
  1071. * X - 1, 2, 3, 6.
  1072. * B - 1, 4, 5, 6.
  1073.  
  1074.  
  1075. SDF SUBR ENTRY/EXIT
  1076. SA1 DF+1 GET UPPER BIT POSITION
  1077. SB6 X1+B1
  1078. SA2 A1+B1 GET FIELD SIZE
  1079. SB5 X2-60D+1
  1080. SB4 X2
  1081. SA2 A2+B1 GET WORD ADDRESS
  1082. IX3 X3+X2
  1083. SA2 X3
  1084. EQ B5,B1,SDF1 IF FULL WORD
  1085. MX1 1 SET MASK
  1086. LX1 X1,B5
  1087. SB5 B6-B4
  1088. BX6 -X1*X6 CLEAR DATA FIELD
  1089. LX1 X1,B5 MOVE MASK TO POSITION
  1090. LX6 X6,B5
  1091. BX2 X1*X2 MERGE DATA
  1092. BX6 X6+X2
  1093. SDF1 SA6 A2
  1094. EQ SDFX RETURN
  1095. SFT SPACE 4
  1096. ** SFT - SPACE FILL TABLE.
  1097. *
  1098. * ENTRY (A0) TABLE NUMBER.
  1099. *
  1100. * EXIT ALL WORDS IN TABLE SPACE FILLED.
  1101. * WORD PRECEEDING TABLE SET TO BLANKS.
  1102. *
  1103. * CALLS SFN.
  1104. *
  1105. * USES A - 1, 2, 3, 4, 6.
  1106. * X - 1, 2, 3, 4, 6, 7.
  1107. * B - 2, 3, 4, 5, 6.
  1108.  
  1109.  
  1110. SFT SUBR ENTRY/EXIT
  1111. SA2 A0+FTAB FWA
  1112. SA4 A0+LTAB LENGTH
  1113. SB4 X2
  1114. SB6 X4
  1115. SA4 SFTA
  1116. BX6 X4
  1117. SA6 B4-B1
  1118. SB5 B0
  1119. SFT1 SA2 A0+CTAB WORDS/ENTRY
  1120. SB3 X2
  1121.  
  1122. SFT2 GE B5,B6,SFTX RETURN - IF END OF TABLE
  1123. SA1 B4+B5
  1124. RJ SFN SPACE FILL
  1125. SA6 A1
  1126. SB5 B5+B1
  1127. EQ B3,B1,SFT2 IF ONLY ONE WORD/ENTRY
  1128. SB3 B3-B1
  1129. GT B3,B1,SFT2 IF MORE WORDS IN ENTRY.
  1130. BX6 X4
  1131. SA6 A6+B1
  1132. SB5 B5+B1
  1133. EQ SFT1 LOOP FOR NEXT ENTRY
  1134.  
  1135. SFTA DATA 10H
  1136. STB SPACE 4,20
  1137. ** STB - SORT TABLE.
  1138. * ENTRIES ARE SORTED WITH LOWEST DISPLAY CODE VALUES
  1139. * COMING FIRST. WITH THIS METHOD, NEGATIVE INTEGER
  1140. * VALUES ARE NOT SORTED PROPERLY.
  1141. *
  1142. * ENTRY (A0) TABLE NUMBER.
  1143. * ((A0)+CTAB) WORD COUNT/ENTRY.
  1144. * ((A0)+STAB) WORD COUNT/ENTRY TO COMPARE.
  1145. *
  1146. * EXIT TABLE SORTED.
  1147. *
  1148. * USES X - 1, 2, 3, 6.
  1149. * A - 0, 1, 2, 3, 6.
  1150. * B - 2, 3, 4, 5, 6, 7.
  1151. *
  1152. * CALLS DZE, GMS.
  1153. *
  1154. * NOTES SAVES AND RESTORES (A0).
  1155.  
  1156.  
  1157. STB SUBR ENTRY/EXIT
  1158. SA1 A0+CTAB GET NUMBER OF WORDS PER ENTRY
  1159. SB5 X1 SET LENGTH OF EACH COLUMN
  1160. SX6 A0 SAVE TABLE NUMBER
  1161. SA6 STBA
  1162. SA2 A0+LTAB GET LENGTH OF TABLE
  1163. IX6 X2/X1 GET NUMBER OF ENTRIES IN TABLE
  1164. SA1 A0+STAB GET NUMBER OF WORDS IN EACH KEY
  1165. SA2 A0+FTAB GET FWA OF TABLE
  1166. SB2 B0 SET CHARACTER SORT
  1167. SB3 B0 SET ASCENDING SORT
  1168. SB4 B1 SET TO SORT ON FIRST COLUMN
  1169. SB6 X6 SET NUMBER OF ENTRIES TO SORT
  1170. SB7 X2+ SET FWA OF TABLE
  1171. RJ GMS SORT TABLE
  1172. SA1 STBA RESTORE TABLE NUMBER
  1173. SA0 X1+
  1174. RJ DZE DELETE ZERO ENTRIES
  1175. EQ STBX RETURN
  1176.  
  1177.  
  1178. STBA CON 0 TABLE NUMBER
  1179. TITLE FILE WRITE ROUTINES
  1180. *** THESE ROUTINES PROVIDE ALL FUNCTIONS NECESSARY FOR
  1181. * WRITING TO THE FILE.
  1182. *
  1183. * *WTB* PERFORMS ALL WRITES OR REWRITES REQUIRED WHEN
  1184. * MANIPULATING THE FILE.
  1185. *
  1186. * *BLD* WRITES THE LEVEL-1 TABLE ON CREATE, BUILDS LEVEL-0
  1187. * AND WRITES IT TO THE FILE.
  1188. *
  1189. * *UDD* UPDATES LEVEL-0 INFORMATION UPON COMPLETION
  1190. * OF AN UPDATE.
  1191. *
  1192. * *RBA* RESETS BLOCK ADDRESSES TO REFLECT PROPER LINKAGE
  1193. * UPON COMPETION OF VARIOUS STAGES OF A REFORMAT RUN.
  1194. *
  1195. * ALL WRITE FUNCTIONS REQUIRE (X5) = FET ADDRESS OF FILE.
  1196. BLD SPACE 4
  1197. ** BLD - BUILD DIRECTORY.
  1198. *
  1199. * ENTRY EOF ENCOUNTERED ON INPUT FILE.
  1200. * (X5) FET ADDRESS (FOR WRITE).
  1201. * (X0) UPPER 24 BITS = CALLER INFORMATION,
  1202. * FOR LEVEL-0, WORD 1.
  1203. *
  1204. * EXIT DIRECTORY BUILT AND WRITTEN TO FILE.
  1205. *
  1206. * CALLS STB, WTB.
  1207. *
  1208. * USES ALL REGISTERS.
  1209.  
  1210.  
  1211. BLD SUBR ENTRY/EXIT
  1212. SA0 B0
  1213. SA1 L.TAB1
  1214. ZR X1,BLD1 IF NULL CREATE
  1215. BX6 X0 SAVE CALLER INFORMATION
  1216. SA0 B1
  1217. SA6 BLDA
  1218. RJ STB SORT TABLE
  1219. SX7 B1
  1220. SA7 CZ
  1221. RJ WTB WRITE TABLE
  1222. BX7 X7-X7
  1223. SA7 CZ
  1224. SA0 B0+
  1225. RJ STB SORT TABLE
  1226. SA1 BLDA RESTORE CALLER INFORMATION
  1227. BX0 X1
  1228. BLD1 RJ WTB WRITE TABLE
  1229. EQ BLDX RETURN
  1230.  
  1231. BLDA CON 0 HOLD FOR CALLER INFORMATION
  1232. RBA SPACE 4
  1233. ** RBA - RESET BLOCK ADDRESSES.
  1234. *
  1235. * ENTRY (A0) TABLE NUMBER.
  1236. * (X5) FET ADDRESS (FOR WRITE).
  1237. *
  1238. * EXIT ALL BLOCKS WRITTEN TO FILE.
  1239. * BLOCK ADDRESSES RESET TO REFLECT CORRECT LINKAGE.
  1240. * IF LEVEL-1, THEN LEVEL-0 IS CREATED.
  1241. * (X6) ADDRESS OF FIRST BLOCK.
  1242. *
  1243. * CALLS ADW, ANB, WTB.
  1244. *
  1245. * USES ALL REGISTERS.
  1246.  
  1247.  
  1248. RBA0 BX7 X7-X7 CLEAR TABLE POINTER
  1249. SA7 A0+PNAA
  1250.  
  1251. RBA SUBR ENTRY/EXIT
  1252. SA1 A0+LTAB CHECK LENGTH
  1253. BX2 X2-X2
  1254. SX0 X5
  1255. ZR X1,RBA3 IF EMPTY TABLE
  1256.  
  1257. RBA1 SX4 A0-1
  1258. NZ X4,RBA2 IF NOT LEVEL-1
  1259. BX6 X6-X6 CLEAR LINK
  1260. SA6 RA1+1
  1261. RBA2 RJ WTB WRITE LAST BLOCK
  1262. SX6 A0
  1263. LX6 1
  1264. SA2 X6+RA0+1 PICK UP ADDRESS OF WRITE
  1265.  
  1266. RBA3 BX6 X2
  1267. SX1 A0 SAVE ADDRESS OF BLOCK
  1268. SA6 RBAA
  1269. SA3 A0+PNEC ADDRESS OF PREVIOUS WRITE
  1270. ZR X3,RBA0 IF FINISHED
  1271. BX6 X3
  1272. LX1 1
  1273. SA6 X1+RA0
  1274. SX0 X5
  1275. RJ ANB ADD NEXT BLOCK
  1276. SA1 CW+2 LINKED BLOCK
  1277. SA2 RBAA
  1278. BX6 X1
  1279. BX7 X2
  1280. SA6 A0+PNEC
  1281. SX1 A0
  1282. LX1 1
  1283. SA7 X1+RA0+1
  1284. SX5 X0 RESET FET ADDRESSES
  1285. EQ RBA1 LOOP TO WRITE BLOCK
  1286.  
  1287. RBAA CON 0 HOLD FOR ADDRESS OF WRITE
  1288. UDD SPACE 4
  1289. ** UDD - UPDATE DIRECTORY.
  1290. *
  1291. * ENTRY (X0) FET ADDRESS (FOR READ).
  1292. * (X5) FET ADDRESS (FOR WRITE).
  1293. * (X6) UPPER 24 BITS = CALLER INFORMATION,
  1294. * FOR LEVEL-0, WORD 1.
  1295. *
  1296. * EXIT MODIFICATION DATE UPDATED.
  1297. * FIRST ENTRY UPDATED IF NECESSARY.
  1298. * (X6) " 0 IF ERROR.
  1299. *
  1300. * CALLS ANB, MVE, WTB.
  1301. *
  1302. * USES ALL REGISTERS.
  1303.  
  1304.  
  1305. UDD SUBR ENTRY/EXIT
  1306. MX3 24
  1307. BX6 X3*X6
  1308. SA6 UDDA
  1309. BX6 X5 SAVE WRITE FET ADDRESS
  1310. SA6 UDDB
  1311. BX6 X6-X6 RESET LENGTH
  1312. SA6 L.TAB0
  1313. SA6 L.TAB1
  1314. SA0 B0 TABLE NUMBER
  1315. SX3 B1 RANDOM ADDRESS
  1316. RJ ANB ADD NEXT BLOCK TO TABLE
  1317. NZ X6,UDDX IF ERROR
  1318. SA1 CW+2
  1319. BX6 X1
  1320. SA6 RA0+1
  1321. SA1 L.TAB0
  1322. ZR X1,UDDX IF EMPTY FILE
  1323. SA1 CW+1 UPDATE MODIFICATION DATE
  1324. SA2 PD
  1325. MX3 18
  1326. LX3 36
  1327. BX6 X3*X1
  1328. BX6 X6+X2
  1329. SA3 UDDA
  1330. BX6 X6+X3
  1331. SA6 A3
  1332. SA3 F.TAB0
  1333. SA1 CTAB
  1334. SB3 X1-1
  1335. SA3 X3+B3 RETRIEVE RANDOM ADDRESS OF FIRST BLOCK
  1336. SA0 B1 TABLE NUMBER
  1337. RJ ANB ADD NEXT BLOCK TO TABLE
  1338. NZ X6,UDDX IF ERROR
  1339. SA1 L.TAB1
  1340. ZR X1,UDDX RETURN - IF EMPTY TABLE
  1341. SA3 F.TAB0
  1342. SA2 F.TAB1
  1343. SA1 CTAB
  1344. MOVE X1-1,X2,X3 REPLACE FIRST ENTRY
  1345. SA1 UDDA
  1346. BX6 X1
  1347. SA6 CW+1
  1348. SA0 B0 TABLE NUMBER
  1349. SX6 B1 SET RANDOM ADDRESS
  1350. SA6 RA0
  1351. SA5 UDDB RESET FET ADDRESS
  1352. BX0 X0-X0
  1353. RJ WTB WRITE BLOCK
  1354. BX6 X6-X6
  1355. EQ UDDX RETURN
  1356.  
  1357. UDDA CON 0 HOLD AREA
  1358. UDDB CON 0 FET ADDRESS HOLD AREA
  1359. WTB SPACE 4
  1360. ** WTB - WRITE BLOCK TO FILE.
  1361. *
  1362. * ENTRY (A0) TABLE NUMBER.
  1363. * (X0) UPPER 24 BITS = CALLER INFORMATION,
  1364. * FOR LEVEL-0, WORD 1.
  1365. * (X5) FET ADDRESS FOR WRITE).
  1366. * ((A0*2)+RA0) RANDOM ADDRESS IF UPDATING EXISTING BLOCK.
  1367. * ((A0*2)+RA0+1) LINK,IF PRESENT.
  1368. * (CZ) " 0 IF LEVEL-0 TO BE BUILT WHILE WRITING L-1.
  1369. *
  1370. * EXIT TABLE WRITTEN TO FILE.
  1371. * ((A0*2)+RA0+1) RANDOM ADDRESS OF LAST WRITE.
  1372. *
  1373. * CALLS ADW, WTW.
  1374. *
  1375. * USES ALL REGISTERS.
  1376.  
  1377.  
  1378. WTB0 SX7 A0
  1379. SX0 B0 RESET LENGTH
  1380. ZR X7,WTB12 IF EMPTY LEVEL-O TABLE
  1381. SA5 WTBD RESET FET ADDRESS
  1382.  
  1383. WTB SUBR ENTRY/EXIT
  1384. BX6 X5 SAVE FET ADDRESS
  1385. SA6 WTBD
  1386. BX6 X0 SAVE STATUS WORD
  1387. SA6 WTBE
  1388. BX7 X7-X7
  1389. SA7 WTBB
  1390. SX4 A0 PICK UP RANDOM ADDRESS, IF PRESENT
  1391. LX4 1
  1392. SA4 X4+RA0
  1393.  
  1394. * DETERMINE IF BLOCK IN TABLE REPLACES AN EXISTING BLOCK ON THE
  1395. * FILE; AND IF SO, DETERMINE IF BLOCK SPLITTING IS REQUIRED.
  1396. * SET APPROPRIATE BLOCK LENGTHS.
  1397.  
  1398. SA3 A0+TFBL FULL BLOCK LENGTH
  1399. WTB1 BX7 X3 SAVE BLOCK LENGTH
  1400. SA7 WTBA
  1401. SX0 X3
  1402. SA1 A0+LTAB LENGTH
  1403. NZ X1,WTB2 IF NOT EMPTY TABLE
  1404. ZR X4,WTB0 RETURN - IF NOT REPLACING BLOCK
  1405. SX0 B0
  1406. WTB2 BX6 X1
  1407. IX3 X6/X3 FULL PRUS
  1408. SX7 WTBB
  1409. SB2 X3
  1410. BX6 X0
  1411. IX3 X3*X6 FULL PRUS LENGTH
  1412. IX6 X1-X3 REMAINING LENGTH
  1413. ZR X4,WTB4 IF NO CHECK REQUIRED FOR SPLIT BLOCK
  1414. EQ B2,WTB4 IF NO FULL PRUS - BLOCK FITS(NO SPLIT)
  1415. GT B2,B1,WTB3 IF MORE THAN 1 FULL PRU (SPLIT BLOCKS)
  1416. ZR X6,WTB5 IF NO PARTIAL PRU - BLOCK FITS(NO SPLIT)
  1417.  
  1418. WTB3 SA3 A0+TPBL PARTIAL BLOCK LENGTH
  1419. SX4 B0+
  1420. EQ WTB1
  1421. WTB4 ZR X6,WTB5 IF NO PARTIAL BLOCK
  1422. BX0 X6 BLOCK LENGTH
  1423. WTB5 EQ B2,WTB11 IF NO FULL PRUS - LAST BLOCK
  1424. GT B2,B1,WTB6 IF MORE THAN ONE FULL PRU
  1425. ZR X6,WTB11 IF NO PARTIAL PRU - LAST BLOCK
  1426.  
  1427. * BUILD CONTROL WORD.
  1428.  
  1429. WTB6 SA4 A0+CWL0 CONTROL WORD
  1430. SA3 A0+CTAB
  1431. BX2 X0
  1432. IX6 X2/X3 ENTRIES IN BLOCK
  1433. LX6 12
  1434. BX6 X4+X6
  1435. SX2 X0+2
  1436. LX2 36
  1437. BX6 X6+X2
  1438. SA6 CW
  1439. SX3 A0 SET LINK
  1440.  
  1441. * SET RANDOM ADDRESS.
  1442.  
  1443. SA2 WTBD
  1444. RECALL X2
  1445. SA7 X2+6
  1446.  
  1447. * SET LINKAGE AND WRITE BLOCK.
  1448.  
  1449. LX3 1
  1450. BX6 X6-X6 CLEAR LINK
  1451. SA3 X3+RA0+1
  1452. BX7 X3
  1453. SA6 A3
  1454. SA1 CZ
  1455. ZR X1,WTB7 IF NOT LEVEL-0 BUILD
  1456. SB3 A0
  1457. NE B3,B1,WTB7 IF NOT LEVEL-1
  1458. BX7 X7-X7
  1459. WTB7 SA7 CW+2
  1460. WRITEW X2,CW,3 WRITE CONTROL WORDS
  1461. ZR X0,WTB8 IF NO WORDS
  1462. SA5 A0+FTAB SET FWA
  1463. SA1 A0+LTAB SET LENGTH
  1464. IX6 X1-X0
  1465. SA6 A1
  1466. IX5 X6+X5
  1467. SA2 WTBD
  1468. WRITEW X2,X5,X0 WRITE BLOCK
  1469. WTB8 SA2 WTBD
  1470. WRITER X2,R
  1471.  
  1472. * MAKE LEVEL-0 ENTRIES IF PROCESSING LEVEL-1 CREATE.
  1473.  
  1474. SB3 A0
  1475. NE B3,B1,WTB9 IF NOT LEVEL-1
  1476. SA1 CZ
  1477. ZR X1,WTB9 IF NOT LEVEL-0 BUILD
  1478. SA1 X5 SET ELEMENT
  1479. ADDWRD TAB0,X1
  1480. SA2 WTBB
  1481. ADDWRD TAB0,X2
  1482. SA0 B1
  1483.  
  1484. * SET RANDOM ADDRESSES OF LAST WRITE AND RESET BLOCK LENGTH.
  1485.  
  1486. WTB9 SA2 WTBB
  1487. BX6 X6-X6 CLEAR RETURN ADDRESS
  1488. SA6 A2
  1489. ZR X2,WTB10 IF NO RETURN ADDRESS
  1490. SX3 A0
  1491. LX3 1
  1492. BX7 X2
  1493. SA7 X3+RA0+1
  1494. WTB10 SA1 A0+LTAB
  1495. ZR X1,WTB15 IF END OF TABLE
  1496. SA3 WTBA RESET BLOCK LENGTH
  1497. BX0 X3
  1498. SX4 B0
  1499. SA1 A0+LTAB
  1500. IX7 X1-X0
  1501. NZ X7,WTB2 IF NOT FIRST BLOCK
  1502.  
  1503. * SET CONTROL WORDS FOR LAST BLOCK.
  1504.  
  1505. WTB11 SX2 A0
  1506. LX2 1
  1507. SA3 X2+RA0
  1508. NZ X3,WTB13 IF RANDOM ADDRESS PRESENT
  1509. SX7 WTBB
  1510. NZ X2,WTB14 IF NOT LEVEL-0
  1511. WTB12 SA1 PD SET CREATION DATE AND MODIFICATION DATE
  1512. SB2 18
  1513. LX6 X1,B2
  1514. BX6 X6+X1
  1515. MX3 24
  1516. SA2 WTBE PICK UP STATUS WORD
  1517. BX2 X3*X2
  1518. BX6 X6+X2
  1519. SA6 CW+1
  1520. SX3 B1
  1521. WTB13 SX7 B1 SET RANDOM ADDRESS IN FET
  1522. LX7 29
  1523. BX7 X7+X3
  1524. WTB14 BX6 X3
  1525. SA6 WTBB
  1526. EQ WTB6 LOOP FOR LAST BLOCK
  1527.  
  1528. WTB15 SX4 A0 CLEAR RANDOM ADDRESS
  1529. BX6 X6-X6
  1530. LX4 1
  1531. SA5 WTBD RESET FET ADDRESS
  1532. SA6 X4+RA0
  1533. EQ WTBX RETURN
  1534.  
  1535. WTBA CON 0 HOLD AREA FOR BLOCK LENGTH
  1536. WTBB CON 0 RANDOM ADDRESS RETURN
  1537. WTBD CON 0 FET ADDRESS HOLD AREA
  1538. WTBE CON 0 STATUS WORD HOLD AREA
  1539. TITLE COMMON DECKS.
  1540. *CALL COMCCIO
  1541. *CALL COMCCPM
  1542. *CALL COMCGMS
  1543. *CALL COMCMTP
  1544. *CALL COMCMVE
  1545. *CALL COMCRDS
  1546. *CALL COMCRDW
  1547. *CALL COMCSFN
  1548. *CALL COMCSYS
  1549. *CALL COMCUSB
  1550. *CALL COMCWTW
  1551. *CALL COMCZTB
  1552. SPACE 4
  1553. * OVERFLOW CHECK.
  1554.  
  1555.  
  1556. USE OVERFLOW
  1557.  
  1558. MEML EQU *
  1559. ERRNG DIRC-MEML-5 PROGRAM OVERFLOWS INTO DIRECT CELL AREA
  1560. SPACE 4
  1561. END