Table of Contents

EXEC6

Table Of Contents

  • [00008] EXEC6 OVERLAYS FOR COMMAND EXECUTION
  • [00030] -OUTPUT- COMMAND
  • [00216] -OUTPUTL- COMMAND
  • [00339] -OUTPUTT- OUTPUT TEXT FORMAT DATA
  • [00398] -ANSDAT- OUTPUT STUDENTS ANSWER
  • [00553] -AREAOUT- OUTPUT -AREA- COMMAND DATA
  • [00652] -HELPOUT- OUTPUT -HELP- KEY DATA
  • [00756] -TERMOUT- OUTPUT -TERM- DATA
  • [00836] PARAMETERS FOR READL,READA,READD
  • [00846] READL
  • [00975] READA
  • [01100] -SYSDATA- COMMAND
  • [01307] -DATAON- COMMAND
  • [01428] -DATAOFF- COMMAND
  • [01456] READD
  • [01551] -SETDAT- SET DATA RESERVED WORDS
  • [01662] -INIDOV- INITIALIZE FOR DATA COLLECTION
  • [01990] -FINDOV- TERMINATE DATA COLLECTION
  • [02214] -DATOOV- OUTPUT TO DATA FILE
  • [02504] -DATOOV- SET TO NEXT DATA FILE
  • [02588] -DATOOV- WAIT FOR DATA FILE AVAILABLE
  • [02704] -BACKOUT-
  • [02937] SHOWE
  • [02999] SHOWO
  • [03048] SHOWH
  • [03097] -TALKREQ- DOCUMENTATION
  • [03098] TALKREQ - TALK/MONITOR INITIATION/TERMINATION.
  • [03188] -TALKREQ- TALK/MONITOR FUNCTIONS
  • [03259] -TALKREQ- COMMAND, KEYWORD ROUTINES
  • [03682] -TALKREQ- *CANCEL* FUNCTION
  • [03683] TRQBYE - COMMON TERMINATION FUNCTION.
  • [03786] -TALKREQ- SUBROUTINES
  • [03791] RDSTAT - READ TALK/MONITOR STATUS FOR STATION.
  • [03838] WRTSTAT - WRITE STATUS WORD FOR STATION.
  • [03884] ZEROSTAT - ZERO STATUS WORD FOR SPECIFIED STATION.
  • [03911] GETARG - GET ARGUMENT FROM COMMAND WORD.
  • [03926] -TALKREQ- EXITS AND STORAGE
  • [03992] FASTKOV – KEY COLLECTION (PIO TO STORAGE)
  • [04313] -HASH- COMMAND EXECUTION.
  • [04314] HASHOV - EXECUTE -HASH- COMMAND.
  • [04401] PURDY - IRREVERSIBLE ENCIPHERING.
  • [04402] PURDYOV - APPLY A ONE-WAY HASHING ALGORITHM.
  • [04501] PURDY - EVALUATE PURDY-S IRREVERSIBLE ENCIPHERING
  • [04615] Z= - OPDEFS TO SET B-REGISTER.
  • [04684] CALLL - CALL LOCAL ROUTINE WITH PARAMETERS.
  • [04712] ZEROL - ZERO A CM BUFFER (LOCAL TO *EXEC6*)
  • [04742] LOAD - LOAD EACH WORD OF A CM BUFFER.
  • [04797] MPSET - COPY ONE M-P NUMBER INTO ANOTHER.
  • [04860] KOMP - COMPARE TWO M-P NUMBERS.
  • [05053] EXPP - COMPUTE Y = X**K MOD PRIME. X AND Y ARE
  • [05124] MULTP - COMPUTE RS = R*S MOD PRIME. RS, R, AND S
  • [05161] ADDP - COMPUTE RPS = R+S MOD PRIME. RPS, R, AND S
  • [05199] MOD2Q - COMPUTE R = W MOD PRIME, FOR 2Q-BIT W.
  • [05279] MODQ1 - COMPUTE Y = S MOD PRIME, FOR (Q+1)-BIT S.
  • [05343] MODQ - COMPUTE Y = X MOD PRIME FOR Q-BIT X.
  • [05377] MPMLT - UNSIGNED, MULTI-PRECISION INTEGER
  • [05504] MPML - UNSIGNED, MULTI-PRECISION INTEGER
  • [05607] MPADD - UNSIGNED, NP-PRECISION INTEGER ADDITION.
  • [05668] MPSUB - UNSIGNED, N-PRECISION INTEGER SUBTRACTION,

Source Code

