Table of Contents

ANS1

Table Of Contents

  • [00008] -ANS1-
  • [00032] OPEN
  • [00075] CONCEPT EXECUTION
  • [00805] -CLOSE-
  • [00867] -LOADA-
  • [00941] ANSV/WRONGV (AND ANSU/WRONGU)
  • [01098] STOREN (STORE NUMERIC)
  • [01197] SPECS EXECUTION
  • [01281] CANONICAL FORM
  • [01501] NO CANONICAL FORM
  • [01549] GETWORD
  • [01664] GETMARK
  • [01747] GETLOC

Source Code

ANS1.txt
  1. ANS1
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK ANS1 00 000 78/04/04 18.12
  4. IDENT PLAT13$
  5. LCC OVERLAY(PLATO,1,0)
  6. END
  7. IDENT ANS1
  8. TITLE -ANS1-
  9. *
  10. *
  11. CST
  12. *
  13. *
  14. ANS1$ OVFILE
  15. *
  16. *
  17. EXT PROCESS,BOUNDS,ECSPRTY,WORDS
  18. EXT ERXBADL ERROR EXIT, -EXEC2-
  19. EXT ERXCMAX TOO MANY CHARACTERS, -EXEC2-
  20. EXT ANSEND IN FILE -ANSWER-
  21. EXT WORDGET IN FILE ANSWER
  22. EXT ANSVJ IN FILE ANSWER
  23. EXT JLPACK
  24. EXT EQTOLER,FGETVAR,GETNDFU,POSTOR
  25. EXT FPUTVAR,NPUTVAR
  26. EXT MISCON= IN FILE EXEC1
  27. EXT GETCODX,WORDS IN FILE EXEC1
  28. EXT SIMPLOT,FIRSTXY
  29. *
  30. *
  31. * /--- BLOCK OPEN 00 000 78/07/05 01.32
  32. TITLE OPEN
  33. *
  34. * SPREADS OUT THE STUDENT ANSWER ONE CHARACTER PER WORD
  35. * STARTING IN THE VARIABLE SPECIFIED. THE NUMBER OF CHARACTERS
  36. * SPREAD IS THE CHARACTER COUNT SPECIFIED BY THE
  37. * /STUDENT/ COMMON VARIABLE *TJCOUNT*.
  38. *
  39. *
  40. *
  41. OPENOV OVRLAY
  42. NGETVAR A1 = STARTING VARIABLE STORAGE ADDRESS
  43. SA0 A1 MOVE TO A0 FOR STANDARD CHECKING ROUTINE
  44. SA5 A5 RETRIEVE ORIGINAL COMMAND WORD
  45. SA1 TJCOUNT X1 = STUDENT CHARACTER COUNT
  46. ZR X1,PROCESS --- EXIT IF NO CHARS
  47. RJ BOUNDS PERFORM BOUNDS CHECK
  48. SB1 1
  49. SA2 JUDGE A2 = STUDENT CHAR BASE ADDRESS
  50. SB2 B0 B2 = CHAR INDEX
  51. SB3 X1 B3 = END TEST
  52. LX5 XFBIT I/F BIT OF -GETVAR- CODE TO TOP
  53. NG X5,OPEN2 JUMP IF FLOATING POINT
  54. OPEN1 SA3 A2+B2 X3 = NEXT STUDENT CHAR
  55. BX6 X3
  56. SA6 A0+B2
  57. SB2 B2+B1 INCREMENT CHAR INDEX
  58. LT B2,B3,OPEN1
  59. EQ PROCESS --- EXIT
  60. OPEN2 SA3 A2+B2 X3 = NEXT STUDENT CHAR
  61. BX6 X3
  62. PX6 X6
  63. NX6 X6 PUT INTO FLOATING POINT FORM
  64. SA6 A0+B2
  65. SB2 B2+B1 INCREMENT CHAR INDEX
  66. LT B2,B3,OPEN2
  67. EQ PROCESS --- EXIT
  68. *
  69. ENDOV
  70. *
  71. *
  72. *
  73. *
  74. * /--- BLOCK CONCEPT 00 000 78/08/29 17.21
  75. TITLE CONCEPT EXECUTION
  76. * EXECUTION OF -CONCEPT- COMMAND
  77. *
  78. * BASIC IDEA...THE -CONTENTED- WORDS ARE FOUND IN THE VOCABULARY
  79. * WHERE THEIR NUMBER IS RETURNED FOR USE WITH -CONCEPT-
  80. * COMMANDS. EXTRA WORDS ARE DROPPED OUT.
  81. *
  82. * COMMAND...
  83. * 12 BITS = NUMBER OF CONCEPTS
  84. * 15 BITS = POINTER TO CONCEPTS IN BINARY RELATIVE
  85. * TO ECS RESIDENT EXTRA STORAGE OF UNIT
  86. * 9 BITS = VOCABULARY UNIT NUMBER
  87. * 12 BITS = MAXIMUM CONCEPT COMMAND RUN-ON
  88. * 12 BITS = COMMAND NUMBER
  89. *
  90. * DATA WORDS IN EXTRA STORAGE...
  91. * 1 BIT = ZERO FOR BINARY SEARCHES
  92. * 37 BITS = HASHED CONCEPT
  93. * 12 BITS = CONCEPT COMMAND RUN-ON COUNT
  94. * 10 BITS = POINTER (REL TO B5) +1 TO USER INFO OPTIONS
  95. * (THE +1 IS TO DISTINGUISH FROM RELPTR=0 CASE)
  96. *
  97. *
  98. * USER INFORMATION OPTION PACKAGES
  99. * TOP BITS = GETVAR CODE TO STORE INFO
  100. * 39-49 = BASE SYNONYM TO DO USER OP ON
  101. * 50-59 = PTR +1 TO ANY ADDITIONAL OPTIONS (REL TO B5)
  102. *
  103. *
  104. SYNBITS EQU 11 BITS NEEDED FOR BASE SYNONYM NUMBER
  105. PHBITS EQU 10 BITS FOR PHRASE LINK LIST
  106. HASHBTS EQU 27 TOP 27 BITS CAN BE CONSIDERED A HASH
  107. FONTBIT EQU 25 FONT BIT (WORD IS IN ALTERNATE FONT)
  108. CAPBIT EQU 26 CAPITALIZATION BIT
  109. URIBITS EQU 9 BITS NEEDED FOR USER INFO
  110. *
  111. CONCPOV OVRLAY
  112. RJ WORDGET MAKE SURE ANSWER -CONTENTED-
  113. SA3 JJXCON SEE IF ANSWER CONCEPTED WITH THIS VOCAB
  114. MX0 51
  115. AX5 24
  116. BX4 -X0*X5 GET -CONCEPT- COMMAND VOCABULARY NUMBER
  117. BX2 X3-X4
  118. ZR X2,CNCEPTD IF YES, THEN SKIP -VOCABULARIZATION-
  119. *
  120. MX6 0
  121. SA6 TJFLAGS CLEAR ALL JUDGING FLAGS
  122. *
  123. SX6 A5 SAVE A5 , B5
  124. LX6 30
  125. SX3 B5
  126. BX6 X3+X6
  127. SA6 CNBIAS
  128. MX6 0 PRESET FOR -CNDPK3-
  129. SA2 TWCOUNT GET NUMBER OF STUDENT WORDS
  130. * /--- BLOCK CONCEPT 00 000 78/09/07 16.54
  131. ZR X2,CNDPK3 IF NONE, GOTO END
  132. *
  133. * X4 HOLDS THE UNIT NUMBER
  134. SA3 ECSULOC GET ECS ADDRESS OF -ULOC- TABLE
  135. IX0 X3+X4 ECS ADDRESS FOR ULOC INO
  136. RX1 X0 (-RXX- 1 WD READ, MAY CHG *A1*)
  137. AX1 60-ULOC1 GET RELATIVE START OF VOCAB BUFFER
  138. SA4 ECSLES GET ECS ADDRESS OF LESSON
  139. IX6 X4+X1 MAKE ABSOLUTE
  140. SA6 VOCEC AND SAVE LATER
  141. BX0 X6 NOW READ IN HEADER AND VOWEL TABLE
  142. SA0 VCTABLH
  143. + RE 9
  144. RJ ECSPRTY
  145. SA1 A0 GET IT
  146. SX6 X1+8 GET VOCABULARY LENGTH + VOWEL TABLE BIAS
  147. SA6 VOCLTH SAVE FOR LATER
  148. AX1 30
  149. SX6 X1
  150. SA6 VOCTYPE GET TYPE OF VOCABULARY
  151. *
  152. SB1 B0 SET CURRENT STUDENT WORD TO ZERO
  153. MX6 0
  154. SA6 PERROR NO ERRORS YET
  155. SA0 VCWORK LEAVE A0 SET FOR REST OF ROUTINE////
  156. *
  157. *
  158. CNL SA3 VOCEC GET ECS ADDRESS OF VOCABS BUFFER
  159. SA1 JJSBUF+B1 GET CONTENT WORD
  160. * *** NOTE A1-X1 SET UNTIL CNFIND ***
  161. BX4 X1
  162. AX4 56 GET COUNT OF VOWELS IN THE WORD
  163. SA2 VCTABLE+X4 GET PROPER VOWEL TABLE ENTRY
  164. SX4 X2 GET RELATIVE START OF WORDS OF THESE VOWELS
  165. IX3 X3+X4 MAKE ABSOLUTE
  166. AX2 30 GET NUMBER OF WORDS WITH THIS NO OF VOWELS
  167. IX2 X3+X2
  168. SX0 1
  169. IX2 X0+X2 ADD ONE TO END
  170. SA4 VOCTYPE GET TYPE OF VOCABULARY
  171. BX7 X4
  172. SA4 JJHBUF+B1 GET SECOND PART OF STUDENT WORD
  173. NZ X7,CN2
  174. *
  175. BX6 X1-X4 CONSTRUCT ONE WORD CONCEPT WORD
  176. MX7 60-SYNBITS MASK FOR CONTENT BITS OF VOCAB WORDS
  177. BX6 X7*X6
  178. *
  179. IX0 X2-X3 GET NUMBER OF WORDS
  180. *
  181. CNLL AX0 1 SINGLE WORD ECS BINARY SEARCH
  182. ZR X0,CNOFIND SEE IF RUN OUT OF WORDS
  183. IX0 X0+X3 MAKE ABSOLUTE ADDRESS
  184. + RE 1
  185. RJ ECSPRTY
  186. SA4 A0 READ UP WORD
  187. BX1 X4*X7 JUST CONTENT BITS
  188. IX1 X6-X1 SEE IF FIND A MATCH
  189. BX4 -X7*X4 FOR LATER POSSIBLE USE IN CNFIND
  190. ZR X1,CNFIND
  191. * /--- BLOCK CONCEPT 00 000 78/09/07 16.47
  192. PL X1,CNPLUS SEE WHICH WAY FOR NEXT CHOP
  193. BX2 X0
  194. IX0 X2-X3 SINGLE WORD ECS BINARY-CHOP
  195. EQ CNLL RESET BOTTOM
  196. CNPLUS BX3 X0
  197. IX0 X2-X3 SINGLE WORD ECS BINARY-CHOP
  198. EQ CNLL RESET TOP
  199. *
  200. *
  201. * *TWO WORD ECS BINARY-CHOP*
  202. *
  203. CN2 IX3 X3-X0 BACK UP THE START
  204. BX7 X4
  205. *
  206. CNLL2 IX0 X2-X3 GET DIFFERENCE
  207. AX0 2 2 TO GET RID OF ONES BIT SINCE 2 WORD CHOP
  208. ZR X0,CNSP RUN OUT OF WORDS, TRY SPELLING
  209. LX0 1
  210. IX0 X0+X3 MAKE ADDRESS ABSOLUTE
  211. + RE 2
  212. RJ ECSPRTY
  213. SA4 A0 GET FIRST (CONTENT) WORD
  214. IX6 X1-X4 SEE IF THE SAME
  215. NZ X6,CNBT2
  216. SA4 A0+1 NEED FURTHER VERIFICATION (HASH WORD)
  217. MX6 HASHBTS
  218. BX6 X6*X4 JUST LOOK AT HASH
  219. IX6 X7-X6
  220. ZR X6,CNFIND
  221. CNBT2 PL X6,CNPLUS2 SEE WHICH WAY TO CHOP
  222. BX2 X0 RESET BOTTOM
  223. EQ CNLL2
  224. CNPLUS2 BX3 X0
  225. EQ CNLL2 RESET TOP
  226. *
  227. * /--- BLOCK CONCEPT 00 000 78/09/11 00.25
  228. *
  229. CNSP SA3 TSPECS SEE IF SPECS NOSPELL
  230. LX3 NOSPELL
  231. NG X3,CNOFIND
  232. *
  233. BX4 X1 GET COPY OF CONTENT WORD
  234. AX4 56 GET VOWEL COUNT
  235. SA3 VCTABLE+X4 GET VOWEL TABLE ENTRY
  236. SX0 X3 GET RELATIVE START OF WORDS OF THESE VOWELS
  237. AX3 30 GET COUNT
  238. SB2 X3
  239. *
  240. SX4 X4-1 TRY FOR WORDS OF ONE LESS VOWEL
  241. NG X4,CNSP1
  242. SA3 VCTABLE+X4
  243. SX0 X3 RESET START TO THESE WORDS
  244. AX3 30 GET COUNT
  245. SB2 B2+X3 ADD TO PREVIOUS
  246. *
  247. CNSP1 SX4 X4+2 TRY FOR WORDS OF ONE MORE VOWEL
  248. SA3 VCTABLE+X4
  249. AX4 3
  250. NZ X4,CNSP2 CAN ONLY GO UP TO 7
  251. AX3 30
  252. SB2 B2+X3 ADD IN TH
  253. *
  254. CNSP2 SX0 X0-1 BACK UP START
  255. SA3 VOCEC GET ABSOLUTE START OF VOCABULARY
  256. IX0 X0+X3 GET ABSOLUTE START OF SEARCH
  257. *
  258. MX7 0 CLEAR SPELLING FLAG
  259. SA7 CSPBEST
  260. *
  261. *
  262. CNDN SB2 B2-2 END TEST
  263. NG B2,CND9 SEE IF ANY MISSPELLINGS FOUND
  264. *
  265. SX6 2
  266. IX0 X0+X6 GET NEXT AUTHOR WORD
  267. MX6 8 (HERE FOR BETTER PACKING OF COMMANDS)
  268. CNDNN RE 8 GET 4 AT ONCE
  269. RJ ECSPRTY
  270. *
  271. SA3 A0 GET FIRST WORD
  272. BX4 X3-X1 GET CONTENT BITS DIFFERENCE
  273. BX4 -X6*X4 MASK OFF TOP STUFF
  274. CX4 X4 COUNT UP THE CONFLICT BITS
  275. SX4 X4-6
  276. NG X4,CSPGO ALLOW UP TO 5
  277. *
  278. SA3 A0+2 GET SECOND WORD
  279. BX4 X3-X1
  280. BX4 -X6*X4
  281. CX4 X4
  282. SX4 X4-6
  283. NG X4,CSPGO2
  284. *
  285. SA3 A0+4 GET THIRD WORD
  286. BX4 X3-X1
  287. BX4 -X6*X4
  288. CX4 X4
  289. SX4 X4-6
  290. NG X4,CSPGO3
  291. *
  292. SA3 A0+6 GET FOURTH WORD
  293. BX4 X3-X1
  294. BX4 -X6*X4
  295. CX4 X4
  296. SX4 X4-6
  297. NG X4,CSPGO4
  298. *
  299. SB2 B2-8 TRY FOR ANOTHER 8
  300. SX4 8
  301. IX0 X0+X4
  302. PL B2,CNDNN LOOP
  303. EQ CND9
  304. *
  305. *
  306. * /--- BLOCK CONCEPT 00 000 78/09/11 00.27
  307. CSPGO2 SB2 B2-2
  308. SX4 2
  309. IX0 X0+X4
  310. PL B2,CSPGO
  311. EQ CND9
  312. CSPGO3 SB2 B2-4
  313. SX4 4
  314. IX0 X0+X4
  315. PL B2,CSPGO
  316. EQ CND9
  317. CSPGO4 SB2 B2-6
  318. SX4 6
  319. IX0 X0+X4
  320. PL B2,CSPGO
  321. EQ CND9
  322. *
  323. CSPGO SA2 JJHBUF+B1 GET HASH PART OF STUDENT WORD
  324. SA4 A3+1 GET HASH PART OF AUTHOR WORD
  325. *
  326. CALL CKWORDX CHECK FOR A MISSPELLING
  327. NG X6,CNDN
  328. *
  329. * /--- BLOCK CONCEPT 00 000 78/09/05 16.33
  330. *
  331. * X6 HOLDS THE RELATIVE FITTNESS...THE SMALLER THE BETTER
  332. SA2 CSPBEST SEE IF THIS FIRST MISSPELLING
  333. ZR X2,CND6
  334. SA2 CSPVAL MUST SEE WHICH IS BETTER
  335. IX2 X6-X2
  336. PL X2,CNDN LAST TIME IS BETTER
  337. CND6 SA6 CSPVAL STORE THIS CRITERION
  338. BX7 X3 SAVE BEST AUTHOR MATCH
  339. SA7 CSPBEST
  340. BX7 X4
  341. SA7 A7+1
  342. EQ CNDN NOW CONTINUE THROUGH REST OF WORDS
  343. *
  344. *
  345. CND9 SA3 CSPBEST FINAL CHECK IF EVER FOUND A MISSPELLING
  346. ZR X3,CNOFIND
  347. BX7 X3 IF ONE FOUND, MOVE WORD AROUND
  348. SA7 A0 A0 IS USED BY FOLLOWING ROUTINES
  349. SA3 A3+1 GET SECOND PART OF WORD BACK
  350. BX7 X3
  351. SA7 A0+1
  352. *
  353. *
  354. * /--- BLOCK CONCEPT 00 000 78/09/01 16.51
  355. *
  356. SA1 CSPVAL SEE IF CAPITALIZATION ERROR
  357. SX2 X1-3
  358. PL X2,CNDSP
  359. SA2 TJFLAGS SET CAP ERROR FLAG
  360. MX7 1
  361. LX7 60-JFCAP
  362. BX6 X2+X7
  363. SA6 A2
  364. SX1 X1-1 SEE IF STU CAP, AUTHOR SMALL
  365. NZ X1,CNDCP
  366. SA2 TSPECS SEE IF SPECS OKCAP
  367. LX2 OKCAP
  368. NG X2,CNOFI
  369. *
  370. CNDCP SA2 TSPECS SEE IF SPELLING ERRORS OK
  371. LX2 OKSPELL
  372. NG X2,CNOFI IF SO, TREAT AS PERFECT
  373. MX7 1
  374. SA7 PERROR SET ERROR FLAG
  375. SX7 8 SET TO CAPITALIZATION ERROR
  376. EQ CNSTUL
  377. *
  378. * /--- BLOCK CONCEPT 00 000 78/09/07 14.28
  379. *
  380. CNDSP SA3 TJFLAGS SET ERROR FLAGS
  381. MX7 1 SET SPELL ERROR FLAG
  382. LX7 60-JFSPELL
  383. BX6 X3+X7
  384. SA6 A3
  385. SA3 TSPECS SEE IF -OKSPELL-
  386. LX3 OKSPELL
  387. NG X3,CNOFI SPELLING ERROR IS OK
  388. MX7 1
  389. SA7 PERROR SET ERROR FLAG
  390. SX7 3 SPELLING ERROR (GIVE ===== FEEDBACK)
  391. EQ CNSTUL
  392. *
  393. CNOFIND SA3 TJFLAGS SET ERROR FLAGS
  394. MX7 1 SET EXTRA VOCABULARY ERROR FLAG
  395. LX7 60-JFVOCAB
  396. MX4 1 ALSO SET EXTRA FLAG
  397. LX4 60-JFEXTRA
  398. BX7 X4+X7 THUS, EXTRA AND VOCAB ARE IDENTICAL
  399. BX6 X3+X7
  400. SA6 A3
  401. SA3 TSPECS SEE IF EXTRA VOCABULARY -OK-
  402. LX3 OKEXTRA
  403. MX4 0 SET TO EXTRA WORD
  404. NG X3,CNFIND
  405. MX7 1
  406. SA7 PERROR SET ERROR FLAG
  407. *
  408. SA4 TBLDATA+1 FOR DATA OUTPUT
  409. MX7 1
  410. LX7 DSVOCAB POSITION -VOCAB- BIT
  411. BX7 X7+X4
  412. SA7 A4
  413. *
  414. SX7 2 SET TO -UUU- MARK-UP
  415. EQ CNSTUL
  416. *
  417. CNOFI SA4 A0+1 GET PROPER HASH WORD
  418. CNFIND BX6 X4 TRANSFER HASH/INFO
  419. SA6 CONBUF+B1 STORE IN CONCEPT NUMBER WORD
  420. SA2 A0 GET AUTHOR-S CONTENT WORD
  421. BX6 X2
  422. SA6 CONCBUF+B1 SAVE FOR POSSIBLE PHRASE USE
  423. MX7 0 SET TO OK
  424. *
  425. CNSTUL SA7 CURJBUX+B1 SET FOR POSSIBLE MARK-UP
  426. SB1 B1+1 INCREMENT THROUGH STUDENT WORDS
  427. SA2 TWCOUNT GET COUNT OF STUDENT WORDS
  428. SB2 X2
  429. LT B1,B2,CNL SEE IF DONE WITH STUDENT WORDS
  430. *
  431. SA2 PERROR SEE IF ANY ERROR UP TO HERE
  432. ZR X2,CNDONE1
  433. * /--- BLOCK CONCEPT 00 000 76/03/02 02.39
  434. *
  435. * NOW MUST DO ERROR MARKUPS, ETC.
  436. CNBAD SA2 JJSBUFA SEE IF PREVIOUS JUDGEMENT
  437. NZ X2,CNDWW IN WHICH CASE SKIP OUT
  438. *
  439. *
  440. SA1 TWCOUNT GET NUMBER OF STUDENT WORDS
  441. MX6 0
  442. SA6 CURJBUX+X1 CLEAR EXTRA WORD TO ZERO SO THAT
  443. * NO EXTRA WORDS ARE MARKED UP
  444. * THIS EXTRA SPACE IS GUARANTEED BY WORDGET
  445. BX6 X1
  446. SA6 A2+2 SAVE NUMBER OF STUDENT WORDS
  447. SX6 1 SET CRITERION TO SMALLEST POSSITIVE
  448. SA6 A2
  449. SX6 -1
  450. SA6 JJCONPK SET TO GARBAGE CONCEPT
  451. SA1 CNBIAS SAVE A5-B5 AT THIS COMMAND
  452. BX6 X1
  453. SA6 A2+4
  454. SA1 TJFLAGS GET ERROR FLAGS INTO JUDGE BUFFERS
  455. BX7 X1
  456. SA7 A2+3 INTO JUDGE BUFFERS
  457. *
  458. SA0 CURJBUX GET JUDGEMENT ON EACH WORD
  459. SA1 ATEMPEC GET ECS WORK BUFFER
  460. BX0 X1
  461. + WE JJSENB OUT TO ECS
  462. RJ ECSPRTY
  463. SA0 JJSBUFA+JJINF INTO PROPER BUFFER IN CM
  464. + RE JJSENB
  465. RJ ECSPRTY
  466. *
  467. EQ CNDWW NOW FIX SO CAN CONTINUE JUDGING
  468. *
  469. *
  470. *
  471. CNDONE1 SB1 B0 INITIALIZE WORD COUNT DONE
  472. * B2 IS SET TO WORD COUNT ALREADY
  473. SA1 VOCTYPE SEPARATE -VOCABS- FROM -VOCAB-
  474. ZR X1,CORDER SINCE NO PHRASE IN -VOCAB-
  475. *
  476. * /--- BLOCK CONCEPT 00 000 78/09/07 14.27
  477. *
  478. * MUST TANGLE WITH PHRASES HERE
  479. *
  480. MX6 0
  481. SA6 PERROR SET PHRASE ERROR FLAG TO GOOD
  482. *
  483. CPLOOP SA1 CONBUF+B1 BRING UP A WORD
  484. BX2 X1
  485. LX2 HASHBTS LOOK IF A START OF A PHRASE
  486. PL X2,CPLOOPZ
  487. *
  488. MX7 HASHBTS START OF A POSSIBLE PHRASE
  489. SB6 B2 GET CURRENT END OF LIST
  490. CPLOOP1 SA5 CONCBUF+B1 GET CONTENT BITS
  491. BX4 X1*X7 GET HASH BITS
  492. BX5 X4-X5 PUT TOGETHER
  493. SB3 B1
  494. CPLOOPA SB3 B3+1
  495. GE B3,B6,CPLOOPZ OUT IF DO NOT FIND AN END OF PHRASE
  496. SA2 CONBUF+B3 BRING UP NEXT WORDS INFO BITS
  497. BX3 X2
  498. LX3 HASHBTS+1 RUN THRU MIDDLE OF PHRASE WORDS
  499. PL X3,CPLOOPB SEE IF NO LONGER MIDDLE PHRASE
  500. SB4 B3+1
  501. GE B4,B6,CPLOOPB SEE IF THIS IS LAST WORD
  502. SA4 CONCBUF+B3 BRING UP THIS WORD-S CONTENT BITS
  503. LX5 5 BUILD A PHRASE WORD
  504. BX5 X5-X4
  505. BX4 X2*X7 GET ONLY HASH BITS
  506. BX5 X5-X4
  507. EQ CPLOOPA
  508. CPLOOPB LX3 1 NOW SEE IF FIND END OF PHRASE
  509. PL X3,CPLOOPM IF NOT END, TRY SOMETHING ELSE
  510. BX4 X5 NOW MAKE PHRASE WORD
  511. LX4 PHBITS+SYNBITS+URIBITS
  512. BX5 X4-X5
  513. AX5 PHBITS+SYNBITS+URIBITS GET ONLY HASH BITS
  514. AX2 60-HASHBTS-3-PHBITS GET LINK TO PHRASE WORD
  515. CPLOOPC MX0 60-PHBITS SET MASK FOR PHRASE
  516. BX2 -X0*X2 GETLINK
  517. ZR X2,CPLOOPM RUN OUT OF LINKS
  518. SA3 VOCEC GET PHRASE WORD OUT OF VOCABS BUFFER
  519. IX0 X2+X3
  520. SA3 VOCLTH
  521. IX0 X0+X3 PHRASES ARE AFTER WORDS
  522. + RE 1
  523. RJ ECSPRTY
  524. SA2 A0 FINALLY BRING UP PH
  525. BX4 X2
  526. AX4 PHBITS+SYNBITS+URIBITS GET ONLY HASH BITS
  527. BX4 X4-X5 SEE IF THIS IS THE PHRASE
  528. ZR X4,CPLOOPD GOT IT
  529. AX2 SYNBITS+URIBITS ELSE, TRY FOR CHAIN LINK
  530. EQ CPLOOPC
  531. *
  532. CPLOOPM SB6 B6-1 SO TRY FOR A SHORTER LENGTH PHRASE
  533. EQ CPLOOP1
  534. *
  535. CPLOOPD SB1 B1+1 NOW SET EXTRA PHRASE WORDS TO EXTRA WORDS
  536. MX6 0
  537. SA6 CONBUF+B1
  538. SA6 JJCUBUF+B1 ALSO KILL FOR USER INFO OPS
  539. LT B1,B3,CPLOOPD
  540. BX1 X2 GET THE PHRASE BASE SYNONYM IN PLACE
  541. *
  542. * /--- BLOCK CONCEPT 00 000 78/02/29 00.09
  543. CPLOOPZ MX0 60-SYNBITS
  544. BX6 X1
  545. SX4 A1-CONBUF GET BIAS INTO BUFFER
  546. SA6 JJCUBUF+X4 STORE WHOLE WORKS FOR USE IN USER INFO OPS
  547. BX6 -X0*X1 NOW GET BASE SYNONYM BITS
  548. SA6 A1
  549. SX6 X6-1 MAKE SURE THAT WORD WAS DEFINED AS SOMETHIN
  550. NZ X6,CZZZ AN ERROR IF ONLY A PART OF A PHRASE
  551. SA1 TJFLAGS SET ERROR FLAGS
  552. MX6 1
  553. LX6 60-JFVOCAB SET VOCAB FLAG
  554. BX1 X1+X6
  555. MX6 1
  556. LX6 60-JFEXTRA SET EXTRA FLAG
  557. BX6 X1+X6
  558. SA6 A1
  559. SA1 TSPECS IF OKEXTRA, THEN NO PHRASE ERRORS
  560. LX1 OKEXTRA
  561. PL X1,CPERP
  562. MX6 0
  563. SA6 A6 JUST SET THE WORD TO -EXTRA- (IGNORE)
  564. EQ CZZZ
  565. CPERP SX6 9 SET PHRASE ERROR FLAG
  566. SA6 PERROR
  567. SA6 CURJBUX+B1 SET TO DO MARK-UP
  568. *
  569. CZZZ SB1 B1+1 INCREMENT THRU ALL WORDS
  570. LT B1,B2,CPLOOP
  571. *
  572. *
  573. SA1 PERROR SEE IF ANY ERRORS IN PHRASE
  574. ZR X1,CORDER
  575. SA1 TJFLAGS SET ERROR FLAGS
  576. MX6 1
  577. LX6 60-JFPHRAS SET PHRASE ERROR FLAG
  578. BX6 X1+X6
  579. SA6 A1
  580. EQ CNBAD
  581. *
  582. *
  583. CORDER SA3 TSPECS SEE IF ORDER IS IMPORTANT
  584. LX3 NOORDER
  585. PL X3,CND NORMAL CASE IS THAT ORDER IS IMPORTANT
  586. SB1 B0
  587. *
  588. * ORDER IS NOT IMPORTANT...THUS, BY ORDERING THE
  589. * WORD NUMBERS, ONE CAN ELIMINATE ANY ORDER.
  590. *
  591. CNBUB1 SA1 CONBUF+B1 DO BUBBLE SORT
  592. SB3 B1
  593. CNBUB2 SB3 B3+1
  594. GE B3,B2,CNBUB3
  595. SA2 CONBUF+B3
  596. IX3 X1-X2
  597. NG X3,CNBUB2
  598. BX6 X1 MUST CHANGE THE ENTRIES
  599. BX7 X2
  600. SA6 A2
  601. SA7 A1
  602. BX1 X2
  603. *
  604. SA3 JJCUBUF+B1 ALSO SORT THE WHOLE WORKS BUFFERS
  605. SA4 JJCUBUF+B3
  606. BX6 X3
  607. BX7 X4
  608. SA6 A4
  609. SA7 A3
  610. EQ CNBUB2
  611. CNBUB3 SB1 B1+1
  612. LT B1,B2,CNBUB1
  613. *
  614. * NOW MUST CONSTRUCT THE CONCEPT WORD
  615. CND MX6 0
  616. SB1 B0
  617. CNDPK1 SA1 CONBUF+B1 BRING UP THE WORD NUMBER
  618. ZR X1,CNDPK2 SKIP EXTRA WORDS
  619. LX6 SYNBITS
  620. BX6 X6-X1 ADD IN THIS NUMBER
  621. * /--- BLOCK CONCEPT 00 000 78/08/29 17.14
  622. CNDPK2 SB1 B1+1
  623. LT B1,B2,CNDPK1 LOOP THRU ALL NUMBERS
  624. *
  625. LX6 12+10+1 MOVE UP OUT OF WAY OF OTHER FIELDS
  626. *
  627. MX1 60-12-10-1 AND CLEAR OUT ANY BOTTOM BITS THAT
  628. BX2 -X1*X6 MAY HAVE BEEN SET BY LONG CONCEPTS
  629. BX1 X1*X6
  630. LX2 36
  631. BX6 X1-X2
  632. LX6 59 MAKE SURE TOP BIT A ZERO FOR
  633. * BINARY SEARCHES
  634. CNDPK3 SA6 JJCONPK STORE FINISHED CONCEPT
  635. *
  636. CNDWW SA5 CNBIAS ENTRY HERE ALSO FROM CNBAD
  637. SB5 X5 GET BACK A5 , B5
  638. AX5 30
  639. SA5 X5
  640. AX5 24 MAKE LIKE ORIGINALLY CONCEPTED CASE
  641. MX0 51
  642. BX6 -X0*X5
  643. SA6 JJXCON SET CURRENT -CONCEPT- VOCAB NUMBER
  644. *
  645. * MATCH STUDENT AND AUTHOR CONCEPTS
  646. CNCEPTD SA1 JJCONPK GET STUDENT CONCEPT
  647. SX2 -1 TEST FOR BAD STUDENT RESPONSE
  648. BX2 X1-X2
  649. ZR X2,CNOPE
  650. *
  651. MX0 45 SEE IF MATCHING CONCEPT
  652. AX5 9 GET RELATIVE POINTER IN BINARY
  653. BX2 -X0*X5
  654. MX0 48
  655. AX5 15 GET NUMBER OF CONCEPTS
  656. BX5 -X0*X5 JUST 12 BITS
  657. *
  658. SA4 ECSXSTO ABSOLUTE START OF UNITS ECS RESIDENT EX STO
  659. IX3 X4+X2 ABSOLUTE START OF CONCEPTS
  660. IX5 X3+X5 ABSOLUTE END
  661. SX4 1
  662. IX3 X3-X4
  663. *
  664. SA0 VCWORK BE SURE A0 SET
  665. MX6 38 CONCEPT HASH MASK
  666. *
  667. IX0 X5-X3
  668. *
  669. CBL AX0 1 BINARY SEARCH
  670. ZR X0,CNOPE RUN OUT WITHOUT FINDING CONCEPT
  671. IX0 X0+X3 MAKE ABSOLUTE
  672. + RE 1 GET AUTHOR CONCEPT
  673. RJ ECSPRTY
  674. SA2 A0
  675. BX4 X6*X2 GET JUST HASH PART
  676. IX4 X1-X4 GET DIFF BETWEEN STUDENT AND AUTHOR WD
  677.  
  678. ZR X4,CNPER FIND IT
  679. PL X4,CBLPL
  680. BX5 X0
  681. IX0 X5-X3
  682. EQ CBL
  683. CBLPL BX3 X0
  684. IX0 X5-X3
  685. EQ CBL
  686. *
  687. * /--- BLOCK CONCEPT 00 000 77/08/14 23.44
  688. *
  689. *
  690. * CANNOT FIND CONCEPT
  691. CNOPE SA5 A5 GET COMMAND WORD AGAIN
  692. AX5 12 GET MAXIMUM CONCEPT RUN-ON COUNT
  693. MX0 48
  694. BX6 -X0*X5
  695. SA2 TANSCNT GET ANSWER COMMAND COUNT
  696. IX6 X6+X2 ADD THE RUN-ON COUNT
  697. SA6 A2
  698. EQ PROCESS
  699. *
  700. *
  701. CNPER MX6 48
  702. BX4 X2 SAVE COPY OF CONCEPT WORD
  703. AX2 10
  704. BX7 -X6*X2 GET CONCEPT RUN-ON COUNT
  705. SA7 CROHOLD SAVE FOR EXIT
  706. SA1 TANSCNT GET COUNT OF ANSWER COMMANDS
  707. IX7 X1+X7 ADD THE NUMBER OF RUN ONS
  708. SA7 A1
  709. *
  710. MX7 0 CLEAR JUDGE BUFFER FLAG
  711. SA7 JJSBUFA
  712. SA7 CUIFLGS CLEAR THAT USER OPS HAS NOT USED ANY WORDS
  713. *
  714. SB7 XANSC SET TO ANSWER-CONTINGENCY
  715. *
  716. CUTOP MX6 50 NOW DO ANY USER INFO OPTIONS
  717. BX4 -X6*X4 GET JUST THE LINK
  718. ZR X4,CALDJ TEST FOR NO OPTIONS
  719. NG X4,CALDJ JUST FOR SAFETY
  720. *
  721. SX4 X4-1 TAKE OFF THE ONE EXTRA ADDED
  722. SA4 B5+X4 GET USER OP WORD
  723. ZR X4,CALDJ CHECK FOR BAD USER OPTION ... NO OP
  724. BX5 X4 GET COPY READY FOR NPUTVAR
  725. BX7 X4
  726. SA7 CUHOLD AND COPY FOR AFTER NPUTVAR
  727. AX4 10 SHIFT OFF LINK
  728. MX7 60-SYNBITS
  729. BX6 -X7*X4 GET BASE SYNONYM TO SEARCH FOR
  730. SB1 B0
  731. SA2 TWCOUNT GET COUNT OF USER WORDS
  732. SB2 X2
  733. *
  734. CUL SA1 JJCUBUF+B1 GET NEXT WORD
  735. BX2 -X7*X1 MASK TO BASE SYN NO
  736. BX2 X2-X6 SEE IF SAME
  737. ZR X2,CULFND
  738. CUL3 SB1 B1+1
  739. LT B1,B2,CUL LOOP THRU ALL WORDS
  740. SX6 -1 NO FIND
  741. EQ CULSTO
  742. *
  743. CULFND MX3 1 SEE THAT THIS WORD NOT ALREADY USED
  744. LX3 B1,X3
  745. SA2 CUIFLGS
  746. BX4 X3*X2
  747. NZ X4,CUL3 TRY FOR A DIFFERENT ONE
  748. BX6 X2+X3 SET THIS WORD BIT (CAN ONLY BE 40 WORDS)
  749. SA6 A2
  750. *
  751. AX1 SYNBITS SHIFT TO USER INFO FIELD
  752. MX6 60-URIBITS
  753. BX6 -X6*X1 GET USER SUPPLIED NUMBER
  754. *
  755. CULSTO NPUTVAR X5=GETVAR CODE, X6= VALUE TO STORE
  756. SA4 CUHOLD GET BACK CURRENT USER OP
  757. EQ CUTOP AND SEE IF LINK TO ANOTHER USER OP
  758. *
  759. *
  760. * /--- BLOCK CONCEPT 00 000 78/09/07 14.29
  761. *
  762. CALDJ SA5 A5 GET ORIGINAL COMMAND
  763. *
  764. MX1 -XCMNDL LOOK AT JUST COMMAND CODE
  765. BX1 -X1*X5
  766. SX3 MISCON= SEE IF THIS -MISCON-
  767. IX1 X1-X3
  768. MX7 0 PRESET TO MISCON
  769. ZR X1,CALDN
  770. SX7 -1 ELSE SET TO JUDGE OK
  771. CALDN SA7 TJUDGED SET JUDGEMENT -1=OK, 0=NO
  772. *
  773. AX5 12 GET MAXIMUM CONCEPT RUN-ON BIAS
  774. MX6 48
  775. BX5 -X6*X5
  776. SA2 CROHOLD
  777. IX5 X5-X2 SEE IF THIS COMMAND IS THE LAST IN RUN
  778. EXT ANSMARK
  779. NZ X5,ANSMARK IF NOT, THEN NO POSSIBLE ANS-CONTINGENCY
  780. * FOR THIS CONCEPT COMMAND
  781. *
  782. EQ PROCESS AND GO TO EXECUTE
  783. *
  784. PERROR BSS 1 ERROR IN PHRASE FLAG
  785. VOCEC BSS 1 HOLDS STARTING LOC OF ECS VOCABS BUFFER
  786. VCWORK BSS 9 TO HOLD HEADER AND VOWEL TABLE OF COM WDS
  787. VCTABLH BSS 1 VOCABULARY HEADER WORD
  788. VCTABLE BSS 8 VOWEL TABLE
  789. *////VCTABLE MUST FOLLOW VCTABLH///
  790. VOCLTH BSS 1 LENGTH OF VOCAB WORDS + VOWEL TABLE BIAS
  791. VOCTYPE BSS 1 TYPE OF VOCABULARY (0=VOCAB,1=VOCABS)
  792. CSPBEST BSS 2 HOLDS BEST SPELLING MATCH WORD
  793. CSPVAL BSS 1 HOLDS SPELLING CRITERION FOR CSPBEST
  794. CNBIAS BSS 1
  795. CONBUF BSS JJSENB HOLDS NUMBER OF WORD IN VOCABULARY
  796. CONCBUF BSS JJSENB HOLDS AUTHOR-S CONTENT BITS FOR PHRASE USE
  797. CURJBUX BSS JJSENB HOLDS JUDGEMENT ON EACH WORD
  798. CUHOLD BSS 1 HOLDS USER OP OVER NPUTVAR
  799. CROHOLD BSS 1 HOLDS CONCEPT RUN-ON COUNT OVER NPUTVAR
  800. CUIFLGS BSS 1 HOLDS BITS SET IF USER OP USES A WORD
  801. *
  802. ENDOV
  803. *
  804. * /--- BLOCK CLOSE 00 000 78/07/05 01.33
  805. TITLE -CLOSE-
  806. *
  807. * 'LOADS THE JUDGE BUFFER FROM VARIABLES (ASSUMED
  808. * TO HOLD ONE 6 BIT CHARACTER RIGHT-JUSTIFIED PER
  809. * WORD). 'LOADING CEASES AT THE 1ST ZERO CHARACTER
  810. * OR WHEN THE SPECIFIED NUMBER OF CHARACTERS IS
  811. * EXHAUSTED.
  812. *
  813. * 1ST ARGUMENT = STARTING VARIABLE
  814. * 2ND ARGUMENT = NUMBER OF CHARACTERS
  815. *
  816. *
  817. *
  818. CLOSEOV OVRLAY
  819. NGETVAR A1 = *FROM* ADDRESS
  820. SX6 A1 SAVE ADDRESS
  821. SA6 CLOSAV
  822. SA5 A5
  823. LX5 XCODEL
  824. NGETVAR X1 = NUMBER OF CHARACTERS
  825. SX1 X1+0 TO CATCH SOME WEIRD BIG NUMBERS
  826. NG X1,ERXBADL --- ERROR EXIT IF NEGATIVE
  827. SX0 X1-JUJLTH
  828. PL X0,ERXCMAX --- ERROR IF BUFFER EXCEEDED
  829. SX7 -1
  830. SA7 JJSTORE TO TELL -STORE- COMMAND TO RECOMPILE ANSWER
  831. SX6 0
  832. SA6 JUDGE GUARANTEE A 0 CODE
  833. SA6 JJFBUF SET COMMON SWITCH THAT ANSWER MODIFIED
  834. SA6 TJCOUNT 0 IN CASE OF 0 STRING LENGTH
  835. ZR X1,PROCESS --- EXIT IF COUNT=0
  836. SA2 CLOSAV GET ADDRESS FOR BOUNDS CHECK
  837. SA0 X2
  838. RJ BOUNDS BOUNDS CHECK--ERRORS DO NOT RETURN
  839. SB1 1
  840. SB2 0 B2 = STORAGE INDEX
  841. SA2 A0-1 PRE-LOAD
  842. SB3 X1 B3 = END TEST
  843. MX0 -6 X0 = CHAR MASK
  844. *
  845. *
  846. CLLP SA2 A2+B1 INCREMENT ADDRESS / LOAD CHAR
  847. BX6 -X0*X2 GET BOTTOM 6 BITS
  848. ZR X6,CLX EXIT IF 0 CHAR
  849. SA6 JUDGE+B2 STORE CHAR
  850. SB2 B2+1
  851. LT B2,B3,CLLP LOOP IF COUNT NOT REACHED
  852. *
  853. *
  854. CLX SX6 B2
  855. MX7 0
  856. SA6 TJCOUNT STORE CORRECT JCOUNT
  857. SA7 JUDGE+B2 GUARANTEE TERMINATING 0 CODE
  858. EQ PROCESS --- RETURN
  859. *
  860. * CERXBIG SX2 JUJLTH
  861. * EXECERR 84 TOO MANY CHARACTERS
  862. *
  863. *
  864. CLOSAV BSS 1
  865. ENDOV
  866. * /--- BLOCK LOADA 00 000 78/04/04 18.12
  867. TITLE -LOADA-
  868. *
  869. * 'LOADS THE JUDGE BUFFER FROM VARIABLES (ASSUMED
  870. * PACKED WITH 10 CHARS PER WORD). 'LOADING CEASES
  871. * AT THE 1ST ZERO CHARACTER OR WHEN THE SPECIFIED
  872. * NUMBER OF CHARACTERS HAS BEEN EXHAUSTED.
  873. *
  874. * 1ST ARGUMENT = STARTING VARIABLE
  875. * 2ND ARGUMENT = NUMBER OF CHARACTERS
  876. *
  877. *
  878. LOADAOV OVRLAY
  879. NGETVAR A1 = *FROM* ADDRESS
  880. SX6 A1 SAVE ADDRESS
  881. SA6 LOASAV
  882. BX6 X1
  883. SA6 LOAVAL SAVE VALUE IN CASE LITERAL
  884. SA5 A5 RETRIEVE ORIGINAL COMMAND WORD
  885. LX5 XCODEL
  886. NGETVAR X1 = NUMBER OF CHARACTERS
  887. SX1 X1+0 TO CATCH SOME WEIRD BIG NUMBERS
  888. NG X1,ERXBADL --- ERROR EXIT IF NEGATIVE
  889. SX0 X1-JUJLTH-1 CAN HAVE UP TO 300...
  890. PL X0,ERXCMAX --- ERROR IF BUFFER EXCEEDED
  891. SX7 -1
  892. SA7 JJSTORE TO TELL -STORE- COMMAND TO RECOMPILE ANSWER
  893. SX6 0
  894. SA6 JUDGE GUARANTEE A 0 CODE
  895. SA6 JJFBUF SET COMMON SWITCH THAT ANSWER MODIFIED
  896. SA6 TJCOUNT 0 IN CASE OF 0 STRING LENGTH
  897. ZR X1,PROCESS --- EXIT IF COUNT=0
  898. SX2 X1-11 SEE IF ONLY 1 WORD (10 CHARS)
  899. PL X2,LOADAX1
  900. SA0 LOAVAL SET ADDRESS
  901. EQ LOADAX2
  902. *
  903. * LERXBIG SX2 JUJLTH
  904. * EXECERR 84 TOO MANY CHARACTERS
  905. *
  906. LOADAX1 SA2 LOASAV GET ADDRESS FOR BOUNDS CHECK
  907. SA0 X2
  908. RJ WORDS BOUNDS CHECK--ERRORS DO NOT RETURN
  909. LOADAX2 SB1 10 INITIALIZE CHARS LEFT IN WORD
  910. SA2 A0 X2 = 1ST WORD
  911. MX0 -6 X0 = CHAR MASK
  912. SB2 B0 B2 = STORAGE INDEX
  913. SB3 X1 B3 = END TEST
  914. *
  915. LACHAR LX2 6 POSITION NEXT CHAR
  916. BX6 -X0*X2 EXTRACT IT
  917. ZR X6,LAX EXIT IF 0 CHAR
  918. SA6 JUDGE+B2 STORE CHAR
  919. SB2 B2+1
  920. EQ B2,B3,LAX EXIT IF CHAR COUNT REACHED
  921. SB1 B1-1 DECREMENT CHARS-IN-WORD COUNT
  922. NZ B1,LACHAR
  923. SA2 A2+1 LOAD NEXT WORD
  924. SB1 10 RESET CHARS-IN-WORD COUNT
  925. EQ LACHAR
  926. *
  927. LAX SX6 B2
  928. MX7 0
  929. SA6 TJCOUNT STORE CORRECT JCOUNT
  930. SA7 JUDGE+B2 GUARANTEE TERMINATING 0 CODE
  931. * NOTE, JUDGE HAS 301 SPACES SO 300 CASE FITS
  932. EQ PROCESS --- RETURN
  933. *
  934. *
  935. LOASAV BSS 1
  936. LOAVAL BSS 1 VALUE SAVED FOR LITERALS
  937. *
  938. *
  939. ENDOV
  940. * /--- BLOCK ANSV 00 000 80/04/22 01.35
  941. TITLE ANSV/WRONGV (AND ANSU/WRONGU)
  942. *
  943. * NUMERICAL ANSWER IS SPECIFIED BY VARIABLE
  944. * (EXPRESSION) AND TOLERANCE (ABSOLUTE OR PERCENT)
  945. *
  946. ANSVOV OVRLAY
  947. *
  948. SA1 XSLCLOK
  949. BX7 X1 SAVE MILLISECOND CLOCK ON ENTRY
  950. SA7 AVETIM
  951. SA1 TANSCNT INCREMENT ANSCNT
  952. SX7 X1+1
  953. SA7 A1
  954. SA1 JJSTORE IF JJSTORE=-2 (RESPONSE WILL NOT COMPILE)
  955. SX1 X1+2 JUST SKIP OVER THIS ANSV
  956. ZR X1,PROCESS
  957. FGETVAR FLOATING POINT RESULT TO X1
  958. BX6 X1
  959. SA6 AVALUE SAVE ANSWER VALUE SPECIFIED
  960. SA5 A5 RETRIEVE COMMAND WORD
  961. LX5 XCODEL
  962. FGETVAR FLOATING POINT RESULT TO X1
  963. SA5 A5 RETRIEVE COMMAND WORD
  964. LX5 2*XCODEL
  965. PL X5,ATOLSAV JUMP IF ABSOLUTE TOLERANCE
  966. SA2 AVHUN 100.0
  967. FX3 X1/X2 CONVERT PERCENTAGE TO FRACTION
  968. SA4 AVALUE X4 = ANSWER VALUE
  969. FX1 X3*X4 CONVERT PERCENTAGE TOLERANCE TO ABSOLUTE
  970. ATOLSAV BX6 X1
  971. PL X6,ATOLOK JUMP IF TOLERANCE POSITIVE
  972. BX6 -X1 FLIP SIGN
  973. ATOLOK SA6 ATOLER SAVE ABSOLUTE VALUE OF TOLERANCE SPECIFIED
  974. SA1 JJSTORE CHECK WHETHER STUDENT ANS ALREADY COMPILED
  975. PL X1,ANSV2 JUMP IF ALREADY COMPILED
  976. *
  977. *
  978. RJ GETNDFU GET NDEFU INITIALIZED
  979. SA1 NDEFU
  980. SX7 -2
  981. ZR X1,ANSV11 JUMP IF NO UNITS
  982. SX7 -1
  983. ANSV11 SA7 NUNITS
  984. SX7 JUDGE INITIALIZE STRING ADDRESS
  985. SA7 WORDPT
  986. MX7 0
  987. SA7 INX ZERO *INX* TO BEGIN EXTRA STORAGE IN *INFO*
  988. CALL QUIKCMP GENERATE MACHINE CODE IN INFO
  989. BX7 X1
  990. SA7 JJSTORE SAVE GETVAR CODE FOR NEXT ANSV
  991. ANSV2 BX5 X1 MOVE TO REQUIRED X5
  992. LX5 60-XCODEL LEFT-ADJUST -GETVAR- CODE
  993. SB1 A5
  994. SX7 B5-B1 SAVE COMMAND BIAS
  995. SA7 OLDB5
  996. SB5 INFO SET UP B5 FOR EXTRA STORAGE IN INFO
  997. MX7 59 FORM -1
  998. SA7 TFORMOK SET OK--WILL BE SET ZERO IF EXEC ERROR
  999. FGETVAR EVALUATE STUDENT EXPRESSION, VALUE IN X1
  1000. BX6 X1
  1001. SA6 ANSVSAV SAVE VALUE
  1002. SA1 OLDB5 RESTORE B5
  1003. MX6 59 -1
  1004. SA6 A1 CLEAR OLDB5
  1005. SB5 X1
  1006. SB5 A5+B5
  1007. * /--- BLOCK ANSV 00 000 74/08/17 17.20
  1008. SA1 ANSVSAV
  1009. SA2 AVALUE X2 = VALUE OF SPECIFIED ANSWER
  1010. OR X1,ABNORMAL
  1011. ID X1,ABNORMAL
  1012. OR X2,ABNORMAL
  1013. ID X2,ABNORMAL
  1014. SA3 ATOLER X3 = ABSOLUTE VALUE OF TOLERANCE
  1015. NZ X3,NONZTOL JUMP IF NONZERO TOLERANCE
  1016. FX1 X1-X2 COMPARE ARGUMENTS
  1017. UX2 X1,B0
  1018. AX2 10
  1019. ZR X2,AOK MOSTLY EQUAL
  1020. PL X1,AEQ1 JUMP IF DIFF POSITIVE
  1021. BX1 -X1 ABS VALUE
  1022. AEQ1 SA2 EQTOLER TINY ABSOLUTE TOLERANCE
  1023. FX1 X1-X2
  1024. NG X1,AOK EQUAL IF DIFF LT TOLERANCE
  1025. EQ ANSVTIM NO MATCH
  1026. NONZTOL SA4 EQTOLER PICK UP ROUNDOFF TOLERANCE
  1027. FX3 X3+X4 INCREASE TOLERANCE
  1028. NX3 X3
  1029. FX4 X1-X2 STUDENT-AUTHOR
  1030. NX4 X4
  1031. PL X4,NZTOL2
  1032. BX4 -X4 TAKE ABS VALUE
  1033. NZTOL2 FX7 X3-X4 ALLOWED TOLERANCE - DIFF
  1034. NG X7,ANSVTIM JUMP IF NO MATCH
  1035. AOK SA5 A5 PICK UP COMMAND AGAIN
  1036. AX5 XCMNDL
  1037. MX7 2*XCODEL+XCMNDL+1 UNITS POINTER MASK
  1038. BX7 -X7*X5 GET POINTER
  1039. ZR X7,AOKU JUMP IF NO UNITS
  1040. SB1 X7-2 POINTER IS ACTUALLY POINTER+1
  1041. SA1 B5+B1 A1 = FIRST UNIT LOC MINUS 1
  1042. SB1 1 INDEX
  1043. SA2 NDEFU NUMBER OF UNITS DEFINED
  1044. SB2 X2 COUNT
  1045. SA2 UADS-1 STUDENT UNIT ARRAY MINUS 1
  1046. SA3 EQTOLER
  1047. AOKL SA1 A1+B1 PICK UP NEXT AUTHOR DIM
  1048. SA2 A2+B1 NEXT STUDENT DIM
  1049. FX7 X1-X2 COMPARE ARGUMENTS
  1050. UX2 X7
  1051. AX2 10
  1052. ZR X2,AOKL3 MOSTLY EQUAL
  1053. PL X7,AOKL2 JUMP IF DIFF POSITIVE
  1054. BX7 -X7 ABS VALUE
  1055. AOKL2 FX7 X3-X7
  1056. NG X7,ANSVTIM JUMP IF DIFF GT TOLERANCE
  1057. AOKL3 SB2 B2-B1 COUNT
  1058. GT B2,B0,AOKL JUMP IF NOT DONE
  1059. AOKU SB7 XANSC SWITCH TO ANS-C
  1060. SA1 ANSVJ PICK UP ANSV OR WRONGV JUDGEMENT
  1061. BX7 X1
  1062. SA7 TJUDGED SET JUDGMENT
  1063. EQ PROCESS --- RESUME PROCESSING
  1064. *
  1065. ABNORMAL BX1 X1-X2 INFINITE OR INDEFINITE
  1066. NG X1,ANSVTIM
  1067. NZ X1,ANSVTIM
  1068. EQ AOK STUDENT = AUTHOR
  1069. * /--- BLOCK ANSV 00 000 80/04/22 01.34
  1070. *
  1071. ANSVTIM SA1 XSLCLOK SEE IF TOO MUCH PROCESSING GOING ON
  1072. SA2 AVETIM
  1073. IX2 X1-X2 COMPUTE ELAPSED TIME
  1074. SX7 30 MAXIMUM ELAPSED TIME
  1075. PX7 X7 FLOAT IT
  1076. NX7 X7
  1077. SA1 CPSPD SCALE BY CPU-SPEED FACTOR
  1078. FX1 X7/X1
  1079. UX1,B1 X1
  1080. LX1 B1
  1081. IX2 X2-X1
  1082. NG X2,PROCESS EXIT IF LESS THAN 30 MILL
  1083. SX7 16
  1084. SA7 TFORMOK TIME-SLICE ERROR, LONG COMPILE
  1085. EQ ANSEND DEFAULT -NO-
  1086. *
  1087. *
  1088. ANSVSAV BSS 1
  1089. AVALUE BSS 1 ANSWER VALUE SPECIFIED
  1090. ATOLER BSS 1 ABSOLUTE VALUE OF TOLERANCE
  1091. AVHUN DATA 100.0
  1092. AVETIM BSS 1
  1093. *
  1094. ENDOV
  1095. *
  1096. * /--- BLOCK STOREN 00 000 76/11/16 21.57
  1097. *
  1098. TITLE STOREN (STORE NUMERIC)
  1099. * STOREN COMMAND
  1100. *
  1101. * STOREN V1 RETURNS NUMERIC FROM STUDENT ANSWER IN V1
  1102. * ALSO BUMPS NUMERIC, SIMILAR TO MATCH.
  1103. * IF NO NUMERIC PRESENT, V1 SET TO 0 AND GO INTO ANS-C
  1104. *
  1105. *
  1106. STRNOV OVRLAY
  1107. RJ WORDGET GET STUDENT ANSWER IN -CONTENT- WORDS
  1108. *NOTE---WORDGET DOES NOT ALTER A5 OR X5.
  1109. SB1 1 B1 = CONSTANT 1
  1110. SB2 -1 INITIALIZE BUFFER POINTER
  1111. SA2 TWCOUNT GET NUMBER OF STUDENT WORDS
  1112. SB3 X2 GET END OF BUFFER POINTER
  1113. *
  1114. STNLOOP SB2 B2+B1 INCREMENT WORD POINTER
  1115. EQ B2,B3,STNONE JUMP IF SEARCH DONE AND NO NUMBER
  1116. SA2 JJHBUF+B2 BRING UP NEXT WORD CONTENT
  1117. LX2 1 GET WORD/NUMBER BIT TO TOP
  1118. PL X2,STNLOOP KEEP LOOKING FOR A NUMBER
  1119. SA1 JJSBUF+B2 GET NUMBER
  1120. MX6 1
  1121. LX2 1 GET THE SIGN BIT BACK IN PLACE
  1122. BX2 X6*X2 GET IT CLEAN
  1123. BX6 X1+X2 RESTORE WHOLE 60 BIT NUMBER
  1124. SA6 SMNUM SAVE NUMBER
  1125. * /--- BLOCK STOREN 00 000 76/11/17 00.18
  1126. *
  1127. * DECREMENT STUDENT WORD COUNT, BUMP -CONTENT- WORD, AND
  1128. * REPLACE CHARACTERS IN -JUDGE- BUFFER WITH SPACES.
  1129. *
  1130. SA2 TWCOUNT GET NUMBER OF STUDENT WORDS
  1131. SX6 X2-1 DECREMENT NUMBER OF STUDENT WORDS
  1132. SA6 A2
  1133. *
  1134. MX6 0 SET TO RE-CONCEPT
  1135. SA6 JJXCON
  1136. *
  1137. *
  1138. * GET INFO ABOUT CHARACTER POSITIONS INVOLVED
  1139. * SAVE IN -X3- AND -X4-
  1140. SA1 JJXY+B2 X1 = COUNT INFO WORD FOR WORD MATCHED
  1141. MX0 15
  1142. BX3 X0*X1
  1143. LX3 15 X3 = INDEX TO FIRST CHAR OF WORD
  1144. LX1 15
  1145. BX4 X0*X1
  1146. LX4 15 X4 = INDEX TO LAST CHAR
  1147. *
  1148. * NOW MOVE ALL BUFFERS DOWN ONE WORD
  1149. *
  1150. MBUMP SB2 B2+B1 GET NEXT ENTRY
  1151. EQ B2,B3,MFLL SEE IF AT END OF BUFFER
  1152. *
  1153. SA1 JJSBUF+B2 -JJSBUF-
  1154. BX6 X1
  1155. SA6 A1-B1
  1156. SA1 JJXY+B2 -JJXY-
  1157. BX6 X1
  1158. SA6 A1-B1
  1159. SA1 JJHBUF+B2 -JJHBUF-
  1160. BX6 X1
  1161. SA6 A1-B1
  1162. SA1 JJSBUFA+JJINF+B2 -JJSBUFA-
  1163. BX6 X1
  1164. SA6 A1-B1
  1165. *
  1166. EQ MBUMP
  1167. *
  1168. * NOW CHANGE CHARACTERS TO SPACES
  1169. MFLL SX6 1R X6 = SPACE CODE
  1170. SB2 X3 B2 = STARTING CHAR INDEX
  1171. SB3 X4 B3 = ENDING CHAR INDEX
  1172. MPUT SA6 JUDGE+B2
  1173. SB2 B2+B1
  1174. LE B2,B3,MPUT
  1175. *
  1176. *
  1177. MX6 -1
  1178. SA6 JJSTORE FLAG RECOMPILE STUDENT RESPONSE
  1179. *
  1180. SA2 SMNUM
  1181. BX6 X2 SET UP VALUE FOR STORE
  1182. FPUTVAR STORE FLOATING POINT VALUE
  1183. EQ PROCESS
  1184. *
  1185. STNONE SX6 1
  1186. SA6 TJUDGED SET JUDGMENT=NO (UNIVERSAL)
  1187. SB7 XANSC AND SWITCH TO ANS-CONTINGENCY
  1188. MX6 0
  1189. NPUTVAR STORE ZERO INTO AUTHOR VARIABLE
  1190. EQ PROCESS
  1191. SMNUM BSS 1
  1192. *
  1193. *
  1194. ENDOV
  1195. * /--- BLOCK SPECS 00 000 75/10/10 23.09
  1196. LIST L
  1197. TITLE SPECS EXECUTION
  1198. *
  1199. SPECXOV OVRLAY
  1200. *
  1201. *** -SPECS- COMMAND HAD RESTRICTION IT COULD NOT BE
  1202. *** EXECUTED IN A LESSON WITH LVARS AND IN A -JOIN-
  1203. *** UNIT. DONT SEE WHY WE HAVE THIS RESTRICTION, SO
  1204. *** HAVE REMOVED IT UNTIL WE FIND OUT WHY. CMH 2/16/95
  1205. *
  1206. * SA1 TLVLESS SEE IF LESSON HAS LVARS
  1207. * ZR X1,SPECSA IF NO LVARS
  1208. **
  1209. * SA1 JOIN
  1210. * ZR X1,SPECSA IF NOT IN ATTACHED UNIT
  1211. **
  1212. * EXECERR 127 -SPECS- NOT ALLOWED
  1213. *
  1214. SPECSA BSS 0
  1215. *
  1216. BX6 X5 X5 HAS SPECS COMMAND INFO
  1217. SA6 TSPECS SAVE
  1218. *
  1219. MX7 0
  1220. SA7 TANSCNT CLEAR ANSCNT WITH SPECS COMMAND
  1221. *
  1222. SA7 JJFBUF SET TO RE-CONTENT, RE-CONCEPT
  1223. *
  1224. SA7 JJSBUFA FORGET ABOUT PREVIOUS JUDGING
  1225. *
  1226. MX6 -1
  1227. SA6 JJSTORE FLAG RECOMPILE STUDENT RESPONSE
  1228. *
  1229. RJ JLPACK PACK UP A5 AND B5
  1230. SA6 TSPLOC PUT AWAY FOR LATER
  1231. *
  1232. SA1 TSPECS GET SPECS BITS AGAIN
  1233. LX1 CANON
  1234. NG X1,SPECSC IF CANONICAL FORM
  1235. LX1 NOCANON-CANON
  1236. NG X1,SPECSNC IF NO CANONICAL FORM
  1237. LX1 BUMPSHFT-NOCANON
  1238. NG X1,SPECSB IF SHIFT CODE TO BE BUMPED
  1239. EQ PROCESS --- RETURN
  1240. *
  1241. * /--- BLOCK SPECS 00 000 79/02/16 20.15
  1242. *
  1243. * BUMP ALL SHIFT CODES FROM STUDENT ANSWER
  1244. *
  1245. SPECSB SA1 TJCOUNT JUDGE COUNT
  1246. ZR X1,PROCESS --- RETURN
  1247. SB1 1
  1248. SB2 B0 CHAR POINTER
  1249. SB3 X1 (B3) = ANSWER LENGTH
  1250. SX0 KUP
  1251. *
  1252. BUMPUP SA1 JUDGE+B2 STUDENT CHAR TO X1
  1253. BX1 X1-X0
  1254. ZR X1,BUMPUP1 SEE IF A SHIFT CODE
  1255. SB2 B2+B1 INCREMENT
  1256. LT B2,B3,BUMPUP CONTINUE LOOPING
  1257. EQ PROCESS FINISHED WITHOUT FINDING ANY SHIFT CODES
  1258. *
  1259. BUMPUP1 SA0 B2 NOW A0 HOLDS WHERE CHARS WITHOUT SHIFTS END
  1260. *
  1261. BUMPUP2 SB2 B2+B1 INCREMENT
  1262. GE B2,B3,BUMPUP4 SEE IF FINISHED
  1263. SA1 JUDGE+B2 GET NEXT CHARACTER
  1264. BX2 X1-X0
  1265. ZR X2,BUMPUP2 JUST LOOP IF FIND ANOTHER SHIFT CODE
  1266. *
  1267. BX6 X1
  1268. SA6 A0+JUDGE RESTORE THIS CHARACTER DOWN SOME
  1269. SA2 JJCHAR+B2 AND ALSO RESTORE THE REAL CHARACTER COUNT
  1270. BX7 X2
  1271. SA7 JJCHAR+A0
  1272. SA0 A0+B1 INCREMENT NUMBER OF REAL CHARACTERS
  1273. EQ BUMPUP2
  1274. *
  1275. BUMPUP4 SX6 A0 NOW STORE THE NUMBER OF CHARS WITHOUT SHIFT
  1276. SA6 TJCOUNT
  1277. MX6 0
  1278. SA6 A0+JUDGE AND A TAILING ZERO IN -JUDGE-
  1279. EQ PROCESS
  1280. * /--- BLOCK SPECSC 00 000 75/10/09 19.41
  1281. TITLE CANONICAL FORM
  1282. *
  1283. * 'THE CANONICAL FORM FOR A RESPONSE IS OBTAINED
  1284. * USING THE FOLLOWING RULES--
  1285. *
  1286. * (1) 'ALL INVISIBLE CODES AT THE END OF THE
  1287. * RESPONSE ARE REMOVED; THESE CODES ARE--
  1288. * SPACE, BACKSPACE, SHIFT, FONT, ACCESS,
  1289. * SUPERSCRIPT, SUBSCRIPT, AND CARRIAGE RETURN.
  1290. *
  1291. * (2) 'IF A SINGLE DISPLAYED CHARACTER IS
  1292. * SUPERSCRIPTED OR SUBSCRIPTED, IT WILL BE
  1293. * DONE WITH A SIMPLE SUPER OR SUB CODE--I.E.,
  1294. * ANY SUCH CASES THAT WERE DONE USING THE
  1295. * LOCKING SUPER OR SUB (SHIFT-SUPER, SHIFT-SUB)
  1296. * WILL BE CONVERTED. 'HOWEVER, A LOCKING CODE
  1297. * WILL NOT BE CHANGED IF IT CAUSES A RETURN TO
  1298. * THE BASE LEVEL. 'THUS IN X'&12'!Y THE SHIFT-SUB
  1299. * RETURNING THE Y TO THE ORIGINAL LEVEL WILL
  1300. * BE RETAINED, WHILE IN X'&12'!Y&3 A SHIFT-SUPER FOR
  1301. * THE 3 WOULD BE CONVERTED TO A SIMPLE SUPER.
  1302. *
  1303. *
  1304. SPECSC SA1 TJCOUNT
  1305. ZR X1,SCEND EXIT IF NO CHARS
  1306. SB1 1
  1307. SA0 JUDGE A0 = START OF CHARS
  1308. SB2 X1 B2 = CHARACTER COUNT
  1309. *
  1310. * 'SCAN FROM THE END BACKWARDS, ELIMINATING ANY
  1311. * TRAILING CODES WHICH ARE INVISIBLE.
  1312. *
  1313. SC1 SB2 B2-B1
  1314. NG B2,SC90 JUMP IF OUT OF CHARS
  1315. SA1 A0+B2
  1316. SX2 X1-1R CHECK FOR SPACE
  1317. ZR X2,SC1
  1318. SX2 X1-KSUB CHECK FOR SUBSCRIPT
  1319. ZR X2,SC1
  1320. SX2 X1-KSUP CHECK FOR SUPERSCRIPT
  1321. ZR X2,SC1
  1322. SX2 X1-KUP CHECK FOR SHIFT CODE
  1323. ZR X2,SC1
  1324. SX2 X1-KCR CHECK FOR CARRIAGE RETURN
  1325. ZR X2,SC1
  1326. SX2 X1-KBKSP CHECK FOR BACKSPACE
  1327. ZR X2,SC1
  1328. SX2 X1-FONT CHECK FOR FONT CODE
  1329. ZR X2,SC1
  1330. SX2 X1-ACCESS CHECK FOR ACCESS CODE
  1331. ZR X2,SC1
  1332. *
  1333. SX6 0
  1334. SA6 UPDN CLEAR SHIFT-SUPER/SHIFT-SUB
  1335. SB3 B2+1 SET END TEST MARKER
  1336. SB2 0 INITIALIZE CHAR INDEX
  1337. * /--- BLOCK SC2 00 000 75/10/09 03.09
  1338. *
  1339. SC2 SA1 A0+B2 X1 = NEXT CHAR
  1340. SB2 B2+B1 INCREMENT CHAR COUNT
  1341. SX2 X1-KUP CHECK FOR SHIFT CODE
  1342. ZR X2,SCSHF
  1343. SX2 X1-KSUP CHECK FOR SUPERSCRIPT
  1344. ZR X2,SCSUP
  1345. SX2 X1-KSUB CHECK FOR SUBSCRIPT
  1346. ZR X2,SCSUB
  1347. LT B2,B3,SC2
  1348. EQ SC99 DONE
  1349. *
  1350. * SHIFT CODE (CANNOT BE LAST CHAR)
  1351. *
  1352. SCSHF SA1 A0+B2 NEXT CHAR
  1353. SB2 B2+B1 INCREMENT CHAR COUNT
  1354. SX2 X1-KSUP
  1355. ZR X2,SCSUP1 IF SHIFT-SUPER
  1356. SX2 X1-KSUB
  1357. ZR X2,SCSUB1 IF SHIFT-SUB
  1358. LT B2,B3,SC2
  1359. EQ SC99 DONE
  1360. *
  1361. SCSUP1 SX4 1 X4 = +1 FOR SHIFT-SUPER
  1362. EQ SCS1
  1363. SCSUB1 SX4 -1 X4 = -1 FOR SHIFT-SUB
  1364. EQ SCS1
  1365. * /--- BLOCK SCS1 00 000 75/10/01 03.46
  1366. *
  1367. SCS1 SA2 UPDN
  1368. IX6 X2+X4
  1369. SA6 A2 UPDATE SHIFT-SUPER/SUB COUNTER
  1370. SCS2 SA2 A0+B2
  1371. SB2 B2+B1
  1372. GE B2,B3,SC98 IF THIS CHAR IS LAST
  1373. SX3 X2-FONT CHECK FOR FONT CODE
  1374. ZR X3,SCS2
  1375. SX3 X2-ACCESS CHECK FOR ACCESS CODE
  1376. ZR X3,SCS2
  1377. SX3 X2-KUP CHECK FOR SHIFT CODE
  1378. NZ X3,SCS3
  1379. SA2 A0+B2 GET CHAR AFTER SHIFT
  1380. SB2 B2+B1
  1381. GE B2,B3,SC98 IF THIS CHAR IS LAST
  1382. SX3 X2-KSUP
  1383. ZR X3,SCSU JUMP IF SHIFT-SUPER
  1384. SX3 X2-KSUB
  1385. ZR X3,SCSD JUMP IF SHIFT-SUB
  1386. *
  1387. SCS3 SA2 A0+B2 SEE IF ONLY 1 SYMBOL
  1388. SB2 B2+B1
  1389. GE B2,B3,SC99 IF DONE
  1390. SX3 X2-KUP
  1391. NZ X3,SC2 IF NOT SHIFT
  1392. SA2 A0+B2
  1393. SB2 B2+B1
  1394. SX3 X2-KSUP
  1395. ZR X3,SCSU JUMP IF SHIFT-SUPER
  1396. SX3 X2-KSUB
  1397. ZR X3,SCSD JUMP IF SHIFT-SUB
  1398. LT B2,B3,SC2
  1399. EQ SC99 DONE
  1400. *
  1401. SCSU NG X4,SCSFIX IF SHIFT-SUB PRECEDED
  1402. SA1 A2 RESET ADDRESS POINTER
  1403. EQ SCS1 PROCESS ANOTHER SHIFT-SUPER
  1404. SCSD PL X4,SCSFIX IF SHIFT-SUPER PRECEDED
  1405. SA1 A2 RESET ADDRESS POINTER
  1406. EQ SCS1 PROCESS ANOTHER SHIFT-SUB
  1407. * /--- BLOCK SCSFIX 00 000 75/10/09 21.27
  1408. *
  1409. SCSFIX SA3 UPDN
  1410. BX4 -X4 COMPLEMENT
  1411. IX6 X3+X4
  1412. SA6 A3
  1413. NZ X3,SCSF1 IF NOT LEAVING MAIN LEVEL
  1414. SA1 A2 RESET ADDRESS POINTER
  1415. EQ SCS2 PROCESS THIS SHIFT-SUPER/SUB
  1416. *
  1417. SCSF1 SX3 A1+B1 ADDRESS OF 1ST SUPER/SUB +1
  1418. SX4 A2-B1 ADDRESS OF 2ND SUPER/SUB -1
  1419. IX6 X3-X4
  1420. PL X6,SCSF4 IF NO CHARS IN-BETWEEN
  1421. SB2 A0
  1422. SB2 A1-B2
  1423. SCSF2 SA1 A0+B2
  1424. BX6 X1
  1425. SA3 JJCHAR+B2 ALSO FIX CHAR COUNT BUFFER
  1426. BX7 X3
  1427. SA6 A1-B1 MOVE BACK ONE
  1428. SA7 A3-B1
  1429. SB2 B2+B1
  1430. SX3 A0+B2
  1431. IX6 X3-X4
  1432. NG X6,SCSF2
  1433. SB2 A0-B1
  1434. SB2 A2-B2 CHAR AFTER 2ND SUPER/SUB
  1435. SCSF3 SA1 A0+B2
  1436. BX6 X1
  1437. SA6 A1-3 MOVE BACK 3 CHARS
  1438. SA3 JJCHAR+B2 ALSO FIX CHAR COUNT BUFFER
  1439. BX7 X3
  1440. SB2 B2+B1
  1441. SA7 A3-3
  1442. LT B2,B3,SCSF3
  1443. SB3 B3-3 ADJUST END MARKER
  1444. SB2 A0+2
  1445. SB2 A2-B2 RESET TO NEXT CHAR
  1446. EQ SC2 RESUME
  1447. *
  1448. SCSF4 SA2 A0+B2 NO CHARS IN-BETWEEN
  1449. BX6 X2
  1450. SA6 A2-4 MOVE BACK 4 CHARS
  1451. SA3 JJCHAR+B2 ALSO FIX CHAR COUNT BUFFER
  1452. BX7 X3
  1453. SB2 B2+B1
  1454. SA7 A3-4
  1455. LT B2,B3,SCSF4
  1456. SB2 A0+B1
  1457. SB2 A1-B2 CHAR BEFORE 1ST SUPER/SUB
  1458. SB3 B3-4 ADJUST END MARKER
  1459. EQ SC2 RESUME
  1460. * /--- BLOCK SCSUP 00 000 75/09/24 19.28
  1461. *
  1462. *
  1463. * SUPERSCRIPT (CANNOT BE LAST CHAR)
  1464. *
  1465. SCSUP EQ SC2 *** NOTHING YET ***
  1466. *
  1467. * SUBSCRIPT (CANNOT BE LAST CHAR)
  1468. *
  1469. SCSUB EQ SC2 *** NOTHING YET ***
  1470. * /--- BLOCK SC90 00 000 75/10/09 03.28
  1471. *
  1472. *
  1473. SC90 SB2 0 NO CHARS
  1474. EQ SC99
  1475. SC98 SA2 UPDN CHECK SHIFT SUPER/SUB
  1476. ZR X2,SC99 DONE IF BACK ON MAIN LEVEL
  1477. SB2 A0 SET TO CODE AFTER THE SHIFT
  1478. SB2 A1-B2
  1479. SC98B SA1 A0+B2 MOVE BACK ONE CHAR
  1480. BX6 X1
  1481. SA3 JJCHAR+B2 ALSO FIX CHAR COUNT BUFFER
  1482. BX7 X3
  1483. SA6 A1-B1
  1484. SA7 A3-B1
  1485. SB2 B2+B1
  1486. LT B2,B3,SC98B
  1487. SB2 B2-1
  1488. SC99 SX6 0
  1489. SA6 A0+B2 ZERO FOR END TEST MARKER
  1490. SX6 B2
  1491. SA6 TJCOUNT RESET CHARACTER COUNT
  1492. *
  1493. SCEND SA1 TSPECS GET SPECS BITS AGAIN
  1494. LX1 BUMPSHFT
  1495. NG X1,SPECSB IF SHIFT CODE TO BE BUMPED
  1496. EQ PROCESS --- RETURN
  1497. *
  1498. *
  1499. UPDN BSS 1 SHIFT-SUPER=+1, SHIFT-SUB=-1
  1500. * /--- BLOCK SPECSNC 00 000 75/10/01 17.33
  1501. TITLE NO CANONICAL FORM
  1502. *
  1503. * 'GET ALL CHARACTERS, NO CANONICAL FORM.
  1504. *
  1505. *
  1506. SPECSNC SX6 0
  1507. SA6 JUDGE BE SURE OF ONE ZERO
  1508. SA2 TJCOUNT X2 = JUDGE COUNT
  1509. ZR X2,SPNCEND
  1510. SB1 1
  1511. *
  1512. * SET CHARACTER COUNTS
  1513. *
  1514. SA1 XNUMRUN BUFFER OF ASCENDING NUMBERS
  1515. BX0 X1
  1516. SB2 X2 B2 = CHARACTER COUNT
  1517. SA0 JJCHAR CHARACTER-COUNT BUFFER
  1518. RE B2
  1519. RJ =XECSPRTY
  1520. *
  1521. SA1 TBINPUT STARTING ADDRESS OF CHARS
  1522. SB3 10 B3 = CHARS LEFT IN WORD
  1523. SA1 X1 A1 = CURRENT INPUT ADDRESS
  1524. MX0 -6 6 BIT MASK
  1525. SA6 A6-B1 *** PRESET A6 TO 1 BEFORE START (PREJUDGE)
  1526. *
  1527. SPNC1 LX1 6 SHIFT TO GET NEXT CHARACTER
  1528. BX6 -X0*X1 MASK OFF REST
  1529. SA6 A6+B1 STORE IN NEXT JUDGE LOCATION
  1530. SB2 B2-B1 DECREMENT COUNT TO DO
  1531. ZR B2,SPNC2 JUMP IF DONE
  1532. SB3 B3-1
  1533. NZ B3,SPNC1 CHECK IF WORD EXHAUSTED
  1534. SA1 A1+1 BRING UP NEXT PACKED INPUT WORD
  1535. SB3 10 10 CHARACTERS PER WORD
  1536. EQ SPNC1
  1537. *
  1538. SPNC2 MX6 0 CLEAR OUT AN EXTRA WORD
  1539. SA6 A6+B1
  1540. *
  1541. SPNCEND SA1 TSPECS GET SPECS BITS AGAIN
  1542. LX1 BUMPSHFT
  1543. NG X1,SPECSB IF SHIFT CODE TO BE BUMPED
  1544. EQ PROCESS --- RETURN
  1545. *
  1546. *
  1547. ENDOV
  1548. * /--- BLOCK GETWORD 00 000 78/04/20 20.30
  1549. TITLE GETWORD
  1550. *
  1551. * -GETWORD-
  1552. *
  1553. * GET THE N-TH WORD OUT OF THE STUDENT ANSWER
  1554. * AND PUT INTO THE STATED BUFFER..
  1555. *
  1556. * GETWORD VAR0,VAR1,VAR2,VAR3
  1557. *
  1558. * VAR0 = WORD WANTED
  1559. * VAR1 = ADDRESS TO PUT WORD PACKED 10 CHARS PER WORD
  1560. * VAR2 = RETURN ACTUAL CHARACTER COUNT
  1561. * VAR3 = MAXIMUM ALLOWABLE NUMBER OF CHARACTERS
  1562. * (IF ABSENT, SET TO DEFAULT 10)
  1563. GETWDOV OVRLAY
  1564. *
  1565. SX6 4 ALWAYS FOUR ARGUMENTS HERE
  1566. RJ GETCODX GET THE FOUR GETVAR CODES
  1567. SA1 VARBUF+2 GET RETURN ADDRESS FIRST IN CASE OF ERROR
  1568. BX5 X1
  1569. NGETVAR
  1570. SX6 A1
  1571. SA6 VARBUF+2 SAVE THE ADDRESS
  1572. SA1 TJUGBUF
  1573. SX1 X1
  1574. ZR X1,GETERR IF NO JUDGE BUFFER
  1575. *
  1576. * NOW MAKE SURE ANSWER IN WORDS
  1577. SA3 TANSCNT
  1578. SX7 X3-1 NEED TO SUBTRACT ONE SINCE
  1579. SA7 A3 WORDGET ALWAYS ADDS ONE
  1580. RJ WORDGET
  1581. *
  1582. SA1 VARBUF GET NUMBER OF WORD USER DESIRES
  1583. BX5 X1
  1584. NGETVAR
  1585. BX6 X1
  1586. SA6 VARBUF SAVE FOR LATTER
  1587. *
  1588. SA2 TWCOUNT SEE IF ALL THINGS WITHIN BOUNDS
  1589. ZR X2,GETERR MAKE SURE THERE ARE STUDENT WORDS
  1590. NG X1,GETERR MAKE SURE AUTHOR HAS POSITIVE NUMBER
  1591. ZR X1,GETERR AND NON-ZERO NUMBER
  1592. IX3 X2-X1
  1593. NG X3,GETERR AND THAT AUTHORS NUMBER IN RANGE OF STU WDS
  1594. *
  1595. SA1 VARBUF+3 GET MAXIMUM NUMBER OF CHARS AUTHOR ALLOWS
  1596. BX5 X1
  1597. NGETVAR
  1598. BX6 X1
  1599. SA6 VARBUF+3 SAVE FOR LATER
  1600. *
  1601. SA1 VARBUF+1 GET STARTING ADDRESS OF WHERE TO STORE CHRS
  1602. BX5 X1
  1603. NGETVAR
  1604. SX6 A1
  1605. SA6 VARBUF+1 SAVE FOR LATER
  1606. *
  1607. SA0 A1 NOW DO BOUNDS TEST
  1608. SA1 VARBUF+3 GET MAX CHARS ALLOWED
  1609. RJ WORDS SO THAT MAXIMUM STORAGE ADDRESS WITHIN BNDS
  1610. * /--- BLOCK GETWORD 00 000 76/02/21 19.27
  1611. *
  1612. * NOW GET INFO ON STUDENT WORD
  1613. SA1 VARBUF GET WORD DESIRED AGAIN
  1614. SA1 JJXY-1+X1 15 BITS START, 15 BITS END CHAR CNT IN JUDG
  1615. MX0 45
  1616. LX1 15
  1617. BX2 -X0*X1 GET STARTING INDEX IN JUDGE BUFFER
  1618. LX1 15
  1619. BX3 -X0*X1 GET ENDING INDEX IN JUDGE BUFFER
  1620. IX6 X3-X2 GET DIFFERENCE BETWEEN FIRST AND LAST CHAR
  1621. SX6 X6+1 ADD ONE TO GET TRUE LENGTH
  1622. *
  1623. SA1 VARBUF+2 GIVE THE AUTHOR THE REAL CHARACTER COUNT
  1624. SA6 X1
  1625. *
  1626. SA1 VARBUF+3 GET MAXIMUM ALLOWED BY AUTHOR
  1627. IX7 X1-X6
  1628. PL X7,GETJJ MAKE SURE WITHIN LIMITS AUTHOR PROVIDES FOR
  1629. *
  1630. SX1 X1-1 NOW MUST FIX ENDING TO FIT BUFFER
  1631. IX3 X2+X1 SO, ADD START AND NUMBER PROVIDED FOR
  1632. *
  1633. * PACK UP THE CHARS IN AUTHORS BUFFER
  1634. GETJJ SB2 X2+JUDGE ABSOLUTE ADDRESS OF STARTING CHARACTER
  1635. SB3 X3+JUDGE ABSOLUTE ADDRESS OF LAST CHARACTER
  1636. SA3 VARBUF+1 GET ADDRESS OF AUTHOR WORD BUFFER
  1637. MX6 0 INITIALIZE PACKED CHARACTER WORD
  1638. SB1 54 STARTING SHIFT COUNT
  1639. *
  1640. GETLP SA1 B2 GET STUDENT CHARACTER
  1641. SB2 B2+1 INCREMENT
  1642. LX1 X1,B1 SHIFT CHARACTER INTO POSITION
  1643. BX6 X1+X6 BUILD THE PACKED WORD
  1644. SB1 B1-6 DECREMENT SHIFT COUNT
  1645. PL B1,GETON SEE IF 10 CHAR WORD FILLED
  1646. SA6 X3 STORE WORD AWAY
  1647. SX3 X3+1 AND GET READY FOR NEXT WORD
  1648. SB1 54
  1649. MX6 0
  1650. *
  1651. GETON LE B2,B3,GETLP LOOP UNTIL ALL CHARACTERS PACKED UP
  1652. ZR X6,PROCESS SEE IF NEED TO STORE LAST WORD
  1653. SA6 X3 STORE LAST WORD
  1654. EQ PROCESS
  1655. *
  1656. *
  1657. GETERR SA1 VARBUF+2 GET AUTHOR RETURN WORD
  1658. MX6 0
  1659. SA6 X1 STORE SOMETHING WRONG
  1660. EQ PROCESS
  1661. *
  1662. ENDOV
  1663. * /--- BLOCK GETMARK 00 000 78/04/20 20.35
  1664. TITLE GETMARK
  1665. * GETMARK ARG1,AGR2
  1666. * ARG1 = WORD INFORMATION WANTED ABOUT IN STUDENT RESPONSE
  1667. * ARG2 = INFORMATION RETURNED
  1668. * = -2 = NO MARKUP POSSIBLE
  1669. * = -1 = OUT OF RANGE OF STUDENT WORDS
  1670. * 0 = PERFECT WORD
  1671. * +N...ALL THE POSSIBLE MARK-UPS...
  1672. * BITS SET FROM BOTTOM
  1673. * 1=MISSING WORD BEFORE
  1674. * 2=OUT OF ORDER...MOVE LEFT
  1675. * 3=CAPITALIZATION ERROR ON FIRST LETTER
  1676. * 4=SPELLING ERROR
  1677. * 5=PART OF A BROKEN PHRASE
  1678. * 6=EXTRA WORD
  1679. * 7=SOMETHING MISSING AT END (ONLY FOR LAST WORD)
  1680. *
  1681. * /--- BLOCK GETMARK 00 000 78/04/20 20.37
  1682. GETMKOV OVRLAY
  1683. LX5 XCODEL GET RETURN ADDRESS FIRST
  1684. NGETVAR
  1685. SX6 A1
  1686. SA6 GETMSAV AND SAVE FOR LATER USE
  1687. SA2 TJUGBUF
  1688. SX2 X2
  1689. ZR X2,GETMNA IF NO JUDGE BUFFER
  1690. SA2 JJSBUFA GET CRITERION
  1691. ZR X2,GETMNA SEE IF REASONABLE
  1692. SA5 A5
  1693. NGETVAR GET WORD NUMBER WANTED
  1694. SA2 TWCOUNT SEE IF WORD IN BOUNDS
  1695. ZR X2,GETMERR
  1696. NG X1,GETMERR
  1697. ZR X1,GETMERR
  1698. IX5 X2-X1 WILL USE X5 ALSO NEAR END
  1699. NG X5,GETMERR
  1700. SA2 JJSBUFA+JJINF-1+X1 GET JUDGEMENT ON WORD
  1701. NG X2,GETMNA SEE IF REASONABLE
  1702. SX3 X2-ANTOT
  1703. PL X3,GETMNA
  1704. SA3 X2+MKBITS GET BIT SETTING FOR THIS ERROR
  1705. BX6 X3
  1706. SA4 GETMSAV GET ADDRESS OF RETURN BUFFER
  1707. SA6 X4
  1708. NZ X5,PROCESS EXIT IF NOT LAST WORD
  1709. SA2 JJSBUFA+JJINF+X1 GET AN ADDITIONAL WORD IF LAST
  1710. NG X2,GETMNA
  1711. SX3 X2-ANTOT
  1712. PL X3,GETMNA
  1713. SA3 X2+MKBITS SET MISSING WORD AT END BIT IN LAST WORD
  1714. BX6 X3+X6
  1715. SA6 X4
  1716. EQ PROCESS
  1717. *
  1718. GETMERR SX6 -1 WORD REQUESTED OUT OF RANGE
  1719. GETMER1 SA1 GETMSAV
  1720. SA6 X1
  1721. EQ PROCESS
  1722. *
  1723. GETMNA SX6 -2 ANSWER NOT JUDGED PROPERLY
  1724. EQ GETMER1
  1725. *
  1726. GETMSAV BSS 1 SAVE RETURN ADDRESS
  1727. *
  1728. ANTOT EQU 13 13 POSSIBILITIES
  1729. MKBITS DATA 00B GOOD WORD
  1730. DATA 40B EXTRA WORD
  1731. DATA 40B NOT IN VOCAB
  1732. DATA 10B MISSPELLED
  1733. DATA 02B OUT OF ORDER
  1734. DATA 12B MISSPELLED-OUT OF ORDER
  1735. DATA 01B MISSING WORD
  1736. DATA 11B MISSPELL-MISSING WORD
  1737. DATA 04B CAPITALIZATION ERROR
  1738. DATA 20B BROKEN PHRASE
  1739. DATA 06B CAP-OUT OF ORDER
  1740. DATA 05B CAP-MISSING WORD
  1741. DATA 100B MISSING WORD AT END
  1742. *
  1743. ENDOV
  1744. *
  1745. * /--- BLOCK GETLOC 00 000 78/04/20 20.43
  1746. *
  1747. TITLE GETLOC
  1748. *
  1749. * GETLOC COMMAND
  1750. *
  1751. * GETLOC ARG1,ARG2,ARG3,(ARG4,ARG5)
  1752. *
  1753. * GET THE SCREEN LOCATION OF STUDENT WORDS
  1754. * ARG1 = WORD WANTED
  1755. * ARG2 = STARTING X
  1756. * ARG3 = STARTING Y
  1757. * ARG4 = ENDING X --OPTIONAL
  1758. * ARG5 = ENDING Y --OPTIONAL
  1759. *
  1760. GETLCOV OVRLAY
  1761. *
  1762. SX6 5 ALWAYS FIVE ARGS (4,5 MIGHT BE DUMMY)
  1763. RJ GETCODX
  1764. *
  1765. SA1 VARBUF
  1766. BX5 X1
  1767. NGETVAR
  1768. BX6 X1 HOLDS WORD WANTED (ARG 1)
  1769. SA6 VARBUF
  1770. *
  1771. SA1 VARBUF+1
  1772. BX5 X1
  1773. NGETVAR
  1774. SX6 A1 GET ARG 2 ADDRESS
  1775. SA6 VARBUF+1
  1776. *
  1777. SA1 TJUGBUF
  1778. SX1 X1
  1779. ZR X1,LOCERR IF NO JUDGE BUFFER
  1780. *
  1781. SA1 VARBUF+2
  1782. BX5 X1
  1783. NGETVAR
  1784. SX6 A1 GET ARG 3 ADDRESS
  1785. SA6 VARBUF+2
  1786. *
  1787. SA1 TBSIZE ALLOW ONLY FOR NORMAL SIZE
  1788. NZ X1,LOCERR
  1789. *
  1790. *
  1791. SA3 TANSCNT MAKE SURE ANSWER IN WORDS
  1792. SX7 X3-1 NEED TO SUBTRACT ONE SINCE
  1793. SA7 A3 WORDGET ALWAYS ADDS ONE
  1794. RJ WORDGET
  1795. *
  1796. SA1 VARBUF GET NUMBER OF WORD USER WANTS
  1797. SA2 TWCOUNT SEE IF ALL THINGS WITHIN BOUNDS
  1798. ZR X2,LOCERR MAKE SURE THERE ARE STUDENT WORDS
  1799. NG X1,LOCERR MAKE SURE AUTHOR HAS POSITIVE NUMBER
  1800. ZR X1,LOCERR AND NON-ZERO
  1801. IX3 X2-X1
  1802. NG X3,LOCERR AND THAT AUTHORS NUMBER IN RANGE OF STU WDS
  1803. *
  1804. RJ FIRSTXY GET STARTING X AND Y
  1805. *
  1806. SA6 GETX SAVE ARROW X POSITION
  1807. SA7 GETY SAVE ARROW Y POSITION
  1808. SA2 TBMARG GET CURRENT MARGIN
  1809. BX7 X2 AND SAVE
  1810. SA7 GETMARG SINCE MUST RESET AT EXIT
  1811. SA6 A2 NOW SET MARGIN TO THAT AT ARROW
  1812. *
  1813. SA1 VARBUF GET WORD AUTHOR WANTS
  1814. SA2 JJXY-1+X1 GET ORIGINAL CHARACTER POSITION
  1815. MX3 -15
  1816. BX6 -X3*X2 ENDING CHAR
  1817. AX2 15
  1818. BX7 -X3*X2 STARTING CHAR
  1819. SX7 X7-1
  1820. SA7 NCHAR SAVE CHAR BEFORE START
  1821. SA6 GETLOC1 SAVE ENDING ADDRESS
  1822. *
  1823. * /--- BLOCK GETLOC 00 000 76/09/04 23.26
  1824. *
  1825. SA1 TBINPUT GET ADDRESS OF STUDENT CHAR STRING
  1826. SB1 X1
  1827. SB2 NCHAR
  1828. RJ SIMPLOT GET STARTING NX AND NY
  1829. *
  1830. SA1 NX GET X
  1831. BX6 X1
  1832. SA2 VARBUF+1
  1833. SA6 X2 STORE IN USER ARG2
  1834. SA1 NY GET Y
  1835. BX6 X1
  1836. SA2 VARBUF+2
  1837. SA6 X2 STORE IN USER ARG 3
  1838. *
  1839. *
  1840. SA1 VARBUF+3 GET 4TH ARG
  1841. ZR X1,GETRSET IF ZERO, THE 3-ARG OPTION AND DONE
  1842. *
  1843. BX5 X1
  1844. NGETVAR
  1845. SX6 A1 GET ARG 4 ADDRESS
  1846. SA6 VARBUF+3
  1847. *
  1848. SA1 VARBUF+4
  1849. BX5 X1
  1850. NGETVAR
  1851. SX6 A1 GET ARG 5 ADDRESS
  1852. SA6 VARBUF+4
  1853. *
  1854. SA1 GETX GET X AT ARROW
  1855. BX6 X1
  1856. SA6 NX
  1857. SA2 GETY AND Y
  1858. BX7 X2
  1859. SA7 NY
  1860. *
  1861. SA1 TBINPUT
  1862. SB1 X1
  1863. SB2 GETLOC1 GET SAVED ENDING COUNT
  1864. RJ SIMPLOT GET ENDING X AND Y
  1865. *
  1866. SA1 NX GET ENDING X
  1867. BX6 X1
  1868. SA2 VARBUF+3
  1869. SA6 X2 STORE ENDING X IN ARG 4
  1870. SA1 NY GET ENDING Y
  1871. BX6 X1
  1872. SA2 VARBUF+4
  1873. SA6 X2 STORE IN ARG 5
  1874. *
  1875. GETRSET SA1 GETMARG GET ORIGINAL MARGIN IN OPERATION
  1876. BX6 X1 AT TIME OF GETLOC CALL
  1877. SA6 TBMARG
  1878. EQ PROCESS ON TO NEXT COMMAND
  1879. *
  1880. *
  1881. LOCERR SA1 VARBUF+1 GET AUTHOR RETURN WORD
  1882. SX6 -1
  1883. SA6 X1 STORE SOMETHING WRONG
  1884. EQ PROCESS
  1885. *
  1886. GETLOC1 BSS 1 HOLDS ENDING CHARACTER COUNT
  1887. GETX BSS 1 SAVED ARROW X+2...ALSO ARROW MARGIN
  1888. GETY BSS 1 SAVED ARROW Y
  1889. GETMARG BSS 1 SAVED MARGIN IN OPERATION AT TIME
  1890. * OF GETLOC CALL...MUST RESTORE AT EXIT
  1891. *
  1892. ENDOV
  1893. *
  1894. * /--- BLOCK END 00 000 76/05/13 21.13
  1895. *
  1896. *
  1897. OVTABLE
  1898. *
  1899. *
  1900. END ANS1$