EXEC6.txt
  1. EXEC6
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK EXEC6 00 000 81/08/26 21.47
  4. IDENT PLAT5$
  5. LCC OVERLAY(PLATO,1,0)
  6. END
  7. IDENT EXEC6
  8. TITLE EXEC6 OVERLAYS FOR COMMAND EXECUTION
  9. *
  10. *
  11. CST
  12. *
  13. *
  14. EXEC6$ OVFILE
  15. *
  16. *
  17. EXT ECSPRTY,DOVRET,PROC,RETRNX,RETPRO
  18. EXT BOUNDS,PROCESS,ANSDAT
  19. EXT AREAOUT,HELPOUT,TERMOUT,ERRDATO,ERXDATO
  20. EXT OUTDATT
  21. EXT NKLIST,NKLEND,RLLOOP,RALOOP,SDSETX
  22. EXT SDCHKX,RSLOOP
  23. EXT ERXBADL,ERXVAL,ERXBOFF,ERXEODF
  24. EXT ERXBFT ERROR EXIT, -EXEC2-
  25. EXT DATAOUT,DATAO,DATAOA,DARG1,DARG2
  26. EXT FINISH
  27. *
  28. *
  29. * /--- BLOCK OUTPUT 00 000 74/03/13 23.42
  30. TITLE -OUTPUT- COMMAND
  31. *
  32. *
  33. * -OUTPUT- COMMAND
  34. * OUTPUTS AUTHOR GENERATED STUDENT DATA
  35. *
  36. * FIRST WORD -
  37. * IST 6 BITS = NUMBER OF ENTRIES
  38. * NEXT 6 = LENGTH OF ENTRY TYPE TABLE
  39. * NEXT 18 = ELAPSED TIME
  40. * NEXT 18 = UNUSED
  41. * NEXT 6 = TOTAL NUMBER OF WORDS
  42. * NEXT 6 = DATA TYPE CODE
  43. *
  44. * NEXT 2 WORDS = STUDENTS NAME
  45. * NEXT WORD = LESSON NAME
  46. * NEXT WORD = AREA NAME
  47. * NEXT N WORDS = DATA TYPE TABLE
  48. * NEXT N WORDS = AUTHOR GENERATED DATA
  49. *
  50. *
  51. OUTOV OVRLAY
  52. LX5 18 POSITION NUMBER OF ENTRIES
  53. SX6 X5
  54. SA6 NENT
  55. SA6 NENTX
  56. LX5 18 POSITION BIAS TO TABLE
  57. SX7 X5+B5
  58. SA7 NTAB
  59. MX6 0
  60. SA6 INDX INITIALIZE INDEX IN TABLE
  61. SA6 INDX1
  62. SA6 ILTH INITIALIZE TOTAL WORD COUNT
  63. SA6 INFO+5
  64. SX6 60
  65. SA6 SHFT1 INITIALIZE SHIFT COUNT
  66. *
  67. OD100 SA1 NENTX NUMBER OF ENTRIES TO PROCESS
  68. SX6 X1-1
  69. NG X6,OD900
  70. SA6 A1
  71. MX0 -1
  72. SA1 INDX
  73. SX6 X1+1 ADVANCE INDEX
  74. SA6 A1
  75. BX5 -X0*X1 MASK OFF ODD/EVEN BIT
  76. AX1 1
  77. SB1 X1 WORD COUNT
  78. SA2 NTAB
  79. SA1 X2+B1 LOAD PROPER WORD OF TABLE
  80. NZ X5,OD120
  81. AX1 30 EXTEND SIGN
  82. EQ OD140
  83. *
  84. OD120 LX1 30
  85. AX1 30 EXTEND UPPER BIT OF ENTRY
  86. * /--- BLOCK OUTPUT 00 000 74/03/13 23.34
  87. *
  88. OD140 NG X1,OD500 JUMP IF -EMBEDDED- VARIABLE
  89. MX0 -9
  90. BX2 -X0*X1 MASK OFF BIAS TO TEXT
  91. SA0 X2+B5 CM ADDRESS OF TEXT
  92. AX1 9
  93. SB1 X1 PICK UP NUMBER OF WORDS
  94. SA1 ILTH
  95. SX6 X1+B1 INCREMENT TOTAL WORD COUNT
  96. SA6 A1
  97. SA2 ATEMPEC ADDRESS OF ECS BUFFER
  98. IX0 X1+X2
  99. + WE B1 TRANSFER TEXT TO ECS
  100. RJ ECSPRTY
  101. SX7 B1 6/TYPE (0=ALPHA), 6/LENGTH
  102. RJ PUTTAB PUT NEXT ENTRY INTO TABLE
  103. EQ OD100
  104. *
  105. OD500 BX5 X1 SET UP FOR -GETVAR- CALL
  106. LX5 60-XCODEL
  107. MX0 -6 MASK FOR TYPE CODE
  108. AX1 XCODEL
  109. BX7 -X0*X1 MASK OFF TYPE CODE
  110. SB3 X7-3 SAVE FOR FLOATING POINT CHECK
  111. LX7 6
  112. SX7 X7+1 6/TYPE, 6/LENGTH
  113. RJ PUTTAB MAKE ENTRY IN TABLE
  114. ZR B3,OD520 JUMP IF FLOATING POINT
  115. NGETVAR
  116. EQ OD540
  117. *
  118. OD520 FGETVAR
  119. *
  120. OD540 BX6 X1 STORE FOR ECS TRANSFER
  121. SA6 ITEMP
  122. SA1 ILTH
  123. SX6 X1+1 INCREMENT TOTAL WORD COUNT
  124. SA6 A1
  125. SA2 ATEMPEC ADDRESS OF ECS BUFFER
  126. IX0 X1+X2
  127. SA0 ITEMP TRANSFER WORD TO ECS
  128. + WE 1
  129. RJ ECSPRTY
  130. EQ OD100 PROCESS NEXT ENTRY
  131. * /--- BLOCK OUTPUT 00 000 74/03/13 23.35
  132. *
  133. OD900 SA1 ILTH NUMBER OF WORDS OF TEXT
  134. SA2 INDX1
  135. SA3 SHFT1 SEE IF LAST TABLE WORD EMPTY
  136. SX3 X3-60
  137. ZR X3,OD910 JUMP IF LAST WORD EMPTY
  138. SX2 X2+1
  139. *
  140. OD910 SA0 X2+INFO+5 CM ADDRESS OF TEXT
  141. SB1 X1
  142. SA3 ATEMPEC ECS ADDRESS OF TEXT
  143. BX0 X3
  144. + RE B1 BRING TEXT INTO *INFO*
  145. RJ ECSPRTY
  146. IX6 X1+X2 COMPUTE TOTAL LENGTH OF DATA
  147. SX6 X6+5 ADD FOR HEADER AND NAME
  148. SB2 X6 SET UP FOR CALL
  149. LX6 6
  150. SX6 X6+AUTHD ATTACH DATA TYPE CODE
  151. SA1 NENT
  152. LX1 60-6 POSITION NUMBER OF ENTRIES
  153. BX6 X1+X6
  154. LX2 60-6-6 POSITION LENGTH OF TABLE
  155. BX6 X2+X6
  156. MX0 -18
  157. SA1 SYSCLOK LOAD RUNNING CLOCK
  158. SA2 TIMEARK
  159. IX1 X1-X2 ELAPSED TIME AT ENTRY
  160. AX1 7 KEEP TO ABOUT 1/10 SECOND
  161. BX1 -X0*X1
  162. LX1 60-6-6-18
  163. BX6 X1+X6
  164. SA6 INFO STORE HEADER WORD
  165. SA1 TNAME
  166. BX6 X1 FIRST WORD OF STUDENT NAME
  167. SA6 INFO+1
  168. MX0 48
  169. SA1 TNAME1
  170. BX6 X0*X1 SECOND WORD OF STUDENT NAME
  171. SA6 INFO+2
  172. CALL FSQUISH,TBLESAC
  173. BX6 X1
  174. SA6 INFO+3
  175. SA1 TBAREA AREA NAME
  176. BX6 X1
  177. SA6 INFO+4
  178. EQ DOVRET
  179. *
  180. * /--- BLOCK OUTPUT 00 000 74/03/13 23.35
  181. *
  182. *
  183. PUTTAB EQ * ENTRY / EXIT
  184. SA2 INDX1 CURRENT WORD IN NEW TABLE
  185. SA1 SHFT1
  186. SX6 X1-12 COMPUTE SHIFT COUNT
  187. PL X6,PT1
  188. SX6 60-12 RE-INITIALIZE SHIFT COUNT
  189. SA6 A1
  190. SX6 X2+1 ADVANCE WORD COUNT
  191. SA6 A2
  192. LX7 60-12 POSITION FIRST BYTE
  193. SA7 X6+INFO+5
  194. EQ PUTTAB
  195. *
  196. PT1 SB1 X6 PICK UP SHIFT COUNT
  197. SA6 A1
  198. LX7 X7,B1
  199. SA1 X2+INFO+5 LOAD CURRENT WORD
  200. BX7 X1+X7
  201. SA7 A1 STORE WITH NEW ENTRY
  202. EQ PUTTAB
  203. *
  204. *
  205. NENT EQU INFO+DATAMAX+5
  206. NENTX EQU NENT+1
  207. NTAB EQU NENTX+1
  208. INDX EQU NTAB+1
  209. INDX1 EQU INDX+1
  210. SHFT1 EQU INDX1+1
  211. ILTH EQU SHFT1+1
  212. *
  213. *
  214. ENDOV
  215. * /--- BLOCK OUTPUTL 00 000 78/07/05 01.26
  216. TITLE -OUTPUTL- COMMAND
  217. *
  218. *
  219. * -OUTPUTL- COMMAND
  220. * OUTPUTS AUTHOR GENERATED DATA WITH LABEL
  221. *
  222. * FIRST WORD -
  223. * IST 18 BITS = ELAPSED TIME
  224. * NEXT 30 = UNUSED
  225. * NEXT 6 = TOTAL NUMBER OF WORDS
  226. * NEXT 6 = DATA TYPE CODE
  227. *
  228. * NEXT 2 WORDS = STUDENTS NAME
  229. * NEXT WORD = LESSON NAME
  230. * NEXT WORD = AREA NAME
  231. * NEXT WORD = DATA LABEL
  232. * NEXT N WORDS = AUTHOR GENERATED DATA
  233. *
  234. *
  235. OUTLOV OVRLAY
  236. NG X5,OUTDLX
  237. NGETVAR GET OUTPUT LABEL
  238. CALL LJUST,(1R ),0
  239. BX6 X1
  240. SA6 INFO+5
  241. SA5 A5 RESTORE X5
  242. LX5 XCODEL
  243. NGETVAR GET STARTING ADDRESS
  244. SX6 A1
  245. SA6 OLWK
  246. SA5 A5 RESTORE X5
  247. AX5 XCMNDL
  248. MX2 2*XCODEL+XCMNDL
  249. BX5 -X2*X5 MASK OFF XSTOR POINTER
  250. SA2 X5+B5
  251. BX5 X2 -GETVAR- CODE TO X5 FOR CALL
  252. NGETVAR GET NUMBER OF WORDS TO OUTPUT
  253. NG X1,ERXBADL NO NEGATIVE OR ZERO LENGTH
  254. ZR X1,ERXBADL EXECERR USES X1 FOR ERXBADL
  255. SB2 X1-21
  256. PL B2,ERXBADL ERROR IF TOO MUCH DATA
  257. * /--- BLOCK OUTPUTL 00 000 74/03/13 23.46
  258. *
  259. SA2 OLWK LOAD STARTING ADDRESS
  260. SA0 X2
  261. CALL BOUNDS
  262. SB1 X1 RESTORE LENGTH
  263. SB2 B1+6 SAVE TOTAL LENGTH FOR LATER
  264. SA1 ATEMPEC
  265. BX0 X1
  266. + WE B1 TRANSFER TO *INFO* VIA ECS
  267. RJ ECSPRTY
  268. SA0 INFO+6
  269. + RE B1
  270. RJ ECSPRTY
  271. MX0 -18
  272. SA1 SYSCLOK LOAD CURRENT CLOCK
  273. SA2 TIMEARK
  274. IX1 X1-X2 COMPUTE ELAPSED TIME
  275. AX1 7
  276. BX1 -X0*X1 KEEP TO 1/10 SECOND
  277. LX1 60-18
  278. SX6 B2 PICK UP TOTAL LENGTH
  279. LX6 6
  280. SX6 X6+AUTHDL LENGTH AND CODE
  281. BX6 X1+X6
  282. SA6 INFO STORE HEADER WORD
  283. SA1 TNAME
  284. BX6 X1 STORE FIRST WORD OF NAME
  285. SA6 INFO+1
  286. MX0 -12
  287. SA1 TNAME1
  288. BX6 X0*X1 STORE SECOND WORD OF NAME
  289. SA6 INFO+2
  290. CALL FSQUISH,TBLESAC
  291. BX6 X1
  292. SA6 INFO+3
  293. SA1 TBAREA AREA NAME
  294. BX6 X1
  295. SA6 INFO+4
  296. EQ DOVRET
  297. *
  298. * /--- BLOCK OUTPUTL 00 000 78/07/05 01.26
  299. *
  300. * -OUTPUTL- COMMAND
  301. * TWO ARGUMENT -OUTPUTL- MINIMUM HEADER INFO
  302. *
  303. *
  304. OUTDLX MX6 1
  305. BX5 -X6*X5 CLEAR FLAG BIT
  306. NGETVAR
  307. SX6 A1 SAVE ADDRESS
  308. SA6 OLWK
  309. SA5 A5 GET NEXT -GETVAR- CODE
  310. LX5 XCODEL
  311. NGETVAR GET NUMBER OF WORDS TO OUTPUT
  312. NG X1,ERXBADL NO NEGATIVE OR ZERO LENGTH
  313. ZR X1,ERXBADL EXECERR USES X1 FOR ERXBADL
  314. SB2 X1-21
  315. PL B2,ERXBADL ERROR IF TOO MUCH DATA
  316. SA2 OLWK LOAD STARTING ADDRESS
  317. SA0 X2
  318. CALL BOUNDS
  319. SB1 X1 RESTORE LENGTH
  320. SB2 B1+1 SAVE TOTAL LENGTH FOR LATER
  321. SA1 ATEMPEC
  322. BX0 X1
  323. + WE B1 TRANSFER TO *INFO* VIA ECS
  324. RJ ECSPRTY
  325. SA0 INFO+1
  326. + RE B1
  327. RJ ECSPRTY
  328. SX6 B2 PICK UP LENGTH OF RECORD
  329. LX6 6
  330. SX6 X6+AUTHDX ATTACH DATA TYPE CODE
  331. SA6 INFO
  332. EQ DOVRET
  333. *
  334. *
  335. OLWK BSS 1
  336. *
  337. ENDOV
  338. * /--- BLOCK OUTPUTT 00 000 78/07/05 01.27
  339. TITLE -OUTPUTT- OUTPUT TEXT FORMAT DATA
  340. *
  341. *
  342. * -OUTPUTT-
  343. * OUTPUTS AUTHOR GENERATED TEXT
  344. *
  345. * FIRST WORD -
  346. * IST 48 BITS = UNUSED
  347. * NEXT 6 = TOTAL NUMBER OF WORDS
  348. * NEXT 6 = DATA TYPE CODE
  349. *
  350. * NEXT 'N WORDS = TEXT TO BE PUT INTO DATAFILE
  351. *
  352. *
  353. OUTTOV OVRLAY
  354. *
  355. NGETVAR GET ADDRESS OF CHARACTER STRING
  356. SX6 A1
  357. SA6 VARBUF SAVE FOR LATER
  358. *
  359. SA5 A5 RE-FETCH COMMAND WORD
  360. LX5 XCODEL
  361. NGETVAR GET SECOND ARGUMENT
  362. *
  363. NG X1,ERXBADL BAD LTH, EXECERR USES X1
  364. ZR X1,PROCESS JUST EXIT IF LENGTH UNSUITABLE
  365. SX6 X1-DATAMAX+1-1 1 WORD FOR HEADER
  366. PL X6,DERXBAD LIMIT OF *DATAMAX* WORDS
  367. *
  368. SA2 VARBUF RE-FETCH STARTING ADDRESS
  369. *
  370. SA0 X2 PREPARE FOR BOUNDS TEST
  371. RJ BOUNDS SEE IF ALL WITHIN BOUNDS
  372. *
  373. *
  374. SB1 X1 LTH OF BUFFER
  375. SX1 X1+1 LENGTH OF RECORD
  376. SB2 X1 SAVE FOR DATAOUT
  377. *
  378. LX1 6 POSITION LENGTH OF RECORD
  379. SX6 X1+DOUTT ATTACH DATA TYPE CODE
  380. SA6 INFO STORE HEADER WORD
  381. *
  382. SA1 ATEMPEC
  383. BX0 X1 ADDRESS OF SCRATCH ECS
  384. + WE B1
  385. RJ ECSPRTY
  386. SA0 INFO+1 MOVE BUFFER SPECIFIED TO *INFO*
  387. + RE B1
  388. RJ ECSPRTY
  389. *
  390. *
  391. EQ DOVRET
  392. *
  393. DERXBAD SX2 DATAMAX-1 POSSIBLY OFF BY ONE
  394. EXECERR 98 VALUE TOO HIGH
  395. *
  396. ENDOV
  397. * /--- BLOCK ANSDAT 00 000 76/04/26 04.55
  398. TITLE -ANSDAT- OUTPUT STUDENTS ANSWER
  399. *
  400. *
  401. * -ANSDAT-
  402. * OUTPUTS STUDENT ANSWER AND RELATED INFORMATION
  403. *
  404. * FIRST WORD -
  405. * 1ST 18 BITS = ELAPSED TIME SINCE SIGN-ON
  406. * NEXT 6 = JUDGEMENT TYPE
  407. * NEXT 9 = ARROW NUMBER
  408. * NEXT 15 = ANSWER DUMP CAUSE BITS
  409. * NEXT 6 = TOTAL NUMBER OF WORDS
  410. * NEXT 6 = DATA TYPE CODE
  411. *
  412. * NEXT 2 WORDS = STUDENTS NAME
  413. * NEXT WORD = LESSON NAME
  414. * NEXT WORD = AREA NAME
  415. * NEXT WORD = UNIT NAME
  416. * NEXT N WORDS = STUDENTS ANSWER
  417. *
  418. *
  419. ANSDOV OVRLAY
  420. SA1 TBITS SEE IF -ERASEU- BIT SET
  421. LX1 ERSUBIT
  422. NG X1,ANSDAT EXIT IF PROCESSING -ERASEU-
  423. MX6 -1 MARK *INFO* BUFFER USED
  424. SA6 JJSTORE
  425. SA1 TJUDGED LOAD JUDGMENT
  426. NG X1,DANS1 JUMP IF -OK-
  427. ZR X1,DANS2 JUMP IF RECOGNIZED -NO-
  428. CALL AREAINC,1,27
  429. MX7 1
  430. LX7 DSUNO POSITION BIT FOR UNRECOGINZED
  431. SA1 TBLDATA+1
  432. BX7 X1+X7 MERGE WITH REST OF DUMP BITS
  433. MX1 1
  434. LX1 DSNO POSITION BIT FOR -NO-
  435. BX7 X1+X7
  436. SA7 A1
  437. EQ ANSXX
  438. *
  439. DANS1 CALL AREAINC,1,9
  440. SA1 TBLDATA+1
  441. MX7 1
  442. LX7 DSOK SET BIT FOR -OK-
  443. BX7 X1+X7
  444. SA7 A1
  445. MX7 -9
  446. BX7 -X7*X1 MASK OFF NUMBER OF TRIES
  447. SX7 X7-1
  448. NZ X7,ANSXX JUMP IF NOT FIRST TRY
  449. CALL AREAINC,1,18
  450. EQ ANSXX
  451. * /--- BLOCK ANSDAT 00 000 74/12/31 18.47
  452. *
  453. DANS2 CALL AREAINC,1,0
  454. SA1 TBLDATA+1
  455. MX7 1
  456. LX7 DSNO SET BIT FOR -NO-
  457. BX7 X1+X7
  458. SA7 A1
  459. *
  460. ANSXX SA1 TBLDATA SELECTED DATA OPTION BITS
  461. SB1 X1 SEE IF COLLECTING DATA
  462. SA2 TBTDATA
  463. NG X2,ANSDAT EXIT IF -SYSDATA- USAGE
  464. BX1 X1+X2 ATTACH LESSON-SELECTED BITS
  465. SA2 TBLDATA+1
  466. MX0 -9
  467. BX6 -X0*X2 CLEAR OUT ALL BUT TRY COUNTER
  468. SA6 A2
  469. ZR B1,ANSDAT EXIT IF NOT COLLECTING DATA
  470. BX6 X1*X2 SEE IF SHOULD DUMP ANSWER
  471. AX6 18
  472. ZR X6,ANSDAT
  473. MX0 15 ALLOW 15 BITS ONLY
  474. LX2 1
  475. BX6 X0*X2 MASK OFF DUMP CAUSE BITS
  476. SA6 ADWK1
  477. SA1 LESUN LOAD UNIT NUMBER
  478. SX6 X1
  479. SA6 ADWK CONVERT NUMBER TO NAME
  480. CALL HOLUNIT,ADWK,ADWK
  481. MX0 -18
  482. SA1 SYSCLOK LOAD CURRENT CLOCK
  483. SA2 TIMEARK
  484. IX1 X1-X2 COMPUTE ELAPSED TIME
  485. AX1 7 KEEP TO ABOUT 1/10 SECOND
  486. BX1 -X0*X1
  487. LX1 60-18 POSITION ELAPSED TIME
  488. MX0 -6
  489. SA2 TJUDGED LOAD ANSWER JUDGMENT
  490. SX6 X2+2 1=OK 2=NO 3=UNREC NO
  491. BX2 -X0*X6
  492. LX2 60-18-6
  493. BX6 X1+X2 BEGIN FORMING HEADER WORD
  494. * /--- BLOCK ANSDAT 00 000 76/05/17 22.12
  495. *
  496. MX0 -9
  497. SA1 AREADAT
  498. BX1 -X0*X1 MASK OFF ARROW COUNT
  499. LX1 60-18-6-9
  500. BX6 X6+X1 MERGE WITH HEADER WORD
  501. SA1 LONG NUMBER OF 6 BIT CODES
  502. SX1 X1+9
  503. PX1 X1 PACK CHARACTER COUNT
  504. SA2 ADK1
  505. FX1 X1*X2 COMPUTE NUMBER OF WORDS
  506. SB1 X1
  507. SX1 X1+6 INCREMENT FOR ADDITIONAL INFO
  508. SB2 X1 SAVE TOTAL COUNT FOR CALL
  509. LX1 6 POSITON WORD COUNT
  510. BX6 X6+X1
  511. SA1 ADWK1 LOAD DUMP-CAUSE BITS
  512. LX1 6+6+15
  513. BX6 X1+X6
  514. SX1 STANS CODE FOR STUDENT ANSWER
  515. BX6 X6+X1
  516. SA6 INFO STORE COMPLETED HEADER
  517. SA1 TNAME FIRST WORD OF STUDENTS NAME
  518. BX6 X1
  519. SA6 INFO+1
  520. MX0 48
  521. SA1 TNAME1 SECOND WORD OF STUDENTS NAME
  522. BX6 X0*X1
  523. SA6 INFO+2
  524. CALL FSQUISH,TBLESAC
  525. BX6 X1
  526. SA6 INFO+3
  527. SA1 TBAREA AREA NAME
  528. BX6 X1
  529. SA6 INFO+4
  530. SA1 ADWK LOAD UNIT NAME
  531. BX6 X1
  532. SA6 INFO+5
  533. SA1 TBINPUT ADDRESS OF STUDENTS ANSWER
  534. SA0 X1
  535. SA1 ATEMPEC ADDRESS OF ECS SCRATCH BUFFER
  536. BX0 X1
  537. + WE B1 MOVE STUDENTS ANSWER
  538. RJ ECSPRTY
  539. SA0 INFO+6
  540. + RE B1
  541. RJ ECSPRTY
  542. EQ ADVEXIT
  543. *
  544. ADK1 DATA 17170631463146314632B (1/10)*2**-48
  545. ADWK BSS 1
  546. ADWK1 BSS 1
  547. *
  548. ADVEXIT RETURN
  549. *
  550. *
  551. ENDOV
  552. * /--- BLOCK AREAOUT 00 000 74/12/31 18.47
  553. TITLE -AREAOUT- OUTPUT -AREA- COMMAND DATA
  554. *
  555. *
  556. * -AREAOUT-
  557. * OUTPUTS DATA ASSOCIATED WITH -AREA- COMMAND
  558. *
  559. * FIRST WORD -
  560. * IST 18 BITS = CURRENT TIME
  561. * NEXT 30 = UNUSED
  562. * NEXT 6 = TOTAL NUMBER OF WORDS
  563. * NEXT 6 = DATA TYPE CODE
  564. *
  565. * NEXT 2 WORDS = STUDENTS NAME
  566. * NEXT WORD = LESSON NAME
  567. * NEXT WORD = AREA NAME
  568. * NEXT 3 WORDS = AREA DATA
  569. *
  570. *
  571. AREAOV OVRLAY
  572. SA1 TBLDATA SEE IF COLLECTING DATA
  573. SX2 X1
  574. ZR X2,AREAOUT
  575. SA2 TBTDATA ATTACH LESSON-SELECTED BITS
  576. NG X2,AREAOUT EXIT IF -SYSDATA-
  577. BX1 X1+X2
  578. LX1 60-DSAREA SEE IF SHOULD DUMP -AREA-
  579. PL X1,AREAOUT
  580. SA1 TBAREA SEE IF ANY -AREA- COMMAND
  581. ZR X1,AREAOUT
  582. BX6 X1 STORE -AREA- NAME
  583. SA6 INFO+4
  584. MX0 -18
  585. SA1 SYSCLOK LOAD CURRENT CLOCK
  586. SA2 TIMEARK
  587. IX2 X1-X2 COMPUTE ELAPSED TIME
  588. AX2 7 KEEP TO ABOUT 1/10 SECOND
  589. BX2 -X0*X2
  590. LX2 60-18 POSITION ELAPSED TIME
  591. * /--- BLOCK AREAOUT 00 000 77/11/05 07.47
  592. *
  593. MX0 18
  594. SA1 AREADAT+1 GET TIME OF ENTRY TO AREA
  595. BX1 X0*X1
  596. IX1 X2-X1 CURRENT TIME - ENTRY TIME
  597. SA3 AREADAT+2 GET PREVIOUS ELAPSED TIME
  598. BX6 X0*X3
  599. IX6 X1+X6 ADD ON RECENT ELAPSED TIME
  600. BX6 X0*X6
  601. BX3 -X0*X3 CLEAR OUT OLD ELAPSED TIME
  602. BX6 X3+X6
  603. SA6 A3
  604. SX6 1000B+DAREA LENGTH AND CODE
  605. BX6 X6+X2
  606. SA6 INFO STORE HEADER WORD
  607. SA1 TNAME
  608. BX6 X1 FIRST WORD OF STUDENTS NAME
  609. SA6 INFO+1
  610. MX0 48
  611. SA1 TNAME1 SECOND WORD OF NAME
  612. BX6 X0*X1
  613. SA6 INFO+2
  614. CALL FSQUISH,TBLESAC
  615. BX6 X1
  616. SA6 INFO+3
  617. SA1 AREADAT AREA DATA WORD
  618. BX6 X1
  619. SA6 INFO+5
  620. SA1 AREADAT+1 SECOND AREA DATA WORD
  621. BX6 X1
  622. SA6 INFO+6
  623. SA1 AREADAT+2 THIRD AREA DATA WORD
  624. BX6 X1
  625. SA6 INFO+7
  626. LX1 18 CHECK IF LAST AREA WAS COMPLETE
  627. MX0 1
  628. LX0 60-18-1 POSITION AREA CONTINUED BIT
  629. BX6 X0+X6 SET CONTINUATION BIT
  630. SA6 A1 WRITE TO INFO BUFFER
  631. PL X1,AOVEND
  632. MX6 0
  633. SA6 TBAREA CLEAR OUT AREA NAME
  634. SA6 AREADAT
  635. MX0 -18
  636. SA1 AREADAT+2 SAVE -DATAON- TIME
  637. BX6 -X0*X1 IN LOWER 18 BITS
  638. SA6 AREADAT+2
  639. SA1 SYSCLOK LOAD RUNNING CLOCK
  640. SA2 TIMEARK
  641. IX1 X1-X2 ELAPSED TIME AT ENTRY
  642. AX1 7 KEEP TO ABOUT 1/10 SECOND
  643. BX6 -X0*X1
  644. LX6 60-18
  645. SA6 AREADAT+1 INITIALIZE DATA FOR THIS AREA
  646. *
  647. AOVEND RETURN
  648. *
  649. *
  650. ENDOV
  651. * /--- BLOCK HELPOUT 00 000 74/12/31 18.49
  652. TITLE -HELPOUT- OUTPUT -HELP- KEY DATA
  653. *
  654. *
  655. * -HELPOUT-
  656. * OUTPUTS HELP-TYPE KEY DATA
  657. *
  658. * ON ENTRY - *OVARG1* = 0 IF HELP NOT FOUND
  659. * -1 IF HELP WAS FOUND
  660. * X5 = UNIT NUMBER
  661. *
  662. * FIRST WORD -
  663. * IST 18 BITS = CURRENT TIME
  664. * NEXT 30 = UNUSED
  665. * NEXT 6 = TOTAL NUMBER OF WORDS
  666. * NEXT 6 = DATA TYPE CODE
  667. *
  668. * NEXT 2 WORDS = STUDENTS NAME
  669. * NEXT WORD = LESSON NAME
  670. * NEXT WORD = AREA NAME
  671. * NEXT WORD = CURRENT UNIT NAME
  672. * NEXT WORD = HELP UNIT NAME (OR 0)
  673. * NEXT WORD = HELP KEY NAME
  674. *
  675. *
  676. HELPOV OVRLAY
  677. BX6 X5 SAVE X5 (UNIT NUMBER)
  678. SA6 HELPSAV
  679. SA1 OVARG1
  680. NG X1,HLPA JUMP IF -HELP- WAS FOUND
  681. CALL AREAINC,0,9
  682. SA1 TBLDATA
  683. SX2 X1 SEE IF COLLECTING DATA
  684. ZR X2,HELPOUT
  685. SA2 TBTDATA
  686. NG X2,HELPOUT EXIT IF -SYSDATA-
  687. BX1 X1+X2 ATTACH LESSON-SELECTED BITS
  688. LX1 60-DSHELPN SEE IF COLLECTING -HELP- DATA
  689. PL X1,HELPOUT
  690. MX6 0 SET FOR -HELP- NOT FOUND
  691. SA6 INFO+6
  692. EQ HLPB
  693. *
  694. HLPA CALL AREAINC,0,18
  695. SA1 TBLDATA
  696. SX2 X1 SEE IF COLLECTING DATA
  697. ZR X2,HELPOUT
  698. SA2 TBTDATA ATTACH LESSON-SELECTED BITS
  699. NG X2,HELPOUT EXIT IF -SYSDATA-
  700. BX1 X1+X2
  701. LX1 60-DSHELP
  702. PL X1,HELPOUT SEE IF COLLECTING -HELP- DATA
  703. SA1 ILESUN
  704. BX5 X1 BE SURE LESSON POINTERS SET
  705. CALL SETLESN
  706. CALL HOLUNIT,HELPSAV,INFO+6
  707. * /--- BLOCK HELPOUT 00 000 76/05/17 22.12
  708. *
  709. HLPB SA1 KEY CONVERT KEY NUMBER TO NAME
  710. SA2 HK1 *NOSUCH*
  711. BX6 X1+X2 MAKE UP NAME IN CASE NO FIND
  712. SA6 NKLEND
  713. MX0 -18 MASK FOR KEY NUMBER
  714. SA2 NKLIST-1
  715. *
  716. HKLP SA2 A2+1 LOAD NEXT KEY NAME/NUMBER
  717. BX3 -X0*X2
  718. BX3 X1-X3 SEE IF NUMBERS MATCH
  719. NZ X3,HKLP
  720. BX6 X0*X2 MASK OFF KEY NAME
  721. SA6 INFO+7
  722. SA1 SYSCLOK LOAD CURRENT CLOCK
  723. SA2 TIMEARK
  724. IX1 X1-X2 COMPUTE ELAPSED TIME
  725. AX1 7
  726. BX1 -X0*X1 KEEP TO 1/10 SECOND
  727. LX1 60-18
  728. SX6 1000B+HELPD
  729. BX6 X1+X6 FORM HEADER WORD
  730. SA6 INFO
  731. SA1 TNAME
  732. BX6 X1 FIRST WORD OF STUDENT NAME
  733. SA6 INFO+1
  734. MX0 -12
  735. SA1 TNAME1
  736. BX6 X0*X1 SECOND WORD OF STUDENT NAME
  737. SA6 INFO+2
  738. CALL FSQUISH,TBLESAC
  739. BX6 X1 STORE LESSON NAME
  740. SA6 INFO+3
  741. SA1 TBAREA
  742. BX6 X1 STORE AREA NAME
  743. SA6 INFO+4
  744. SA1 TUNAME
  745. BX6 X1 STORE CURRENT UNIT NAME
  746. SA6 INFO+5
  747. EQ HOEXIT
  748. *
  749. HK1 DATA 6LNOSUCH
  750. *
  751. HOEXIT RETURN
  752. *
  753. *
  754. ENDOV
  755. * /--- BLOCK TERMOUT 00 000 76/05/29 00.23
  756. TITLE -TERMOUT- OUTPUT -TERM- DATA
  757. *
  758. *
  759. * -TERMOUT-
  760. * OUTPUTS TERM REQUEST INFO
  761. *
  762. * ON ENTRY - *OVARG1* = 0 IF TERM NOT FOUND
  763. * -1 IF TERM WAS FOUND
  764. *
  765. * FIRST WORD -
  766. * IST 18 BITS = CURRENT TIME
  767. * NEXT 30 = UNUSED
  768. * NEXT 6 = TOTAL NUMBER OF WORDS
  769. * NEXT 6 = DATA TYPE CODE
  770. *
  771. * NEXT 2 WORDS = STUDENTS NAME
  772. * NEXT WORD = LESSON NAME
  773. * NEXT WORD = AREA NAME
  774. * NEXT WORD = TERM DATA
  775. *
  776. *
  777. TERMOV OVRLAY
  778. SA1 OVARG1
  779. ZR X1,TRMOUT0 JUMP IF TERM NOT FOUND
  780. CALL AREAINC,0,36
  781. SA1 TBLDATA SEE IF COLLECTING DATA
  782. SX2 X1
  783. ZR X2,TERMOUT
  784. SA2 TBTDATA ATTACH LESSON-SELECTED BITS
  785. NG X2,TERMOUT EXIT IF -SYSDATA-
  786. BX1 X1+X2
  787. LX1 60-DSTERM
  788. PL X1,TERMOUT SEE IF TERM DUMP SPECIFIED
  789. MX7 0 FLAG FOR TERM FOUND
  790. EQ TRMOUT1
  791. *
  792. TRMOUT0 CALL AREAINC,0,27
  793. SA1 TBLDATA SEE IF COLLECTING DATA
  794. SX2 X1
  795. ZR X2,TERMOUT
  796. SA2 TBTDATA ATTACH LESSON-SELECTED BITS
  797. NG X2,TERMOUT EXIT IF -SYSDATA-
  798. BX1 X1+X2
  799. LX1 60-DSTERMN
  800. PL X1,TERMOUT SEE IF TERM DUMP SPECIFIED
  801. SX7 1
  802. *
  803. TRMOUT1 MX0 -18
  804. SA1 SYSCLOK LOAD CURRENT CLOCK
  805. SA2 TIMEARK
  806. IX1 X1-X2 COMPUTE ELAPSED TIME
  807. AX1 7
  808. BX1 -X0*X1 KEEP TO 1/10 SECOND
  809. LX1 60-18
  810. SX6 600B+TERMD LENGTH AND CODE
  811. BX6 X1+X6
  812. SA6 INFO STORE HEADER WORD
  813. SA1 TNAME
  814. BX6 X1 STORE FIRST WORD OF NAME
  815. SA6 INFO+1
  816. MX0 -12
  817. SA1 TNAME1
  818. BX6 X0*X1 STORE SECOND WORD OF NAME
  819. SA6 INFO+2
  820. CALL FSQUISH,TBLESAC
  821. BX6 X1
  822. SA6 INFO+3
  823. SA1 TBAREA AREA NAME
  824. BX6 X1
  825. SA6 INFO+4
  826. *
  827. SA1 TTERM TERM NAME
  828. BX6 X1+X7 STORE TERM NAME AND BIT
  829. SA6 INFO+5
  830. RETURN
  831. *
  832. ENDOV
  833. *
  834. *
  835. * /--- BLOCK PARAMETERS 00 000 77/07/14 03.38
  836. TITLE PARAMETERS FOR READL,READA,READD
  837. *
  838. * THE FOLLOWING BUFFER IS USED BY READL, READA, READD
  839. * OVERLAYS TO ASSEMBLE THE STUDENT DATA PACKAGE TO BE
  840. * WRITTEN TO ECS.
  841. *
  842. IIBUFF EQU INFO+DATAMAX+1
  843. *
  844. *
  845. * /--- BLOCK READL 00 000 78/12/23 00.34
  846. TITLE READL
  847. *
  848. * -READL- COMMAND
  849. *
  850. * READ NEXT -OUTPUTL- DATA RECORD
  851. *
  852. * ON EXIT--
  853. * *TRETURN* = -1 IF OK
  854. * 0 IF END-OF-FILE ENCOUNTERED
  855. * (*TERROR* = REVERSE OF ABOVE)
  856. *
  857. *
  858. READLOV OVRLAY
  859. MX0 -6
  860. SA1 INFO LOAD HEADER WORD
  861. ZR X1,RLEOF JUMP IF END-OF-FILE
  862. BX2 -X0*X1
  863. SX6 X2-AUTHDL CHECK FOR -OUTPUTL-
  864. ZR X6,RLLPA
  865. SX6 X2-AUTHDX
  866. ZR X6,RDOLX JUMP IF TWO-ARG -OUTPUTL-
  867. EQ RLLOOP
  868. *
  869. RLLPA MX6 18
  870. BX6 X6*X1 MASK OFF TIME
  871. LX6 18+7
  872. SA6 IIBUFF+5
  873. AX1 6 POSITION LENGTH OF RECORD
  874. BX1 -X0*X1
  875. SX6 X1+1 LENGTH OF RE-FORMATTED RECORD
  876. SA6 IIBUFF
  877. SA1 INFO+2 SECOND WORD OF STUDENT NAME
  878. BX6 X1
  879. SA6 IIBUFF+2
  880. SA1 INFO+1 FIRST WORD OF STUDENT NAME
  881. *
  882. RLLP0 BX6 X1
  883. SA6 IIBUFF+1
  884. SA1 INFO+3
  885. BX6 X1 LESSON NAME
  886. SA6 IIBUFF+3
  887. SA1 INFO+4
  888. BX6 X1 AREA NAME
  889. SA6 IIBUFF+4
  890. SA1 INFO+5
  891. BX6 X1 OUTPUT LABEL
  892. SA6 IIBUFF+6
  893. SA1 IIBUFF LENGTH OF RECORD
  894. SB3 X1 SAVE TOTAL LENGTH OF RECORD
  895. SB1 X1-7 LENGTH OF AUTHOR DATA
  896. SA2 ATEMPEC
  897. BX0 X2
  898. SA0 IIBUFF REFORM RECORD IN TEMP ECS
  899. WE 7
  900. RJ ECSPRTY
  901. SA0 INFO+6
  902. SX3 7 ADVANCE ECS ADDRESS
  903. IX0 X0+X3
  904. WE B1 WRITE OUT AUTHOR DATA
  905. RJ ECSPRTY
  906. *
  907. RLLPB SA1 TBDFINF+1
  908. SB2 X1 PICK OFF ADDRESS OF BUFFER
  909. AX1 18
  910. SB1 X1 PICK OFF LENGTH OF BUFFER
  911. BX0 X2 ECS SCRATCH BUFFER
  912. SA0 B2
  913. RE B1 MOVE DATA TO AUTHOR BUFFER
  914. RJ ECSPRTY
  915. GE B3,B1,RLLP1
  916. SA0 B2+B3
  917. SB3 B1-B3
  918. SX1 A0 SAVE *A0*
  919. ZERO X1,B3 CLEAR OUT REST OF BUFFER
  920. * /--- BLOCK RLLP1 00 000 78/12/23 00.36
  921. *
  922. RLLP1 MX6 -1 -1 = OK
  923. MX7 0
  924. SA6 TRETURN
  925. SA7 TERROR
  926. EQ PROCESS --- RETURN
  927. *
  928. RDOLX AX1 6 POSITION LENGTH OF RECORD
  929. BX1 -X0*X1
  930. SB1 X1-1 LENGTH OF AUTHOR DATA
  931. SX6 B1+7 LENGTH OF REFORMATED RECORD
  932. SA6 IIBUFF
  933. SB3 X6
  934. MX6 0 CLEAR OUT NAME, LESSON ETC
  935. SA6 IIBUFF+1
  936. SA6 IIBUFF+2
  937. SA6 IIBUFF+3
  938. SA6 IIBUFF+4
  939. SA6 IIBUFF+5
  940. SA6 IIBUFF+6
  941. SA2 ATEMPEC
  942. BX0 X2
  943. SA0 IIBUFF REFORM RECORD IN ECS
  944. WE 7
  945. RJ ECSPRTY
  946. SX3 7
  947. IX0 X0+X3
  948. SA0 INFO+1
  949. WE B1 WRITE OUT AUTHOR DATA
  950. RJ ECSPRTY
  951. EQ RLLPB
  952. *
  953. *
  954. RLEOF SA1 TBDFINF+1 LOAD BUFFER ADDRESS/LENGTH
  955. SA0 X1 PICK OFF ADDRESS
  956. AX1 18
  957. SB1 X1 PICK OFF LENGTH
  958. SX1 A0 SAVE *A0*
  959. ZERO X1,B1 ZERO REST OF BUFFER
  960. SA1 TBDFINF
  961. SX1 X1 RELEASE DATA-READ BUFFER
  962. CALL ALTLES,-1
  963. MX6 0
  964. SA6 TBDFINF CLEAR OUT INFO WORDS
  965. SA6 TBDFINF+1
  966. MX6 0 0 = END-OF-FILE ENCOUNTERED
  967. MX7 -1
  968. SA6 TRETURN
  969. SA7 TERROR
  970. EQ PROCESS --- RETURN
  971. *
  972. *
  973. ENDOV
  974. * /--- BLOCK READA 00 000 75/11/27 20.27
  975. TITLE READA
  976. *
  977. * -READA- COMMAND
  978. *
  979. * READ NEXT -AREA- DATA RECORD
  980. *
  981. * ON EXIT--
  982. * *TRETURN* = -1 IF OK
  983. * 0 IF END-OF-FILE ENCOUNTERED
  984. * (*TERROR* = REVERSE OF ABOVE)
  985. *
  986. *
  987. READAOV OVRLAY
  988. MX0 -6
  989. SA1 INFO LOAD HEADER WORD
  990. ZR X1,RAEOF JUMP IF END-OF-FILE
  991. BX2 -X0*X1
  992. SX2 X2-DAREA CHECK FOR -AREA- DATA
  993. NZ X2,RALOOP
  994. SA1 INFO+2 SECOND WORD OF STUDENT NAME
  995. BX6 X1
  996. SA6 IIBUFF+1
  997. SA1 INFO+1 FIRST WORD OF STUDENT NAME
  998. * /--- BLOCK RALP0 00 000 78/12/23 00.37
  999. *
  1000. RALP0 BX6 X1
  1001. SA6 IIBUFF
  1002. SA1 INFO+3 LESSON NAME
  1003. BX6 X1
  1004. SA6 IIBUFF+2
  1005. SA1 INFO+4 AREA NAME
  1006. BX6 X1
  1007. SA6 IIBUFF+3
  1008. MX6 18
  1009. SA1 INFO+7 ELAPSED TIME
  1010. BX6 X6*X1
  1011. LX6 18+7 REPOSITION FOR MSEC TIME
  1012. SA6 IIBUFF+4
  1013. BX6 X1
  1014. LX6 19 POSITION CONTINUATION BIT
  1015. AX6 59
  1016. MX0 -1 -1 IF A CONTINUATION
  1017. BX6 X6*X0
  1018. SA6 IIBUFF+15
  1019. LX1 18 POSITION -COMPLETE- BIT
  1020. AX1 59
  1021. * MX6 -1
  1022. BX6 X1*X0 -1 = COMPLETE, 0 = INCOMPLETE
  1023. SA6 IIBUFF+14
  1024. MX0 -9
  1025. SA1 INFO+5
  1026. BX6 -X0*X1 NUMBER OF ARROWS ENCOUNTERED
  1027. SA6 IIBUFF+5
  1028. AX1 9
  1029. BX6 -X0*X1 NUMBER OF UNSUCESSFUL -HELPS-
  1030. SA6 IIBUFF+11
  1031. AX1 9
  1032. BX6 -X0*X1 NUMBER OF SUCESSFUL -HELPS-
  1033. SA6 IIBUFF+10
  1034. AX1 9
  1035. BX6 -X0*X1 NUMBER OF UNSUCESSFUL -TERMS-
  1036. SA6 IIBUFF+13
  1037. AX1 9
  1038. BX6 -X0*X1 NUMBER OF SUCESSFUL -TERMS-
  1039. SA6 IIBUFF+12
  1040. SA1 INFO+6
  1041. BX6 -X0*X1 NUMBER OF -NO- JUDGEMENTS
  1042. SA6 IIBUFF+8
  1043. AX1 9
  1044. BX6 -X0*X1 NUMBER OF -OK- JUDGEMENTS
  1045. SA6 IIBUFF+6
  1046. AX1 9
  1047. BX6 -X0*X1 NUMBER -OK- ON FIRST TRY
  1048. SA6 IIBUFF+7
  1049. AX1 9
  1050. BX6 -X0*X1 NUMBER OF UNRECOGNIZED -NO-
  1051. SA6 IIBUFF+9
  1052. *
  1053. SA1 TBDFINF+1
  1054. SB2 X1 PICK OFF ADDRESS OF BUFFER
  1055. AX1 18
  1056. SB1 X1 PICK OFF LENGTH OF BUFFER
  1057. SB3 16 **** LENGTH OF DATA ****
  1058. GE B3,B1,RALP1
  1059. SA0 B3+IIBUFF
  1060. SB3 B1-B3
  1061. SX1 A0 SAVE *A0*
  1062. ZERO X1,B3 CLEAR OUT REST OF BUFFER
  1063. * /--- BLOCK RALP1 00 000 78/12/23 00.39
  1064. *
  1065. RALP1 SA1 ATEMPEC
  1066. BX0 X1 ECS SCRATCH BUFFER
  1067. SA0 IIBUFF
  1068. WE B1 MOVE DATA TO ECS SCRATCH
  1069. RJ ECSPRTY
  1070. SA0 B2
  1071. RE B1 MOVE DATA TO AUTHOR BUFFER
  1072. RJ ECSPRTY
  1073. MX6 -1 -1 = OK
  1074. MX7 0
  1075. SA6 TRETURN
  1076. SA7 TERROR
  1077. EQ PROCESS --- RETURN
  1078. *
  1079. RAEOF SA1 TBDFINF+1 LOAD BUFFER ADDRESS/LENGTH
  1080. SA0 X1 PICK OFF ADDRESS
  1081. AX1 18
  1082. SB1 X1 PICK OFF LENGTH
  1083. SX1 A0 SAVE *A0*
  1084. ZERO X1,B1 ZERO REST OF BUFFER
  1085. SA1 TBDFINF
  1086. SX1 X1 RELEASE DATA-READ BUFFER
  1087. CALL ALTLES,-1
  1088. MX6 0
  1089. SA6 TBDFINF CLEAR OUT INFO WORDS
  1090. SA6 TBDFINF+1
  1091. MX6 0 0 = END-OF-FILE ENCOUNTERED
  1092. MX7 -1
  1093. SA6 TRETURN
  1094. SA7 TERROR
  1095. EQ PROCESS --- RETURN
  1096. *
  1097. *
  1098. ENDOV
  1099. * /--- BLOCK SYSDATA 00 000 75/08/25 00.51
  1100. TITLE -SYSDATA- COMMAND
  1101. *
  1102. *
  1103. *
  1104. * -SYSDATA- COMMAND
  1105. * PERFORMS VARIOUS SYSTEM FUNCTIONS FOR HANDLING
  1106. * OF STUDENT DATA FILES
  1107. *
  1108. *
  1109. SDATOV OVRLAY
  1110. MX6 -1 MARK *INFO* BUFFER USED
  1111. SA6 JJSTORE
  1112. NGETVAR GET OPTION CODE
  1113. SB1 X1
  1114. JP B1+*+1
  1115. *
  1116. + EQ SDAT10 -SETFILE-
  1117. + EQ SDAT20 -REWIND-
  1118. + EQ SDAT30 -CHECKPT-
  1119. *
  1120. *
  1121. *
  1122. * SYSDATA SETFILE,FILE NAME
  1123. * ACTIVATES DATA FOR THIS STUDENT WITH ONLY -OUTPUT-
  1124. * AND -OUTPUTL- COMMAND DATA SELECTED
  1125. *
  1126. *
  1127. SDAT10 SX6 3
  1128. CALL GETCODX UNPACK 3 ARGUMENTS TO VARBUF
  1129. CALL ACCFILE,VARBUF+1,TBINTSV,0
  1130. SA1 TBINTSV+1 LOAD FILE NAME
  1131. ZR X1,SDAT90 EXIT IF FILE NAME ZERO
  1132. *
  1133. SA1 TBLDATA
  1134. SX0 X1 CHECK IF DATA ALREADY ON
  1135. NZ X0,SDAT90
  1136. MX0 1 SET UP -SYSDATA- BIT
  1137. MX6 1
  1138. LX6 DSOUTP SET UP BIT FOR -OUTPUT- COMMAND
  1139. BX6 X0+X6 ATTACH -SYSDATA- BIT
  1140. SA6 TBTDATA
  1141. MX6 0 CLEAR -AREA- COMMAND INFO
  1142. SA6 TBAREA
  1143. SA6 AREADAT
  1144. SA6 AREADAT+1
  1145. SA6 AREADAT+2
  1146. EQ SDSETX GO TO ACTIVATE DATA COLLECTION
  1147. *
  1148. * /--- BLOCK SYSDATA 00 000 77/10/20 01.38
  1149. *
  1150. *
  1151. * SYSDATA REWIND
  1152. * REWINDS AND CHECKPOINTS DATA-FILE SPECIFIED BY
  1153. * STUDENT BANK VARIABLE *TBLDATA*
  1154. *
  1155. *
  1156. SDAT20 SA1 TBLDATA GET DATA BUFFER LESSON NUMBER
  1157. SX1 X1
  1158. ZR X1,SDAT90 EXIT IF NO DATA FILE
  1159. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  1160. CALL DATDATE GET HOLLERITH DATE AND TIME
  1161. SA1 ITEMP
  1162. BX6 X1 SAVE COMPRESSED DATE / TIME
  1163. SA6 SDWK
  1164. INTLOK X,I.DAT,W INTERLOCK
  1165. SA1 TBLDATA GET BUFFER LESSON NUMBER
  1166. SX1 X1
  1167. CALL READLES,IBUFF,(LPRMLTH+DPRMLTH)
  1168. SX1 LPRMLTH
  1169. IX5 X0+X1 ECS ADDRESS OF DATA BUFFER
  1170. SA1 IINF+DATSTAT LOAD BUFFER STATUS WORD
  1171. BX0 X1
  1172. LX0 DINITSH CHECK IF FILE BEING INITIALIZED
  1173. NG X0,SDAT96
  1174. BX0 X1
  1175. LX0 DWRITSH CHECK IF FILE BEING WRITTEN
  1176. NG X0,SDAT96
  1177. BX0 X1
  1178. LX0 DERRSH CHECK IF ERROR HAS OCCURRED
  1179. NG X0,SDAT97
  1180. MX0 1
  1181. LX0 -DFULLSH SET UP MASK FOR FILE FULL BIT
  1182. BX6 -X0*X1 CLEAR FILE FULL BIT
  1183. SA6 A1
  1184. SX6 1 RE-SET CURRENT BLOCK NUMBER
  1185. SA6 IINF+DATBLOK
  1186. SX6 0 RE-SET CURRENT WORD NUMBER
  1187. SA6 IINF+DATWORD
  1188. BX0 X5 ECS ADDRESS OF INFO
  1189. SA0 IINF
  1190. + WE DPRMLTH UPDATE BUFFER INFO WORDS
  1191. RJ ECSPRTY
  1192. * /--- BLOCK SYSDATA 00 000 78/12/23 00.45
  1193. *
  1194. SX3 DDIRECT X3 = BIAS TO DIRECTORY AREA
  1195. IX0 X5+X3 ECS ADDRESS OF DIRECTORY AREA
  1196. SA0 BBUFF
  1197. + RE BLKLTH READ IN DIRECTORY BLOCK
  1198. RJ ECSPRTY
  1199. SA1 BBUFF+2 LOAD NUMBER OF BLOCKS IN FILE
  1200. SB1 X1-1 SUBTRACT 1 FOR DIRECTORY BLOCK
  1201. ZERO BBUFF+64+128+1,B1 ZERO OUT BLOCK NAMES
  1202. SA1 SDWK LOAD COMPRESSED DATE / TIME
  1203. BX6 X1
  1204. SA6 A0 SET DATE FIRST BLOCK STARTED
  1205. SA0 BBUFF+64+1 ADDRESS OF BLOCK INFO WORDS + 1
  1206. SB2 0 B2=POINTER
  1207. SB3 1 B3=INCREMENT
  1208. MX0 -9
  1209. LX0 9
  1210. SDAT22 SA1 A0+B2
  1211. BX6 X0*X1 CLEAR THE WORD COUNT
  1212. SA6 A1
  1213. SB2 B2+B3
  1214. LT B2,B1,SDAT22
  1215. *
  1216. SA1 BBUFF+3 FLAG / LAST BLOCK USED
  1217. SX2 1 X2 = NEW LAST BLOCK
  1218. MX6 -18
  1219. BX6 X6*X1 ONLY LAST 18 BITS ARE BLOCK
  1220. BX6 X6+X2 PUT IN NEW BLOCK NUMBER (1)
  1221. SA6 A1
  1222. *
  1223. SDAT25 SA0 BBUFF
  1224. IX0 X5+X3 ECS ADDRESS OF DIRECTORY AREA
  1225. + WE BLKLTH RE-WRITE DIRECTORY
  1226. RJ ECSPRTY
  1227. ZERO BBUFF,BLKLTH ZERO *BBUFF* BUFFER
  1228. SX1 DBLK1 BIAS TO CURRENT DATA BLOCK
  1229. IX0 X5+X1
  1230. + WE BLKLTH ZERO CURRENT DATA BLOCK
  1231. RJ ECSPRTY
  1232. EQ SDAT35
  1233. * /--- BLOCK SYSDATA 00 000 81/08/19 03.59
  1234. *
  1235. *
  1236. * SYSDATA CHECKPT
  1237. * CHECKPOINTS DATA FILE INDICATED BY *TBLDATA*
  1238. *
  1239. *
  1240. SDAT30 CALL SAVLES SAVE COMMON, STORAGE, ETC.
  1241. *
  1242. SDAT35 INTLOK X,I.DAT,W INTERLOCK
  1243. SA1 TBLDATA
  1244. SX1 X1 DATA BUFFER LESSON NUMBER
  1245. ZR X1,SDAT95
  1246. CALL READLES,IBUFF,(LPRMLTH+DPRMLTH)
  1247. SA1 IINF+DATSTAT LOAD BUFFER STATUS WORD
  1248. BX0 X1
  1249. LX0 DINITSH CHECK IF FILE BEING INITIALIZED
  1250. NG X0,SDAT96
  1251. BX0 X1
  1252. LX0 DWRITSH CHECK IF FILE BEING WRITTEN
  1253. NG X0,SDAT96
  1254. BX0 X1
  1255. LX0 DFULLSH CHECK IF FILE FULL
  1256. NG X0,SDAT98
  1257. LX1 DERRSH CHECK IF ERROR HAS OCCURRED
  1258. NG X1,SDAT97
  1259. EQ SDCHKX GO TO CHECKPOINT DATA FILE
  1260. *
  1261. *
  1262. *
  1263. *
  1264. SDAT90 MX6 -1 MARK ERROR OCCURRED
  1265. SA6 TERROR
  1266. INTCLR X,I.DAT RELEASE INTERLOCK
  1267. EQ PROC
  1268. *
  1269. SDAT95 MX6 -1 MARK ERROR OCCURRED
  1270. SA6 TERROR
  1271. EQ SDATX
  1272. *
  1273. SDAT96 SX6 -2 -2 = DATA FILE ACTIVE
  1274. SA6 TERROR
  1275. EQ SDATX
  1276. *
  1277. SDAT97 SX6 -3 -3 = DISK ERROR HAS OCCURRED
  1278. SA6 TERROR
  1279. EQ SDATX
  1280. *
  1281. SDAT98 SX6 -4 -4 = DATA FILE FULL
  1282. SA6 TERROR
  1283. EQ SDATX
  1284. *
  1285. SDAT99 MX6 0 MARK NO ERROR
  1286. SA6 TERROR
  1287. *
  1288. SDATX INTCLR X,I.DAT RELEASE INTERLOCK
  1289. EQ RETPRO
  1290. *
  1291. *
  1292. IBUFF EQU INFO
  1293. IINF EQU INFO+LPRMLTH
  1294. BBUFF EQU IINF+DPRMLTH
  1295. *
  1296. SDWK BSS 1
  1297. *
  1298. DBUFNAM BSS 1 DATA BUFFER NAME
  1299. DATA 10LDATA
  1300. + VFD 12/3,48/0
  1301. *
  1302. *
  1303. ENDOV
  1304. *
  1305. *
  1306. * /--- BLOCK DATAON 00 000 79/08/18 18.46
  1307. TITLE -DATAON- COMMAND
  1308. *
  1309. *
  1310. * -DATAON- COMMAND
  1311. * TURN ON STUDENT DATA OR SELECTED DATA TYPES
  1312. *
  1313. * FIRST WORD -
  1314. * IST 30 BITS = BCD TIME OF SIGN-ON
  1315. * NEXT 18 = UNUSED
  1316. * NEXT 6 = TOTAL NUMBER OF WORDS
  1317. * NEXT 6 = DATA TYPE CODE
  1318. *
  1319. * NEXT 2 WORDS = STUDENTS NAME
  1320. * NEXT WORD = LESSON NAME
  1321. * NEXT WORD = BCD DATE
  1322. *
  1323. *
  1324. DATONOV OVRLAY
  1325. * ENTRY DATAONX
  1326. *
  1327. DATAONX MX6 -1 MARK *INFO* BUFFER USED
  1328. SA6 JJSTORE
  1329. MX0 60-18-1
  1330. LX0 59 POSITION MASK FOR OPTION BITS
  1331. NG X5,DATAOFX JUMP IF -DATAOFF- COMMAND
  1332. BX6 X0*X5
  1333. MX0 1
  1334. SA1 TBTDATA LOAD CURRENT OPTION BITS
  1335. BX1 -X0*X1 CLEAR -SYSDATA- BIT
  1336. BX6 X1+X6
  1337. SA6 A1
  1338. SA1 TBLDATA
  1339. SX2 X1 SEE IF DATA ALREADY -ON-
  1340. NZ X2,=XPROC
  1341. SA1 TBDFILE SEE IF ANY DATA FILE
  1342. ZR X1,=XPROC
  1343. FINISH DON10 CHECK IF IN -FINISH- UNIT
  1344. EQ DON15
  1345. *
  1346. DON10 MX6 0 KILL ANY OUTPUT FOR -FINISH-
  1347. SA6 MOUTLOC
  1348. *
  1349. *
  1350. DON15 SA1 KEY
  1351. BX6 X1
  1352. SA6 TOKEY SAVE ORIGINAL KEY
  1353. *
  1354. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  1355. *
  1356. CALLX INITDAT,TBDFACC,TBDFILE INITIALIZE
  1357. SA1 TBLDATA
  1358. SX1 X1 CHECK IF DATA INITIALIZED
  1359. NZ X1,DON20
  1360. TUTIM 250 PAUSE FOR A WHILE
  1361. * /--- BLOCK DATAON 00 000 77/07/05 20.58
  1362. *
  1363. DON20 CALL RESTLES RESTORE LESSON, COMMON, ETC.
  1364. *
  1365. CALL INROUTE
  1366. PL X1,DON30 IF NOT IN ROUTER LESSON
  1367. MX6 0 CLEAR OUT -AREA- DATA IF ROUTER
  1368. SA6 TBAREA
  1369. SA6 AREADAT
  1370. SA6 AREADAT+1
  1371. SA6 AREADAT+2
  1372. *
  1373. DON30 SA1 TBLDATA
  1374. SX2 X1 SEE IF DATA COLLECTION -ON-
  1375. ZR X2,DON90
  1376. *
  1377. SA2 TBTDATA MERGE LESSON-SELECTED BITS
  1378. SA3 TBTDATA+1 OPTIONS LESSON MAY TURN ON
  1379. BX6 -X3*X2
  1380. SA6 A2
  1381. BX1 X1+X6
  1382. BX0 X1
  1383. LX1 60-DSDATON SEE IF -DATAON- SELECTED
  1384. PL X1,DON90
  1385. LX0 60-DSNODON BIT SET IF NO OUTPUT
  1386. NG X0,DON90
  1387. *
  1388. CALL S=TDATE,ITEMP
  1389. MX0 30
  1390. SA1 ITEMP LOAD CLOCK (BCD)
  1391. LX1 6
  1392. BX1 X0*X1 SAVE HOURS AND MINUTES
  1393. SX6 500B+DSIGNI
  1394. BX6 X1+X6 STORE HEADER WORD
  1395. SA6 INFO
  1396. SA1 TNAME
  1397. BX6 X1 FIRST 10 CHARS OF NAME
  1398. SA6 INFO+1
  1399. MX0 -12
  1400. SA1 TNAME1 LAST 8 CHARS OF NAME
  1401. BX6 X0*X1
  1402. SA6 INFO+2
  1403. CALL FSQUISH,TBLESAC
  1404. BX6 X1
  1405. SA6 INFO+3
  1406. SA1 ITEMP+1 LOAD BCD DATE
  1407. BX6 X1
  1408. SA6 INFO+4
  1409. CALLX DATAOUT,INFO,5
  1410. *
  1411. DON90 SA1 SYSCLOK
  1412. SA2 TIMEARK TIME OF ENTRY TO LESSON
  1413. IX6 X1-X2 ELAPSED TIME AT -DATAON-
  1414. AX6 7 KEEP TO ABOUT 1/10 SEC
  1415. MX0 -18
  1416. SA2 AREADAT+2
  1417. BX2 X0*X2 CLEAR PREVIOUS ENTRY TIME
  1418. BX6 -X0*X6 LIMIT TIME TO 18 BITS
  1419. BX6 X6+X2 ADD IN REST OF DATA WORD
  1420. SA6 A2 STORE LESSON ENTRY TIME
  1421. SA1 TOKEY
  1422. BX6 X1
  1423. SA6 KEY RESTORE ORIGINAL KEY
  1424. EQ =XCKPROC TO PROCESS AFTER TIME CHECK
  1425. *
  1426. *
  1427. * /--- BLOCK DATAOFF 00 000 79/08/18 18.46
  1428. TITLE -DATAOFF- COMMAND
  1429. *
  1430. *
  1431. * -DATAOFF- COMMAND
  1432. * TURN OFF STUDENT DATA OR SELECTED DATA TYPES
  1433. *
  1434. *
  1435. DATAOFX BX6 X0*X5 MASK OFF OPTION BITS
  1436. ZR X6,DATAOF1 JUMP IF BLANK TAG
  1437. SA1 TBTDATA
  1438. BX6 -X6*X1 CLEAR APPROPRIATE BITS
  1439. SA6 A1
  1440. EQ =XPROC
  1441. *
  1442. DATAOF1 FINISH CHECK FOR -FINISH- UNIT
  1443. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  1444. CALLX FINDAT
  1445. CALLX DATAFIN TERMINATE DATA COLLECTION
  1446. MX6 0 CLEAR DATA OPTION BITS
  1447. SA6 TBTDATA
  1448. SX6 NEXT
  1449. SA6 KEY SWALLOW ANY KEY
  1450. CALL RESTLES RESTORE LESSON, COMMON, ETC.
  1451. EQ RETRNX PAUSE FOR A WHILE
  1452. ENDOV
  1453. *
  1454. *
  1455. * /--- BLOCK READD 00 000 76/02/13 16.19
  1456. TITLE READD
  1457. *
  1458. * -READD SIGNOFF-
  1459. *
  1460. * READ NEXT -SIGNOFF- DATA RECORD
  1461. *
  1462. * ON EXIT--
  1463. * *TRETURN* = -1 IF OK
  1464. * 0 IF END-OF-FILE ENCOUNTERED
  1465. * (*TERROR* = REVERSE OF ABOVE)
  1466. *
  1467. *
  1468. READDOV OVRLAY
  1469. MX0 -6
  1470. SA1 INFO LOAD HEADER WORD
  1471. ZR X1,RDEOF JUMP IF END-OF-FILE
  1472. BX2 -X0*X1
  1473. SX2 X2-DSIGNF CHECK FOR -SIGNOFF- DATA
  1474. NZ X2,RSLOOP
  1475. *
  1476. SA1 INFO+1 FIRST WORD OF STUDENT NAME
  1477. BX6 X1
  1478. SA6 IIBUFF
  1479. SA1 INFO+2 SECOND WORD OF STUDENT NAME
  1480. BX6 X1
  1481. SA6 IIBUFF+1
  1482. SA1 INFO+3 LESSON NAME
  1483. BX6 X1
  1484. SA6 IIBUFF+2
  1485. *
  1486. SA1 INFO+4 DATE
  1487. BX6 X1
  1488. SA6 IIBUFF+5
  1489. MX0 30
  1490. SA1 INFO TIME
  1491. BX6 X0*X1
  1492. SA6 IIBUFF+6
  1493. *
  1494. SA1 INFO+5
  1495. BX6 -X0*X1 PICK OFF ELAPSED TIME (MIN)
  1496. SA6 IIBUFF+3
  1497. MX6 -1 IF NOT COMPLETE
  1498. NG X1,RDD01 SEE IF COMPLETED THIS TIME
  1499. BX6 X0*X1
  1500. LX6 30
  1501. RDD01 SA6 IIBUFF+4 STORE COMPLETION TIME
  1502. * /--- BLOCK RDD01 00 000 78/12/23 00.47
  1503. *
  1504. SA1 TBDFINF+1
  1505. SB2 X1 PICK OFF ADDRESS OF BUFFER
  1506. AX1 18
  1507. SB1 X1 PICK OFF LENGTH OF BUFFER
  1508. SB3 7 **** LENGTH OF DATA ****
  1509. GE B3,B1,RDD03
  1510. SA0 B3+IIBUFF
  1511. SB3 B1-B3
  1512. SX1 A0 SAVE *A0*
  1513. ZERO X1,B3 CLEAR OUT REST OF BUFFER
  1514. *
  1515. RDD03 SA1 ATEMPEC
  1516. BX0 X1 ECS SCRATCH BUFFER
  1517. SA0 IIBUFF
  1518. WE B1 MOVE DATA TO ECS SCRATCH
  1519. RJ ECSPRTY
  1520. SA0 B2
  1521. RE B1 MOVE DATA TO AUTHOR BUFFER
  1522. RJ ECSPRTY
  1523. MX6 -1 -1 = OK
  1524. MX7 0
  1525. SA6 TRETURN
  1526. SA7 TERROR
  1527. EQ PROCESS --- RETURN
  1528. *
  1529. RDEOF SA1 TBDFINF+1 LOAD BUFFER ADDRESS/LENGTH
  1530. SA0 X1 PICK OFF ADDRESS
  1531. AX1 18
  1532. SB1 X1 PICK OFF LENGTH
  1533. SX1 A0 SAVE *A0*
  1534. ZERO X1,B1 ZERO REST OF BUFFER
  1535. SA1 TBDFINF
  1536. SX1 X1 RELEASE DATA-READ BUFFER
  1537. CALL ALTLES,-1
  1538. MX6 0
  1539. SA6 TBDFINF CLEAR OUT INFO WORDS
  1540. SA6 TBDFINF+1
  1541. MX6 0 0 = END-OF-FILE ENCOUNTERED
  1542. MX7 -1
  1543. SA6 TRETURN
  1544. SA7 TERROR
  1545. EQ PROCESS --- RETURN
  1546. *
  1547. *
  1548. ENDOV
  1549. * /--- BLOCK SETDAT 00 000 76/07/05 21.05
  1550. *
  1551. TITLE -SETDAT- SET DATA RESERVED WORDS
  1552. *
  1553. *
  1554. SETROV OVRLAY
  1555. LX5 XCODEL GET CODE FOR RESERVED WORD
  1556. SX6 X5
  1557. SA6 SRTEMP SAVE INDEX
  1558. NGETVAR GET VALUE OF EXPRESSION
  1559. SA3 SRTEMP
  1560. SB1 X3+1
  1561. + JP *+B1 GO TO APPROPRIATE SUBROUTINE
  1562. + EQ SR001 AARROWS
  1563. + EQ SR002 AOK
  1564. + EQ SR003 AOKIST
  1565. + EQ SR004 ASNO
  1566. + EQ SR005 AUNO
  1567. + EQ SR006 AHELP
  1568. + EQ SR007 AHELPN
  1569. + EQ SR008 ATERM
  1570. + EQ SR009 ATERMN
  1571. + EQ SR010 AAREA
  1572. + EQ SR011 ATIME
  1573. *
  1574. * /--- BLOCK SETDAT 00 000 77/05/30 03.55
  1575. *
  1576. SR001 SB1 B0 WORD POSITION FOR *AARROWS*
  1577. SB2 B0 SHIFT COUNT
  1578. EQ SAREA
  1579. *
  1580. SR002 SB1 1 WORD POSITION FOR *AOK*
  1581. SB2 9 SHIFT COUNT
  1582. EQ SAREA
  1583. *
  1584. SR003 SB1 1 WORD POSITION FOR *AOKIST*
  1585. SB2 18 SHIFT COUNT
  1586. EQ SAREA
  1587. *
  1588. SR004 SB1 1 WORD POSITION FOR *ASNO*
  1589. SB2 B0 SHIFT COUNT
  1590. EQ SAREA
  1591. *
  1592. SR005 SB1 1 WORD POSITION FOR *AUNO*
  1593. SB2 27 SHIFT COUNT
  1594. EQ SAREA
  1595. *
  1596. SR006 SB1 B0 WORD POSITION FOR *AHELP*
  1597. SB2 18 SHIFT COUNT
  1598. EQ SAREA
  1599. *
  1600. SR007 SB1 B0 WORD POSITION FOR *AHELPN*
  1601. SB2 9 SHIFT COUNT
  1602. EQ SAREA
  1603. *
  1604. SR008 SB1 B0 WORD POSITION FOR *ATERM*
  1605. SB2 36 SHIFT COUNT
  1606. EQ SAREA
  1607. *
  1608. SR009 SB1 B0 WORD POSITION FOR *ATERMN*
  1609. SB2 27 SHIFT COUNT
  1610. EQ SAREA
  1611. *
  1612. *
  1613. * EXECERR USES X1
  1614. SAREA NG X1,ERXVAL NEGATIVE NOT ALLOWED
  1615. SA2 AREADAT+B1 READ APPROPRIATE DATA WORD
  1616. SB1 60
  1617. SB3 B1-B2
  1618. LX2 X2,B3 GET RIGHT FIELD LOWER
  1619. MX0 -9
  1620. BX2 X0*X2 CLEAR OUT CURRENT VALUE
  1621. BX1 -X0*X1 LIMIT NEW VALUE TO 9 BITS
  1622. BX6 X1+X2 MERGE WITH AREA WORD
  1623. LX6 X6,B2 SHIFT BACK
  1624. SA6 A2 REWRITE AREA WORD
  1625. EQ PROCESS
  1626. *
  1627. * /--- BLOCK SETDAT 00 000 77/05/30 03.55
  1628. *
  1629. SR010 CALL LJUST,(1R ),0 GET NEW AREA NAME
  1630. BX6 X1
  1631. SA6 TBAREA STORE AS NEW AREA NAME
  1632. EQ PROCESS
  1633. *
  1634. * EXECERR USES X1
  1635. SR011 NG X1,ERXVAL NEGATIVE NOT ALLOWED
  1636. SA2 SYSCLOK GET CURRENT TIME
  1637. SA3 TIMEARK TIME OF SIGNON
  1638. IX2 X2-X3 CURRENT ELAPSED TIME
  1639. IX3 X2-X1 SUBTRACT NEW FROM CURRENT
  1640. NG X3,SR011A IF TOO LONG SET TO ENTRY
  1641. SR011B AX3 7 KEEP TIME TO ABOUT 1/10 SEC
  1642. MX0 18
  1643. SA2 AREADAT+1 GET ENTRY TIME TO AREA
  1644. BX2 -X0*X2 CLEAR OUT ENTRY TIME
  1645. LX3 -18 SHIFT TIME TO TOP 18 BITS
  1646. BX3 X0*X3 LIMIT TO 18 BITS
  1647. BX6 X2+X3 MERGE IN NEW ENTRY TIME
  1648. SA6 A2
  1649. SA2 AREADAT+2 GET PREVIOUS ELAPSED TIME
  1650. BX6 -X0*X2 CLEAR IT OUT
  1651. SA6 A2
  1652. EQ PROCESS
  1653. *
  1654. SR011A MX3 0 AREA STARTED AT SIGNON TIME
  1655. EQ SR011B
  1656. *
  1657. *
  1658. SRTEMP BSS 1
  1659. *
  1660. ENDOV
  1661. * /--- BLOCK INITDAT 00 000 79/07/15 21.52
  1662. TITLE -INIDOV- INITIALIZE FOR DATA COLLECTION
  1663. *
  1664. *
  1665. EXT DATAFIN,DBUFNAM,IDWK
  1666. *
  1667. *
  1668. PURGMAC DISKI
  1669. MACREF DISKI$
  1670. DISKI MACRO ADD,UNIT,BLOCK,ECS,N
  1671. LOCAL AA,XX
  1672. MACREF DISKI
  1673. IFC EQ,*N**,1
  1674. SX3 K1
  1675. IFC NE,*N**,1
  1676. SX3 N
  1677. CALL DISKXJ,ADD,UNIT,BLOCK,K1,ECS,X3
  1678. NZ X6,XX
  1679. AA TUTIM -1,,IOKEY
  1680. CALL POSTXJ,XX,AA,XX
  1681. XX BSS 0
  1682. ENDM
  1683. *
  1684. *
  1685. PURGMAC DISKO
  1686. MACREF DISKO$
  1687. DISKO MACRO ADD,UNIT,BLOCK,ECS,N
  1688. LOCAL AA,XX
  1689. MACREF DISKO
  1690. CALL DISKXJ,ADD,UNIT,BLOCK,K2,ECS,K1
  1691. NZ X6,XX
  1692. AA TUTIM -1,,IOKEY
  1693. CALL POSTXJ,XX,AA,XX
  1694. XX BSS 0
  1695. ENDM
  1696. *
  1697. *
  1698. * ENTRY - TBINTSV+1 = *EQ* TO RETURN TO CALLING ROUTINE
  1699. * TBINTSV+2 = DATA FILE ACCOUNT NAME
  1700. * TBINTSV+3 = DATA FILE NAME
  1701. *
  1702. *
  1703. INIDOV OVRLAY (TBINTSV+15)
  1704. EQ ID120
  1705. *
  1706. ID110 INTCLR X,I.DAT RELEASE INTERLOCK
  1707. TUTIM 250 PAUSE FOR A WHILE
  1708. *
  1709. * CHECK IF ECS DATA BUFFER ALREADY SET UP
  1710. *
  1711. ID120 SA1 TBINTSV+2 GET DATA FILE ACCOUNT NAME
  1712. SA2 TBINTSV+3 GET FILE NAME
  1713. BX6 X1
  1714. BX7 X2
  1715. SA6 DBUFNAM SET UP DATA ACCOUNT NAME
  1716. SA7 DBUFNAM+1 AND FILE NAME
  1717. INTLOK X,I.DAT,W INTERLOCK
  1718. CALL FINDLES,DBUFNAM,LESNUM
  1719. SA1 LESNUM
  1720. NG X1,ID200 JUMP IF NO BUFFER EXISTS YET
  1721. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  1722. SA1 INF+DATSTAT LOAD DATA FILE STATUS WORD
  1723. LX1 DINITSH POSITION FILE INITIALIZING BIT
  1724. NG X1,ID110 EXIT IF FILE BEING INITIALIZED
  1725. SA1 LESNUM
  1726. SA2 TBLDATA
  1727. BX6 X1+X2 SET DATA BUFFER LESSON NUMBER
  1728. SA6 A2
  1729. CALL ALTLES,1 SIGN INTO DATA BUFFER
  1730. EQ ID900
  1731. *
  1732. * /--- BLOCK INITDAT 00 000 78/06/24 21.16
  1733. *
  1734. *
  1735. * CHECK THAT FILE EXISTS AND IS OF CORRECT TYPE
  1736. *
  1737. ID200 SA1 TBINTSV+3 LOAD DATA FILE NAME
  1738. CALL FINDFN
  1739. NG X7,ID900 EXIT IF FILE DOES NOT EXIST
  1740. SA7 IDWK SAVE DISK UNIT NUMBER
  1741. SA1 X7+FITS
  1742. IX0 X1+X6 ECS ADDRESS OF FILE INFO WORD
  1743. SA0 IDWK+1
  1744. + RE 1 READ FILE INFO WORD
  1745. RJ ECSPRTY
  1746. MX0 -6 MASK FOR FILE TYPE CODE
  1747. SA1 A0 LOAD FILE INFO WORD
  1748. AX1 30
  1749. BX1 -X0*X1 MASK OFF FILE TYPE CODE
  1750. SX1 X1-4 CHECK FOR TYPE 4 = DATA FILE
  1751. NZ X1,ID900 EXIT IF NOT A DATA FILE
  1752. SA6 ITEMP SAVE FILE INDEX
  1753. CALL FILMARK,IDWK,ITEMP MARK FILE ALTERED
  1754. *
  1755. * CREATE ECS DATA BUFFER
  1756. *
  1757. CALL XSTOR,DBUFNAM,DBUFLTH
  1758. SA1 LESNUM
  1759. NG X1,ID110 JUMP IF INSUFFICIENT ECS
  1760. SA2 TBLDATA
  1761. BX6 X1+X2 ATTACH DATA BUFFER LESSON NUM
  1762. SA6 A2
  1763. CALL ALTLES,1 SIGN INTO DATA BUFFER
  1764. CALL IOLESSN,TBLDATA,4000B
  1765. INTCLR X,I.ADDL RELEASE LESNAM INTERLOCK
  1766. *
  1767. * /--- BLOCK INITDAT 00 000 78/06/24 21.39
  1768. *
  1769. * INITIALIZE DATA BUFFER PARAMETERS
  1770. *
  1771. SA1 TBLDATA DATA BUFFER LESSON NUMBER
  1772. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  1773. SX1 LPRMLTH BIAS PAST HEADER RECORD
  1774. IX0 X0+X1 ECS ADDRESS OF DATA BUFFER
  1775. MX6 1 SET UP FILE INITIALIZING BIT
  1776. LX6 60-DINITSH
  1777. MX1 -18 CLEAR THE OLD STATION NUMBER
  1778. BX6 X6*X1
  1779. SA1 STATION INSERT CURRENT STATION NUMBER
  1780. BX6 X6+X1
  1781. SA6 INF+DATSTAT SET DATA FILE STATUS WORD
  1782. SA1 TBINTSV+2 ACCOUNT NAME
  1783. SA2 TBINTSV+3 FILE NAME
  1784. BX6 X1
  1785. BX7 X2
  1786. SA6 INF+DFACCT
  1787. SA7 INF+DFILNAM
  1788. SA1 IDWK
  1789. BX6 X1 SET DATA FILE DISK UNIT NUMBER
  1790. SA6 INF+DDISKU
  1791. SA1 IDWK+1
  1792. BX6 X1 SET DATA FILE INFO WORD
  1793. SA6 INF+DFINF
  1794. SA0 INF
  1795. + WE DPRMLTH INITIALIZE ECS DATA PARAMETERS
  1796. RJ ECSPRTY
  1797. *
  1798. * READ DATA FILE DIRECTORY TO ECS DIRECTORY AREA
  1799. *
  1800. SX1 DDIRECT BIAS TO FILE DIRECTORY AREA
  1801. IX6 X0+X1
  1802. SA6 DECSLOC ECS ADDRESS OF DIRECTORY AREA
  1803. INTCLR X,I.DAT
  1804. DISKI (INF+DFINF),(INF+DDISKU),K0,DECSLOC
  1805. NZ X6,ID750 EXIT IF DISK ERROR
  1806. *
  1807. * CHECK THAT FILE DIRECTORY IS INTACT
  1808. *
  1809. INTLOK X,I.DAT,W INTERLOCK
  1810. SA1 TBLDATA RESTORE DATA BUFFER PARAMETERS
  1811. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  1812. SX1 LPRMLTH
  1813. IX5 X0+X1 ECS ADDRESS OF DATA BUFFER
  1814. SX1 DDIRECT BIAS TO FILE DIRECTORY AREA
  1815. IX0 X1+X5
  1816. SA0 INFO READ FILE DIRECTORY TO *INFO*
  1817. + RE BLKLTH
  1818. RJ ECSPRTY
  1819. *
  1820. * /--- BLOCK INITDAT 00 000 78/06/24 21.40
  1821. *
  1822. SA1 INFO LOAD FILE NAME
  1823. SA2 INF+DFILNAM
  1824. BX1 X1-X2 CHECK THAT FILE NAME IS CORRECT
  1825. NZ X1,ID750
  1826. SA1 INFO+1 LOAD FILE TYPE
  1827. SA2 KDATAD
  1828. BX1 X1-X2 CHECK THAT FILE TYPE IS CORRECT
  1829. NZ X1,ID750
  1830. *
  1831. SA2 INF+DFINF LOAD FILE INFO WORD
  1832. MX0 -6
  1833. AX2 24 POSITION NUMBER OF DISK SPACES
  1834. BX2 -X0*X2
  1835. SX0 DSBLKS NUMBER OF BLOCKS PER PART
  1836. IX6 X0*X2 COMPUTE NUMBER BLOCKS IN FILE
  1837. SA6 DBLKLIM (X6=BLOCK COUNT--USED LATER)
  1838. SX7 X6-1 SET MAXIMUM BLOCK NUMBER
  1839. SA7 INF+DATBLIM
  1840. *
  1841. SA1 INFO+3 FLAG / LAST BLOCK USED
  1842. SX2 X1 X2 = LAST BLOCK
  1843. IX3 X6-X2
  1844. NG X2,ID750 --- EXIT IF UNREASONABLE BLOCK
  1845. NG X3,ID750 --- EXIT IF UNREASONABLE BLOCK
  1846. ZR X3,ID225 X3(WORD)=0 IF FILE FULL
  1847. SA3 INFO+64+X2 APPROPRIATE INFO WORD
  1848. MX0 -9
  1849. AX3 9
  1850. BX3 -X0*X3 X3 = LAST WORD
  1851. ID225 BSS 0
  1852. NZ X2,ID250
  1853. SX2 1 DO NOT ALLOW BLOCK 0
  1854. ID250 IX0 X6-X2
  1855. NG X0,ID750 --- EXIT IF UNREASONABLE BLOCK
  1856. SB1 B0 B1 = 0 = FILE NOT FULL
  1857. NZ X0,ID300 JUMP IF FILE NOT FULL
  1858. MX6 1
  1859. LX6 60-DFULLSH SET UP FILE FULL BIT
  1860. SA1 INF+DATSTAT LOAD DATA FILE STATUS WORD
  1861. BX6 X1+X6
  1862. SA6 A1 SET BIT TO MARK FILE FULL
  1863. SB1 -1 B1 = -1 = FILE FULL
  1864. * /--- BLOCK INITDAT 00 000 78/12/18 21.45
  1865. *
  1866. ID300 BX6 X2 SET CURRENT BLOCK NUMBER
  1867. SA6 INF+DATBLOK
  1868. SA6 DBLOKN
  1869. NG X3,ID750 --- EXIT IF UNREASONABLE WORD
  1870. SX0 BLKLTH
  1871. IX0 X3-X0
  1872. PL X0,ID750 --- EXIT IF UNREASONABLE WORD
  1873. BX6 X3 SET CURRENT WORD POINTER
  1874. SA6 INF+DATWORD
  1875. NZ B1,ID800 EXIT IF FILE FULL
  1876. ZR X3,ID400 JUMP IF CURRENT BLOCK EMPTY
  1877. *
  1878. * LOAD CURRENT DATA BLOCK TO CURRENT BLOCK AREA
  1879. *
  1880. BX0 X5 ECS ADDRESS OF DATA PARAMETERS
  1881. SA0 INF
  1882. + WE DPRMLTH UPDATE PARAMETERS
  1883. RJ ECSPRTY
  1884. SX1 DBLK1 BIAS TO CURRENT BLOCK AREA
  1885. IX6 X1+X5
  1886. SA6 DECSLOC SET ECS ADDRESS OF BLOCK
  1887. INTCLR X,I.DAT
  1888. DISKI (INF+DFINF),(INF+DDISKU),DBLOKN,DECSLOC
  1889. NZ X6,ID750 JUMP IF DISK ERROR
  1890. *
  1891. * CORRECT POSSIBLE DAMAGE TO CURRENT WORD POINTER
  1892. *
  1893. INTLOK X,I.DAT,W INTERLOCK
  1894. SA1 TBLDATA
  1895. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  1896. SX1 LPRMLTH
  1897. IX5 X0+X1 ECS ADDRESS OF DATA PARAMETERS
  1898. SX1 DBLK1
  1899. IX0 X1+X5 ADDRESS OF CURRENT BLOCK
  1900. SA0 INFO
  1901. + RE 1 READ FIRST WORD OF DATA BLOCK
  1902. RJ ECSPRTY
  1903. SA1 A0 LOAD FIRST WORD OF DATA BLOCK
  1904. NZ X1,ID800 JUMP IF DATA ACTUALLY PRESENT
  1905. MX6 0
  1906. SA6 INF+DATWORD RE-SET WORD POINTER
  1907. ZERO INFO,BLKLTH READ BOCK OF ZEROS TO CM
  1908. SX1 DBLK1 BIAS TO CURRENT DATA BLOCK
  1909. IX0 X1+X5
  1910. + WE BLKLTH ZERO OUT CURRENT BLOCK AREA
  1911. RJ ECSPRTY
  1912. EQ ID800
  1913. * /--- BLOCK INITDAT 00 000 77/10/20 01.04
  1914. *
  1915. * PUT DATE BLOCK STARTED IN DIRECTORY IF 1ST BLOCK
  1916. *
  1917. ID400 SA1 DBLOKN CHECK IF ON FIRST BLOCK
  1918. SX1 X1-1
  1919. NZ X1,ID800
  1920. BX6 X5 SAVE ECS ADDRESS OF BUFFER
  1921. SA6 DECSLOC
  1922. *
  1923. CALL DATDATE GET HOLLERITH DATE / TIME
  1924. *
  1925. SA1 DECSLOC GET ECS ADDRESS OF BUFFER
  1926. BX5 X1 BACK TO X5
  1927. SX1 DDIRECT+64+128 X1 = BIAS TO BLOCK NAMES
  1928. SA2 DBLOKN
  1929. IX1 X1+X2 ADD BIAS TO CURRENT BLOCK
  1930. IX0 X1+X5
  1931. SA0 ITEMP CURRENT HOLLERITH DATE
  1932. + WE 1 WRITE OUT DATE BLOCK STARTED
  1933. RJ ECSPRTY
  1934. EQ ID800
  1935. * /--- BLOCK INITDAT 00 000 78/06/24 23.02
  1936. *
  1937. * FINAL PROCESSING
  1938. * CLEAR INITIAL BIT AND SET ERROR BIT IF NECCESSARY
  1939. *
  1940. ID750 MX6 1 SET UP BIT FOR ERROR CONDITION
  1941. LX6 60-DERRSH
  1942. SA6 DERRFLG SET ERROR FLAG
  1943. INTLOK X,I.DAT,W INTERLOCK
  1944. SA1 TBLDATA
  1945. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  1946. SX1 LPRMLTH
  1947. IX5 X0+X1 BIAS TO DATA PARAMETER AREA
  1948. EQ ID810
  1949. *
  1950. ID800 MX6 0 MARK NO ERROR OCCURRED
  1951. SA6 DERRFLG
  1952. *
  1953. ID810 MX6 1 SET UP MASK FOR INITIAL BIT
  1954. LX6 60-DINITSH
  1955. SA1 INF+DATSTAT LOAD STATUS WORD
  1956. BX6 -X6*X1 CLEAR INITIAL BIT
  1957. SA2 DERRFLG
  1958. BX6 X2+X6 ATTACH ANY ERROR BIT
  1959. SA6 A1
  1960. BX0 X5 ECS ADDRESS OF DATA BUFFER INFO
  1961. SA0 INF
  1962. + WE DPRMLTH UPDATE BUFFER INFO WORDS
  1963. RJ ECSPRTY
  1964. CALL IOLESSN,TBLDATA,-4000B
  1965. *
  1966. ID900 INTCLR X,I.DAT RELEASE INTERLOCK
  1967. EQ TBINTSV+1 EXIT
  1968. *
  1969. *
  1970. DECSLOC BSS 1
  1971. DWORD BSS 1
  1972. DBLOKN BSS 1
  1973. DBLKLIM BSS 1
  1974. DERRFLG BSS 1
  1975. ISYSF BSS 1
  1976. *
  1977. DATINF BSS LPRMLTH+DPRMLTH
  1978. INF EQU DATINF+LPRMLTH
  1979. *
  1980. DSLTH EQU 1+DATAMAX+DRJLTH
  1981. *
  1982. K0 DATA 0
  1983. K1 DATA 1
  1984. K2 DATA 2
  1985. KDATAD DATA 10LDATA D
  1986. *
  1987. *
  1988. ENDOV
  1989. * /--- BLOCK DATAFIN 00 000 81/08/20 02.38
  1990. TITLE -FINDOV- TERMINATE DATA COLLECTION
  1991. SPACE 4
  1992. FINDOV OVRLAY (TBINTSV+15)
  1993. INTLOK X,I.SIGN,W KEEP EM MANAGER AT BAY...
  1994. INTLOK X,I.DAT,W INTERLOCK
  1995. SA1 TBLDATA
  1996. SX1 X1
  1997. CALL ALTLES,-1 SIGN OUT OF DATA FILE
  1998. SA1 NSTUDS NUMBER OF STUDENTS USING FILE
  1999. ZR X1,DF200 JUMP IF FILE NO LONGER IN USE
  2000. *
  2001. DF100 MX0 -18
  2002. SA1 TBLDATA CLEAR OUT BUFFER LESSON NUMBER
  2003. BX6 X0*X1
  2004. SA6 A1
  2005. INTCLR X,I.DAT RELEASE INTERLOCK
  2006. INTCLR X,I.SIGN RELEASE INTERLOCK
  2007. EQ DATAFIN EXIT
  2008. *
  2009. DF110 SA1 TBLDATA DATA BUFFER LESSON NUMBER
  2010. CALL DELETE DELETE DATA BUFFER
  2011. EQ DF100
  2012. *
  2013. DF200 SA1 TBLDATA DATA BUFFER LESSON NUMBER
  2014. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2015. SX1 LPRMLTH LENGTH OF HEADER
  2016. IX5 X0+X1 ADDRESS OF DATA BUFFER
  2017. SA1 INF+DATSTAT BUFFER STATUS WORD
  2018. BX2 X1
  2019. LX2 DERRSH CHECK IF ERROR HAS OCCURRED
  2020. NG X2,DF110
  2021. BX2 X1
  2022. LX2 DFULLSH CHECK IF DATA FILE FULL
  2023. NG X2,DF110
  2024. MX6 1 SET UP FILE WRITE BIT
  2025. LX6 60-DWRITSH
  2026. BX6 X1+X6 ATTACH TO STATUS WORD
  2027. MX1 -18 CLEAR THE OLD STATION NUMBER
  2028. BX6 X6*X1
  2029. SA1 STATION INSERT CURRENT STATION NUMBER
  2030. BX6 X6+X1
  2031. SA6 INF+DATSTAT STORE FILE BUSY AND STATION
  2032. *
  2033. * /--- BLOCK DATAFIN 00 000 81/08/20 02.38
  2034. *
  2035. * MOVE CURRENT DATA BLOCK TO DISK BUFFER AREA
  2036. *
  2037. SX1 DBLK1 BIAS TO CURRENT BLOCK AREA
  2038. IX0 X1+X5
  2039. SA0 INFO TEMPORARY CM BUFFER
  2040. + RE BLKLTH READ CURRENT DATA BLOCK
  2041. RJ ECSPRTY
  2042. SX1 DBLK2 BIAS TO DISK BUFFER AREA
  2043. IX0 X1+X5
  2044. + WE BLKLTH MOVE DATA TO DISK BUFFER AREA
  2045. RJ ECSPRTY
  2046. BX6 X5 SAVE ECS ADDRESS OF DATA BUFFER
  2047. SA6 DECSLOC
  2048. *
  2049. * GET FILE INFO WORD
  2050. *
  2051. SA1 INF+DFILNAM LOAD DATA FILE NAME
  2052. CALL FINDFN GET POINTERS TO FILE INFO
  2053. NG X7,DF110
  2054. SA7 INF+DDISKU SAVE DISK UNIT NUMBER
  2055. SA1 X7+FITS
  2056. IX0 X1+X6 ECS ADDRESS OF FILE INFO WORD
  2057. SA0 INF+DFINF
  2058. + RE 1 READ FILE INFO WORD
  2059. RJ ECSPRTY
  2060. MX0 -6
  2061. SA1 A0 LOAD FILE INFO WORD
  2062. AX1 24
  2063. BX1 -X0*X1 MASK OFF NUMBER OF DISK SPACES
  2064. SX2 DSBLKS
  2065. IX2 X1*X2 COMPUTE NUMBER OF BLOCKS
  2066. SA1 INF+DATBLOK LOAD CURRENT BLOCK NUMBER
  2067. IX2 X1-X2
  2068. PL X2,DF110 EXIT IF BLOCK NUMBER TOO BIG
  2069. + NZ X1,*+1
  2070. SX1 1 DO NOT ALLOW BLOCK 0
  2071. + BX6 X1 SET CURRENT BLOCK NUMBER
  2072. SA6 DBLOKN
  2073. *
  2074. * /--- BLOCK DATAFIN 00 000 77/10/20 01.09
  2075. *
  2076. * UPDATE BLOCK AND WORD COUNTS IN FILE DIRECTORY
  2077. *
  2078. SA1 DECSLOC ECS ADDRESS OF FILE
  2079. BX5 X1 BACK TO X5
  2080. SX1 DDIRECT+3 BIAS TO FLAG / LAST BLOCK USED
  2081. IX0 X5+X1
  2082. SA0 ITEMP
  2083. + RE 1
  2084. RJ ECSPRTY
  2085. SA1 A0 FLAG / LAST BLOCK USED
  2086. SA2 DBLOKN X2 = CURRENT LAST BLOCK
  2087. MX6 -18
  2088. BX6 X6*X1 ONLY LAST 18 BITS ARE BLOCK
  2089. BX6 X6+X2 PUT IN NEW BLOCK NUMBER
  2090. SA6 A0
  2091. + WE 1 UPDATE FLAG / LAST BLOCK USED
  2092. RJ ECSPRTY
  2093. SX1 DDIRECT+64+X2 BIAS TO BLOCK INFO WORD
  2094. IX0 X5+X1
  2095. + RE 1 READ PROPER BLOCK INFO WORD
  2096. RJ ECSPRTY
  2097. SA1 A0
  2098. MX6 -9
  2099. LX6 9
  2100. BX6 X6*X1 CLEAR OLD WORD COUNT
  2101. SA1 INF+DATWORD CURRENT LAST WORD
  2102. LX1 9
  2103. BX6 X6+X1
  2104. SA6 A0
  2105. + WE 1 UPDATE BLOCK INFO WORD
  2106. RJ ECSPRTY
  2107. *
  2108. * /--- BLOCK DATAFIN 00 000 78/06/24 21.50
  2109. *
  2110. * RETURN CURRENT DATA BLOCK TO DISK
  2111. *
  2112. DF500 SA1 TBLDATA SIGN BACK INTO DATA BUFFER
  2113. CALL ALTLES,1
  2114. CALL IOLESSN,TBLDATA,4000B
  2115. *
  2116. * CALL LINKS,WORK SAVE RETURN JUMP TRAIL
  2117. SB1 WORK
  2118. + RJ =XLINKS
  2119. - VFD 30/DATAFIN
  2120. *
  2121. SA1 DECSLOC ECS ADDRESS OF DATA BUFFER
  2122. BX5 X1 BACK TO X5
  2123. SX1 DRJSAVE BIAS TO RJ TRAIL SAVE AREA
  2124. IX0 X1+X5
  2125. SA0 WORK CM ADDRESS OF RJ TRAIL
  2126. + WE DRJLTH SAVE RETURN JUMP TRAIL
  2127. RJ ECSPRTY
  2128. SX1 DBLK2 BIAS TO DISK BUFFER AREA
  2129. IX6 X1+X5
  2130. SA6 DECSLOC SET ECS ADDRESS OF BLOCK
  2131. BX0 X5 ECS ADDRESS OF DATA PARAMETERS
  2132. SA0 INF
  2133. + WE DPRMLTH UPDATE DATA PARAMETERS
  2134. RJ ECSPRTY
  2135. *
  2136. INTCLR X,I.DAT RELEASE INTERLOCK
  2137. INTCLR X,I.SIGN DURING DISKIO, OK SINCE PINNED
  2138. DISKO (INF+DFINF),(INF+DDISKU),DBLOKN,DECSLOC
  2139. SA6 DERRFLG SAVE DISK ERROR FLAG
  2140. NZ X6,DF800 EXIT IF DISK ERROR
  2141. * /--- BLOCK DATAFIN 00 000 78/06/24 23.04
  2142. *
  2143. * RETURN DIRECTORY BLOCK TO DISK
  2144. *
  2145. SA1 TBLDATA RELOAD DATA PARAMETERS
  2146. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2147. SX1 LPRMLTH+DDIRECT
  2148. IX6 X0+X1 ECS ADDRESS OF DIRECTORY BLOCK
  2149. SA6 DECSLOC
  2150. DISKO (INF+DFINF),(INF+DDISKU),K0,DECSLOC
  2151. SA6 DERRFLG SAVE DISK ERROR FLAG
  2152. *
  2153. DF800 INTLOK X,I.SIGN,W DISKIO DONE, BLOCK EM MANAGER
  2154. INTLOK X,I.DAT,W INTERLOCK DIRECTORY
  2155. CALL IOLESSN,TBLDATA,-4000B UNPIN
  2156. SA1 TBLDATA RE-LOAD DATA BUFFER PARAMETERS
  2157. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2158. SX1 LPRMLTH BIAS PAST HEADER RECORD
  2159. IX0 X0+X1
  2160. MX6 1 FORM MASK FOR FILE WRITE BIT
  2161. LX6 60-DWRITSH
  2162. SA1 INF+DATSTAT LOAD BUFFER STATUS WORD
  2163. BX6 -X6*X1 CLEAR FILE WRITE BIT
  2164. SA1 DERRFLG CHECK IF ANY DISK ERROR
  2165. ZR X1,DF810
  2166. MX1 1 SET UP DISK ERROR BIT
  2167. LX1 60-DERRSH
  2168. BX6 X1+X6 SET DISK ERROR BIT
  2169. *
  2170. DF810 SA6 INF+DATSTAT STORE UPDATED STATUS WORD
  2171. SA0 INF
  2172. + WE DPRMLTH UPDATE BUFFER PARAMETERS
  2173. RJ ECSPRTY
  2174. SX1 DRJSAVE BIAS TO SAVED RJ TRAIL
  2175. IX0 X0+X1
  2176. SA0 WORK
  2177. + RE DRJLTH READ SAVED RJ TRAIL TO CM
  2178. RJ ECSPRTY
  2179. *
  2180. * CALL LINKR,WORK RESTORE RJ TRAIL
  2181. SB1 WORK
  2182. + RJ =XLINKR
  2183. - VFD 30/DATAFIN
  2184. *
  2185. SA1 TBLDATA
  2186. CALL ALTLES,-1 SIGN OUT OF DATA BUFFER AGAIN
  2187. SA1 NSTUDS
  2188. NZ X1,DF100 EXIT IF BUFFER IN USE AGAIN
  2189. SA1 TBLDATA
  2190. CALL DELETE DELETE ECS DATA BUFFER
  2191. EQ DF100 EXIT
  2192. *
  2193. *
  2194. DECSLOC BSS 1
  2195. DWORD BSS 1
  2196. DBLOKN BSS 1
  2197. DBLKLIM BSS 1
  2198. DERRFLG BSS 1
  2199. ISYSF BSS 1
  2200. *
  2201. DATINF BSS LPRMLTH+DPRMLTH
  2202. INF EQU DATINF+LPRMLTH
  2203. *
  2204. DSLTH EQU 1+DATAMAX+DRJLTH
  2205. *
  2206. K0 DATA 0
  2207. K1 DATA 1
  2208. K2 DATA 2
  2209. *
  2210. *
  2211. ENDOV
  2212. *
  2213. * /--- BLOCK DATAOUT 00 000 78/11/12 21.42
  2214. TITLE -DATOOV- OUTPUT TO DATA FILE
  2215. *
  2216. *
  2217. * ON ENTRY - *OVARG1* = 0 = INITIAL ENTRY
  2218. * 1 = ADVANCE TO NEXT FILE
  2219. * 2 = NEXT DATA-FILE RE-ENTRY
  2220. * *OVARG2* = LENGTH OF DATA RECORD
  2221. *
  2222. DATOOV OVRLAY (TBINTSV+15)
  2223. SA1 OVARG1 GET RE-ENTRY INDEX
  2224. SB1 X1
  2225. JP B1+*+1
  2226. *
  2227. + EQ ENT 0 = INITIAL ENTRY
  2228. + EQ DATNXT 1 = ADVANCE TO NEXT DATA-FILE
  2229. + EQ REENT1 2 = ADVANCE FILE RE-ENTRY
  2230. *
  2231. *
  2232. ENT SA1 TBLDATA
  2233. SX1 X1 GET DATA BUFFER LESSON NUM
  2234. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2235. SX1 LPRMLTH
  2236. IX4 X0+X1 X4 = ECS ADDRESS OF INFO
  2237. SA1 OVARG2
  2238. SB1 X1 B1 = LENGTH OF DATA RECORD
  2239. *
  2240. * /--- BLOCK DATAOUT 00 000 78/12/18 21.49
  2241. *
  2242. * COPY CURRENT FULL BLOCK TO DISK BUFFER AREA AND
  2243. * RE-INITIALIZE WITH CURRENT DATA RECORD
  2244. *
  2245. SA3 INF+DATSTAT
  2246. LX3 DWRITSH CHECK IF FILE BEING WRITTEN
  2247. NG X3,DATWAIT GO TO WAIT LOOP IF FILE BUSY
  2248. MX6 1
  2249. BX6 X3+X6 SET FILE WRITE BIT
  2250. LX6 60-DWRITSH
  2251. MX1 -18 CLEAR THE OLD STATION NUMBER
  2252. BX6 X6*X1
  2253. SA1 STATION INSERT CURRENT STATION NUMBER
  2254. BX6 X6+X1
  2255. SA6 A3
  2256. SA1 INF+DATWORD LAST WORD FOR CURRENT BLOCK
  2257. BX6 X1
  2258. SX7 B1 NEW WORD COUNT
  2259. SA7 A1
  2260. SA6 DWORD SAVE OLD WORD COUNT
  2261. SA1 DARG1 GET CM ADDRESS OF DATA RECORD
  2262. SA0 X1
  2263. SA2 ATEMPEC ECS SCRATCH BUFFER
  2264. BX0 X2
  2265. + WE B1 WRITE CURRENT RECORD TO SCRATCH
  2266. RJ ECSPRTY
  2267. SX3 DBLK1 BIAS TO CURRENT FILLED BLOCK
  2268. IX0 X3+X4
  2269. SA0 INFO CM SCRATCH BUFFER
  2270. + RE BLKLTH MOVE FILLED BLOCK TO CM
  2271. RJ ECSPRTY
  2272. SX1 DBLK2 BIAS TO DISK I/O BUFFER
  2273. IX0 X1+X4
  2274. + WE BLKLTH MOVE FILLED BLOCK TO BUFFER
  2275. RJ ECSPRTY
  2276. ZERO INFO,BLKLTH PRE-ZERO *INFO*
  2277. BX0 X2 ECS ADDRESS OF CURRENT RECORD
  2278. + RE B1 READ RECORD TO *INFO*
  2279. RJ ECSPRTY
  2280. IX0 X3+X4 ADDRESS OF CURRENT BLOCK AREA
  2281. + WE BLKLTH INITIALIZE NEW BLOCK
  2282. RJ ECSPRTY
  2283. BX6 X4 SAVE ADDRESS OF DATA LESSON
  2284. SA6 DECSLOC
  2285. *
  2286. * /--- BLOCK DATAOUT 00 000 77/10/20 01.19
  2287. *
  2288. * GET FILE INFO WORD AND CHECK IF DATA FILE NOW FULL
  2289. *
  2290. SA1 INF+DFILNAM
  2291. CALL FINDFN GET POINTERS TO FILE INFO
  2292. PL X7,DD120 JUMP IF FILE OK
  2293. MX6 1 SET UP ERROR BIT
  2294. LX6 60-DERRSH
  2295. SA1 INF+DATSTAT LOAD BUFFER STATUS WORD
  2296. BX6 X1+X6
  2297. MX1 -18 CLEAR THE OLD STATION NUMBER
  2298. BX6 X6*X1
  2299. SA1 STATION INSERT CURRENT STATION NUMBER
  2300. BX6 X6+X1
  2301. SA6 INF+DATSTAT STORE ERROR BIT AND STATION
  2302. EQ DD130
  2303. *
  2304. DD120 SA7 INF+DDISKU SAVE DISK UNIT NUMBER
  2305. SA1 X7+FITS
  2306. IX0 X1+X6 ECS ADDRESS OF FILE INFO WORD
  2307. SA0 INF+DFINF
  2308. + RE 1 READ FILE INFO WORD
  2309. RJ ECSPRTY
  2310. MX0 -6
  2311. SA1 A0 LOAD FILE INFO WORD
  2312. AX1 24 POSITION NUMBER OF DISK SPACES
  2313. BX1 -X0*X1 MASK OFF NUMBER OF PARTS
  2314. SX2 DSBLKS NUMBER OF BLOCKS PER PART
  2315. IX6 X1*X2 COMPUTE NUMBER OF BLOCKS
  2316. SA6 DBLKLIM
  2317. SX3 X6-1 LAST LEGAL BLOCK NUMBER
  2318. SA1 INF+DATBLOK X1 = CURRENT BLOCK NUMBER
  2319. IX2 X1-X3 CHECK IF FILE IS FULL
  2320. NG X2,DD150 JUMP IF NOT FULL YET
  2321. MX7 1
  2322. LX7 60-DFULLSH SET UP FILE FULL BIT
  2323. SA3 INF+DATSTAT LOAD FILE STATUS WORD
  2324. BX7 X3+X7
  2325. SA7 A3 MARK DATA FILE FULL
  2326. IX2 X1-X6
  2327. NG X2,DD150 CHECK FOR LEGAL BLOCK NUMBER
  2328. SA6 INF+DATBLOK RE-SET TO LAST BLOCK + 1
  2329. MX7 1
  2330. LX7 60-DWRITSH SET UP FILE WRITE BIT
  2331. BX7 -X7*X3 CLEAR FILE WRITE BIT
  2332. SA7 A3
  2333. *
  2334. DD130 SA1 DECSLOC ECS ADDRESS OF DATA BUFFERS
  2335. BX0 X1
  2336. SA0 INF CM ADDRESS OF DATA INFO
  2337. + WE DPRMLTH UPDATE DATA INFO
  2338. RJ ECSPRTY
  2339. EQ DAT990
  2340. *
  2341. * /--- BLOCK DATAOUT 00 000 77/01/29 21.42
  2342. *
  2343. DD150 NZ X1,DD151 BLOCK NUMBER MUST NOT BE ZERO
  2344. SX1 1
  2345. DD151 SX6 X1 SAVE NUMBER OF BLOCK TO RETURN
  2346. SA6 DBLOKN
  2347. SX6 X1+1 ADVANCE BLOCK NUMBER
  2348. SA6 INF+DATBLOK
  2349. *
  2350. * UPDATE CURRENT BLOCK AND WORD POINTERS AND
  2351. * DATE BLOCK BEGUN IN DIRECTORY AREA
  2352. *
  2353. CALL DATDATE GET HOLLERITH DATE / TIME
  2354. SA1 DECSLOC
  2355. BX5 X1 GET ECS ADDRESS OF DATA LESSON
  2356. * /--- BLOCK DATAOUT 00 000 77/10/20 01.24
  2357. *
  2358. SA0 ITEMP CURRENT HOLLERITH DATE
  2359. SA1 DBLKLIM GET NUMBER OF BLOCKS IN LESSON
  2360. SA2 INF+DATBLOK X2 = NEW BLOCK (USED LATER)
  2361. SB1 1 B1 = LENGTH FOR LATER
  2362. IX0 X2-X1 CHECK IF DATA FILE NOW FULL
  2363. PL X0,DD165
  2364. SX1 DDIRECT+64+128 BIAS TO BLOCK NAMES
  2365. IX1 X1+X2 ADD BIAS TO CURRENT BLOCK
  2366. IX0 X5+X1
  2367. + WE 1 WRITE OUT DATE BLOCK STARTED
  2368. RJ ECSPRTY
  2369. SB1 2 GET BOTH PREVIOUS AND CURRENT
  2370. *
  2371. DD165 SA1 DBLOKN PREVIOUS BLOCK NUMBER
  2372. SX1 DDIRECT+64+X1 BIAS TO BLOCK INFO WORD
  2373. IX0 X5+X1
  2374. + RE B1 READ PROPER BLOCK INFO WORD(S)
  2375. RJ ECSPRTY
  2376. SA1 A0
  2377. MX3 -9
  2378. LX3 9
  2379. BX6 X3*X1 CLEAR OLD WORD COUNT
  2380. SA1 DWORD PREVIOUS LAST WORD
  2381. LX1 9
  2382. BX6 X6+X1
  2383. SA6 A0
  2384. SX1 B1-2
  2385. NG X1,DD170 JUMP IF FILE FULL
  2386. SA1 A0+1
  2387. BX6 X3*X1 CLEAR OLD WORD COUNT
  2388. SA1 INF+DATWORD CURRENT LAST WORD
  2389. LX1 9
  2390. BX6 X6+X1
  2391. SA6 A0+1
  2392. *
  2393. DD170 WE B1 UPDATE BLOCK INFO WORD(S)
  2394. RJ ECSPRTY
  2395. *
  2396. SX1 DDIRECT+3 BIAS TO FLAG / LAST BLOCK USED
  2397. IX0 X5+X1
  2398. MX6 -18
  2399. + RE 1
  2400. RJ ECSPRTY
  2401. SA1 A0 FLAG / LAST BLOCK USED
  2402. BX6 X6*X1 ONLY LAST 18 BITS ARE BLOCK
  2403. BX6 X6+X2 PUT IN NEW BLOCK NUMBER
  2404. SA6 A0
  2405. + WE 1 UPDATE FLAG / LAST BLOCK USED
  2406. RJ ECSPRTY
  2407. *
  2408. DD175 BX0 X5 ECS ADDRESS OF DATA BUFFERS
  2409. SA0 INF
  2410. + WE DPRMLTH WRITE OUT STATUS WORDS
  2411. RJ ECSPRTY
  2412. * /--- BLOCK DATAOUT 00 000 78/11/12 21.33
  2413. *
  2414. * SAVE STATUS / RJ TRAIL BEFORE BEGINNING I/O
  2415. *
  2416. CALL IOLESSN,TBLDATA,4000B
  2417. SX6 B7 SAVE CURRENT CONTINGENCY
  2418. SA6 NCTYPEP
  2419. NG X6,DD200 JUMP IF NOT NORMAL EXECUTION
  2420. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  2421. *
  2422. * CALL LINKS,WORK SAVE RETURN JUMP TRAIL
  2423. DD200 SB1 WORK
  2424. + RJ =XLINKS
  2425. - VFD 30/DATAOUT
  2426. *
  2427. * WRITE FILLED DATA BLOCK TO DISK
  2428. *
  2429. SA5 DECSLOC ECS ADDRESS OF DATA LESSON
  2430. SX1 DRJSAVE
  2431. IX0 X1+X5 ADDRESS FOR RJ TRAIL BUFFER
  2432. SA0 WORK
  2433. + WE DRJLTH WRITE OUT RJ TRAIL
  2434. RJ ECSPRTY
  2435. SX1 DBLK2 BIAS TO BLOCK TO WRITE
  2436. IX6 X1+X5 ECS ADDRESS OF BLOCK TO WRITE
  2437. SA6 DECSLOC
  2438. *
  2439. INTCLR X,I.DAT RELEASE INTERLOCK
  2440. DISKO (INF+DFINF),(INF+DDISKU),DBLOKN,DECSLOC
  2441. SA6 DERRFLG SAVE ERROR RETURN
  2442. NZ X6,DDEXIT EXIT IF DISK ERROR
  2443. *
  2444. * WRITE UPDATED DATA FILE DIRECTORY BLOCK TO DISK
  2445. *
  2446. SA1 TBLDATA RELOAD DATA BUFFER INFO WORDS
  2447. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2448. SX1 LPRMLTH+DDIRECT
  2449. IX6 X0+X1 ADDRESS OF DIRECTORY BLOCK
  2450. SA6 DECSLOC
  2451. DISKO (INF+DFINF),(INF+DDISKU),K0,DECSLOC
  2452. SA6 DERRFLG SAVE ERROR RETURN
  2453. NZ X6,DDEXIT EXIT IF DISK ERROR
  2454. * /--- BLOCK DATAOUT 00 000 78/11/12 21.05
  2455. *
  2456. * CLEAR DATA FILE WRITE BIT AND SET ERROR BIT IF
  2457. * DISK ERROR OCCURRED
  2458. *
  2459. DDEXIT INTLOK X,I.DAT,W INTERLOCK
  2460. CALL IOLESSN,TBLDATA,-4000B
  2461. SA1 TBLDATA RESTORE DATA FILE PARAMETERS
  2462. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2463. SX1 LPRMLTH BIAS PAST HEADER RECORD
  2464. IX5 X0+X1
  2465. MX6 1 FORM MASK FOR WRITE BIT
  2466. LX6 60-DWRITSH
  2467. SA1 INF+DATSTAT DATA FILE STATUS WORD
  2468. BX6 -X6*X1 CLEAR FILE WRITE BIT
  2469. SA2 DERRFLG
  2470. ZR X2,DD900 JUMP IF NO DISK ERROR OCCURRED
  2471. MX2 1
  2472. LX2 60-DERRSH POSITION DISK ERROR BIT
  2473. BX6 X2+X6 SET BIT TO MARK ERROR OCCURRED
  2474. MX1 -18 CLEAR THE OLD STATION NUMBER
  2475. BX6 X6*X1
  2476. SA1 STATION INSERT CURRENT STATION NUMBER
  2477. BX6 X6+X1
  2478. *
  2479. DD900 SA6 INF+DATSTAT STORE ERROR BIT AND STATION
  2480. *
  2481. * RESTORE STATUS / RJ TRAIL AFTER I/O
  2482. *
  2483. BX0 X5 ECS ADDRESS OF DATA INFO WORDS
  2484. SA0 INF
  2485. + WE DPRMLTH UPDATE DATA FILE PARAMETERS
  2486. RJ ECSPRTY
  2487. SX1 DRJSAVE BIAS TO RJ TRAIL SAVE AREA
  2488. IX0 X1+X5
  2489. SA0 WORK
  2490. + RE DRJLTH READ SAVED RJ TRAIL TO CM
  2491. RJ ECSPRTY
  2492. * CALL LINKR,WORK RESTORE RJ TRAIL
  2493. SB1 WORK
  2494. + RJ =XLINKR
  2495. - VFD 30/DATAOUT
  2496. SA1 NCTYPEP
  2497. SB7 X1 RESTORE CONTINGENCY
  2498. NG X1,DAT990 EXIT IF NOT IN NORMAL EXECUTION
  2499. CALL RESTLES RESTORE LESSON, COMMON, ETC.
  2500. EQ DAT990
  2501. *
  2502. *
  2503. * /--- BLOCK DATAOUT 00 000 78/11/12 21.06
  2504. TITLE -DATOOV- SET TO NEXT DATA FILE
  2505. *
  2506. *
  2507. * GET NAME OF NEXT DATA FILE IF ANY
  2508. *
  2509. DATNXT SA1 TBLDATA DATA BUFFER LESSON NUMBER
  2510. SX1 X1
  2511. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2512. SX1 LPRMLTH
  2513. IX5 X0+X1 ECS ADDRESS OF DATA BUFFER
  2514. *
  2515. SX1 DDIRECT+4+O.NFNAM OFFSET TO NEXT FILE NAME
  2516. SA0 TBINTSV+1
  2517. IX0 X5+X1
  2518. + RE 1 *TBINTSV(1)* = NEXT FILE NAME
  2519. RJ ECSPRTY
  2520. SA1 A0 CHECK IF ANY NEXT DATA FILE
  2521. ZR X1,DAT990 EXIT IF NONE
  2522. SA1 TBINTSV+3
  2523. SX6 X1-1 CHECK IF LOOPING THROUGH TOO
  2524. NG X6,DAT990 MANY DATA FILES
  2525. SA6 A1
  2526. *
  2527. * SAVE STATUS / DATA RECORD / RJ TRAIL
  2528. *
  2529. SA1 DARG1 ADDRESS OF DATA RECORD
  2530. SA0 X1
  2531. SA1 DARG2 LENGTH OF DATA RECORD
  2532. SB1 X1
  2533. SA1 ADATAEC ADDRESS OF TEMPORARY ECS BUFFER
  2534. BX0 X1
  2535. + WE B1 WRITE DATA RECORD TO TEMP ECS
  2536. RJ ECSPRTY
  2537. SX6 B7 SAVE CURRENT CONTINGENCY
  2538. SA6 NCTYPEP
  2539. NG X6,DATN10 JUMP IF NOT IN NORMAL EXECUTION
  2540. *
  2541. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  2542. * /--- BLOCK DATAOUT 00 000 78/11/12 21.25
  2543. *
  2544. * CREATE STORAGE AREA FOR RJ TRAIL AND DATA RECORD
  2545. *
  2546. DATN10 CALL XSTOR,DSNAME,DSLTH
  2547. SA1 LESNUM
  2548. NG X1,DATW95 EXIT IF ECS IS NOT AVAILABLE
  2549. SX6 X1
  2550. SA6 TBINTSV *TBINTSV(0)* = LESSON NUMBER
  2551. CALL ALTLES,1
  2552. INTCLR X,I.ADDL RELEASE LESNAM INTERLOCK
  2553. *
  2554. * SAVE DATA RECORD AND RJ TRAIL IN STORAGE AREA
  2555. *
  2556. SA1 DARG2 GET LENGTH OF DATA RECORD
  2557. BX6 X1
  2558. SA6 INFO MOVE TO CM BUFFER
  2559. SB1 X1
  2560. SA1 ADATAEC ECS ADDRESS OF SAVED RECORD
  2561. BX0 X1
  2562. SA0 INFO+1 ADDRESS OF CM BUFFER
  2563. + RE B1 BRING IN DATA RECORD
  2564. RJ ECSPRTY
  2565. * CALL LINKS,(INFO+1+DATAMAX) SAVE RJ TRAIL
  2566. SB1 INFO+1+DATAMAX
  2567. + RJ =XLINKS
  2568. - VFD 30/DATAOUT
  2569. SA1 TBINTSV GET ECS ADDRESS OF STORAGE
  2570. CALL READLES,0,0
  2571. SX1 LPRMLTH BIAS PAST HEADER RECORD
  2572. IX0 X0+X1
  2573. SA0 INFO CM ADDRESS OF STUFF TO SAVE
  2574. + WE DSLTH
  2575. RJ ECSPRTY
  2576. EQ DATAOA ADVANCE TO NEXT DATA-FILE
  2577. *
  2578. * RETURNS TO *REENT1* AFTER ADVANCE
  2579. *
  2580. REENT1 INTLOK X,I.DAT,W INTERLOCK
  2581. SA1 TBLDATA
  2582. SX1 X1 CHECK IF NEW DATA FILE SET
  2583. ZR X1,DATW95
  2584. EQ DATW40
  2585. *
  2586. *
  2587. * /--- BLOCK DATAOUT 00 000 78/11/12 21.10
  2588. TITLE -DATOOV- WAIT FOR DATA FILE AVAILABLE
  2589. *
  2590. *
  2591. * SAVE STATUS / DATA RECORD / RJ TRAIL BEFORE WAIT
  2592. * ON DATA WRITE BUFFER AVAILABLE
  2593. *
  2594. DATWAIT SA1 DARG1 ADDRESS OF DATA RECORD
  2595. SA0 X1
  2596. SA1 DARG2 LENGTH OF DATA RECORD
  2597. SB1 X1
  2598. SA1 ADATAEC ADDRESS OF TEMPORARY ECS BUFFER
  2599. BX0 X1
  2600. + WE B1 WRITE DATA RECORD TO TEMP ECS
  2601. RJ ECSPRTY
  2602. SX6 B7 SAVE CURRENT CONTINGENCY
  2603. SA6 NCTYPEP
  2604. NG X6,DATW10 JUMP IF NOT IN NORMAL EXECUTION
  2605. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  2606. *
  2607. * CREATE STORAGE AREA FOR RJ TRAIL AND DATA RECORD
  2608. *
  2609. DATW10 CALL XSTOR,DSNAME,DSLTH
  2610. SA1 LESNUM
  2611. NG X1,DATW95 EXIT IF ECS IS NOT AVAILABLE
  2612. SX6 X1
  2613. SA6 TBINTSV SAVE STORAGE AREA LESSON NUM
  2614. CALL ALTLES,1
  2615. INTCLR X,I.ADDL RELEASE LESNAM INTERLOCK
  2616. *
  2617. * SAVE DATA RECORD AND RJ TRAIL IN STORAGE AREA
  2618. *
  2619. SA1 DARG2 GET LENGTH OF DATA RECORD
  2620. BX6 X1
  2621. SA6 INFO MOVE TO CM BUFFER
  2622. SB1 X1
  2623. SA1 ADATAEC ECS ADDRESS OF SAVED RECORD
  2624. BX0 X1
  2625. SA0 INFO+1 ADDRESS OF CM BUFFER
  2626. + RE B1 BRING IN DATA RECORD
  2627. RJ ECSPRTY
  2628. * CALL LINKS,(INFO+1+DATAMAX) SAVE RJ TRAIL
  2629. SB1 INFO+1+DATAMAX
  2630. + RJ =XLINKS
  2631. - VFD 30/DATAOUT
  2632. SA1 TBINTSV GET ECS ADDRESS OF STORAGE
  2633. CALL READLES,0,0
  2634. SX1 LPRMLTH BIAS PAST HEADER RECORD
  2635. IX0 X0+X1
  2636. SA0 INFO CM ADDRESS OF STUFF TO SAVE
  2637. + WE DSLTH
  2638. RJ ECSPRTY
  2639. *
  2640. * /--- BLOCK DATAOUT 00 000 78/11/12 21.22
  2641. *
  2642. * WAIT FOR DATA OUTPUT BUFFER AVAILABLE
  2643. *
  2644. DATW30 INTCLR X,I.DAT RELEASE INTERLOCK
  2645. TUTIM 250 PAUSE FOR A WHILE
  2646. INTLOK X,I.DAT,W INTERLOCK
  2647. SA1 TBLDATA
  2648. CALL READLES,DATINF,(LPRMLTH+DPRMLTH)
  2649. SA1 INF+DATSTAT LOAD STATUS WORD
  2650. LX1 DWRITSH CHECK IF FILE AVAILABLE
  2651. NG X1,DATW30
  2652. *
  2653. DATW40 SA1 NCTYPEP RESTORE CURRENT CONTINGENCY
  2654. SB7 X1
  2655. NG B7,DATW45 JUMP IF NOT NORMAL EXECUTION
  2656. CALL RESTLES RESTORE LESSON, COMMON, ETC.
  2657. *
  2658. DATW45 SA1 TBINTSV STORAGE LESSON NUMBER
  2659. CALL ALTLES,-1 RELEASE STORAGE BLOCK
  2660. SA1 TBINTSV
  2661. CALL READLES,INFO,(LPRMLTH+DSLTH)
  2662. * CALL LINKR,(INFO+LPRMLTH+1+DATAMAX)
  2663. SB1 INFO+LPRMLTH+1+DATAMAX
  2664. + RJ =XLINKR
  2665. - VFD 30/DATAOUT
  2666. SA1 INFO+LPRMLTH
  2667. SB2 X1 LENGTH OF DATA RECORD
  2668. SB1 INFO+LPRMLTH+1 ADDRESS OF DATA RECORD
  2669. EQ DATAO GO BACK AND START OVER AGAIN
  2670. *
  2671. DATW95 SA1 NCTYPEP RESTORE CURRENT CONTINGENCY
  2672. SB7 X1
  2673. NG X1,DAT990 EXIT IF NOT NORMAL EXECUTION
  2674. CALL RESTLES RESTORE LESSON, COMMON, ETC.
  2675. *
  2676. DAT990 INTCLR X,I.DAT RELEASE INTERLOCK
  2677. EQ DATAOUT
  2678. *
  2679. *
  2680. K0 DATA 0
  2681. K1 DATA 1
  2682. K2 DATA 2
  2683. *
  2684. DECSLOC BSS 1
  2685. DWORD BSS 1
  2686. DBLOKN BSS 1
  2687. DBLKLIM BSS 1
  2688. DERRFLG BSS 1
  2689. ISYSF BSS 1
  2690. *
  2691. DATINF BSS LPRMLTH+DPRMLTH
  2692. INF EQU DATINF+LPRMLTH
  2693. *
  2694. DSLTH EQU 1+DATAMAX+DRJLTH
  2695. *
  2696. DSNAME DATA 0
  2697. DATA 0LDATATEMP
  2698. DATA 0LSTORAGE
  2699. + VFD 12/1,48/0
  2700. *
  2701. ENDOV
  2702. *
  2703. * /--- BLOCK BACKOUT 00 000 75/03/10 15.51
  2704. TITLE -BACKOUT-
  2705. *
  2706. * *BACKOUT*, *BACK ON* AND *BACKTST* FUNCTIONS
  2707.  
  2708. * -BACKOUT (-1),STATION- OR -BACKOUT (-1)-
  2709.  
  2710. * 'THIS COMMAND BACKS OUT EITHER A SINGLE STATION
  2711. * OR ALL STATIONS. 'THE SAME BASIC PROCESS IS USED
  2712. * IN BOTH CASES'; PRESSING KEY ',SSBKEY', ON A STATION
  2713. * STARTS A PROCESS ON THAT STATION THAT
  2714.  
  2715. * A) LOCKS OUT ALL KEYSET KEYS
  2716.  
  2717. * B) PRESSES A SEQUENCE OF ',STOP1', AND ',BACK', KEYS
  2718. * ON THE STATION, UNTIL EITHER THE STATION GIVES UP
  2719. * ITS STUDENT BANK, OR THE SEQUENCE REACHES AN END
  2720.  
  2721. * C) THE PROCESS (EVEN FOR ALL TERMINALS) SHOULD REACH
  2722. * COMPLETION IN A FEW SECONDS.
  2723.  
  2724. * D) IF THE BACKOUT PROCESS REACHES THE END OF THE
  2725. * SEQUENCE AND THE STATION IS NOT YET OUT, THE
  2726. * BACKOUT BIT IS TURNED OFF.
  2727.  
  2728. * 'THE RESULTING STATUS OF A STATION IS DETERMINED
  2729. * FROM THE FOLLOWING TABLE';
  2730. *
  2731. * 'CONDITION-'STATUS BACKOUT BIT BANK ADDRESS
  2732. * B.O. IN PROGRESS ON ON
  2733. * B.O. COMPLETED ON OFF
  2734. * B.O. UNSUCCESSFUL OFF ON
  2735. * MAY HAVE LOST A
  2736. * PRESS KEY, OR STATION
  2737. * WAS SIGNED OUT AFTER
  2738. * UNSUCCESSFUL B.O. OFF OFF
  2739.  
  2740.  
  2741. * 'THE -BACKOUT- COMMAND WILL NOT BACK OUT THE EXECUTING STATION
  2742.  
  2743. * -BACKON-';
  2744.  
  2745. * -BACKOUT (0),STATION- OR -BACKOUT (0)-
  2746.  
  2747. * 'THIS COMMAND TURNS OFF THE STATION'7S BACKOUT FLAG,
  2748. * THEREBY LETTING IT BACK ON. THE FLAG IS SIMPLY
  2749. * CLEARED.
  2750.  
  2751. * -BACKOUT (1),STATION OR -BACKOUT (1)-
  2752.  
  2753. * 'THIS COMMAND RETURNS (IN ERROR)';
  2754. * SINGLE STATION'; ALL STATIONS
  2755. * -1 STATION BACKED OUT -1 ALL BACKED OUT
  2756. * 0 STATION ACTIVE 0 NOT RETURNED
  2757. * 1 BEING BACKED OUT (N) NUMBER OF
  2758. * 2 STATION INACTIVE, NOT STATIONS NOT
  2759. * BACKED OUT BACKED OUT
  2760. * 3 STATION LT 0
  2761. * 4 STATION GT MAX
  2762.  
  2763. *
  2764. * ERROR RETURNS FOR *BACKOUT* AND *BACKON* FUNCTIONS
  2765. *
  2766. * -1 FUNCTION REQUEST PERFORMED
  2767. * 3 STATION LT 0
  2768. * 4 STATION GT MAX
  2769. * 5 ACTION REQUEST OVERFLOW
  2770. * IN *TERROR*
  2771. * /--- BLOCK BACKOUX 00 000 79/07/15 21.39
  2772. BACKOTV OVRLAY
  2773. EXT TEMP -BACKOUT- USED TO BE IN *IOPUT*
  2774. BACKOUX SX7 -1
  2775. SA7 TERROR PRESET
  2776. CALL SAVKEY
  2777. NGETVAR
  2778. SA5 A5 CHECK FOR 2ND ARG
  2779. LX5 XCODEL
  2780. ZR X1,BACKON JUMP IF -BACK ON-
  2781. PL X1,BACKTST -BACKTST-
  2782. PL X5,SBACKX BRANCH IF STATION SPECIFIED
  2783. *
  2784. CALL SAVLES SAVE COMMON, STORAGE, ETC.
  2785. PAUSE FORMAT ANY OUTPUT
  2786. SX6 RQBKOUT
  2787. SA6 ACTOUT REQUEST BACKOUT
  2788. SX6 1
  2789. SA6 AOUTLOC
  2790. TUTIM -1,,IOKEY WAIT FOR IOKEY
  2791. CALL RESTKEY
  2792. EQ RETPRO TO PROCESSING, RELOAD COMMON,STO, ETC
  2793. * /--- BLOCK SBACKX 00 000 77/12/01 23.16
  2794.  
  2795. SBACKX NGETVAR STATION NUMBER
  2796. NG X1,SBERR0
  2797. SX2 NUMSTAT-1 MAX STATION NUMBER
  2798. IX2 X2-X1
  2799. NG X2,SBERR1
  2800. SA2 STATION
  2801. IX2 X1-X2
  2802. ZR X2,PROCESS EXIT IF THIS STATION
  2803.  
  2804. * THE FOLLOWING CODE PRESSES THE BACKOUT KEY ON
  2805. * THE DESIGNATED STATION
  2806.  
  2807. SA2 AOUTLOC
  2808. SX7 X2+3
  2809. SX3 X7-AOUTLTH
  2810. PL X3,SBERR2 STANDARD CHECK FOR ROOM IN BUFFER
  2811. SA7 A2
  2812. SX6 RQPRESS
  2813. SA6 ACTOUT+X2
  2814. SX6 SSBKEY
  2815. SA6 A6+1
  2816. BX6 X1 STATION
  2817. SA6 A6+1
  2818. EQ PROCESS
  2819. *
  2820. * CLEAR ',BACKOUT', STATUS TO LET TERMINAL(S) BACK ON
  2821.  
  2822. BACKON BSS 0
  2823. SA2 BCKOUT FLAG, STATION SET FOR GENERAL BACKOUT
  2824. MX6 1 CLEAR FLAG BIT
  2825. BX6 -X6*X2
  2826. SA6 A2 CLEARS GENERAL BACKOUT FLAG
  2827. SA6 MASRQ+1 INTO REQUEST BUFFER
  2828. SX6 XR.BKOU
  2829. SA6 MASRQ SET INTER-EXEC REQUEST CODE
  2830. CALL MXRQALL TELL OTHER EXECUTORS TO CLEAR FLAG
  2831. BACKO2 PL X5,SBCKONX BRANCH IF SINGLE STATION
  2832.  
  2833. SB1 B0
  2834. MX1 0
  2835.  
  2836. * /--- BLOCK SBACKX 00 000 77/04/04 23.46
  2837. * BOTH ALL AND SINGLE STATION ',BACKON', COMES HERE,
  2838. * WITH B1 AND X1 SET APPROPRIATELY
  2839.  
  2840. BCKONCX BSS 0
  2841. SX0 STFLAGS-STSTART
  2842. SA3 NSYSBNK
  2843. IX0 X0+X3
  2844. SA3 NSYSLTH
  2845. IX1 X3*X1 BIAS FOR STATION (X1)
  2846. SB2 NUMSTAT-1
  2847. SA0 TEMP
  2848. IX0 X0+X1 ADD BIAS FOR SINGLE STATION
  2849. MX1 1
  2850. LX1 SSBBIT
  2851. MX2 1
  2852. LX2 SSCBIT
  2853. BX2 X1+X2 CLEAR SSBBIT AND SSCBIT
  2854.  
  2855. * THE FOLLOWING LOOP CLEARS THE BACKOUT BIT IN ALL
  2856. * STATION BANKS, INCLUDING THE ECS COPY FOR THIS
  2857. * STATION--WHICH DOES NO HARM
  2858. BCKLP BSS 0
  2859. RE 1
  2860. RJ ECSPRTY
  2861. SA1 A0
  2862. BX6 -X2*X1
  2863. SA6 A0
  2864. WE 1
  2865. RJ ECSPRTY
  2866. IX0 X0+X3
  2867. SB1 B1+1
  2868. LE B1,B2,BCKLP
  2869. EQ PROCESS
  2870.  
  2871. SBCKONX NGETVAR GET STATION NUMBER
  2872. NG X1,SBERR0
  2873. SX3 NUMSTAT-1 MAX STATION NUMBER
  2874. IX2 X3-X1
  2875. NG X2,SBERR1
  2876. * THERE IS NO CHECK HERE FOR THIS STATION, AS IT
  2877. * CAN NOT ARISE (EXCEPT THROUGH PRESS KEY ACTIONS)
  2878. * NOR WOULD IT MATTER
  2879.  
  2880. SB1 X3 SET B1 TO EXIT FROM LOOP
  2881. EQ BCKONCX
  2882. *
  2883. SBERR0 MX7 0 STATION ^$ LT 0
  2884. EQ SBERR
  2885.  
  2886. SBERR1 SX7 1 STATION ^$ GT MAX
  2887. EQ SBERR
  2888.  
  2889. SBERR2 SX7 2 ACTION REQUEST OVERFLOW
  2890. SBERR SA7 TERROR
  2891. EQ PROCESS
  2892. * /--- BLOCK BACKTST 00 000 77/04/04 23.33
  2893. BACKTST BSS 0
  2894. PL X5,BKSSTST
  2895. SB2 NUMSTAT
  2896. SB1 1 CONSTANT
  2897. MX6 0
  2898. TSTALLP BSS 0
  2899. SB2 B2-B1 DECREMENT STATION NUMBER
  2900. LE B2,TSTQUIT SKIP CONSOLE
  2901. SX1 B2
  2902. SA2 STATION
  2903. IX2 X1-X2
  2904. ZR X2,TSTALLP
  2905.  
  2906. CALL SSTST STATUS RETURNED IN X7
  2907.  
  2908. NG X7,TSTALLP
  2909. SX6 X6+B1
  2910. EQ TSTALLP
  2911.  
  2912. TSTQUIT BSS 0
  2913. SX7 -1
  2914. ZR X6,TSTSET
  2915. BX7 X6 (N) NOT YET BACKED OUT
  2916. TSTSET SA7 TERROR
  2917. EQ PROCESS
  2918.  
  2919.  
  2920. BKSSTST BSS 0
  2921. NGETVAR STATION NUMBER
  2922.  
  2923. * * CHECK VALIDITY OF STATION NUMBER
  2924.  
  2925. NG X1,SBERR0
  2926. SX2 NUMSTAT-1
  2927. IX2 X2-X1
  2928. NG X2,SBERR1
  2929.  
  2930. CALL SSTST
  2931.  
  2932.  
  2933. SA7 TERROR
  2934. EQ PROCESS
  2935. ENDOV
  2936. * /--- BLOCK SHOWE 00 000 81/01/14 11.42
  2937. TITLE SHOWE
  2938. * -SHOWE-
  2939. *
  2940. * SHOWS TUTOR VARIABLE IN SCIENTIFIC NOTATION
  2941. * THE SECOND ARGUMENT SPECIFIES THE NUMBER OF
  2942. * SIGNIFICANT FIGURES. 'THERE IS ALWAYS A LEADING
  2943. * BLANK OR MINUS SIGN; THE DEFAULT IS 4 SIG . FIGS
  2944. * THIRD ARG IS 0 FOR REGULAR, NON-ZERO FOR **
  2945. *
  2946. SHOWEOV OVRLAY
  2947. EXT ARAYFLG,ASHOWE,SHOWFIN,ASHOWIN
  2948. * ABOVE IS DUE TO OVERLAYING OF THIS COMMAND
  2949. SHOWE SX7 0
  2950. SA7 ARAYFLG GETVAR SETS NONZERO IF ARRAY
  2951. SA7 STARFLG CLEAR FLAG
  2952. FGETVAR EVALUATE 1ST ARGUMENT
  2953. BX7 X1
  2954. SA7 SHOWVAL SAVE IT
  2955. SA5 A5 RESTORE COMMAND
  2956. LX5 XCODEL LEFT-ADJUST 2ND ARG CODE
  2957. NG X5,SHOWE2 NEG MEANS DEFAULT 2ND ARGUMENT (6.3 OR 2.0)
  2958. NGETVAR DO THE CALC TO GET THE FORMAT
  2959. BX6 X1
  2960. ZR X6,PROCESS OUT IF NOTHING TO DO
  2961. *
  2962. SHOWE1 SA5 A5 REFETCH COMMAND WORD
  2963. LX5 2*XCODEL
  2964. PL X5,SHOWE3 FOR THREE ARG SHOW
  2965. *
  2966. SHOWE1A SA6 NCHAR INTERFACE (SAVE FOR ASHOWE)
  2967. MX7 0
  2968. SA7 SHOWOUT REQUEST LEADING BLANK/SIGN
  2969. SX7 1
  2970. SA7 SUPPFLG NO ZERO SUPPRESSION
  2971. SA1 ARAYFLG
  2972. NZ X1,ASHOWE JUMP IF IS ARRAY
  2973. RJ =XESHOW
  2974. EQ SHOWFIN
  2975. *
  2976. ****
  2977. SHOWE2 SX6 4 INTERFACE DEFAULT
  2978. EQ SHOWE1
  2979. ***
  2980. SHOWE3 SA6 NCHAR STORE NCHAR (KLUDGE)
  2981. MX0 2*XCODEL+XCMNDL FLAG BIT NOT SET IFGETHERE
  2982. LX5 60-2*XCODEL-XCMNDL POSITION ADDRESS
  2983. BX5 -X0*X5
  2984. SA1 B5+X5 FETCH 3RD ARG
  2985. BX5 X1
  2986. NGETVAR
  2987. MX6 0 REMOVE -0
  2988. IX6 X6+X1
  2989. SA6 STARFLG
  2990. *
  2991. SA1 NCHAR
  2992. BX6 X1 RESTORE NCHAR
  2993. EQ SHOWE1A REENTER FLOW
  2994. *
  2995. ENDOV
  2996. *
  2997. * /--- BLOCK SHOWO 00 000 78/09/01 21.37
  2998. *
  2999. TITLE SHOWO
  3000. * -SHOWO- (CODE=32)
  3001. *
  3002. * SHOWS IN OCTAL FORMAT THE CONTENTS OF A TUTOR VARIABLE.
  3003. *
  3004. SHOWOOV OVRLAY
  3005. EXT ARAYFLG,ASHOWE,SHOWFIN,ASHOW3,ASHOWIN
  3006. * ABOVE IS DUE TO OVERLAYING OF THIS COMMAND
  3007. SHOWOX SX7 0
  3008. SA7 ARAYFLG PREPARE FOR SHOWO(ARRAY)
  3009. NGETVAR I/F BIT OUT AT CONDENSE TIME
  3010. BX7 X1
  3011. SA7 SHOWVAL SAVE IT
  3012. SA5 A5 RESTORE COMMAND
  3013. LX5 XCODEL LEFT-ADJUST 2ND ARG CODE
  3014. NGETVAR ROUNDS TO INTEGER IN X1
  3015. ZR X1,PROCESS OUT IF NOTHING TO DO
  3016. BX6 X1
  3017. SA6 NCHAR
  3018. SA1 ARAYFLG
  3019. NZ X1,ASHOWO JUMP IF WHOLE ARRAY
  3020. RJ =XOSHOW
  3021. EQ SHOWFIN
  3022. *
  3023. ASHOWO SA3 SHOWO1 PLANT EQ SHOWO2 IN LOOP
  3024. SX6 1 TYPE=1 FOR NGETVAR
  3025. EQ ASHOWIN
  3026. *
  3027. SHOWO1 EQ SHOWO2
  3028. *
  3029. SHOWO2 RJ OSHOW
  3030. CALL XYFIX
  3031. CALL TUTWRT
  3032. SA1 NX
  3033. SX7 X1+16
  3034. SA7 A1 ADJUST WHEREX
  3035. SX7 5555B TWO SPACES
  3036. LX7 48
  3037. SA7 SHOWVAL BETWEEN OCTAL VALUES
  3038. SB1 A7 PTR TO STRING
  3039. SX7 2
  3040. SA7 SHOWOUT
  3041. SB2 A7 PTR TO COUNT
  3042. EQ ASHOW3 CALL TUTWRT FOR SPACES + GO ON
  3043. *
  3044. ENDOV
  3045. *
  3046. * /--- BLOCK SHOWH 00 000 78/10/18 03.01
  3047. *
  3048. TITLE SHOWH
  3049. * -SHOWH- (CODE=43)
  3050. *
  3051. * 'SHOWS THE CONTENTS OF A 'T'U'T'O'R VARIABLE IN HEX.
  3052. *
  3053. *
  3054. SHOWHOV OVRLAY
  3055. EXT ARAYFLG,ASHOWE,SHOWFIN,ASHOW3,ASHOWIN
  3056. * ABOVE IS DUE TO OVERLAYING OF THIS COMMAND
  3057. SHOWHX SX7 0
  3058. SA7 ARAYFLG PREPARE FOR SHOWH(ARRAY)
  3059. NGETVAR I/F BIT OUT AT CONDENSE TIME
  3060. BX7 X1
  3061. SA7 SHOWVAL SAVE IT
  3062. SA5 A5 RESTORE COMMAND
  3063. LX5 XCODEL LEFT-ADJUST 2ND ARG CODE
  3064. NGETVAR ROUNDS TO INTEGER IN X1
  3065. ZR X1,PROCESS --- EXIT IF NOTHING TO DO
  3066. BX6 X1
  3067. SA6 NCHAR
  3068. SA1 ARAYFLG
  3069. NZ X1,ASHOWH JUMP IF WHOLE ARRAY
  3070. RJ =XHSHOW
  3071. EQ SHOWFIN --- FINAL EXIT
  3072.  
  3073. ASHOWH SA3 SHOWH1 PLANT EQ SHOWH2 IN LOOP
  3074. SX6 1 TYPE=1 FOR NGETVAR
  3075. EQ ASHOWIN
  3076. *
  3077. SHOWH1 EQ SHOWH2
  3078. *
  3079. SHOWH2 RJ HSHOW
  3080. CALL XYFIX
  3081. CALL TUTWRT
  3082. SA1 NX
  3083. SX7 X1+16
  3084. SA7 A1 ADJUST WHEREX
  3085. SX7 5555B TWO SPACES
  3086. LX7 48
  3087. SA7 SHOWVAL BETWEEN OCTAL VALUES
  3088. SB1 A7 PTR TO STRING
  3089. SX7 2
  3090. SA7 SHOWOUT
  3091. SB2 A7 PTR TO COUNT
  3092. EQ ASHOW3 CALL TUTWRT FOR SPACES + GO ON
  3093. ENDOV
  3094. *
  3095. *
  3096. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3097. TITLE -TALKREQ- DOCUMENTATION
  3098. ** TALKREQ - TALK/MONITOR INITIATION/TERMINATION.
  3099. *
  3100. * ENTRY (OVARG1) = ZERO IF CALLED BY TUTOR COMMAND
  3101. * NZ IF BY SIGNOUT PROCESS
  3102. *
  3103. * ALL THE VARIOUS FUNCTIONS ARE ACTUALLY OFF-SHOOTS
  3104. * OF THE ABILITY OF THE FORMATTER TO SWITCH OUTPUT
  3105. * BETWEEN TERMINALS. THE ',FORWARD POINTER', IS USED
  3106. * BY THE FORMATTER TO RE-ROUTE OUTPUT (AFTER BEING
  3107. * SENT TO IT'7S ORIGINATOR). FOR EXAMPLE'; TALK IS
  3108. * ACTUALLY MONITOR MODE, BUT THE TWO USERS ARE HELD
  3109. * AT THEIR INDIVIDUAL ARROWS. MONITOR AND TELECONF
  3110. * ALLOW ONE USER TO MOVE AROUND THE SYSTEM WHILE THE
  3111. * OTHER(S) ARE HELD. MASTER MODE ALLOWS BOTH USERS
  3112. * TO MOVE AROUND (THOUGH ONE STATION IS USUALLY NOT
  3113. * SIGNED IN).
  3114. *
  3115. * THE MOST IMPORTANT ASSOCIATED DECKS';
  3116. * EXECUTOR DECK TUTORX, ROUTINE (I)MODE7.
  3117. * FORMATTER DECK FORMAT, ROUTINE FORMX.
  3118. * CONDENSOR DECK COVLAY2, OVERLAY TRQCOV.
  3119. *
  3120. *
  3121. *
  3122. * *ATALK* -- TALK/MONITOR STATUS TABLE.
  3123. *
  3124. * PROTECTED BY PROCESS INTERLOCK *I.TALK*;
  3125. * 1 WORD/STATION (CONFIGURED IN DECK MSUBS)';
  3126. *
  3127. * 6/STATUS (SEE TRS. EQUATES)
  3128. * 18/EXTRA INFO (PEOPLE LIST BUFFER NUMBER IN TLC)
  3129. * 18/',BACK PTR', TO PREVIOUS STATION IN CHAIN
  3130. * 18/',FORWARD PTR', TO NEXT STATION IN CHAIN
  3131. *
  3132. *
  3133. * THE SIGN BIT OF *PSLAVE* (/STATION/ BANK) IS USED
  3134. * TO FLAG MONITOR STATUS IS ACTIVE'; FORMATTER RE-
  3135. * ROUTING INFORMATION IS IN THE *ATALK* STATUS WORD
  3136. * FOR THIS STATION. THIS IS ALSO USED BY THE EXEC
  3137. * WHEN THE 'T'E'R'M KEY IS PRESSED.
  3138. *
  3139.  
  3140. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3141. EJECT
  3142. **
  3143. * EFFECTS OF VARIOUS -TALKREQ- FUNCTIONS WITH REGARDS TO
  3144. * STATUS OF THE EXECUTING STATION AND THE TARGET STATION.
  3145. *
  3146. * NOTE - THE *PSLAVE* FLAG IS SET/CLEARED FOR THE EXECUTING
  3147. * STATION ONLY. IF THE OTHER STATION ISN'7T ',WATCHING', FOR
  3148. * A STATUS CHANGE (I.E. MONITOR, MASTER), THE INITIATING
  3149. * STATION MUST USE THE -STCHANG- COMMAND TO SET/CLEAR THE
  3150. * FLAG FOR HIM.
  3151. **
  3152. * ------ BEFORE ----- ----- AFTER ------
  3153. * (US) (THEM) (US) (THEM)
  3154. *-----------------------------------------------------------
  3155. * REQUEST 0/SYSLIB 0 RTK RTK
  3156. *-----------------------------------------------------------
  3157. * CANCEL 0 N/A N/A N/A
  3158. * TELE-MAS TELE-MON 0 0
  3159. * TELE-MON TELE-XXX 0 UNCHANGED
  3160. * (ELSE) TELE-XXX 0 UNCHANGED
  3161. * (ELSE) (ELSE) 0 0
  3162. *-----------------------------------------------------------
  3163. * ANSWER RTK RTK TALK TALK
  3164. *-----------------------------------------------------------
  3165. * SETSLIB 0 SYSLIB
  3166. *-----------------------------------------------------------
  3167. * MONITOR 0 0 MONITOR MONITORED
  3168. * MASTER 0 0 MASTER MASTER
  3169. *-----------------------------------------------------------
  3170. * TLK2MON TALK TALK MONITORED MONITOR
  3171. * MON2TLK MONITORED MONITOR TALK TALK
  3172. *-----------------------------------------------------------
  3173. * STATUS N/A
  3174. *-----------------------------------------------------------
  3175. * JOIN 0/SYSLIB/RTK TELEXXX TELE-MON TELEXXX
  3176. *-----------------------------------------------------------
  3177. * CONFER 0 N/A TELE-MAS N/A
  3178. *-----------------------------------------------------------
  3179. * PAGE TELE-MAS 0 UNCHANGED RTK
  3180. *-----------------------------------------------------------
  3181. * UNPAGE N/A RTK N/A 0
  3182. *-----------------------------------------------------------
  3183. * PASS TELE-MAS TELE-MON TELE-MON TELE-MAS
  3184. *-----------------------------------------------------------
  3185. *
  3186.  
  3187. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3188. TITLE -TALKREQ- TALK/MONITOR FUNCTIONS
  3189. TALKRQV OVRLAY
  3190.  
  3191. *
  3192. * STATUS EQUATES
  3193. *
  3194. TRS.0 EQU 0 0 = NOT BUSY
  3195. TRS.RTK EQU 1 1 = REQUEST TALK/TELECONF
  3196. TRS.TLK EQU 2 2 = TALKING
  3197. TRS.SLB EQU 3 3 = IN NON-INTERRUPT SYSLIB FNC
  3198. TRS.MTR EQU 4 4 = MONITORING
  3199. TRS.MTB EQU 5 5 = BEING MONITORED
  3200. TRS.MST EQU 6 6 = DUAL-STATION MASTER
  3201. TRS.TLM EQU 7 7 = TELECONFERENCE MASTER
  3202. TRS.TLC EQU 8 8 = TELECONFERENCE MONITOR
  3203.  
  3204. *
  3205. * MAIN ENTRY -- CHECK FOR SUBROUTINE VS. COMMAND
  3206. *
  3207. SA1 OVARG1
  3208. ZR X1,TRQCMND -- JUMP IF TUTOR COMMAND
  3209. *
  3210. * SUBROUTINE CALL DURING SIGNOUT PROCESS
  3211. *
  3212. INTLOK X,I.TALK,W
  3213. CALL TRQBYE
  3214. INTCLR X,I.TALK
  3215. RETURN -- EXIT OVERLAY
  3216. *
  3217. *
  3218.  
  3219. *
  3220. * -TALKREQ- COMMAND EXECUTION
  3221. *
  3222.  
  3223. * ENTRY (X5) = 20/STATION GETVAR CODE
  3224. * 20/2ND ARGUMENT (NOT USED)
  3225. * 11/REQUEST TYPE CODE
  3226. * 9/-TALKREQ- COMMAND CODE
  3227. *
  3228.  
  3229. TRQCMND BSS 0 TUTOR COMMAND PROCESSOR
  3230. BX1 X5
  3231. MX0 -11 MASK FOR REQUEST TYPE
  3232. AX1 XCMNDL SHIFT COMMAND CODE OFF
  3233. BX1 -X0*X1 X1 = REQUEST TYPE
  3234. SB1 X1
  3235. JP B1+TRQTAB JUMP TO SPECIFIC ROUTINE
  3236. *
  3237. * -TRQTAB- TALK REQUEST JUMP TABLE
  3238. *
  3239. * NOTE -- THIS TABLE MUST MATCH THE CORRESPONDING
  3240. * ==== TABLE IN THE CONDENSOR (COVLAY2).
  3241. *
  3242. TRQTAB EQ TRQ0 0 = REQUEST
  3243. EQ TRQ1 1 = CANCEL
  3244. EQ TRQ2 2 = ANSWER
  3245. EQ TRQ3 3 = SETSLIB
  3246. EQ TRQ4 4 = MONITOR
  3247. EQ TRQ5 5 = MASTER
  3248. EQ TRQ6 6 = TLK2MON
  3249. EQ TRQ7 7 = MON2TLK
  3250. EQ TRQ8 8 = STATUS
  3251. EQ TRQ9 9 = JOIN
  3252. EQ TRQ10 10 = CONFER
  3253. EQ TRQ11 11 = PAGE
  3254. EQ TRQ12 12 = UNPAGE
  3255. EQ TRQ13 13 = PASS
  3256. *
  3257.  
  3258. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3259. TITLE -TALKREQ- COMMAND, KEYWORD ROUTINES
  3260. ************************************************************
  3261. * 0 = REQUEST ISSUE TERM-TALK REQUEST
  3262. ************************************************************
  3263.  
  3264. * OUR STATUS SHOULD BE 0 OR -IN SYSLIB-
  3265. * HIS STATUS SHOULD BE 0
  3266.  
  3267. TRQ0 CALL GETARG,TARGET
  3268. INTLOK X,I.TALK,W
  3269. CALL RDSTAT,STATION,S.WORD,S.STATUS
  3270. ZR X6,TRQ0A -- OUR STATUS IS 0; OK
  3271. SX1 X6-TRS.SLB
  3272. NZ X1,TRQERR1 -- ERROR, OUR STATUS WRONG
  3273. TRQ0A CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3274. NZ X6,TRQERR0 -- ERROR, HIS STATUS WRONG
  3275. *
  3276. SX6 TRS.RTK *REQUEST TALK* STATUS CODE
  3277. SA6 S.STATUS
  3278. SA6 T.STATUS
  3279. SA1 SELF OUR STATION NUMBER
  3280. SA2 TARGET HIS STATION NUMBER
  3281. BX6 X1
  3282. BX7 X2
  3283. SA6 T.TARGET POINT TO EACH OTHER
  3284. SA7 S.TARGET
  3285.  
  3286. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3287. CALL WRTSTAT,TARGET,T.WORD,T.STATUS
  3288. EQ TRQDONE -- COMPLETE, EXIT
  3289. *
  3290.  
  3291. ************************************************************
  3292. * 1 = CANCEL CANCEL ANY EXISTING STATE
  3293. ************************************************************
  3294.  
  3295. * OUR STATUS COULD BE ANYTHING
  3296.  
  3297. TRQ1 INTLOK X,I.TALK,W
  3298. CALL TRQBYE
  3299. EQ TRQDONE
  3300. *
  3301.  
  3302. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3303.  
  3304. ************************************************************
  3305. * 2 = ANSWER ANSWER TERM-TALK REQUEST
  3306. ************************************************************
  3307.  
  3308. * BOTH STATIONS SHOULD BE IN *REQUEST TALK*
  3309. * AND POINTING AT EACH OTHER.
  3310.  
  3311. TRQ2 INTLOK X,I.TALK,W
  3312. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3313. SX3 X6-TRS.RTK
  3314. NZ X3,TRQERR1 -- NOT BEING PAGED
  3315. CALL RDSTAT,S.TARGET,T.WORD,T.STATUS
  3316. SX3 X6-TRS.RTK
  3317. NZ X3,TRQERR0
  3318.  
  3319. SA1 SELF CHECK POINTERS
  3320. SA2 T.TARGET
  3321. IX3 X1-X2 COMPARE
  3322. NZ X3,TRQERR0
  3323.  
  3324. SX6 TRS.TLK CHANGE TO *TALKING*
  3325. SA6 S.STATUS
  3326. SA6 T.STATUS
  3327.  
  3328. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3329. CALL WRTSTAT,S.TARGET,T.WORD,T.STATUS
  3330.  
  3331. SA1 PSLAVE SET PSLAVE FLAG FOR SELF
  3332. MX6 1
  3333. BX6 X1+X6
  3334. SA6 A1
  3335. EQ TRQDONE
  3336. *
  3337.  
  3338. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3339.  
  3340. ************************************************************
  3341. * 3 = SETSLIB IN NON-INTERRUPT SYSLIB FUNCTN
  3342. ************************************************************
  3343.  
  3344. * OUR STATUS SHOULD BE 0
  3345.  
  3346. TRQ3 INTLOK X,I.TALK,W
  3347. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3348. NZ X6,TRQERR1 -- ALREADY DOING SOMETHING
  3349.  
  3350. SX6 TRS.SLB
  3351. SA6 S.STATUS
  3352. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3353. EQ TRQDONE
  3354. *
  3355.  
  3356. ************************************************************
  3357. * 4 = MONITOR MONITOR ANOTHER STATION
  3358. ************************************************************
  3359.  
  3360. * BOTH STATIONS SHOULD HAVE STATUS = 0
  3361.  
  3362. TRQ4 CALL GETARG,TARGET
  3363. INTLOK X,I.TALK,W
  3364. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3365. NZ X6,TRQERR1 -- WE ARE DOING SOMETHING ELSE
  3366. CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3367. NZ X6,TRQERR0 -- HE IS DOING SOMETHING ELSE
  3368.  
  3369. SX6 TRS.MTR SET UP OUR STATUS FIRST
  3370. SA6 S.STATUS
  3371. SA1 TARGET
  3372. SX6 X1
  3373. SA6 S.TARGET
  3374.  
  3375. SX6 TRS.MTB NOW HIS STATUS
  3376. SA6 T.STATUS
  3377. SA1 SELF
  3378. SX6 X1
  3379. SA6 T.TARGET
  3380.  
  3381. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3382. CALL WRTSTAT,TARGET,T.WORD,T.STATUS
  3383.  
  3384. SA1 PSLAVE SET PSLAVE BIT FOR SELF
  3385. MX6 1
  3386. BX6 X1+X6
  3387. SA6 A1
  3388. EQ TRQDONE
  3389. *
  3390.  
  3391. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3392.  
  3393. ************************************************************
  3394. * 5 = MASTER DUAL-STATION MASTER
  3395. ************************************************************
  3396.  
  3397. * BOTH STATIONS SHOULD HAVE STATUS = 0
  3398.  
  3399. TRQ5 CALL GETARG,TARGET
  3400. INTLOK X,I.TALK,W
  3401. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3402. NZ X6,TRQERR1 -- WE ARE DOING SOMETHING ELSE
  3403. CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3404. NZ X6,TRQERR0 -- HE IS DOING SOMETHING ELSE
  3405.  
  3406. SX6 TRS.MST BOTH STATIONS TO *MASTER*
  3407. SA6 S.STATUS
  3408. SA6 T.STATUS
  3409.  
  3410. SA1 TARGET POINT AT EACH OTHER
  3411. SX6 X1
  3412. SA6 S.TARGET
  3413. SA1 SELF
  3414. SX6 X1
  3415. SA6 T.TARGET
  3416.  
  3417. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3418. CALL WRTSTAT,TARGET,T.WORD,T.STATUS
  3419.  
  3420. SA1 PSLAVE SET PSLAVE FLAG FOR SELF
  3421. MX6 1
  3422. BX6 X1+X6
  3423. SA6 A1
  3424. EQ TRQDONE
  3425. *
  3426.  
  3427. ************************************************************
  3428. * 6 = TLK2MON SWITCH FROM TALK TO MONITOR
  3429. ************************************************************
  3430.  
  3431. * BOTH STATIONS SHOULD BE IN *TALK* STATE
  3432. * AND POINTING TO EACH OTHER
  3433.  
  3434. TRQ6 INTLOK X,I.TALK,W
  3435. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3436. SX3 X6-TRS.TLK
  3437. NZ X3,TRQERR1 -- WE AREN'7T TALKING
  3438. CALL RDSTAT,S.TARGET,T.WORD,T.STATUS
  3439. SX3 X6-TRS.TLK
  3440. NZ X3,TRQERR0 -- HE ISN'7T TALKING
  3441.  
  3442. SA1 SELF OUR STATION NUMBER
  3443. SA2 T.TARGET WHO IS HE TALKING TO
  3444. IX3 X1-X2 COMPARE
  3445. NZ X3,TRQERR0 -- NOT TALKING TO US
  3446.  
  3447. SX6 TRS.MTB SET OUR STATUS TO *MONITORED*
  3448. SA6 S.STATUS
  3449. SX6 TRS.MTR SET HIS STATUS TO *MONITORING*
  3450. SA6 T.STATUS
  3451.  
  3452. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3453. CALL WRTSTAT,S.TARGET,T.WORD,T.STATUS
  3454. EQ TRQDONE
  3455. *
  3456.  
  3457. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3458.  
  3459. ************************************************************
  3460. * 7 = MON2TLK SWITCH FROM MONITOR TO TALK
  3461. ************************************************************
  3462.  
  3463. * OUR STATUS SHOULD BE *MONITORED*
  3464. * HIS STATUS SHOULD BE *MONITORING*
  3465. * SHOULD BE POINTING AT EACH OTHER
  3466.  
  3467. TRQ7 INTLOK X,I.TALK,W
  3468. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3469. SX3 X6-TRS.MTB
  3470. NZ X3,TRQERR1 -- NOT BEING MONITORED
  3471. CALL RDSTAT,S.TARGET,T.WORD,T.STATUS
  3472. SX3 X6-TRS.MTR
  3473. NZ X3,TRQERR0 -- NOT MONITORING
  3474.  
  3475. SA1 SELF OUR STATION NUMBER
  3476. SA2 T.TARGET HIS PARTNER
  3477. IX3 X1-X2 COMPARE
  3478. NZ X3,TRQERR0 -- MONITORING SOMEONE ELSE
  3479.  
  3480. SX6 TRS.TLK SET BOTH STATUS TO *TALK*
  3481. SA6 S.STATUS
  3482. SA6 T.STATUS
  3483.  
  3484. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3485. CALL WRTSTAT,S.TARGET,T.WORD,T.STATUS
  3486. EQ TRQDONE
  3487. *
  3488.  
  3489. ************************************************************
  3490. * 8 = STATUS RETURN STATUS IN *ERROR*
  3491. ************************************************************
  3492.  
  3493. * READ TARGET STATUS AND RETURN VIA EXIT PROCESS
  3494.  
  3495. TRQ8 CALL GETARG,TARGET
  3496. INTLOK X,I.TALK,W
  3497. CALL RDSTAT,TARGET,S.WORD,B0
  3498. EQ TRQDONE
  3499. *
  3500.  
  3501. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3502.  
  3503. ************************************************************
  3504. * 9 = JOIN JOIN A TELECONFERENCE
  3505. ************************************************************
  3506.  
  3507. * OUR STATUS SHOULD BE 0, IN SYSLIB, OR REQUEST
  3508. * IF REQUEST, WE MUST BE TARGETING OUR REQUESTOR.
  3509. * HIS STATUS SHOULD BE EITHER TELE-MASTER/MONITOR.
  3510.  
  3511. TRQ9 CALL GETARG,TARGET
  3512. INTLOK X,I.TALK,W
  3513. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3514. ZR X6,TRQ9A -- OK, NOT BUSY
  3515. SX3 X6-TRS.SLB
  3516. ZR X3,TRQ9A -- OK, IN SYSLIB
  3517. SX3 X6-TRS.RTK
  3518. NZ X3,TRQERR1 -- ERROR, NOT REQUESTED
  3519.  
  3520. SA1 S.TARGET
  3521. SA2 TARGET
  3522. IX3 X1-X2
  3523. NZ X3,TRQERR1 -- REQUESTOR .NE. TARGET
  3524.  
  3525. TRQ9A CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3526. SX3 X6-TRS.TLM
  3527. ZR X3,TRQ9B -- TARGET IS TELE-MASTER
  3528. SX3 X6-TRS.TLC
  3529. NZ X3,TRQERR0 -- TARGET NOT IN TELECONF
  3530. TRQ9B SA1 SELF
  3531. SA2 T.OTHER
  3532. SX6 X1
  3533. SA6 A2
  3534. SX6 X2
  3535. SA6 S.OTHER
  3536. CALL WRTSTAT,TARGET,T.WORD,T.STATUS
  3537.  
  3538. CALL RDSTAT,S.OTHER,O.WORD,O.STATUS
  3539. SA1 SELF
  3540. SA2 O.TARGET
  3541. SX6 X1
  3542. SA6 A2
  3543. SX6 X2
  3544. SA6 S.TARGET
  3545. CALL WRTSTAT,S.OTHER,O.WORD,O.STATUS
  3546.  
  3547. SA1 T.PLIST
  3548. SX6 X1
  3549. SA6 S.PLIST
  3550. SX6 TRS.TLC
  3551. SA6 S.STATUS
  3552.  
  3553. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3554.  
  3555. SA1 PSLAVE SET PSLAVE FLAG FOR SELF
  3556. MX6 1
  3557. BX6 X1+X6
  3558. SA6 A1
  3559. EQ TRQDONE
  3560. *
  3561.  
  3562. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3563.  
  3564. ************************************************************
  3565. * 10 = CONFER START A TELECONFERENCE
  3566. ************************************************************
  3567.  
  3568. * OUR STATUS SHOULD BE 0 OR *IN SYSLIB*
  3569.  
  3570. * THE ARGUMENT IS THE LESSON NUMBER OF THE
  3571. * PEOPLE LIST, NOT A STATION NUMBER.
  3572.  
  3573. TRQ10 CALL GETARG,TARGET
  3574. INTLOK X,I.TALK,W
  3575. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3576. ZR X6,TRQ10A -- OK, NOT BUSY
  3577. SX3 X6-TRS.SLB
  3578. NZ X3,TRQERR1 -- ERR, ALREADY DOING SOMETHING
  3579.  
  3580. TRQ10A SX6 TRS.TLM TELE-MASTER
  3581. SA6 S.STATUS
  3582. SA1 SELF
  3583. SX6 X1+
  3584. SA6 S.OTHER
  3585. SA6 S.TARGET
  3586. SA1 TARGET
  3587. SX6 X1+
  3588. SA6 S.PLIST
  3589.  
  3590. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3591.  
  3592. SA1 PSLAVE SET PSLAVE FLAG FOR SELF
  3593. MX6 1
  3594. BX6 X1+X6
  3595. SA6 A1
  3596. EQ TRQDONE
  3597. *
  3598.  
  3599. ************************************************************
  3600. * 11 = PAGE PAGE SOMEONE FOR A TELECONF
  3601. ************************************************************
  3602.  
  3603. * OUR STATUS SHOULD BE *TELE-MASTER*
  3604. * HIS STATUS SHOULD BE 0
  3605.  
  3606. TRQ11 CALL GETARG,TARGET
  3607. INTLOK X,I.TALK,W
  3608. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3609. SX3 X6-TRS.TLM
  3610. NZ X3,TRQERR1 -- WE ARE NOT TELE-MASTER
  3611.  
  3612. CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3613. NZ X6,TRQERR0 -- ALREADY DOING SOMETHING
  3614.  
  3615. SX6 TRS.RTK
  3616. SA6 T.STATUS
  3617. SA1 SELF
  3618. SX6 X1
  3619. SA6 T.TARGET
  3620.  
  3621. CALL WRTSTAT,TARGET,T.WORD,T.STATUS
  3622. EQ TRQDONE
  3623. *
  3624.  
  3625. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3626.  
  3627. ************************************************************
  3628. * 12 = UNPAGE CLEAR SOMEONE'7S PAGING STATUS
  3629. ************************************************************
  3630.  
  3631. * HIS STATUS SHOULD BE *REQUEST TALK* AND
  3632. * HE SHOULD BE POINTING AT US.
  3633.  
  3634. TRQ12 CALL GETARG,TARGET
  3635. INTLOK X,I.TALK,W
  3636. CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3637. SX3 X6-TRS.RTK
  3638. NZ X3,TRQERR0 -- NOT BEING PAGED
  3639.  
  3640. SA1 SELF
  3641. SA2 T.TARGET
  3642. IX3 X1-X2
  3643. NZ X3,TRQERR0 -- PAGED BY SOMEONE ELSE
  3644.  
  3645. CALL ZEROSTAT,TARGET
  3646. EQ TRQDONE
  3647. *
  3648.  
  3649. ************************************************************
  3650. * 13 = PASS PASS CONTROL OF TELECONF
  3651. ************************************************************
  3652.  
  3653. * OUR STATUS SHOULD BE TELE-MASTER
  3654. * HIS STATUS SHOULD BE TELE-MONITOR
  3655. * AND HE SHOULD BE IN SAME TELECONF.
  3656.  
  3657. TRQ13 CALL GETARG,TARGET
  3658. INTLOK X,I.TALK,W
  3659. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3660. SX3 X6-TRS.TLM
  3661. NZ X3,TRQERR1 -- OUR STATUS IS WORNG
  3662. CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3663. SX3 X6-TRS.TLC
  3664. NZ X3,TRQERR0 -- HIS STATUS IS WRONG
  3665.  
  3666. SA1 S.PLIST
  3667. SA2 T.PLIST
  3668. IX3 X1-X2
  3669. NZ X3,TRQERR0 -- NOT IN OUR TELECONF
  3670.  
  3671. SX6 TRS.TLM MAKE HIM THE MASTER
  3672. SA6 T.STATUS
  3673. SX6 TRS.TLC AND US A MONITOR
  3674. SA6 S.STATUS
  3675.  
  3676. CALL WRTSTAT,SELF,S.WORD,S.STATUS
  3677. CALL WRTSTAT,TARGET,T.WORD,T.STATUS
  3678. EQ TRQDONE
  3679. *
  3680.  
  3681. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3682. TITLE -TALKREQ- *CANCEL* FUNCTION
  3683. ** TRQBYE - COMMON TERMINATION FUNCTION.
  3684. *
  3685. * REMOVE EXECUTING STATION FROM ANY MONITORS.
  3686. * DROP PEOPLE LIST IF LAST PERSON IN TELECONF.
  3687. *
  3688.  
  3689. TRQBYE EQ * ENTRY/EXIT
  3690.  
  3691. * CLEAR OUR OWN PSLAVE FLAG
  3692. SA1 PSLAVE
  3693. MX6 1
  3694. BX6 -X6*X1
  3695. SA6 A1
  3696.  
  3697. CALL RDSTAT,SELF,S.WORD,S.STATUS
  3698. ZR X6,TRQBYE -- NOTHING TO DO, EXIT
  3699. SX3 X6-TRS.TLM CHECK FOR TELE-MASTER
  3700. ZR X3,TRQB0 -- ADJOURN TELECON
  3701.  
  3702. SA1 SELF X1 = EXECUTING STATION NUMBER
  3703. SA2 S.TARGET X2 = FORWARD STATION
  3704. IX3 X1-X2 COMPARE
  3705. NZ X3,TRQB2 -- SOMEONE ELSE IS IN CHAIN
  3706.  
  3707. * POINTING AT SELF
  3708. SX3 X6-TRS.TLC
  3709. NZ X3,TRQB1 -- NOT IN A TELECONF
  3710. CALL S=LOG,TRQMSG,3
  3711. EQ TRQB1 -- CLEAR SELF AND EXIT
  3712.  
  3713. TRQB0 BSS 0 ** ADJOURN TELECONFERENCE **
  3714. CALL ZEROSTAT,SELF
  3715.  
  3716. SA1 S.TARGET SAVE NEXT STATION IN CHAIN
  3717. SX6 X1
  3718. SA6 TARGET
  3719.  
  3720. SA1 S.PLIST GET PEOPLE LIST LESSON NUMBER
  3721. ZR X1,ADJRN1 -- NO PEOPLE LIST
  3722. SA1 OVARG1 DO WE NEED TO SAVLES'/
  3723. + NZ X1,*+1 -- NO, NOT CALLED BY COMMAND
  3724. RJ =XSAVLES SAVE COMMON/STORAGE/ETC
  3725.  
  3726. SA1 S.PLIST GET PEOPLE LIST LESSON NUMBER
  3727. CALL DELETE DELETE BUFFER
  3728.  
  3729. SA1 OVARG1 DO WE NEED TO RESTLES'/
  3730. + NZ X1,*+1 -- NO, CALLED BY COMMAND
  3731. RJ =XRESTLES RESTORE COMMON/STORAGE/ETC.
  3732.  
  3733. ADJRN1 BSS 0
  3734. CALL RDSTAT,TARGET,T.WORD,T.STATUS
  3735. ZR X6,TRQBYE -- EXIT, COMPLETED CHAIN
  3736. CALL ZEROSTAT,TARGET
  3737. SA1 T.TARGET
  3738. SX6 X1
  3739. SA6 TARGET SAVE NEXT STATION NUMBER
  3740. EQ ADJRN1
  3741.  
  3742. TRQB1 BSS 0 ** CLEAR OWN STATUS AND EXIT **
  3743. CALL ZEROSTAT,SELF
  3744. EQ TRQBYE
  3745.  
  3746.  
  3747. TRQB2 BSS 0 ** CHECK ON MONITOR'7S STATUS **
  3748. SX3 X6-TRS.TLC CHECK FOR TELECONFERENCE
  3749. ZR X3,TRQB3 -- YES, WE ARE IN ONE
  3750. CALL RDSTAT,S.TARGET,T.WORD,T.STATUS
  3751. SX3 X6-TRS.TLM
  3752. ZR X3,TRQB1 -- TELE-MASTER, JUST CLEAR SELF
  3753. SX3 X6-TRS.TLC
  3754. ZR X3,TRQB1 -- TELE-MON, JUST CLEAR SELF
  3755. CALL ZEROSTAT,S.TARGET CLEAR HIS STATUS TOO
  3756. EQ TRQB1 -- NOW CLEAR OUR STATUS
  3757.  
  3758. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3759.  
  3760. TRQB3 BSS 0 ** REMOVE SELF FROM TELECONF **
  3761. * CORRECT FORWARD LINK IN CHAIN
  3762. CALL RDSTAT,S.TARGET,T.WORD,T.STATUS
  3763. SX3 X6-TRS.TLM
  3764. ZR X3,TRQB4 -- OK, HE'7S THE TELE-MASTER
  3765. SX3 X6-TRS.TLC
  3766. NZ X3,TRQB1 -- OOPS, JUST CLEAR AND EXIT
  3767. TRQB4 SA1 S.OTHER READ OWN BACKWRD POINTER
  3768. SX6 X1
  3769. SA6 T.OTHER STORE IT AS THEIR BACK PTR
  3770. CALL WRTSTAT,S.TARGET,T.WORD,T.STATUS
  3771.  
  3772. * CORRECT BACKWARD LINK IN CHAIN
  3773. CALL RDSTAT,S.OTHER,O.WORD,O.STATUS
  3774. SX3 X6-TRS.TLM
  3775. ZR X3,TRQB5 -- OK, HE'7S THE TELE-MASTER
  3776. SX3 X6-TRS.TLC
  3777. NZ X3,TRQB1 -- OOPS, JUST CLEAR AND EXIT
  3778. TRQB5 SA1 S.TARGET READ OWN FORWARD POINTER
  3779. BX6 X1
  3780. SA6 O.TARGET STORE IT AS THEIR FORWRD PTR
  3781. CALL WRTSTAT,S.OTHER,O.WORD,O.STATUS
  3782.  
  3783. EQ TRQB1 -- NOW CLEAR OUR STATUS
  3784.  
  3785. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3786. TITLE -TALKREQ- SUBROUTINES
  3787. ***********************************************************
  3788. * SUBROUTINES FOR -TALKREQ-
  3789. ***********************************************************
  3790.  
  3791. ** RDSTAT - READ TALK/MONITOR STATUS FOR STATION.
  3792. *
  3793. * ENTRY (B1) = ADDR OF DESIRED STATION NUMBER.
  3794. * (B2) = ADDRESS TO HOLD STATUS WORD.
  3795. * (B3) = ADDRESS OF 4-WORD DETAILED BUFFER.
  3796. * (ZERO MEANS WORD NOT BROKEN DOWN)
  3797. *
  3798. * EXIT (X1) = DESIRED STATUS WORD (ALSO IN CM).
  3799. * (X6) = 6-BIT STATUS CODE, IF BROKEN DOWN.
  3800. *
  3801. * ERROR IF INVALID STATION, EXITS TO TRQERR2.
  3802. *
  3803. * USES A - 0, 1, 6.
  3804. * B - NONE.
  3805. * X - 0, 1, 6.
  3806. *
  3807. RDSTAT EQ * ENTRY/EXIT POINT
  3808. SA1 B1 GET DESIRED STATION NUMBER
  3809. SX0 X1 TRUNCATE TO 18, MOVE TO X0
  3810. NG X0,TRQERR2 -- ILLEGAL, NEG. STATION NUM.
  3811. SX1 NUMSTAT NUMBER OF STATIONS ON SYSTEM
  3812. IX1 X0-X1 COMPARE
  3813. PL X1,TRQERR2 -- ILLEGAL, STATION TOO LARGE
  3814. SA1 ATALK X1 = EM ADDR OF STATUS TABLE
  3815. IX0 X0+X1 X0 = EM ADDR FOR DESIRED WORD
  3816. SA0 B2 CELL TO HOLD STATUS WORD
  3817. RE 1 READ STATUS WORD FROM EM TO CM
  3818. RJ =XECSPRTY HALF-EXIT IFF HARDWARE ERROR
  3819. SA1 A0 READ STATUS WORD FROM CM
  3820. ZR B3,RDSTAT -- NO BREAK-DOWN BUFFER SPECIF.
  3821.  
  3822. SX6 X1 X6 = FORWARD POINTER
  3823. SA6 B3+3 SAVE IT
  3824. AX1 18 SHIFT TO NEXT FIELD
  3825. SX6 X1 X6 = BACKWARD POINTER
  3826. SA6 B3+2 SAVE IT
  3827. AX1 18 SHIFT TO NEXT FIELD
  3828. SX6 X1 X6 = PEOPLE LIST NUMBER
  3829. SA6 B3+1 SAVE IT
  3830. AX1 18 SHIFT TO NEXT FIELD
  3831. SX6 X1 X6 = STATUS
  3832. SA6 B3 SAVE IT
  3833. EQ RDSTAT -- RETURN TO CALLER
  3834. *
  3835.  
  3836. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3837.  
  3838. ** WRTSTAT - WRITE STATUS WORD FOR STATION.
  3839. *
  3840. * ENTRY (B1) = ADDR OF STATION NUMBER.
  3841. * (B2) = ADDR OF NEW STATUS WORD.
  3842. * (B3) = ADDR OF DETAILED STATUS BUFFER.
  3843. * (ZERO MEANS ALREADY IN STATUS WD.)
  3844. *
  3845. * ERROR IF INVALID STATION, EXITS TO TRQERR2.
  3846. *
  3847. * USES A - 0, 1, 6.
  3848. * B - NONE.
  3849. * X - 0, 1, 6.
  3850. *
  3851. WRTSTAT EQ * ENTRY/EXIT
  3852. ZR B3,WRTS1 -- NO DETAILED BUFFER SPECIF.
  3853. SA1 B3 GET 6-BIT STATUS CODE
  3854. MX6 -6 MASK FOR STATUS CODE
  3855. BX6 -X6*X1 TRUNCATE
  3856. LX6 18 SHIFT
  3857. SA1 B3+1 GET 18-BIT PEOPLE LIST NUMBER
  3858. SX1 X1 TRUNCATE
  3859. BX6 X1+X6 UNION
  3860. LX6 18 SHIFT
  3861. SA1 B3+2 GET 18-BIT BACKWARD POINTER
  3862. SX1 X1 TRUNCATE
  3863. BX6 X1+X6 UNION
  3864. LX6 18 SHIFT
  3865. SA1 B3+3 GET 18-BIT FORWARD POINTER
  3866. SX1 X1 TRUNCATE
  3867. BX6 X1+X6 UNION
  3868. SA6 B2 STORE RESULT
  3869.  
  3870. WRTS1 SA1 B1 READ STATION NUMBER
  3871. SX0 X1 TRUNCATE TO 18, MOVE TO X0
  3872. NG X0,TRQERR2 -- ILLEGAL, NEG. STATION NUM.
  3873. SX1 NUMSTAT NUMBER OF STATIONS ON SYSTEM
  3874. IX1 X0-X1 COMPARE
  3875. PL X1,TRQERR2 -- ILLEGAL, STATION TOO LARGE
  3876. SA1 ATALK X1 = EM ADDR OF STATUS TABLE
  3877. IX0 X0+X1 EM ADDR OF STATUS WORD
  3878. SA0 B2 CELL HOLDING NEW STATUS WORD
  3879. WE 1 WRITE STATUS WORD TO EM
  3880. RJ =XECSPRTY HALF-EXIT IFF HARDWARE ERROR
  3881. EQ WRTSTAT -- RETURN TO CALLER
  3882. *
  3883.  
  3884. ** ZEROSTAT - ZERO STATUS WORD FOR SPECIFIED STATION.
  3885. *
  3886. * ENTRY (B1) = ADDRESS OF STATION NUMBER.
  3887. *
  3888. * ERROR EXITS TO TRQERR2 IF BAD STATION NUMBER.
  3889. *
  3890. * USES A - 0, 1.
  3891. * B - NONE.
  3892. * X - 0, 1.
  3893. *
  3894. ZEROSTAT EQ * ENTRY/EXIT
  3895. SA1 B1 READ STATION NUMBER
  3896. SX0 X1 TRUNCATE TO 18, MOVE TO X0
  3897. NG X0,TRQERR2 -- ILLEGAL, NEG. STATION NUM.
  3898. SX1 NUMSTAT NUMBER OF STATIONS ON SYSTEM
  3899. IX1 X0-X1 COMPARE
  3900. PL X1,TRQERR2 -- ILLEGAL, STATION TOO LARGE
  3901. SA1 ATALK X1 = EM ADDR OF STATUS TABLE
  3902. IX0 X0+X1 EM ADDR OF STATUS WORD
  3903. SA0 KZERO CONSTANT ZERO
  3904. WE 1 WRITE STATUS WORD TO EM
  3905. RJ =XECSPRTY HALF-EXIT IFF HARDWARE ERROR
  3906. EQ ZEROSTAT -- RETURN TO CALLER
  3907. *
  3908.  
  3909. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3910.  
  3911. ** GETARG - GET ARGUMENT FROM COMMAND WORD.
  3912. *
  3913. * ENTRY (B1) = ADDRESS TO STORE ARGUMENT
  3914. *
  3915. GETARG PS ENTRY/EXIT
  3916. SX6 B1
  3917. SA6 CARG SAVE ADDR
  3918. NGETVAR
  3919. BX6 X1
  3920. SA1 CARG
  3921. SA6 X1
  3922. EQ GETARG
  3923. *
  3924.  
  3925. * /--- BLOCK -TALKREQ- 00 000 82/08/20 06.00
  3926. TITLE -TALKREQ- EXITS AND STORAGE
  3927. ***********************************************************
  3928. * EXITS FOR -TALKREQ-
  3929. ***********************************************************
  3930.  
  3931. TRQERR0 SX6 0 0 = TARGET HAS WRONG STATUS
  3932. SA1 T.WORD READ TARGET STATUS WORD
  3933. EQ TRQEXIT
  3934.  
  3935. TRQERR1 SX6 1 1 = OUR STATUS IS WRONG
  3936. SA1 S.WORD READ OUR STATUS WORD
  3937. EQ TRQEXIT
  3938.  
  3939. TRQERR2 SX6 2 2 = BAD STATION NUMBER
  3940. SX1 0 NO STATUS WORD TO RETURN
  3941. EQ TRQEXIT
  3942.  
  3943. TRQDONE SX6 -1 -1 = REQUEST PROCESSED OK
  3944. SA1 S.WORD READ OUR STATUS WORD
  3945.  
  3946. TRQEXIT SA6 TRETURN SET *ZRETURN* TO RETURN CODE
  3947. BX6 X1
  3948. SA6 TERROR SET *ERROR* TO STATUS WORD
  3949. INTCLR X,I.TALK CLEAR INTERLOCK
  3950. SA1 OVARG1 COMMAND OR SIGNOUT'/
  3951. ZR X1,PROCESS -- EXIT TO NEXT COMMAND
  3952. RETURN -- EXIT OVERLAY AS SUBR.
  3953.  
  3954.  
  3955. ***********************************************************
  3956. * STORAGE CELLS FOR -TALKREQ-
  3957. ***********************************************************
  3958.  
  3959. *
  3960. * STATION NUMBER, STATUS WORD, DISASSEMBLED FIELDS.
  3961. *
  3962. SELF EQU STATION EXECUTING STATION
  3963. S.WORD BSSZ 1 STATUS WORD FROM EM
  3964. S.STATUS BSSZ 1 6-BIT STATUS CODE
  3965. S.PLIST BSSZ 1 18-BIT PEOPLE LIST LESSON NUM.
  3966. S.OTHER BSSZ 1 18-BIT BACKWARD POINTER
  3967. S.TARGET BSSZ 1 18-BIT FORWARD POINTER
  3968. *
  3969. TARGET BSSZ 1 FORWARD STATION (COMMAND TAG)
  3970. T.WORD BSSZ 1 STATUS WORD FROM EM
  3971. T.STATUS BSSZ 1 6-BIT STATUS CODE
  3972. T.PLIST BSSZ 1 18-BIT PEOPLE LIST LESSON NUM.
  3973. T.OTHER BSSZ 1 18-BIT BACKWARD POINTER
  3974. T.TARGET BSSZ 1 18-BIT FORWARD POINTER
  3975. *
  3976. OTHER BSSZ 1 BACKWARD STATION
  3977. O.WORD BSSZ 1 STATUS WORD FROM EM
  3978. O.STATUS BSSZ 1 6-BIT STATUS CODE
  3979. O.PLIST BSSZ 1 18-BIT PEOPLE LIST LESSON NUM.
  3980. O.OTHER BSSZ 1 18-BIT BACKWARD POINTER
  3981. O.TARGET BSSZ 1 18-BIT FORWARD POINTER
  3982. *
  3983. KZERO CON 0 CONSTANT ZERO
  3984. CARG BSSZ 1 COMMAND ARGUMENT ADDRESS
  3985. TRQMSG DIS ,* UNSAFE TELECONF CLEANUP.*
  3986.  
  3987. ENDOV
  3988.  
  3989.  
  3990. * /--- BLOCK FASTKOV 00 000 81/09/01 03.45
  3991. *
  3992. TITLE FASTKOV -- KEY COLLECTION (PIO TO STORAGE)
  3993.  
  3994. * -FASTKEY- (CODE=360)
  3995.  
  3996. * FASTKEY STORAGE,NUMKEYS
  3997.  
  3998. * ON COMPLETION *TRETURN* IS SET AS FOLLOWS
  3999.  
  4000. * -1 = I/O COMPLETED SUCCESSFULLY
  4001. * 0 = BAD STORAGE ADDRESS
  4002. * 1 = BAD NUMBER OF KEYS
  4003. * 2 = NO STORAGE AVAILABLE
  4004. * 3 = INSUFFICIENT STORAGE AVAILABLE
  4005.  
  4006. FASTKOV OVRLAY
  4007.  
  4008. FINISH ILLEGAL IN FINISH UNIT
  4009.  
  4010. SA1 TBITS KILL ANY FORCE FIRSTERASE
  4011. MX2 1
  4012. LX2 -FSTEBIT
  4013. BX6 -X2*X1
  4014. SA6 A1
  4015.  
  4016. * SA1 AUTKEY CHECK IF NEED TO END TIMESLICE
  4017. * NG X1,FKINT BRANCH IF IN BACKGROUND
  4018. * CALL COMPTIM CHECK CPU USAGE
  4019. * NG B2,FKINT BRANCH IF NO EXCESS
  4020. * EQ FKBKUP
  4021.  
  4022. * /--- BLOCK FASTKOV 00 000 81/09/02 02.38
  4023.  
  4024. * RESERVE THE PIO CONTROL BUFFER, IF POSSIBLE
  4025.  
  4026. FKINT INTLOK X,I.SSON INTERLOCK
  4027. SA1 APIOFKB CHK BUFFER FREE
  4028. BX0 X1 SET FOR ECS READ
  4029. SA0 CPIOFKB
  4030. + RE 2
  4031. - RJ ECSPRTY
  4032. SA1 A0+1 CHECK 10TH BYTE (12BITS/BYTE)
  4033. MX2 -12
  4034. BX2 -X2*X1
  4035. ZR X2,FKRES BRANCH IF BUFFER AVAILABLE
  4036. INTCLR X,I.SSON NOT AVAILABLE, CLEAR INTERLOCK
  4037. FKBKUP SA5 A5+1 BACK UP COMMAND POINTER
  4038. EQ =XXSLICE END TIME SLICE
  4039.  
  4040. FKRES SA2 STATION RESERVE THE BUFFER WITH STATION
  4041. BX6 X2
  4042. SA6 A1
  4043. + WE 2
  4044. - RJ ECSPRTY
  4045. INTCLR X,I.SSON CLEAR INTERLOCK
  4046.  
  4047. * GET ARGUMENTS
  4048.  
  4049. NGETVAR GET STORAGE ADDRESS
  4050. SX2 1 CHK LOWER BOUND
  4051. IX6 X1-X2
  4052. NG X6,FKERR0 --- ERROR BAD STORAGE ADDR
  4053. SA6 FKECSAD SAVE STORAGE ORDINAL
  4054.  
  4055. SA5 A5 RETRIEVE COMMAND WORD
  4056. LX5 XCODEL SHIFT TO SECOND GETVAR CODE
  4057. NGETVAR GET NUMBER OF KEYS TO COLLECT
  4058. ZR X1,FKNOERR --- DONE IF 0
  4059. NG X1,FKERR1 --- ERROR IF NEGATIVE
  4060. BX6 X1
  4061. SA6 FKNUMKY SAVE NUMBER OF KEYS TO COLLECT
  4062.  
  4063. * /--- BLOCK FASTKOV 00 000 81/09/03 01.33
  4064.  
  4065. SX2 X1+4 COMPUTE NUMBER OF WORDS
  4066. PX2 X2
  4067. NX2 X2
  4068. SX3 5
  4069. PX3 X3
  4070. NX3 X3
  4071. FX4 X2/X3 NWORDS = (NKEYS+4)/5
  4072. UX4 X4,B2
  4073. LX4 X4,B2
  4074. BX6 X4
  4075. SA6 FKNUMWD SAVE NUMBER OF WORDS NEEDED
  4076.  
  4077. SA1 TBXSTOR CHECK THAT STORAGE EXISTS
  4078. ZR X1,FKERR2 --- ERROR IF NO STORAGE
  4079. CALL SETSTOR X1 IS INPUT; X6 AND *STORWRD*
  4080. * ARE OUTPUT = 24/ECSAD,18/LEN
  4081. SA1 FKECSAD X1=RELATIVE ECS ADDRESS
  4082. SA2 FKNUMWD X2=NUMBER OF WORDS
  4083. IX3 X1+X2 LAST WORD
  4084. AX6 18 GET LENGTH
  4085. SX4 X6 18 BIT FIELD
  4086. IX3 X4-X3 (LENGTH)-(LAST WORD)
  4087. NG X3,FKERR3 --- ERROR IF BAD ECS ADDRESS
  4088.  
  4089. * BUILD PIO COMMAND BUFFER
  4090.  
  4091. AX6 18 GET STORAGE ECS ADDR
  4092. SA1 FKECSAD GET RELATIVE START
  4093. IX6 X6+X1
  4094. LX6 36 MOVE ADDR TO TOP TWO BYTES
  4095. SA6 CPIOFKB FIRST WORD OF PIO COMMAND BUFF
  4096. SA1 CPIOFKB+1 START WITH STATION IN LAST BYTE
  4097. BX6 X1
  4098. LX6 -12 ALSO IN TOP BYTE
  4099. BX6 X6+X1
  4100. SA1 FKNUMKY NUMBER OF KEYS
  4101. LX1 12
  4102. BX6 X6+X1
  4103. SA6 CPIOFKB+1 SECOND WORD OF PIO COMMAND BUFF
  4104.  
  4105. * WRITE COMMAND BUFFER BACK TO ECS
  4106.  
  4107. SA1 APIOFKB
  4108. BX0 X1
  4109. SA0 CPIOFKB
  4110. + WE 2
  4111. - RJ ECSPRTY
  4112.  
  4113. * /--- BLOCK FASTKOV 00 000 81/09/06 23.19
  4114.  
  4115. * UNLOAD COMMON/STORAGE AND SAVE LESSON POINTERS
  4116.  
  4117. CALL SAVLES SAVE COMMMON, STORAGE, ETC.
  4118.  
  4119. * CHECK FOR STEP MODE
  4120.  
  4121. FKSTEP SA1 TBITS
  4122. LX1 STEPBIT
  4123. PL X1,FKIOLN
  4124. CALL STEPXX PLOT '7WAITING FOR KEY'7
  4125.  
  4126. * MARK STORAGE AS NON-RELOCATABLE AND NON-DELETABLE
  4127.  
  4128. FKIOLN CALL IOLESSN,TBXSTOR,4000B
  4129.  
  4130. * TURN ON COLLECTION BIT IN KEYBUFFER
  4131.  
  4132. SA1 NKEYECS X1 = STARTING ECS ADDR KEYBUFF
  4133. SA2 STATION X2 = STATION
  4134. LX2 NKEYSHF
  4135. IX0 X1+X2 SET FOR ECS READ
  4136. SA0 FKKEYBF
  4137. + RE NKEYLTH
  4138. - RJ ECSPRTY
  4139. SA1 A0+1 X1 = SECOND WORK OF KEYBUFFER
  4140. MX2 -1 X2 = ONE BIT MASK
  4141. LX2 23 MOVE TO TOP BIT OF STOP1 BYTE
  4142. BX6 -X2+X1 TURN ON THE BIT
  4143. SA6 A1
  4144. SX1 1 WRITE ONLY 1 WORD BACK
  4145. IX0 X0+X1
  4146. SA0 A0+1
  4147. + WE NKEYLTH-1 WRITE IT BACK TO ECS
  4148. - RJ ECSPRTY
  4149.  
  4150. * CHECK FOR VARIOUS UNPROCESSED TIMING KEYS
  4151.  
  4152. SA2 TIMING X2 = TIMING FLAGS
  4153. LX2 59-TMRDONE
  4154. NG X2,FKTR BRANCH TO PROCESS -TIMER-
  4155.  
  4156. LX2 TMRDONE-TMEDONE CHECK FOR UNPROS. TIME
  4157. PL X2,FKTTL BRANCH IF NO
  4158. MX6 1 CLEAR UNPROCESSED BIT
  4159. BX6 -X6*X2
  4160. LX6 TMEDONE-59
  4161. SA6 A2
  4162. EQ FKLONG GO TO END PROCESSING
  4163.  
  4164. * /--- BLOCK FASTKOV 00 000 81/09/06 22.55
  4165.  
  4166. * WAIT FOR REQUEST TO BE COMPLETED
  4167.  
  4168. FKTTL TUTIM -1,,ANYKEY
  4169.  
  4170. * PROCESS THE ENDING KEY
  4171.  
  4172. SA1 KEY
  4173. SX2 X1-STOP1 CHECK FOR STOP1
  4174. NG X2,FKDN BRANCH IF LESS THAN STOP1
  4175. ZR X2,FKSTP1 BRANCH IF STOP1
  4176. SX2 X1-LONGUP
  4177. ZR X2,FKLONG BRANCH IF -TIMEL-
  4178. SX2 X1-ROUTUP
  4179. NZ X2,FKDN BRANCH IF NOT -TIMER-
  4180.  
  4181. * PROCESS -TIMER-
  4182.  
  4183. FKTR SA2 TIMING SEE IF A -TIMER- UNIT
  4184. MX6 -12
  4185. LX6 12
  4186. BX1 -X6*X2
  4187. ZR X1,FKTTL IGNORE KEY IF NO -TIMER- UNIT
  4188. MX1 1 TURN OFF -UNPROCESSED- BIT
  4189. LX1 TMRDONE-59 IN *TMRDONE* POSITION
  4190. BX2 -X1*X2
  4191. CALL INROUTE X1=-1(IN ROUTER),0(NO ROUTER),
  4192. * 1(HAS ROUTER BUT NOT IN IT)
  4193. PL X1,FKTR1 PROCESS IF NOT IN ROUTER NOW
  4194. BX6 X6*X2 AM IN ROUTER-CLEAR UNIT NUMBER,
  4195. SA6 A2 WRITE BACK TIMING WORD
  4196. EQ FKLONG GO RESET KEY AND EXIT
  4197.  
  4198. FKTR1 MX6 1 INDICATE -STOP1- KEY
  4199. LX6 TMRSTOP-59 IS TO EXIT TO -TIMER- UNIT
  4200. BX6 X6+X2 BY SETTING NEXT TO TOP BIT
  4201. SA6 A2 IN TIMING WORD.
  4202. SX6 STOP1 THEN PROCESS AS -STOP1-
  4203. SA6 KEY
  4204.  
  4205. * PROCESS STOP1 KEY
  4206.  
  4207. FKSTP1 CALL STOPCHK SEE IF SPECIAL SYSTEM LESSON
  4208. ZR X2,FKDN YES, SO TREAT AS NORMAL KEY
  4209.  
  4210. CALL FKOKBB TURN OFF THE KEYBUFFER BIT
  4211. PAUSE PAUSE TO MAKE SURE PIO IS DONE
  4212. CALL FKRCB RELEASE FASTKEY COMMAND BUFFER
  4213. CALL RTCLEAR REMOVE TIMING REQUESTS
  4214. EQ FINISH AND DO FINISH PROCESSING
  4215.  
  4216. * /--- BLOCK FASTKOV 00 000 81/09/06 23.20
  4217.  
  4218. FKLONG SX6 TIMEUP RESET KEY TO TIMEUP
  4219. SA6 KEY
  4220.  
  4221. * NORMAL EXIT PROCESSING
  4222.  
  4223. FKDN CALL FKOKBB TURN OFF FASTKEY BIT IN KEYBUFF
  4224. PAUSE WAIT TO BE SURE PIO IS DONE
  4225. SA1 APIOFKB RETURN NUMBER OF KEYS COLLECTED
  4226. BX0 X1 IN ERROR (CHANGE LATER)
  4227. SA0 CPIOFKB
  4228. + RE 2
  4229. - RJ ECSPRTY
  4230. SA1 CPIOFKB
  4231. LX1 -12
  4232. SX6 X1
  4233. SA6 TERROR
  4234. CALL RTCLEAR REMOVE LEFTOVER TIMING REQUEST
  4235. CALL IOLESSN,TBXSTOR,-4000B FREE STORAGE
  4236. CALL RESTLES RESTORE COMMON, LESSON, ETC
  4237.  
  4238. FKNOERR SX6 -1 SET *ZRETURN* TO NO ERROR
  4239. FKERRX SA6 TRETURN
  4240. CALL FKRCB RELEASE THE COMMAND BUFFER
  4241.  
  4242. * RETURN TO PROCESS NEXT COMMAND
  4243.  
  4244. SA1 TRETURN
  4245. NG X1,=XCKPROC
  4246. EQ PROCESS DONE
  4247.  
  4248. * ERROR EXITS
  4249.  
  4250. FKERR0 SX6 0 0 = BAD STORAGE ADDRESS
  4251. EQ FKERRX
  4252. FKERR1 SX6 1 1 = BAD NUMBER OF KEYS
  4253. EQ FKERRX
  4254. FKERR2 SX6 2 2 = NO STORAGE
  4255. EQ FKERRX
  4256. FKERR3 SX6 3 3 = TOO MANY KEYS
  4257. EQ FKERRX
  4258.  
  4259. * /--- BLOCK FASTKOV 00 000 81/09/06 16.49
  4260.  
  4261. * SUBROUTINES
  4262.  
  4263. * SUBROUTINE TO TURN OFF FASTKEY BIT IN KEY BUFFER
  4264.  
  4265. FKOKBB PS ENTRY / EXIT
  4266. SA1 NKEYECS X1 = STARTING ECS ADDR KEYBUFF
  4267. SA2 STATION X2 = STATION
  4268. LX2 NKEYSHF
  4269. IX0 X1+X2 SET FOR ECS READ
  4270. SA0 FKKEYBF
  4271. + RE NKEYLTH
  4272. - RJ ECSPRTY
  4273. SA1 A0+1 X1 = SECOND WORD OF KEY BUFFER
  4274. MX2 -1 X2 = 1 BIT MASK
  4275. LX2 23 POSITION TO TOP OF STOP1 BYTE
  4276. BX6 X2*X1 TURN OFF
  4277. SA6 A1
  4278. SX1 1
  4279. IX0 X0+X1
  4280. SA0 A0+1
  4281. + WE NKEYLTH-1 WRITE IT BACK TO ECS
  4282. - RJ ECSPRTY
  4283. EQ FKOKBB RETURN
  4284.  
  4285. * SUBROUTINE TO RELEASE FASTKEY COMMAND BUFFER
  4286.  
  4287. FKRCB PS ENTRY / EXIT
  4288. MX6 0 ZERO OUT THE BUFFER
  4289. SA6 CPIOFKB
  4290. SA6 CPIOFKB+1
  4291. SA1 APIOFKB WRITE IT BACK TO ECS
  4292. BX0 X1
  4293. SA0 CPIOFKB
  4294. + WE 2
  4295. - RJ ECSPRTY
  4296. EQ FKRCB RETURN
  4297.  
  4298.  
  4299. * STORAGE, ETC.
  4300.  
  4301. NKEYSHF EQU 1
  4302. NKEYLTH EQU 2
  4303.  
  4304. CPIOFKB OVDATA 2
  4305. FKECSAD OVDATA 1
  4306. FKNUMKY OVDATA 1
  4307. FKNUMWD OVDATA 1
  4308. FKKEYBF OVDATA 2
  4309.  
  4310. ENDOV
  4311. *
  4312. * /--- BLOCK HASHOV 00 000 84/09/23 15.11
  4313. TITLE -HASH- COMMAND EXECUTION.
  4314. ** HASHOV - EXECUTE -HASH- COMMAND.
  4315. *
  4316. * COMMAND WORD FORMAT --
  4317. * 20 / GETVAR CODE FOR INPUT.
  4318. * 20 / GETVAR CODE FOR RESULT.
  4319. * 11 / POINTER TO EXTRA STORAGE (IF THIRD TAG)
  4320. * 9 / -HASH- COMMAND.
  4321. *
  4322. * USES THE *MRKLAST* CONVENTION (TOP BIT OF LAST
  4323. * GETVAR CODE IS SET). ALSO, THE SECOND BIT OF
  4324. * THE RESULT GETVAR CODE IS SET IF THE *PASSWORD*
  4325. * KEYWORD IS SPECIFIED.
  4326. *
  4327. * ENTRY (A5/X5) = COMMAND WORD.
  4328. *
  4329. * EXIT TO *PROCESS*.
  4330. *
  4331. * CALLS PURDYOV (LEVEL 1 OVERLAY).
  4332. *
  4333.  
  4334.  
  4335. HASHOV OVRLAY
  4336.  
  4337. SX6 3 UP TO 3 ARGUMENTS
  4338. CALL GETARGS
  4339. SX1 X6-3 CHECK 2- OR 3- ARGUMENT FORM
  4340. PL X1,OWNHASH -- GET USER SPECIFIED PRIME
  4341. SX6 X6-2 CHECK FOR 1- OR 2- ARG FORMS
  4342. PL X6,TWOHASH -- IF 2 ARGUMENT FORM
  4343. SA1 VARBUF ELSE, COPY FIRST ARG TO SECOND
  4344. BX6 X1
  4345. SA6 VARBUF+1
  4346. TWOHASH BSS 0
  4347. SX6 PWPRIME PRIME FOR SIGNON PASSWORDS
  4348. SA5 A5 GET ORIGINAL COMMAND WORD
  4349. LX5 XCODEL+1 SHIFT TO 2ND BIT OF 2ND CODE
  4350. NG X5,SETHASH -- *PASSWORD* SPECIFIED
  4351. SA1 LESSCM+LSTOUSE CHECK FOR SYSTEM LESSON
  4352. SX6 SYSPRIME PRIME FOR SYSTEM LESSONS
  4353. NG X1,SETHASH -- IT IS A SYSTEM LESSON
  4354. SX6 USRPRIME PRIME FOR USER LESSONS
  4355. SETHASH BSS 0
  4356. SA6 OVARG2 *OVARG2* = INPUT FOR PRIME
  4357.  
  4358. SA1 VARBUF GET WORD TO BE HASHED
  4359. BX5 X1
  4360. NGETVAR
  4361. BX6 X1
  4362. SA6 OVARG1 *OVARG1* = WORD TO BE HASHED
  4363.  
  4364. X PURDYOV LEVEL 1 OVERLAY
  4365.  
  4366. SA1 VARBUF+1 RESULT VAR CODE
  4367. SA2 OVRET1 RESULT FROM PURDYOV
  4368. BX5 X1
  4369. BX6 X2
  4370. NPUTVAR STORE RESULT IN USER'7S VARS
  4371.  
  4372. EQ PROCESS -- EXIT
  4373. *
  4374. *
  4375. OWNHASH BSS 0
  4376. SA1 VARBUF+2 GET THIRD ARGUMENT (PRIME)
  4377. BX5 X1
  4378. NGETVAR
  4379. BX6 X1
  4380. AX1 59 SHIFT SIGN BIT THRU ENTIRE WORD
  4381. BX6 X6-X1 ABSOLUTE VALUE
  4382. SX1 X6-PWPRIME CHECK FOR RESTRICTED PRIME
  4383. NZ X1,SETHASH -- NOT THE SAME, ALLOW VALUE
  4384. SA1 BADPRIME SUBSTITUTE DIFF VALUE
  4385. BX6 X1
  4386. EQ SETHASH -- STORE USER-SPECIFIED PRIME
  4387. *
  4388. * THE PRIME MODULUS IS ACTUALLY (2**60 - OVARG2).
  4389. * THE FOLLOWING DEFINES ARE THE DEFAULTS FOR SYSTEM
  4390. * AND NON-SYSTEM LESSONS, ACCORDINGLY.
  4391. *
  4392. * /--- BLOCK HASHOV 00 000 84/09/23 15.11
  4393. SYSPRIME EQU 2RFK SYSTEM LESSONS
  4394. USRPRIME EQU 2RGE USER LESSONS
  4395. BADPRIME DATA 377777B IF USER SPECIFIED *PWPRIME*
  4396. *
  4397. *
  4398.  
  4399. ENDOV
  4400. * /--- BLOCK PURDYOV 00 000 84/09/23 15.35
  4401. TITLE PURDY - IRREVERSIBLE ENCIPHERING.
  4402. ** PURDYOV - APPLY A ONE-WAY HASHING ALGORITHM.
  4403. *
  4404. * ENTRY *OVARG1* = WORD TO ENCIPHER.
  4405. * *OVARG2* = INPUT TO PRIME MODULUS,
  4406. * ( 2**60 - OVARG2 ).
  4407. *
  4408. * EXIT *OVRET1* = ENCIPHERED RESULT.
  4409. * A5, B5, AND B7 ARE SAVED AND RESTORED.
  4410. * (X5) = COMMAND WORD.
  4411. *
  4412. * NOTES IT IS GUARANTEED THAT BITS 54-59 (THE
  4413. * FIRST CHARACTER) OF THE RESULT ARE NOT
  4414. * ALL 0.
  4415. *
  4416. * THE FUNCTION EVALUATED IS --
  4417. *
  4418. * Y = [X**(2**19+5) + ACOEFF(1)*X**(2**18+3)
  4419. * + ACOEFF(2)*X**3 + ACOEFF(3)*X**2
  4420. * + ACOEFF(4)*X + ACOEFF(5)]
  4421. * MOD (2**60 - OVARG2).
  4422. *
  4423.  
  4424.  
  4425. * /--- BLOCK PURDYOV 00 000 84/09/23 15.31
  4426. PURDYOV OVRLAY
  4427. *
  4428. * SAVE REGISTERS.
  4429. *
  4430. SX6 A5
  4431. SX7 B5
  4432. SA6 PDY.SAV SAVE A5
  4433. SA7 PDY.SAV+1 SAVE B5
  4434. MX0 -30 MASK TO SPLIT INPUT
  4435. SX6 B7
  4436. SA6 PDY.SAV+2 SAVE B7
  4437. *
  4438. * SPLIT INPUT INTO TWO WORDS PRIOR TO *PURDY*.
  4439. *
  4440. SA1 OVARG1 (X1) = INPUT
  4441. BX7 -X0*X1
  4442. SA7 PDY.BUF+1 LOWER HALF
  4443.  
  4444. LX1 0-30
  4445. BX6 -X0*X1
  4446. SA6 PDY.BUF UPPER HALF
  4447. *
  4448. * SET UP PARAMETERS AND CALL *PURDY*.
  4449. *
  4450. SB1 A6 (B1) = VALUE TO ENCIPHER
  4451. SB2 PDY.AC (B2) = COEFFICIENTS
  4452. SB3 PDY.NM1 (B3) = (N-1)
  4453. SB4 OVARG2 SPECIFIES PRIME MODULUS
  4454. RJ PURDY RESULT IN *PDY.BUF*
  4455. *
  4456. * PUT THE RESULT TOGETHER.
  4457. *
  4458. SA1 PDY.BUF
  4459. SA2 A1+1
  4460. LX1 30
  4461. BX6 X1+X2
  4462. *
  4463. * ENSURE THAT THE FIRST CHARACTER IS NONZERO.
  4464. *
  4465. BX1 X6
  4466. AX1 -6
  4467. NZ X1,PDY1 IF NOT 00
  4468. NG X1,PDY1 IF NOT 00
  4469.  
  4470. MX0 1
  4471. BX6 X6+X0 SET TOP BIT
  4472.  
  4473. PDY1 BSS 0
  4474. *
  4475. * STORE RESULT, RESTORE REGISTERS, AND EXIT.
  4476. *
  4477. SA6 OVRET1
  4478. SA1 PDY.SAV (X1) = A5
  4479. SA2 A1+B1 (X2) = B5
  4480. SA3 A2+B1 (X3) = B7
  4481. SA5 X1
  4482. SB5 X2
  4483. SB7 X3
  4484.  
  4485. RETURN EXIT
  4486.  
  4487. *
  4488. * PARAMETER BUFFERS.
  4489. *
  4490. PDY.BUF OVDATA 2 INPUT AND RESULT
  4491. PDY.AC DATA 7777777777B,7777777641B ACOEFF(1)
  4492. DATA 7777777777B,7777777603B ACOEFF(2)
  4493. DATA 7777777777B,7777777573B ACOEFF(3)
  4494. DATA 7777777777B,7777777636B ACOEFF(4)
  4495. DATA 7777777777B,7777777402B ACOEFF(5)
  4496. PDY.NM1 CON 1S18+2 N = 2**18 + 3
  4497.  
  4498. PDY.SAV OVDATA 3 A5, B5, B7
  4499. * /--- BLOCK PURDY-DOC 00 000 84/09/15 22.11
  4500. DOCUMENT TITLE PURDY - IRREVERSIBLE ENCIPHERING.
  4501. ** PURDY - EVALUATE PURDY-S IRREVERSIBLE ENCIPHERING
  4502. * FUNCTION, F(X) = P(X) MOD PRIME, WHERE
  4503. * P(X) IS A POLYNOMIAL OF LARGE DEGREE, AND
  4504. * PRIME IS A LARGE PRIME NUMBER.
  4505. *
  4506. * MARK B. ZVILIUS 84/08/22
  4507. *
  4508. *
  4509. * IN GENERAL, P(X) HAS THE FORM,
  4510. * P(X) = SUM(A(I) * X**N(I)), I = 1,2,...,NN.
  4511. * WHERE THE A(I) ARE ARBITRARY COEFFICIENTS, AND
  4512. * THE N(I) ARE ARBITRARY POWERS OF X.
  4513. *
  4514. * HOWEVER, FOR THE SAKE OF SPEED, THIS ROUTINE ONLY
  4515. * EVALUATES POLYNOMIALS WITH THE FOLLOWING FORM.
  4516. *
  4517. * P(X) = X**(2*N-1) + ACOEFF(1)*X**N +
  4518. * ACOEFF(2)*X**3 + ACOEFF(3)*X**2 +
  4519. * ACOEFF(4)*X + ACOEFF(5).
  4520. *
  4521. * MULTI-PRECISION INTEGER ARITHMETIC IS USED
  4522. * THROUGHOUT. THE FOLLOWING PARAMETERS DEFINE THE
  4523. * MULTI-PRECISION FORMAT.
  4524. *
  4525. * NP THE NUMBER OF COMPUTER WORDS THAT MAKE UP
  4526. * A MULTI-PRECISION NUMBER. *NP* IS AN
  4527. * ASSEMBLY-TIME CONSTANT BECAUSE IT DEFINES
  4528. * THE LENGTH OF WORKING BUFFERS.
  4529. *
  4530. * M IN EACH WORD OF A MULTI-PRECISION NUMBER
  4531. * THE LOWER M BITS ARE SIGNIFICANT. SINCE
  4532. * MULTIPLICATION MUST BE PERFORMED ON TWO
  4533. * M-BIT NUMBERS, M MUST BE <= 48. M IS AN
  4534. * ASSEMBLY-TIME CONSTANT, BUT COULD BE AN
  4535. * EXECUTION-TIME PARAMETER WITH CHANGES TO
  4536. * *MPMLT* AND *MPADD*. THE COST IS ABOUT
  4537. * 0.5 MS PER EVALUATION.
  4538. *
  4539. * Q TOTAL NUMBER OF BITS IN A MULTI-PRECISION
  4540. * NUMBER. Q = NP*M. Q IS NOT REFERENCED IN
  4541. * THE CODE, BUT IS USED IN THE DOCUMENTATION.
  4542. *
  4543. * MULTI-PRECISION NUMBERS ARE STORED IN CONSECUTIVE
  4544. * WORDS WITH THE HIGH-ORDER WORD FIRST. THE UPPER
  4545. * 60-M BITS OF EACH WORD MUST BE 0.
  4546. *
  4547. * THE PRIME MODULUS HAS THE SPECIAL FORM,
  4548. * PRIME = 2**Q - A
  4549. * WHERE *A* IS A SINGLE-PRECISION NUMBER. THAT IS,
  4550. * A < 2**M.
  4551. * /--- BLOCK PURDY-DOC 00 000 84/09/23 14.56
  4552. DOCUMENT EJECT
  4553. * THE PARAMETERS PASSED TO THIS ROUTINE ARE--
  4554. * X MULTI-PRECISION VALUE TO ENCIPHER.
  4555. * ACOEFF(I) MULTI-PRECISION COEFFICIENTS. I = 1..5
  4556. * (N-1) WHERE N SPECIFIES THE FIRST TWO EXPONENTS.
  4557. * A SINGLE-PRECISION NUMBER SPECIFYING THE
  4558. * PRIME MODULUS.
  4559. *
  4560. * THE ENCIPHERED RESULT IS RETURNED IN THE SAME
  4561. * BUFFER WHERE X WAS PASSED.
  4562. *
  4563. *
  4564. * ENTRY (B1) = FWA OF NP-WORD X.
  4565. * (B2) = FWA OF 5 BY NP-WORD ACOEFF(I) IN
  4566. * ROW-MAJOR ORDER.
  4567. * (B3) = ADDR OF (N-1).
  4568. * (B4) = ADDR OF A.
  4569. *
  4570. * EXIT F(X) IS RETURNED IN THE BUFFER FOR X.
  4571. * (B1) = 1.
  4572. *
  4573. * ERROR IF ANY OF THE PARAMETERS IS INVALID, F(X)
  4574. * WILL BE UNPREDICTABLE.
  4575. *
  4576. * USES ALL REGISTERS ARE DESTROYED.
  4577. *
  4578. * CALLS EXPP, MULTP, ADDP, MPSUB.
  4579. *
  4580. * MACROS ZERO, MPSET, CALLL.
  4581. *
  4582. * DEFINE (B1) = 1.
  4583. *
  4584. * NOTES THIS ROUTINE WAS ADAPTED FROM ALGORITHM 536
  4585. * IN THE COLLECTED ALGORITHMS OF THE ACM.
  4586. * THAT ALGORITHM WAS WRITTEN BY H. D. KNOBLE,
  4587. * PENN STATE UNIVERSITY COMPUTATION CENTER,
  4588. * JUNE 1977.
  4589. *
  4590. * THE PAPER DESCRIBING ALGORITHM 536 IS
  4591. * KNOBLE, H. D., FORNEY, C., AND BADER, F. S.
  4592. * AN EFFICIENT ONE-WAY ENCIPHERING ALGORITHM.
  4593. * ACM TRANS. MATH. SOFTWARE 5, 1
  4594. * (MARCH 1979), 97-107.
  4595. *
  4596. * THE ALGORITHM WAS ORIGINALLY PROPOSED IN
  4597. * PURDY, G. B.
  4598. * A HIGH SECURITY LOG-IN PROCEDURE.
  4599. * COMM. ACM 17, 8 (AUGUST 1974), 442-444.
  4600. *
  4601. * MULTI-PRECISION ARITHMETIC ROUTINES FROM
  4602. * KNUTH, D. E.
  4603. * THE ART OF COMPUTER PROGRAMMING, VOL. 2,
  4604. * SEMINUMERICAL ALGORITHMS.
  4605. * ADDISON-WESLEY, READING, MASS., 1969.
  4606. *
  4607. * /--- BLOCK PURDY-MAC 00 000 84/09/15 02.53
  4608. MACROS EJECT
  4609. *
  4610. * EQUATES.
  4611. *
  4612. NP EQU 2 WORDS IN MP NUMBERS
  4613. M EQU 30 BITS PER WORD IN M-P NUMBERS
  4614. Z= SPACE 4,20
  4615. ** Z= - OPDEFS TO SET B-REGISTER.
  4616. *
  4617. * Z= BREG,VAL
  4618. *
  4619. * ENTRY *BREG* = B-REGISTER TO SET.
  4620. * *VAL* = A REGISTER TO SET *BREG* TO, OR A
  4621. * VALUE TO LOAD INTO *BREG*.
  4622. * (B1) = 1.
  4623. *
  4624. * NOTES THE FOLLOWING OPTIMIZATIONS ARE PERFORMED.
  4625. *
  4626. * IF *VAL* IS THE SAME REGISTER AS *BREG*, NO
  4627. * CODE IS GENERATED.
  4628. *
  4629. * IF *VAL* IS A CONSTANT, A 15-BIT SET
  4630. * INSTRUCTION WILL BE GENERATED, IF
  4631. * POSSIBLE, USING (B1) = 1.
  4632. *
  4633.  
  4634.  
  4635. Z=B,Q OPDEF I,VAL
  4636. *
  4637. * IF NOT DEFINED YET, CANNOT DO OPTIMIZATION CHECKS.
  4638. *
  4639. IF -DEF,VAL,1
  4640. ELSE SKIP
  4641. *
  4642. IFEQ VAL,0,2 VAL = 0
  4643. SB.I B0
  4644. DONE SKIP
  4645. *
  4646. IFEQ VAL,1,2 VAL = 1
  4647. SB.I B1
  4648. DONE SKIP
  4649. *
  4650. IFEQ VAL,2,2 VAL = 2
  4651. SB.I B1+B1
  4652. DONE SKIP
  4653. *
  4654. IFEQ VAL,-1,2 VAL = -1
  4655. SB.I -B1
  4656. DONE SKIP
  4657. *
  4658. ELSE ENDIF
  4659. *
  4660. * VAL = ANYTHING ELSE.
  4661. *
  4662. SB.I VAL
  4663. *
  4664. DONE ENDIF
  4665. ENDM
  4666.  
  4667.  
  4668. Z=B,X OPDEF I,J
  4669. SB.I X.J
  4670. ENDM
  4671.  
  4672.  
  4673. Z=B,A OPDEF I,J
  4674. SB.I A.J
  4675. ENDM
  4676.  
  4677.  
  4678. Z=B,B OPDEF I,J
  4679. IFC NE,*I*J*,1
  4680. SB.I B.J
  4681. ENDM
  4682. * /--- BLOCK PURDY-MAC 00 000 78/12/19 00.30
  4683. CALLL SPACE 4,15
  4684. ** CALLL - CALL LOCAL ROUTINE WITH PARAMETERS.
  4685. *
  4686. * CALLL NAME,P1,P2,P3,P4,P5
  4687. *
  4688. * ENTRY *NAME* = NAME OF ROUTINE.
  4689. * *PI* = OPTIONAL PARAMETERS PASSED IN B-
  4690. * REGISTERS. P1 IN B2, P2 IN B3, ETC.
  4691. *
  4692. * EXIT TO ROUTINE *NAME* WITH PARAMETERS IN
  4693. * B-REGISTERS.
  4694. *
  4695. * USES B - 2, 3, 4, 5, 6.
  4696. *
  4697. * MACROS Z=.
  4698. *
  4699.  
  4700.  
  4701. CALLL MACRO NAME,P1,P2,P3,P4,P5
  4702. MACREF CALLL
  4703. *
  4704. PARAMS ECHO ,PI=(P1,P2,P3,P4,P5),N=(2,3,4,5,6)
  4705. IFC NE,*PI**,1
  4706. Z= B.N,PI
  4707. PARAMS ENDD
  4708. *
  4709. RJ NAME
  4710. CALLL ENDM
  4711. ZEROL SPACE 4,25
  4712. ** ZEROL - ZERO A CM BUFFER (LOCAL TO *EXEC6*)
  4713. *
  4714. * ZEROL BUF,LTH
  4715. *
  4716. * ENTRY *BUF* = FWA OF BUFFER.
  4717. * *LTH* = LENGTH OF BUFFER.
  4718. * (B1) = 1.
  4719. *
  4720. * EXIT BUFFER ZEROED.
  4721. * (A7) = *BUF* + *LTH* - 1
  4722. * (X7) = 0.
  4723. *
  4724. * USES X - 7.
  4725. * A - 7.
  4726. * B - 7.
  4727. *
  4728. * MACROS LOAD.
  4729. *
  4730. * NOTES IF *NP* IS GREATER THAN ABOUT 5, IT BECOMES
  4731. * MORE EFFICIENT TO READ ZEROES FROM AN ESM
  4732. * BUFFER.
  4733. *
  4734.  
  4735.  
  4736. ZEROL MACRO BUF,LTH
  4737. MACREF ZEROL
  4738. MX7 0
  4739. LOAD BUF,LTH
  4740. ZEROL ENDM
  4741. LOAD SPACE 4,20
  4742. ** LOAD - LOAD EACH WORD OF A CM BUFFER.
  4743. *
  4744. * LOAD BUF,LTH
  4745. *
  4746. * ENTRY *BUF* = FWA OF BUFFER.
  4747. * *LTH* = LENGTH OF BUFFER.
  4748. * (X7) = VALUE TO LOAD INTO EACH WORD.
  4749. * (B1) = 1.
  4750. *
  4751. * EXIT EACH WORD IN *BUF* LOADED WITH VALUE IN X7.
  4752. * (A7) = *BUF* + *LTH* - 1
  4753. *
  4754. * USES A - 7.
  4755. * B - 7.
  4756. *
  4757. * MACROS Z=.
  4758. *
  4759.  
  4760.  
  4761. LOAD MACRO BUF,LTH
  4762. MACREF LOAD
  4763. *
  4764. * ERROR IF *LTH* IS LESS THAN 1 OR MORE THAN 100.
  4765. *
  4766. IFLE LTH,0,1
  4767. ERR
  4768. IFGT LTH,100,1
  4769. ERR
  4770. *
  4771. * LOAD FIRST WORD.
  4772. *
  4773. SA7 BUF
  4774. *
  4775. * LOAD REMAINING WORDS.
  4776. *
  4777. LD1 IFNE LTH,1
  4778. *
  4779. * IF 2 <= *LTH* <= 6
  4780. *
  4781. LD2 IFLE LTH,6
  4782. DUP LTH-1,1
  4783. SA7 A7+B1
  4784. *
  4785. * IF *LTH* > 6.
  4786. *
  4787. LD2 ELSE
  4788. Z= B7,LTH-1
  4789. + SA7 A7+B1
  4790. SB7 B7-B1
  4791. NZ B7,*
  4792. LD2 ENDIF
  4793. LD1 ENDIF
  4794. LOAD ENDM
  4795. * /--- BLOCK PURDY-MAC 00 000 84/09/03 20.46
  4796. MPSET SPACE 4,20
  4797. ** MPSET - COPY ONE M-P NUMBER INTO ANOTHER.
  4798. *
  4799. * MPSET TO,FROM,LTH
  4800. *
  4801. * ENTRY *TO* = FWA OF DESTINATION BUFFER.
  4802. * *FROM* = FWA OF SOURCE BUFFER.
  4803. * *LTH* = NUMBER OF WORDS TO COPY.
  4804. * (B1) = 1.
  4805. *
  4806. * USES X - 1, 7.
  4807. * A - 1, 7.
  4808. * B - 7.
  4809. *
  4810. * MACROS Z=.
  4811. *
  4812. * NOTES SINCE *LTH* IS *NP* FOR MOST CALLS, AND
  4813. * SINCE *NP* IS SMALL, THIS ROUTINE COPIES
  4814. * WORD BY WORD INSTEAD OF USING A SCRATCH
  4815. * ESM BUFFER.
  4816. *
  4817.  
  4818.  
  4819. MPSET MACRO TO,FROM,LTH
  4820. MACREF MPSET
  4821. *
  4822. * ERROR IF *LTH* IS LESS THAN 1 OR MORE THAN 100.
  4823. *
  4824. IFLE LTH,0,1
  4825. ERR
  4826. IFGT LTH,100,1
  4827. ERR
  4828. *
  4829. * COPY FIRST WORD.
  4830. *
  4831. SA1 FROM
  4832. BX7 X1
  4833. SA7 TO
  4834. *
  4835. * COPY REMAINING WORDS.
  4836. *
  4837. SET1 IFNE LTH,1
  4838. *
  4839. * IF *LTH* = 2.
  4840. *
  4841. SET2 IFEQ LTH,2
  4842. SA1 A1+B1
  4843. BX7 X1
  4844. SA7 A7+B1
  4845. *
  4846. * IF *LTH* > 2.
  4847. *
  4848. SET2 ELSE
  4849. Z= B7,LTH-1
  4850. + SA1 A1+B1
  4851. BX7 X1
  4852. SA7 A7+B1
  4853. SB7 B7-B1
  4854. NZ B7,*-1
  4855. SET2 ENDIF
  4856. SET1 ENDIF
  4857. MPSET ENDM
  4858. * /--- BLOCK PURDY-MAC 00 000 84/09/07 19.09
  4859. KOMP SPACE 4,20
  4860. ** KOMP - COMPARE TWO M-P NUMBERS.
  4861. *
  4862. * KOMP X,Y,N
  4863. *
  4864. * ENTRY *X* = FWA OF N-PRECISION NUMBER.
  4865. * *Y* = FWA OF N-PRECISION NUMBER.
  4866. * *N* = PRECISION OF INPUTS.
  4867. * (B1) = 1.
  4868. *
  4869. * EXIT (X0) POSITIVE IF X >= Y, NEGATIVE IF X < Y.
  4870. *
  4871. * USES X - 0, 1, 2.
  4872. * A - 1, 2.
  4873. * B - 7.
  4874. *
  4875. * MACROS Z=.
  4876. *
  4877.  
  4878.  
  4879. KOMP MACRO X,Y,N
  4880. LOCAL QUIT5678
  4881. MACREF KOMP
  4882. *
  4883. * ERROR IF *N* IS LESS THAN 1 OR MORE THAN 100.
  4884. *
  4885. IFLE N,0,1
  4886. ERR
  4887. IFGT N,100,1
  4888. ERR
  4889. *
  4890. * COMPARE HIGH-ORDER WORDS.
  4891. *
  4892. SA1 X
  4893. SA2 Y
  4894. IX0 X1-X2
  4895. *
  4896. * COMPARE REMAINING WORDS, HIGH-ORDER FIRST.
  4897. *
  4898. K1 IFNE N,1
  4899. NZ X0,QUIT5678
  4900. *
  4901. * IF *N* = 2.
  4902. *
  4903. K2 IFEQ N,2
  4904. SA1 A1+B1
  4905. SA2 A2+B1
  4906. IX0 X1-X2
  4907. *
  4908. * IF *N* > 2.
  4909. *
  4910. K2 ELSE
  4911. Z= B7,N-1
  4912. + ZR B7,QUIT5678
  4913. SA1 A1+B1
  4914. SA2 A2+B1
  4915. IX0 X1-X2
  4916. SB7 B7-B1
  4917. ZR X0,*-1
  4918. K2 ENDIF
  4919. QUIT5678 BSS 0
  4920. K1 ENDIF
  4921. KOMP ENDM
  4922. * /--- BLOCK PURDY 00 000 78/12/19 00.27
  4923. MAIN SPACE 4,25
  4924. *
  4925. * MAIN ROUTINE.
  4926. *
  4927. PURDY EQ *+1S17 ENTRY/EXIT
  4928. *
  4929. * SAVE ADDRESSES.
  4930. *
  4931. SX6 B1
  4932. SX7 B2
  4933. SA6 PUR.AX SAVE FWA OF X
  4934. SA7 PUR.AC SAVE FWA OF ACOEFF
  4935. SX7 B4+
  4936. SA7 AA SAVE ADDR OF A
  4937. *
  4938. * (X4) = FWA OF X.
  4939. * (X5) = ADDR OF (N-1).
  4940. * THESE ARE PRESERVED OVER THE CALL TO *MPSUB*.
  4941. *
  4942. SX5 B3+ (X5) = ADDR OF (N-1)
  4943. BX4 X6 (X4) = FWA OF X
  4944.  
  4945. SB1 1 CONSTANT 1
  4946. *
  4947. * COMPUTE PRIME = 2**Q - A.
  4948. *
  4949. * WORK1 <-- 0. (SINCE *MPSUB* IGNORES THE BORROW IT
  4950. * IS AS IF WORK1 = 2**Q.)
  4951. *
  4952. ZEROL PUR.W1,NP
  4953. *
  4954. * WORK2 <-- A. (X7 IS ALREADY 0.)
  4955. *
  4956. LOAD PUR.W2,NP-1
  4957. SA1 B4 (X1) = A
  4958. BX7 X1
  4959. SA7 A7+1 WORK2(NP) &lt;-- A
  4960. *
  4961. * PRIME <-- WORK1-WORK2.
  4962. *
  4963. CALLL MPSUB,PUR.W1,PUR.W2,PRIME,NP-1
  4964. * /--- BLOCK PURDY 00 000 84/09/15 22.19
  4965. *
  4966. * X**(2*N-1) + K*X**N
  4967. * FACTORS INTO
  4968. * ((X**(N-1) + K)*X**(N-1))*X
  4969. * WHERE K = ACOEFF(1).
  4970. *
  4971. * WORK1 <-- X**(N-1) MOD PRIME.
  4972. *
  4973. CALLL EXPP,X4,X5,PUR.W1
  4974. *
  4975. * (X4) = FWA OF ACOEFF(J).
  4976. * PRESERVED OVER CALLS TO *ADDP* AND *MULTP*.
  4977. *
  4978. SA4 PUR.AC (X4) = FWA OF ACOEFF(1)
  4979. *
  4980. * WORK2 <-- (X**(N-1) + K) MOD PRIME.
  4981. *
  4982. CALLL ADDP,PUR.W1,X4,PUR.W2
  4983. *
  4984. * WORK2 <-- (X**(N-1) + K)*X**(N-1) MOD PRIME.
  4985. *
  4986. CALLL MULTP,PUR.W2,PUR.W1,PUR.W2
  4987. *
  4988. * WORK1 <-- (X**(N-1) + K)*X**(N-1)*X MOD PRIME.
  4989. *
  4990. SA1 PUR.AX (X1) = FWA OF X
  4991. CALLL MULTP,PUR.W2,X1,PUR.W1
  4992. *
  4993. * B*X**3 + C*X**2 + D*X + E
  4994. * FACTORS INTO
  4995. * ((B*X + C)*X + D)*X + E
  4996. * WHERE B = ACOEFF(2), C = ACOEFF(3), ETC.
  4997. *
  4998. * WORK2 <-- ACOEFF(2), I <-- 3, J <-- 3
  4999. * REPEAT
  5000. * WORK2 <-- WORK2 * X
  5001. * WORK2 <-- WORK2 + ACOEFF(J)
  5002. * I <-- I-1, J <-- J+1
  5003. * UNTIL I=0
  5004. *
  5005. SX4 X4+NP (X4) = FWA OF ACOEFF(2)
  5006. MPSET PUR.W2,X4,NP WORK2 &lt;-- AC(2)
  5007. *
  5008. * (X5) = LOOP COUNT.
  5009. * PRESERVED OVER CALLS TO *ADDP* AND *MULTP*.
  5010. *
  5011. SX5 3 I &lt;-- 3
  5012.  
  5013. PURDY1 BSS 0 REPEAT
  5014.  
  5015. SA1 PUR.AX (X1) = FWA OF X
  5016. CALLL MULTP,PUR.W2,X1,B2 WORK2 &lt;-- WORK2*X
  5017.  
  5018. SX4 X4+NP (X4) = FWA OF ACOEFF(J)
  5019. CALLL ADDP,PUR.W2,X4,B2 WORK2 &lt;-- WORK2+AC(J)
  5020.  
  5021. SX5 X5-1 I &lt;-- I-1
  5022. NZ X5,PURDY1 UNTIL I=0
  5023. *
  5024. * WORK1 HAS THE TWO HIGH-ORDER TERMS. WORK2 HAS THE
  5025. * LOW-ORDER TERMS. ADD TOGETHER AND STORE OVER X.
  5026. *
  5027. SA1 PUR.AX (X1) = FWA OF X
  5028. CALLL ADDP,PUR.W1,PUR.W2,X1
  5029.  
  5030. *
  5031. * DONE.
  5032. *
  5033. EQ PURDY EXIT
  5034.  
  5035. *
  5036. * DATA DEFINITIONS.
  5037. *
  5038. PUR.AX OVDATA ADDR OF X
  5039. PUR.AC OVDATA ADDR OF ACOEFF
  5040. AA OVDATA ADDR OF A. USED GLOBALLY.
  5041.  
  5042. PUR.W1 OVDATA NP M-P SCRATCH BUFFER
  5043. PUR.W2 OVDATA NP M-P SCRATCH BUFFER
  5044. *
  5045. * USED IN CONJUNCTION WITH *PRIME*, *XPRIME* IS
  5046. * AN (N+1)-WORD BUFFER WHOSE VALUE IS THE MODULUS.
  5047. * ROUTINE MOD2Q REQUIRES THIS.
  5048. *
  5049. XPRIME DATA 0
  5050. PRIME BSS NP PRIME MODULUS. USED GLOBALLY.
  5051. * /--- BLOCK EXPP 00 000 78/12/19 00.28
  5052. EXPP SPACE 4,25
  5053. ** EXPP - COMPUTE Y = X**K MOD PRIME. X AND Y ARE
  5054. * M-P NUMBERS. K IS A ONE-WORD EXPONENT.
  5055. * SEE KNUTH, ALGORITHM 4.6.3 A.
  5056. *
  5057. * ENTRY (B2) = FWA OF NP-WORD X.
  5058. * (B3) = ADDR OF K.
  5059. * (B4) = FWA OF NP-WORD Y.
  5060. * *PRIME* = NP-WORD MODULUS.
  5061. * *AA* = ADDR OF A. A = 2**Q MOD PRIME.
  5062. * (B1) = 1.
  5063. *
  5064. * USES X - 0, 1, 4, 5, 7.
  5065. * A - 1, 4, 7.
  5066. * B - 2, 3, 4, 7.
  5067. *
  5068. * CALLS MULTP.
  5069. *
  5070. * MACROS MPSET, ZEROL, CALLL.
  5071. *
  5072. * DEFINE (X4) = K; THE EXPONENT.
  5073. * (X5) = FWA OF Y.
  5074. * BOTH ARE PRESERVED OVER *MULTP*.
  5075. *
  5076.  
  5077. EXPP EQ *+1S17 ENTRY/EXIT
  5078. *
  5079. * FORM SQUARES OF X IN SCRATCH BUFFER Z. Z <-- X.
  5080. *
  5081. MPSET EXP.Z,B2,NP
  5082. *
  5083. * INITIALIZE RESULT. Y <-- 1.
  5084. *
  5085. ZEROL B4,NP-1
  5086. SX7 B1
  5087. SA7 A7+1 Y(NP) &lt;-- 1
  5088. *
  5089. * MAIN LOOP.
  5090. *
  5091. SA4 B3 (X4) = K
  5092. SX5 B4 (X5) = FWA OF Y
  5093. ZR X4,EXPP IF ZERO EXPONENT
  5094.  
  5095. EXP1 MX0 -1
  5096. BX1 -X0*X4 (X1) = BIT OF EXPONENT
  5097. BX4 X0*X4 CLEAR IT
  5098. LX4 -1 POSITION NEXT BIT
  5099. *
  5100. * IF BIT = 1
  5101. * Y <-- Y*Z MOD PRIME
  5102. * EXIT IF K=0
  5103. * ENDIF
  5104. *
  5105. ZR X1,EXP2 IF BIT = 0
  5106.  
  5107. SB3 EXP.Z
  5108. CALLL MULTP,X5,B3,X5
  5109.  
  5110. ZR X4,EXPP IF NO MORE BITS IN EXPONENT
  5111. *
  5112. * CONTINUE SQUARING Z.
  5113. *
  5114. EXP2 CALLL MULTP,EXP.Z,EXP.Z,EXP.Z
  5115.  
  5116. EQ EXP1 CONTINUE LOOPING
  5117.  
  5118. *
  5119. * DATA DEFINITIONS
  5120. *
  5121. EXP.Z OVDATA NP M-P BUFFER TO FORM SQUARES OF X
  5122. * /--- BLOCK MULTP/ADDP 00 000 84/09/15 22.22
  5123. MULTP SPACE 4,20
  5124. ** MULTP - COMPUTE RS = R*S MOD PRIME. RS, R, AND S
  5125. * ARE M-P NUMBERS.
  5126. *
  5127. * ENTRY (B2) = FWA OF NP-WORD R.
  5128. * (B3) = FWA OF NP-WORD S.
  5129. * (B4) = FWA OF NP-WORD RS.
  5130. * *PRIME* = NP-WORD MODULUS.
  5131. * *AA* = ADDR OF A. A = 2**Q MOD PRIME.
  5132. * (B1) = 1.
  5133. *
  5134. * USES A - 0.
  5135. * B - 2, 3, 4.
  5136. *
  5137. * CALLS MPMLT, MOD2Q.
  5138. *
  5139. * MACROS CALLL.
  5140. *
  5141.  
  5142. MULTP EQ *+1S17 ENTRY/EXIT
  5143.  
  5144. SA0 B4+ SAVE FWA OF RS OVER CALL
  5145. *
  5146. * WORK <-- R*S. WORK IS 2*NP-PRECISION.
  5147. *
  5148. CALLL MPMLT,B2,B3,MUL.WK
  5149. *
  5150. * RS <-- WORK MOD PRIME.
  5151. *
  5152. CALLL MOD2Q,MUL.WK,A0
  5153.  
  5154. EQ MULTP EXIT
  5155.  
  5156. *
  5157. * DATA DEFINITIONS.
  5158. *
  5159. MUL.WK OVDATA NP+NP MULTIPLICATION RESULT
  5160. ADDP SPACE 4,20
  5161. ** ADDP - COMPUTE RPS = R+S MOD PRIME. RPS, R, AND S
  5162. * ARE M-P NUMBERS.
  5163. *
  5164. * ENTRY (B2) = FWA OF NP-WORD R.
  5165. * (B3) = FWA OF NP-WORD S.
  5166. * (B4) = FWA OF NP-WORD RPS.
  5167. * *PRIME* = NP-WORD MODULUS.
  5168. * *AA* = ADDR OF A. A = 2**Q MOD PRIME.
  5169. * (B1) = 1.
  5170. *
  5171. * USES A - 0.
  5172. * B - 2, 3, 4.
  5173. *
  5174. * CALLS MPADD, MODQ1.
  5175. *
  5176. * MACROS CALLL.
  5177. *
  5178.  
  5179. ADDP EQ *+1S17 ENTRY/EXIT
  5180.  
  5181. SA0 B4+ SAVE FWA OF RPS OVER CALL
  5182. *
  5183. * WORK <-- R+S. WORK IS NP+1-PRECISION.
  5184. *
  5185. CALLL MPADD,B2,B3,ADD.WK
  5186. *
  5187. * RPS <-- WORK MOD PRIME.
  5188. *
  5189. CALLL MODQ1,ADD.WK,A0
  5190.  
  5191. EQ ADDP EXIT
  5192.  
  5193. *
  5194. * DATA DEFINITIONS.
  5195. *
  5196. ADD.WK OVDATA NP+1 ADDITION RESULT
  5197. * /--- BLOCK MOD2Q 00 000 84/09/15 22.23
  5198. MOD2Q SPACE 4,20
  5199. ** MOD2Q - COMPUTE R = W MOD PRIME, FOR 2Q-BIT W.
  5200. *
  5201. * ENTRY (B2) = FWA OF 2*NP-WORD W.
  5202. * (B3) = FWA OF NP-WORD R.
  5203. * *PRIME* = NP-WORD MODULUS.
  5204. * *AA* = ADDR OF A. A = 2**Q MOD PRIME.
  5205. * (B1) = 1.
  5206. *
  5207. * USES X - 0, 1, 2, 6.
  5208. * A - 0, 1, 2, 6.
  5209. * B - 2, 3, 4, 5, 6, 7.
  5210. *
  5211. * CALLS MPML, MPSUB, ADDP.
  5212. *
  5213. * MACROS CALLL, KOMP.
  5214. *
  5215. * DEFINE (A0) = FWA OF W0.
  5216. * (B6) = FWA OF R.
  5217. * BOTH ARE PRESERVED OVER *MPML* AND *MPSUB*.
  5218. *
  5219.  
  5220. MOD2Q EQ *+1S17 ENTRY/EXIT
  5221. *
  5222. * SAVE ADDRESSES.
  5223. *
  5224. SA0 B2+NP (A0) = FWA OF W0
  5225. SB6 B3+ (B6) = FWA OF R
  5226. *
  5227. * LET W = W0 + W1*2**Q. FORM U = A*W1.
  5228. *
  5229. SA1 AA (X1) = ADDR OF A
  5230. CALLL MPML,B2,X1,M2Q.U
  5231. *
  5232. * USE KNUTH-S THEOREM 4.3.1 B AND LEADING DIGIT
  5233. * THEOREM TO SOLVE FOR J SUCH THAT,
  5234. * J*PRIME <= U < (J+1)*PRIME.
  5235. *
  5236. * U(1) UNDERESTIMATES J BY AT MOST 1.
  5237. *
  5238. SA1 M2Q.U (X1) = U(1)
  5239. MX6 -1
  5240. IX6 X1-X6
  5241. SA6 M2Q.J J &lt;-- U(1)+1
  5242. *
  5243. * JP <-- J*PRIME.
  5244. *
  5245. CALLL MPML,PRIME,M2Q.J,M2Q.JP
  5246. *
  5247. * COMPARE U AND J*PRIME. RESULT IN X0.
  5248. *
  5249. KOMP M2Q.U,M2Q.JP,NP+1
  5250. PL X0,M2Q1 IF U >= J*PRIME
  5251. *
  5252. * IF U < J*PRIME, THEN J <-- J-1 AND JP <-- J*PRIME.
  5253. * IN OTHER WORDS, JP <-- JP - PRIME.
  5254. *
  5255. CALLL MPSUB,M2Q.JP,XPRIME,M2Q.JP,NP
  5256.  
  5257. M2Q1 BSS 0
  5258. *
  5259. * R <-- U - J*PRIME. THAT IS, R = A*W1 MOD PRIME.
  5260. *
  5261. CALLL MPSUB,M2Q.U+1,M2Q.JP+1,B6,NP-1
  5262. *
  5263. * HAVE R = A*W1 MOD PRIME.
  5264. * WANT R = (W0 + (A*W1 MOD PRIME)) MOD PRIME.
  5265. * NOTE THAT (B6) = (B4) = FWA OF R.
  5266. *
  5267. CALLL ADDP,A0,B6,B4
  5268.  
  5269. EQ MOD2Q EXIT
  5270.  
  5271. *
  5272. * DATA DEFINITIONS.
  5273. *
  5274. M2Q.U OVDATA NP+1 U = A*W1
  5275. M2Q.J OVDATA J
  5276. M2Q.JP OVDATA NP+1 JP = J*PRIME
  5277. * /--- BLOCK MODQ1 00 000 78/12/19 00.28
  5278. MODQ1 SPACE 4,20
  5279. ** MODQ1 - COMPUTE Y = S MOD PRIME, FOR (Q+1)-BIT S.
  5280. *
  5281. * ENTRY (B2) = FWA OF (NP+1)-WORD S.
  5282. * (B3) = FWA OF NP-WORD Y.
  5283. * *PRIME* = NP-WORD MODULUS.
  5284. * *AA* = ADDR OF A. A = 2**Q MOD PRIME.
  5285. * (B1) = 1.
  5286. *
  5287. * USES X - 1, 3, 7.
  5288. * A - 1, 7.
  5289. * B - 2, 3, 4, 6, 7.
  5290. *
  5291. * CALLS MODQ, MPADD.
  5292. *
  5293. * MACROS CALLL.
  5294. *
  5295. * DEFINE (X3) = S1; HIGH-ORDER WORD OF S.
  5296. * (B6) = FWA OF Y.
  5297. * BOTH ARE PRESERVED OVER *MODQ* AND *MPADD*.
  5298. *
  5299.  
  5300. MODQ1 EQ *+1S17 ENTRY/EXIT
  5301.  
  5302. SA1 B2
  5303. BX3 X1 (X3) = HIGH-ORDER WORD OF S
  5304. SB6 B3 (B6) = FWA OF Y
  5305. *
  5306. * LET S = S0 + S1*2**Q. THEN S1 IS EITHER 0 OR 1.
  5307. *
  5308. * Y <-- S0 MOD PRIME.
  5309. *
  5310. SB2 B2+B1 (B2) = FWA OF S0
  5311. CALLL MODQ,B2,B3
  5312. *
  5313. * IF S1=0, THEN DONE.
  5314. *
  5315. ZR X3,MODQ1 EXIT
  5316.  
  5317. SB3 MQ1.WK (B3) = FWA OF WORK
  5318. *
  5319. * HAVE Y = S0 MOD PRIME.
  5320. * WANT Y = ((S0 MOD PRIME) + A) MOD PRIME.
  5321. *
  5322. ZEROL B3,NP-1
  5323. SA1 AA (X1) = ADDR OF A
  5324. SA1 X1 (X1) = A
  5325. BX7 X1
  5326. SA7 A7+B1 WORK(NP) &lt;-- A
  5327.  
  5328. CALLL MPADD,B6,B3,B3 WORK &lt;-- Y + WORK
  5329. *
  5330. * WORK(1), THE HIGH-ORDER WORD, IS GUARANTEED ZERO.
  5331. *
  5332. SB2 B3+B1 (B2) = ADDR OF WORK(2)
  5333. CALLL MODQ,B2,B6
  5334.  
  5335. EQ MODQ1 EXIT
  5336.  
  5337. *
  5338. * DATA DEFINITIONS.
  5339. *
  5340. MQ1.WK OVDATA NP+1 (NP+1)-PRECISION SCRATCH BUFFER
  5341. * /--- BLOCK MODQ 00 000 84/09/08 23.11
  5342. MODQ SPACE 4,15
  5343. ** MODQ - COMPUTE Y = X MOD PRIME FOR Q-BIT X.
  5344. *
  5345. * ENTRY (B2) = FWA OF NP-WORD X.
  5346. * (B3) = FWA OF NP-WORD Y.
  5347. * *PRIME* = NP-WORD MODULUS.
  5348. * (B1) = 1.
  5349. *
  5350. * USES X - 0, 1, 2, 7.
  5351. * A - 1, 2, 7.
  5352. * B - 3, 4, 5, 7.
  5353. *
  5354. * CALLS MPSUB.
  5355. *
  5356. * MACROS KOMP, MPSET, CALLL.
  5357. *
  5358.  
  5359. MOD1 BSS 0
  5360. *
  5361. * X >= PRIME, THEREFORE Y = X - PRIME.
  5362. *
  5363. SB4 B3 (B4) = FWA OF Y
  5364. CALLL MPSUB,B2,PRIME,B4,NP-1
  5365.  
  5366. MODQ EQ *+1S17 ENTRY/EXIT
  5367.  
  5368. KOMP B2,PRIME,NP
  5369. PL X0,MOD1 IF X >= PRIME
  5370. *
  5371. * X < PRIME, THEREFORE Y = X.
  5372. *
  5373. MPSET B3,B2,NP
  5374. EQ MODQ EXIT
  5375. * /--- BLOCK MPMLT 00 000 78/12/19 00.28
  5376. MPMLT SPACE 4,30
  5377. ** MPMLT - UNSIGNED, MULTI-PRECISION INTEGER
  5378. * MULTIPLICATION. W = U*V. U AND V ARE
  5379. * NP-PRECISION; W IS 2*NP-PRECISION.
  5380. *
  5381. * ENTRY (B2) = FWA OF NP-WORD U.
  5382. * (B3) = FWA OF NP-WORD V.
  5383. * (B4) = FWA OF 2*NP-WORD W.
  5384. * (B1) = 1.
  5385. *
  5386. * USES X - 0, 1, 2, 3, 6, 7.
  5387. * A - 1, 2, 6, 7.
  5388. * B - 2, 3, 4, 5, 6, 7.
  5389. *
  5390. * MACROS ZERO1.
  5391. *
  5392. * DEFINE (B2) = FWA OF U.
  5393. * (B3) = FWA OF V.
  5394. * (B4) = FWA OF W.
  5395. * (B5) = I; INDEX INTO U.
  5396. * (B6) = J; INDEX INTO V.
  5397. * (X3) = MASK TO SPLIT UP RESULT.
  5398. * (X6) = K; CARRY.
  5399. * (X7) = VALUE TO STORE BACK TO W(I+J).
  5400. *
  5401. * NOTES IF *NP* IS 4 OR MORE, IT BECOMES WORTHWHILE
  5402. * TO PACK EACH WORD OF U AND V INTO FLOATING
  5403. * POINT FORMAT BEFORE STARTING THE MAIN LOOP.
  5404. * OF COURSE THIS REQUIRES 2, NP-WORD SCRATCH
  5405. * BUFFERS.
  5406. *
  5407.  
  5408. MPMLT EQ *+1S17 ENTRY/EXIT
  5409. *
  5410. * BEGIN KNUTH-S ALGORITHM 4.3.1 M.
  5411. *
  5412. * (1) INITIALIZE.
  5413. *
  5414. ZEROL B4+NP,NP ZERO LOW HALF OF RESULT
  5415.  
  5416. MX3 60-M SET UP MASK FOR LATER
  5417. *
  5418. * DECREMENT THE BUFFER ADDRESSES SO THE INDICES
  5419. * CAN RUN FROM NP --> 1.
  5420. *
  5421. SB2 B2-B1 U
  5422. SB3 B3-1 V
  5423. SB4 B4-1 W
  5424.  
  5425. SB6 NP J &lt;-- NP
  5426. *
  5427. * (2) PROBABILITY OF V(J)=0 IS SMALL; SKIP STEP 2.
  5428. *
  5429. * (3) INITIALIZE I.
  5430. *
  5431. MLT1 BSS 0 REPEAT
  5432.  
  5433. SB5 NP I &lt;-- NP
  5434. SX6 0 K &lt;-- 0
  5435. * /--- BLOCK MPMLT 00 000 84/09/03 19.33
  5436. *
  5437. * (4) MULTIPLY AND ADD.
  5438. * COMPUTE T <-- U(I)*V(J) + W(I+J) + K.
  5439. * T IS GUARANTEED TO BE LESS THAN 2**(2*M).
  5440. *
  5441. MLT2 BSS 0 REPEAT
  5442.  
  5443. SA1 B2+B5 (X1) = U(I)
  5444. SA2 B3+B6 (X2) = V(J)
  5445. PX1 X1
  5446. PX2 X2
  5447. FX0 X1*X2 (X0) = HIGH 48 BITS OF UI*VJ
  5448. DX7 X1*X2 (X7) = LOW 48 BITS OF UI*VJ
  5449. *
  5450. * IN ONE UNLIKELY CASE, AN AUTOMATIC NORMALIZE IS
  5451. * DONE. OTHERWISE, NO SHIFTS ARE NECESSARY.
  5452. *
  5453. UX0 X0
  5454. UX7,B7 X7 (B7) = -1 IF SHIFT NEEDED
  5455. ZR B7,MLT0 IF NO SHIFT NEEDED
  5456.  
  5457. LX0 -1 UN-DO NORMALIZING SHIFT
  5458. LX7 -1 UN-DO NORMALIZING SHIFT
  5459. *
  5460. * SHIFT LOW BIT OUT OF (X0) INTO HIGH BIT OF (X7).
  5461. *
  5462. MX2 1
  5463. BX2 X2*X0 PICK OFF BIT 59 (WAS BIT 0)
  5464. BX0 -X2*X0 CLEAR IT IN HIGH-ORDER WORD
  5465. LX2 47-59 POSITION TO BIT 47
  5466. BX7 X7+X2 MERGE INTO THE LOW-ORDER WORD
  5467.  
  5468. MLT0 BSS 0
  5469. *
  5470. * ADD IN W(I+J) AND K. NO OVERFLOW IS POSSIBLE.
  5471. *
  5472. SB7 B5+B6 (B7) = I+J
  5473. SA1 B4+B7 (X1) = W(I+J)
  5474. IX1 X1+X6 (X1) = W(I+J) + K
  5475. IX6 X7+X1 (X6) = W(I+J)+K+(LOW ORDER WD)
  5476.  
  5477. BX7 -X3*X6 (X7) = LOWER M BITS OF T
  5478. SA7 A1 W(I+J) &lt;-- LOWER HALF OF T
  5479.  
  5480. AX6 M-0 CHOP OFF LOWER M BITS
  5481. *
  5482. * NOW X6 HAS THE LOWER (48-M) SIGNIFICANT BITS OF
  5483. * THE UPPER HALF OF T. IT ALSO HAS CARRY BITS TO
  5484. * ADD INTO THE OTHER (2*M-48) BITS WHICH ARE IN X0.
  5485. *
  5486. LX0 48-M POSITION UPPER (2*M-48) BITS
  5487. IX6 X0+X6 (X6) = K = UPPER HALF OF T
  5488. *
  5489. * (5) LOOP ON I.
  5490. *
  5491. SB5 B5-B1 I &lt;-- I-1
  5492. NZ B5,MLT2 UNTIL I=0
  5493.  
  5494. SA6 B4+B6 W(J) &lt;-- K
  5495. *
  5496. * (6) LOOP ON J.
  5497. *
  5498. SB6 B6-B1 J &lt;-- J-1
  5499. NZ B6,MLT1 UNTIL J=0
  5500.  
  5501. EQ MPMLT EXIT
  5502. * /--- BLOCK MPML 00 000 84/09/08 23.11
  5503. MPML SPACE 4,30
  5504. ** MPML - UNSIGNED, MULTI-PRECISION INTEGER
  5505. * MULTIPLICATION FOR THE SPECIAL CASE WHERE
  5506. * ONE OPERAND IS SINGLE-PRECISION.
  5507. * W <-- S*U, WHERE U IS NP-PRECISION; S IS
  5508. * SINGLE PRECISION; W IS (NP+1)-PRECISION.
  5509. *
  5510. * ENTRY (B2) = FWA OF NP-WORD U.
  5511. * (B3) = ADDR OF S.
  5512. * (B4) = FWA OF (NP+1)-WORD W.
  5513. * (B1) = 1.
  5514. *
  5515. * USES X - 0, 1, 2, 3, 6, 7.
  5516. * A - 1, 2, 6, 7.
  5517. * B - 2, 5, 7.
  5518. *
  5519. * DEFINE (B2) = FWA OF U.
  5520. * (X1) = S.
  5521. * (B4) = FWA OF W.
  5522. * (B5) = I; INDEX INTO U.
  5523. * (X3) = MASK TO SPLIT UP RESULT.
  5524. * (X6) = K; CARRY.
  5525. * (X7) = VALUE TO STORE BACK TO W(I+1).
  5526. *
  5527. * NOTES THIS IS DERIVED FROM KNUTH-S ALGORITHM
  5528. * 4.3.1 M FOR THE SPECIAL CASE OF A SINGLE-
  5529. * PRECISION MULTIPLIER. SEE KNUTH-S PROBLEM
  5530. * 4.3.1-13.
  5531. *
  5532.  
  5533. * /--- BLOCK MPML 00 000 84/09/08 23.08
  5534. MPML EQ *+1S17 ENTRY/EXIT
  5535. *
  5536. * DECREMENT FWA OF U SO THAT I RUNS FROM NP --> 1.
  5537. * BUT LEAVE FWA OF W ALONE, THUS TAKING CARE OF THE
  5538. * OFFSET OF 1 IN W(I+1).
  5539. *
  5540. SB2 B2-B1
  5541.  
  5542. MX3 60-M SET UP MASK FOR LATER
  5543.  
  5544. SA1 B3 (X1) = S
  5545. PX1 X1 FLOATING POINT FORMAT
  5546. *
  5547. * (3) INITIALIZE I.
  5548. *
  5549. SB5 NP I &lt;-- NP
  5550. SX6 0 K &lt;-- 0
  5551. *
  5552. * (4) MULTIPLY AND ADD. COMPUTE T <-- U(I)*S + K.
  5553. *
  5554. ML1 BSS 0 REPEAT
  5555.  
  5556. SA2 B2+B5 (X2) = U(I)
  5557. PX2 X2 FLOATING POINT FORMAT
  5558. FX0 X1*X2 (X0) = HIGH 48 BITS OF UI*VJ
  5559. DX7 X1*X2 (X7) = LOW 48 BITS OF UI*VJ
  5560. *
  5561. * IN ONE UNLIKELY CASE, AN AUTOMATIC NORMALIZE IS
  5562. * DONE. OTHERWISE, NO SHIFTS ARE NECESSARY.
  5563. *
  5564. UX0 X0
  5565. UX7,B7 X7 (B7) = -1 IF SHIFT NEEDED
  5566. ZR B7,ML0 IF NO SHIFT NEEDED
  5567.  
  5568. LX0 -1 UN-DO NORMALIZING SHIFT
  5569. LX7 -1 UN-DO NORMALIZING SHIFT
  5570. *
  5571. * SHIFT LOW BIT OUT OF (X0) INTO HIGH BIT OF (X7).
  5572. *
  5573. MX2 1
  5574. BX2 X2*X0 PICK OFF BIT 59 (WAS BIT 0)
  5575. BX0 -X2*X0 CLEAR IT IN HIGH-ORDER WORD
  5576. LX2 47-59 POSITION TO BIT 47
  5577. BX7 X7+X2 MERGE INTO THE LOW-ORDER WORD
  5578.  
  5579. ML0 BSS 0
  5580. *
  5581. * ADD IN K. NO OVERFLOW IS POSSIBLE.
  5582. *
  5583. IX6 X6+X7 (X6) = K + (LOW ORDER WORD)
  5584.  
  5585. BX7 -X3*X6 (X7) = LOWER M BITS OF T
  5586. SA7 B4+B5 W(I+1) &lt;-- LOWER HALF OF T
  5587.  
  5588. AX6 M-0 CHOP OFF LOWER M BITS
  5589. *
  5590. * NOW X6 HAS THE LOWER (48-M) SIGNIFICANT BITS OF
  5591. * THE UPPER HALF OF T. IT ALSO HAS CARRY BITS TO
  5592. * ADD INTO THE OTHER (2*M-48) BITS WHICH ARE IN X0.
  5593. *
  5594. LX0 48-M POSITION UPPER (2*M-48) BITS
  5595. IX6 X0+X6 (X6) = K = UPPER HALF OF T
  5596. *
  5597. * (5) LOOP ON I.
  5598. *
  5599. SB5 B5-1 I &lt;-- I-1
  5600. NZ B5,ML1 UNTIL I=0
  5601.  
  5602. SA6 B4+ W(1) &lt;-- K
  5603.  
  5604. EQ MPML EXIT
  5605. * /--- BLOCK MPADD 00 000 84/09/09 00.54
  5606. MPADD SPACE 4,25
  5607. ** MPADD - UNSIGNED, NP-PRECISION INTEGER ADDITION.
  5608. * W = U+V. U AND V ARE NP-PRECISION; W IS
  5609. * (NP+1)-PRECISION.
  5610. *
  5611. * ENTRY (B2) = FWA OF NP-WORD U.
  5612. * (B3) = FWA OF NP-WORD V.
  5613. * (B4) = FWA OF (NP+1)-WORD W.
  5614. * (B1) = 1.
  5615. *
  5616. * USES X - 0, 1, 2, 6, 7.
  5617. * A - 1, 2, 6, 7.
  5618. * B - 4, 5.
  5619. *
  5620. * DEFINE (B2) = FWA OF U.
  5621. * (B3) = FWA OF V.
  5622. * (B4) = 1 + (FWA OF W).
  5623. * (B5) = J; INDEX INTO BUFFERS.
  5624. * (X0) = MASK FOR CARRY.
  5625. * (X6) = K; CARRY.
  5626. * (X7) = W(J+1); BYTE ADDITION RESULT.
  5627. *
  5628.  
  5629. MPADD EQ *+1S17 ENTRY/EXIT
  5630. *
  5631. * INCREMENT FWA OF W TO ACCOUNT FOR THE OFFSET OF 1
  5632. * IN W(J+1). J RUNS FROM (NP-1) --> 0, ALTHOUGH THE
  5633. * DOCUMENTATION IS AS IF IT RUNS FROM NP --> 1.
  5634. *
  5635. SB4 B4+1
  5636. *
  5637. * BEGIN KNUTH-S ALGORITHM 4.3.1 A.
  5638. *
  5639. * (1) INITIALIZE.
  5640. *
  5641. SB5 NP-1 J &lt;-- NP
  5642. MX6 0 K &lt;-- 0
  5643. MX0 60-M MASK FOR CARRY
  5644. *
  5645. * (2) ADD DIGITS. W(J+1) <-- (U(J)+V(J)+K) MOD 2**M.
  5646. *
  5647. MPA1 BSS 0 REPEAT
  5648.  
  5649. SA1 B2+B5 (X1) = U(J)
  5650. SA2 B3+B5 (X2) = V(J)
  5651. IX1 X1+X2 (X1) = U(J)+V(J)
  5652. IX6 X1+X6 (X6) = U(J)+V(J)+K
  5653.  
  5654. BX7 -X0*X6 MASK OFF CARRY
  5655. SA7 B4+B5 W(J+1) &lt;-- U(J)+V(J)+K MOD 2**M
  5656. AX6 M-0 (X6) = CARRY = K
  5657. *
  5658. * (3) LOOP ON J.
  5659. *
  5660. SB5 B5-B1 J &lt;-- J-1
  5661. PL B5,MPA1 UNTIL J=0
  5662.  
  5663. SA6 B4-1 W(1) &lt;-- K
  5664.  
  5665. EQ MPADD EXIT
  5666. * /--- BLOCK MPSUB 00 000 84/09/09 00.54
  5667. MPSUB SPACE 4,25
  5668. ** MPSUB - UNSIGNED, N-PRECISION INTEGER SUBTRACTION,
  5669. * W = U-V, IGNORING POSSIBLE BORROW IF U<V.
  5670. * U, V, AND W ARE ALL N-PRECISION INTEGERS.
  5671. *
  5672. * ENTRY (B2) = FWA OF N-WORD U.
  5673. * (B3) = FWA OF N-WORD V.
  5674. * (B4) = FWA OF N-WORD W.
  5675. * (B5) = (N-1), WHERE N = OPERAND PRECISION.
  5676. * (B1) = 1.
  5677. *
  5678. * USES X - 0, 1, 2, 6, 7.
  5679. * A - 1, 2, 7.
  5680. * B - 5.
  5681. *
  5682. * DEFINE (B2) = FWA OF U.
  5683. * (B3) = FWA OF V.
  5684. * (B4) = FWA OF W.
  5685. * (B5) = J; INDEX INTO BUFFERS.
  5686. * (X0) = MASK FOR BORROW.
  5687. * (X6) = K; BORROW.
  5688. * (X7) = W(J); BYTE SUBTRACTION RESULT.
  5689. *
  5690.  
  5691. MPSUB EQ *+1S17 ENTRY/EXIT
  5692. *
  5693. * J RUNS FROM (N-1)..0, ALTHOUGH THE DOCUMENTATION
  5694. * IS AS IF IT RUNS FROM N..1.
  5695. *
  5696. * BEGIN KNUTH-S ALGORITHM 4.3.1 A.
  5697. *
  5698. * (1) INITIALIZE.
  5699. *
  5700. SX6 1 K &lt;-- 1
  5701. MX0 60-M MASK FOR BORROW
  5702. BX0 -X0 MASK OFF BORROW
  5703. *
  5704. * (2) SUBTRACT DIGITS. W(J) <-- (U(J)-V(J)+K) MOD 2**M.
  5705. *
  5706. MPS1 BSS 0 REPEAT
  5707.  
  5708. SA1 B2+B5 (X1) = U(J)
  5709. SA2 B3+B5 (X2) = V(J)
  5710. IX1 X1-X2 (X1) = U(J)-V(J)
  5711. IX6 X1+X6 (X6) = U(J)-V(J)+K
  5712. IX6 X6+X0 TO AVOID 1-S COMPLEMENT
  5713.  
  5714. BX7 X0*X6 MASK OFF BORROW
  5715. SA7 B4+B5 W(J) &lt;-- U(J)-V(J)+K MOD 2**M
  5716. AX6 M-0 (X6) = BORROW = K
  5717. *
  5718. * (3) LOOP ON J.
  5719. *
  5720. SB5 B5-1 J &lt;-- J-1
  5721. PL B5,MPS1 UNTIL J=0
  5722.  
  5723. EQ MPSUB EXIT
  5724. * /--- BLOCK PURDYOV 00 000 84/09/15 22.34
  5725. ENDOV
  5726. * /--- BLOCK END 00 000 81/08/20 23.07
  5727. *
  5728. *
  5729. OVTABLE
  5730. *
  5731. *
  5732. END EXEC6$