User Tools

Site Tools


plato:source:plaopl:answin

ANSWIN

Table Of Contents

  • [00088] LISTIN
  • [00216] ANSWER COMMAND
  • [00496] MATCH
  • [00679] ANSWERC
  • [00758] AUNAM
  • [00829] -OR-
  • [00936] -ANSWERA-/-WRONGA-

Source Code

ANSWIN.txt
  1. ANSWIN
  2. * /--- FILE TYPE = E
  3. * /--- BLOCK ANSWIN 00 000 81/07/13 01.09
  4. *******PROBLEMS
  5. * AT LERRS...JUST GIVE ERROR MESSAGE, FORGET ABOUT
  6. * SHOWING EXACT CHARACTER...
  7. *
  8. *******
  9. IDENT ANSWIN
  10. LCC OVERLAY(1,1)
  11. *
  12. *
  13. CST
  14. *
  15. *
  16. ANSWIN$ OVFILE
  17. *
  18. *
  19. EXT CONTENT,GETOP,GETOPN IN FILE -CONTEN-
  20. EXT COMCONT CONTINUED COMMAND WORD
  21. EXT PUTCODE
  22. EXT PUTCOMP IN LEX
  23. EXT COMPILE IN LEX
  24. EXT ERRORC
  25. EXT GETLINE
  26. EXT NXTLINE
  27. EXT UNAMX
  28. EXT ECSPRTY
  29. EXT LNGUNIT IN CONDEN
  30. EXT ERRTAGS,ERRNAME,ERRSTOR
  31. EXT ERRXYTG,ERR2MNY,ERR2FEW
  32. EXT ERRTERM,ERRUARG,ERRVTYP
  33. EXT ERROUTR,ERRCNTD,ERRXORQ
  34. EXT ERRBAL
  35. EXT NOARG
  36. EXT ARHDA=
  37. EXT VARDO
  38. *
  39. *
  40. * /--- BLOCK START 00 000 79/05/12 05.29
  41. *
  42. *
  43. ANSWOV OVRLAY
  44. *
  45. *
  46. SA1 OVARG1 DETERMINE WHICH ENTRY POINT
  47. SB3 X1
  48. JP B3+*+1
  49. *
  50. + EQ LIS01
  51. + EQ ANS01
  52. + EQ MATCH01
  53. + EQ * WAS -CONTAIN-,-DISCARD,-CANT-
  54. + EQ ANSC01
  55. + EQ ORC01
  56. + EQ OKWRD01
  57. + EQ ANSA01
  58. *
  59. *
  60. *
  61. * HUMAN ENTITIES IN ANSWER COMMANDS ARE CODED BY TWO 60-BIT
  62. * WORDS...
  63. * FIRST WORD...
  64. * 0...0 FOR WORD, 1 FOR LIST
  65. * 1-3...NUMBER OF VOWELS
  66. * 4-7...NUMBER OF CONSONANTS
  67. * 8-59...CONTENT BITS
  68. * SECOND WORD...
  69. * 0...UNUSED
  70. * 1...0=WORD, 1=NUMBER
  71. * 2-16...WORD HASH, OR 2=SIGN BIT OF NUMBER
  72. * 17-22...FIRST LETTER
  73. * 23-25...NUMBER OF CONSONANT/VOWEL PAIRS
  74. * 26...CAPITALIZATION BIT
  75. * FOLLOWING ARE NOT SET BY CONTENT
  76. * 27...1=START OF A PHRASE
  77. * 28...1=MIDDLE OF A PHRASE
  78. * 29...1=END OF A PHRASE
  79. * 30-41...UNUSED IN ANSWER AT PRESENT
  80. * 42-49...UNUSED AT PRESENT
  81. * 50-59...WORD INFORMATION NUMBER
  82. * /--- BLOCK LISTIN 00 000 76/07/25 10.13
  83. PHRASE BSS 1 PHRASE FLAG
  84. PSTART VFD 27/0,1/1,22/0 PHRASE START BIT
  85. PMIDDLE VFD 28/0,1/1,21/0 MIDDLE WORD IN PHRASE
  86. PEND VFD 29/0,1/1,20/0 LAST WORD IN PHRASE
  87. *
  88. TITLE LISTIN
  89. *
  90. *
  91. * THIS ROUTINE STORES A LIST OF WORDS THAT CAN LATER BE
  92. * REFERENCED BY THE OTHER ANSWER COMMANDS. THE LIST IS STORED
  93. * AS A DUMMY UNIT. THE -ULOC- TABLE ENTRY HAS...
  94. * BIT 1 = 1 IF SOMETHING WENT WRONG AND LIST BAD
  95. * ELSE TOP 18 BITS = RELATIVE ADDRESS OF START OF LIST
  96. * NEXT 12 BITS = LENGTH OF LIST ( 2 WORDS PER ENTRY)
  97. *
  98. *
  99. *
  100. LIS01 MX3 0 CLEAR SPECIAL TERMINATOR FOR AUNAM
  101. SA1 PRETAG SET UP INPUT CHARACTER ADDRESS (-1)
  102. RJ AUNAM GO PUT LIST NAME IN UNAME TABLE
  103. *
  104. SA2 X6+ULOC NOW SEE THAT ULOC INDICATES FIRST TIME SEE
  105. PL X2,ERRORC TOP BIT SET MEANS NOT SEEN BEFORE
  106. SA6 WKWD STORE NUMBER TEMPORARILY
  107. *
  108. MX7 0
  109. SA7 WORK ZERO WORD COUNT
  110. SA7 PHRASE ZERO PHRASE FLAG
  111. ZR X1,LGET2Z SEE IF AT END OF LINE
  112. *
  113. LGET RJ CONTENT CONTENT THE WORDS
  114. *
  115. NZ X7,LGETA SEE IF ANYTHING THERE
  116. SA4 PHRASE ERROR IF BUILDING PHRASE
  117. ZR X4,LGET2
  118. EQ ERRORC
  119. *
  120. LGETA MX5 0
  121. SX3 X1-COPASTR SET UP PHRASE CONTINUE TEST
  122. SA4 PHRASE LOAD PHRASE FLAG
  123. NZ X4,LGET0 SEE IF ALREADY STARTED PHRASE
  124. *
  125. NZ X3,LGET1 NOT IN PHRASE, NOT STARTING ONE
  126. SA5 PSTART STARTING PHRASE
  127. MX4 1 SET -PHRASE- FLAG
  128. EQ LGET1
  129. *
  130. LGET0 NZ X3,LGET00 IN PHRASE, SEE IF PHRASE CONTINUES
  131. SA5 PMIDDLE IN MIDDLE OF PHRASE
  132. EQ LGET1
  133. *
  134. LGET00 SA5 PEND AT END OF PHRASE
  135. MX4 0 CLEAR PHRASE FLAG
  136. *
  137. LGET1 BX7 X7+X5 PUT IN ANY PHRASE BITS
  138. SA2 WORK GET CURRENT WORD COUNT
  139. SX3 X2-WORKLTH+2 DO OVERFLOW TEST
  140. PL X3,ERR2MNY
  141. * /--- BLOCK LISTIN 00 000 77/04/04 16.21
  142. *
  143. SA6 X2+WORK+1 STORE FIRST PART
  144. SA7 A6+1 STORE SECOND PART
  145. SX6 X2+2 INCREMENT
  146. SA6 A2 AND PUT BACK IN -WORK-
  147. BX6 X4
  148. SA6 A4 MAINTAIN -PHRASE- FLAG
  149. *
  150. LGET2 ZR X1,LGET2Z SEE IF END OF LINE
  151. SX2 X1-COPPER PERIOD SEPARATES LETTER-LIKES FROM PUNCS
  152. NG X2,LGET ANYTHING LESS OK TO CONTINUE
  153. EQ LERRS ALL ELSE AN ERROR
  154. *
  155. LGET2Z SA1 NEXTCOM SEE IF NEXT LINE A CONTINUATION
  156. SA2 COMCONT
  157. BX1 X1-X2
  158. NZ X1,LGET3 NON-ZERO MEANS FINISH UP
  159. RJ GETLINE ELSE GET NEXT LINE
  160. SA1 PRETAG INITIALIZE CHAR POINTER FOR CONTENT
  161. EQ LGET AND BACK TO CONTENT LOOP
  162. *
  163. LGET3 SA2 WORK GET LOC AND LENGTH OF LIST TO OUTPUT
  164. ZR X2,ERRNAME SEE IF SOMETHING THERE
  165. MX7 60-ULOC4 MAKE SURE IT WILL FIT IN FIELD
  166. BX7 X7*X2
  167. NZ X7,ERRNAME
  168. SA1 CONDPNT GET CURRENT READ-IN ECS POINTER
  169. BX0 X1 INTO X0
  170. IX7 X1+X2 ADD LENGTH TO START TO GET END
  171. SA4 CONBUFF ADDRESS OF START OF CONDENSE BUFFER
  172. SA3 CBLTH LENGTH OF BUFFER
  173. IX3 X4+X3 GET END OF BUFFER
  174. IX3 X7-X3
  175. PL X3,ERR2MNY SEE IF TOO BIG
  176. SA7 A1 UPDATE NEXT AVAILABLE PLACE TO CONDENSOR
  177. SB7 X2
  178. SA0 WORK+1 CM STARTING ADDRESS OF LIST
  179. + WE B7 WRITE OUT
  180. RJ ECSPRTY
  181. *
  182. IX6 X1-X4 BIAS TO UNIT
  183. LX6 ULOC2+ULOC3+ULOC4
  184. BX6 X6+X2 AND PUT IN TOTAL LENGTH
  185. LX6 60-ULOC1-ULOC2-ULOC3-ULOC4
  186. SA1 WKWD GET LOCATION OF LIST IN ULOC TABLE
  187. SA6 X1+ULOC SET ENTRY INTO ULOC TABLE
  188. EQ NXTLINE
  189. * /--- BLOCK LISTIN 00 000 76/07/31 18.26
  190. *
  191. LERRS SX6 A1 GIVE NON-FATAL ERROR MESSAGE FOR
  192. SA6 WORDPT BAD PUNCTUATION AT THIS TIME
  193. *
  194. * EVENTUALLY FORGET ABOUT SHOWING EXACT CHARACTER...
  195. * JUST MAKE SURE POINTER IS ON IT...AND APPROPRIATE
  196. * MESSAGE IS GIVEN...
  197. BX6 X1
  198. LX6 54
  199. SA6 SHOWOUT
  200. SX6 1
  201. SA6 NCHAR
  202. *
  203. SB1 907
  204. SB2 B0
  205. SX1 B0
  206. SA2 NCHAR
  207. SB3 SHOWOUT
  208. SB4 1
  209. RJ =XRJERRB
  210. LNORM SA1 WORDPT RESTORE A1
  211. SA1 X1
  212. EQ LGET CONTINUE
  213. *
  214. *
  215. * /--- BLOCK ANSEY 00 000 76/10/12 17.24
  216. TITLE ANSWER COMMAND
  217. *
  218. * THIS ROUTINE IS USED TO READ-IN -ANSWER- AND -WRONG-
  219. * COMMANDS. THE COMMAND WORD STARTS WITH A 6 BIT FIELD SET
  220. * ZERO IF SINGLE ANSWER OR 1 IF SYNONYMOUS ANSWER
  221. * THEN 18 BIT RELATIVE BIAS FROM START OF ECS RESIDENT
  222. * EXTRA STORAGE FOR THIS UNIT, THEN 12 BITS LENGTH.
  223. * THEN 12 BITS HIGHEST KEYWORD NUMBER, REST OF WORD HAS
  224. * COMMAND NUMBER.
  225. * IF A SYNONYMOUS SET OF ANSWERS...THEN THE TOP 4-BIT FIELD
  226. * IS SET...THE RELATIVE LOCATION + LENGTH THEN POINTS
  227. * TO THE NEXT INFO WORD IN THE BINARY...AD INFINITUM.
  228. * THE WORD ENTRIES REFER EITHER TO THE WORDS
  229. * DIRECTLY (TOP BIT = 0) IN WHICH CASE TWO 60-BIT WORDS ARE
  230. * USED...OR...TO A LIST CONTAINING THE WORDS (TOP BIT = 1) IN
  231. * WHICH CASE ONLY ONE 60-BIT WORD IS USED TO POINT TO THE LIST.
  232. * THIS POINTER WORD THEN HAS ... BIT 1 = 1, BITS 2-30 = UNIT NUM
  233. * IN EITHER CASE, THE BOTTOM 10 BITS CONTAIN 0=IGNORE WORD OR
  234. * N=COUNT OF KEYWORD (A RUN OF THE SAME N MEANS SYNONYMS)
  235. * PHRASES ARE POSSIBLE IN WHICH CASE THE START, MIDDLE,
  236. * AND END PHRASE BITS MAY BE SET.
  237. *
  238. *
  239. * /--- BLOCK ANSEY 00 000 76/07/25 10.14
  240. *
  241. *
  242. ANS01 SA1 PRETAG SET TO START OF CHARACTER STRING
  243. MX7 0
  244. SA7 ANTYPE SET TO ANSWER
  245. RJ ANSXXX
  246. EQ PUTCODE
  247. *
  248. *
  249. *
  250. * THE FOLLOWING IS USED BY THE ANSWER COMMAND (ANS01)
  251. * AND ANSWERC COMMAND (ANSC01), BOTH IN THIS OVERLAY
  252. *
  253. * A1 AND X1 ARE CHANGED ONLY BY CONTENT, AUNAM, AND GETOP WITHIN
  254. * THIS ROUTINE.
  255. *
  256. ANSXXX EQ *
  257. MX7 0
  258. SA7 SAFLAG NO SYNONYMOUS ANSWER YET
  259. *
  260. ATOP MX7 0 CLEAR WORD COUNTER
  261. SA7 WORK
  262. SA7 PHRASE NOT IN PHRASE
  263. SA7 ASFND NOT FOUND SYNONYMOUS ANSWER MARK
  264. SX6 1 INITIALIZE WORD TYPE TO KEYWORD COUNT
  265. SA6 KEYWDS
  266. SA6 WDTYPE
  267. SA6 ATYPE 0=IGNORE, +=KWD, -=SYN.KWD
  268. *
  269. ALOOP RJ CONTENT GET ANY WORD
  270. NZ X7,ALOOPA SEE IF ANYTHING THERE
  271. SA4 PHRASE ERROR IF BUILDING PHRASE
  272. ZR X4,ACK
  273. SB1 63 INCOMPLETE PHRASE
  274. EQ =XERR
  275. *
  276. ALOOPA MX5 0
  277. SX3 X1-COPASTR SET UP PHRASE CONTINUE TEST
  278. SA4 PHRASE LOAD PHRASE FLAG
  279. NZ X4,ALOO0 SEE IF ALREADY STARTED PHRASE
  280. *
  281. NZ X3,ALOOP1 NOT IN PHRASE, NOT STARTING ONE
  282. SA5 PSTART STARTING PHRASE
  283. MX4 1 SET -PHRASE- FLAG
  284. EQ ALOOP1
  285. *
  286. ALOO0 NZ X3,ALOO00 IN PHRASE, SEE IF PHRASE CONTINUES
  287. SA5 PMIDDLE IN MIDDLE OF PHRASE
  288. EQ ALOOP1
  289. *
  290. ALOO00 SA5 PEND AT END OF PHRASE
  291. MX4 0 CLEAR PHRASE FLAG
  292. *
  293. ALOOP1 BX7 X7+X5 ADD ANY PHRASE BITS
  294. SA5 WDTYPE GET WORD TYPE
  295. BX7 X5+X7 PUT INTO WORD INFORMATION FIELD
  296. *
  297. SA2 WORK CHECK FOR OVERFLOW
  298. SX3 X2-WORKLTH+2
  299. PL X3,ERR2MNY
  300. SA6 X2+WORK+1 SEND WORD OUT
  301. SA7 A6+1
  302. SX6 X2+2 INCREMENT WORD COUNT
  303. SA6 A2
  304. BX6 X4 MAINTAIN PHRASE FLAG
  305. SA6 A4
  306. * /--- BLOCK ANSEY 00 000 75/12/11 11.40
  307. *
  308. SA5 ATYPE GET WHERE IN ANSWER COMMAND
  309. ZR X5,ACK IF PROCESSING IGNORE WORDS
  310. NG X5,ACK IF PROCESSING SYNONYMS
  311. NZ X4,ACK SEE IF DOING PHRASE
  312. SA2 KEYWDS INCREMENT NUMBER OF KEYWORDS
  313. SX6 X2+1
  314. SA6 A2
  315. SA6 WDTYPE
  316. *
  317. ACK ZR X1,ADONE SEE IF END OF LINE
  318. SX2 X1-COPCOMA ANYTHING LESS IS LETTER/NUMBER
  319. NG X2,ALOOP
  320. *
  321. SA4 PHRASE PHRASES SHOULD NOT BE HERE
  322. NZ X4,ERRORC
  323. SA2 ATYPE GET WHERE IN ANSWER COMMAND
  324. ZR X2,IGN BRANCH OFF TO IGNORE WORDS
  325. NG X2,SYNK SYNONYMOUS KEYWORDS
  326. *
  327. SX3 X1-COPCOMA SEE IF SYNONYMOUS ANSWER FOLLOWS
  328. ZR X3,ADONES
  329. SX3 X1-COPSEMI SEE IF ANSWERC DELIMITER
  330. ZR X3,ANDONC
  331. *
  332. SX3 X1-COPLPRN SEE IF START OF SYNONYMS
  333. NZ X3,OTH ELSE SEE IF OTHER THINGS
  334. MX6 -1
  335. SA6 ATYPE SET TO SYN KEYWORDS
  336. EQ ALOOP
  337. *
  338. SYNK SX3 X1-COPCOMA SEE IF COMMA
  339. ZR X3,ALOOP COMMA OK IN SYN KEYWORDS
  340. SX3 X1-COPRPRN SEE IF DONE WITH SYN KEYWORDS
  341. NZ X3,SYNKK
  342. SA3 KEYWDS INCREMENT KEYWORD COUNT
  343. SX6 X3+1
  344. SA6 A3
  345. SA6 ATYPE
  346. SA6 WDTYPE
  347. EQ ALOOP
  348. SYNKK SX3 X1-COPLPRN SEE IF KEYWORD LIST ((LIST))
  349. NZ X3,ERRORC ALL ELSE ERROR
  350. SX3 COPRPRN SET UNAM END TEST
  351. EQ ALISTIN
  352. *
  353. OTH SX3 X1-COPLTH SEE IF <
  354. NZ X3,ERRORC ALL ELSE ERRORS
  355. MX6 0
  356. SA6 WDTYPE SET WORDTYPE TO IGNORE
  357. SA6 ATYPE
  358. EQ ALOOP
  359. *
  360. IGN SX3 X1-COPGTH SEE IF >
  361. NZ X3,IGN1
  362. SA4 KEYWDS SET BACK TO KEYWORDS
  363. BX6 X4
  364. SA6 WDTYPE
  365. SA6 ATYPE
  366. EQ ALOOP
  367. * /--- BLOCK ANSEY 00 000 76/07/25 10.16
  368. *
  369. IGN1 SX3 X1-COPCOMA SEE IF COMMA
  370. ZR X3,ALOOP COMMA OK IN EXTRA WORDS
  371. SX3 X1-COPLTH SEE IF EXTRA LIST <<LIST>>
  372. NZ X3,ERRORC ALL ELSE ERROR
  373. SX3 COPGTH SET UNAM END TEST
  374. *
  375. ALISTIN BX7 X3 SAVE X3 FOR POSSIBLE SECOND USE
  376. SA7 WKWD
  377. RJ AUNAM ADD TO UNAM TABLE (X3 HOLDS TERMINATOR)
  378. *
  379. LX6 30 UNIT NUMBER
  380. MX7 1 SET TO LIST WORD
  381. BX6 X6+X7
  382. SA2 WDTYPE ADD WORD TYPE
  383. BX6 X6+X2
  384. SA2 WORK GET CURRENT WORD COUNT
  385. SX3 X2-WORKLTH+1 DO OVERFLOW TEST
  386. PL X3,ERR2MNY
  387. SA6 X2+WORK+1 STORE AWAY LIST REFERENCE
  388. SX6 X2+1 INCREMENT
  389. SA6 A2 AND PUT BACK IN -WORK-
  390. *
  391. SA3 WKWD PRE-SET X3
  392. SX4 X1-COPCOMA CHECK FOR COMMA ((LISTX,LISTY))
  393. ZR X4,ALISTIN GO RIGHT ON TO NEXT LIST
  394. *
  395. BX4 X1-X3 SEE THAT NEXT CHARACTER EITHER > OR )
  396. ZR X4,ALOOP
  397. EQ ERRTERM
  398. *
  399. ADONE SA1 NEXTCOM SEE IF NEXT READ-IN LINE A CONTINUATION
  400. SA2 COMCONT
  401. BX1 X1-X2
  402. NZ X1,ADONE1
  403. RJ GETLINE GET NEXT CONTINUATION LINE
  404. SA1 PRETAG SET ADDRESS OF INPUT STRING FOR CONTENT
  405. EQ ALOOP BACK TO MAIN WORD INPUT LOOP
  406. *
  407. ANDONC SA5 ANTYPE MAKE SURE JUST ANSWERC
  408. ZR X5,ERRORC
  409. MX7 1
  410. SA7 ANCEND MARK END BY SEMICOLON
  411. EQ ADONE1
  412. * /--- BLOCK ANSEY 00 000 77/03/29 21.04
  413. *
  414. ADONES SX6 1 SET FLAG FOR SYN ANSWER FOLLOWS
  415. SA6 ASFND
  416. *
  417. ADONE1 SA2 ATYPE MUST NOT BE IN IGNORE, SYN, OR PHRASE
  418. ZR X2,ERRORC
  419. NG X2,ERRORC
  420. SA2 PHRASE
  421. NZ X2,ERRORC
  422. *
  423. SA2 WORK GET LOC AND LENGTH OF LIST TO OUTPUT
  424. MX7 48 MAKE SURE WILL FIT IN 12 BITS
  425. BX7 X7*X2
  426. NZ X7,ERRORC
  427. *
  428. SA3 ECSARGS GET NUMBER OF ECS ARGS ALREADY
  429. IX7 X3+X2 ADD IN MORE
  430. SX4 X7-ECSRESL+1 SEE THAT BUFFER DOES NOT OVERFLOW
  431. * THE +1 IS FOR -ASYNC- FOLLOWING
  432. PL X4,LNGUNIT
  433. SA7 A3 UPDATE NEW NUMBER OF ECS ARGS
  434. SA5 ECSRESB GET START OF ECS BUFFER
  435. IX0 X5+X3 GET PLACE TO ADD MORE ARGS
  436. SB7 X2
  437. SA0 WORK+1 CM STARTING ADDRESS OF LIST
  438. + WE B7 WRITE OUT
  439. RJ ECSPRTY
  440. *
  441. LX3 12 GET REL LOC OF ECS ARGS IN PLACE
  442. BX6 X3+X2 PUT TOGETHER WITH LENGTH
  443. LX6 12
  444. SA5 KEYWDS PUT IN NUMBER OF KEYWORDS
  445. SX5 X5-1
  446. BX6 X5+X6
  447. LX6 12
  448. *
  449. SA5 ASFND SEE IF SYNONYMOUS ANSWER FOLLOWING
  450. NZ X5,ASYNA
  451. SA5 SAFLAG SEE IF A PREVIOUS SYNONYMOUS ANSWER
  452. ZR X5,ANSXXX EXIT TO CALLING ROUTINE
  453. SA6 A0 IF PREVIOUS, MUST PUT OUT COMMAND INFO
  454. SA2 SAHOLE IN HOLE LEFT IN ECS
  455. BX0 X2
  456. + WE 1
  457. RJ ECSPRTY
  458. BX6 X5 AND GET FIRST ANSWER INFO
  459. EQ ANSXXX TO ADD COMMAND CODE AND STORE
  460. *
  461. ASYNA LX5 54 SET SYNONYMOUS ANSWER BIT
  462. BX6 X6+X5
  463. SA5 SAFLAG SYNONYMOUS ANSWER, SEE IF THIS FIRST
  464. NZ X5,ASYNB
  465. SA6 A5 STORE AWAY FIRST FOR FINAL EXIT
  466. EQ ASYNC
  467. *
  468. ASYNB SA6 A0 NOW PUT INFO FOR THIS ANSWER INTO
  469. SA2 SAHOLE ECS HOLE PREVIOUSLY MADE
  470. BX0 X2
  471. + WE 1
  472. RJ ECSPRTY
  473. *
  474. ASYNC SA2 ECSARGS OPEN UP HOLE IN ECS
  475. SX7 X2+1 OVERFLOW TEST DONE ALREADY
  476. SA7 A2
  477. SA3 ECSRESB AND SAVE ADDRESS OF ECS HOLE
  478. IX7 X2+X3
  479. SA7 SAHOLE
  480. EQ ATOP AND ONTO NEXT SYNONYMOUS ANSWER
  481. *
  482. * /--- BLOCK ANSEY 00 000 75/10/16 22.39
  483. *
  484. *
  485. WDTYPE BSS 1 CURRENT WORD TYPE
  486. KEYWDS BSS 1 NUMBER OF KEYWORDS
  487. ATYPE BSS 1 0=IGNORE, 1=KEYWORD, -1=SYN KEYWORD
  488. WKWD BSS 1
  489. SAFLAG BSS 1 HOLDS FIRST OF SYN ANSWERS AS FLAG
  490. SAHOLE BSS 1 ECS ADDRESS OF HOLE FOR CURRENT SYN ANSWER
  491. ASFND BSS 1 FLAG THAT SYNONYMOUS ANSWER FOLLOWS
  492. ANTYPE BSS 1 0=ANSWER, -1=ANSWERC
  493. *
  494. * /--- BLOCK MATCH 00 000 78/06/13 13.53
  495. *
  496. TITLE MATCH
  497. * THIS ROUTINE IS USED TO READ-IN -MATCH- COMMANDS.
  498. * CURRENTLY IT IS SIMILAR TO ANSWER READ-IN.
  499. * COMMAND WORD HAS TOP XCODEL BITS WITH GETVAR CODE
  500. * THEN 18 BITS ADDRESS RELATIVE TO START OF ECS RESIDENT
  501. * EXTRA STORAGE FOR THIS UNIT
  502. * THEN 12 BITS LENGTH OF ENTRIES
  503. *
  504. *
  505. MATCH01 CALL PUTCOMP DECODE VARIABLE
  506. LX1 60-XCODEL POSITION -GETVAR- CODE AT TOP
  507. BX6 X1
  508. SA6 MAFLAG STORE AWAY FOR NOW
  509. *
  510. MX7 0 CLEAR WORD COUNTER
  511. SA7 WORK
  512. SA7 PHRASE NOT IN PHRASE
  513. SX6 1 INITIALIZE WORD TYPE TO KEYWORD COUNT
  514. SA6 KEYWDS +=KEYWORD, -=SYNONYMOUS KEYWORDS
  515. SA6 WDTYPE SET TO FIRST MATCH ENTRY
  516. *
  517. SA2 LASTKEY
  518. ZR X2,MDONE SEE IF AT END OF LINE ALREADY
  519. SA1 WORDPT X1 = ADDRESS OF CHARACTER AFTER SEPARATOR
  520. SA1 X1-1 SET ADDRESS OF INPUT STRING FOR CONTENT
  521. BX6 X1
  522. SA6 PREPUNC INITIALIZE PREVIOUS STOPER
  523. * /--- BLOCK MATCH 00 000 78/06/13 13.52
  524. *
  525. *
  526. MLOOP RJ CONTENT GET ANY WORD
  527. NZ X7,MLOOPA SEE IF ANYTHING THERE
  528. SA4 PHRASE ERROR IF BUILDING PHRASE
  529. NZ X4,ERRORC
  530. SA2 PREPUNC WHAT WAS PREVIOUS STOPER
  531. SX2 X2-COPCOMA
  532. NZ X2,MCK SEE IF WAS A COMMA
  533. SX2 X1-COPCOMA THEN SEE IF THIS ANOTHER COMMA
  534. ZR X2,MCK0 IF SO, MAYBE ADVANCE KEYWORD
  535. EQ MCK COUNT
  536. *
  537. MLOOPA MX5 0
  538. SX3 X1-COPASTR SET UP PHRASE CONTINUE TEST
  539. SA4 PHRASE LOAD PHRASE FLAG
  540. NZ X4,MLOO1 SEE IF ALREADY STARTED PHRASE
  541. *
  542. NZ X3,MLOOP1 NOT IN PHRASE, NOT STARTING ONE
  543. SA5 PSTART STARTING PHRASE
  544. MX4 1 SET -PHRASE- FLAG
  545. EQ MLOOP1
  546. *
  547. MLOO1 NZ X3,MLOO2 IN PHRASE, SEE IF PHRASE CONTINUES
  548. SA5 PMIDDLE IN MIDDLE OF PHRASE
  549. EQ MLOOP1
  550. *
  551. MLOO2 SA5 PEND AT END OF PHRASE
  552. MX4 0 CLEAR PHRASE FLAG
  553. *
  554. MLOOP1 BX7 X7+X5 ADD ANY PHRASE BITS
  555. SA5 WDTYPE GET WORD TYPE
  556. BX7 X5+X7 PUT INTO WORD INFORMATION FIELD
  557. *
  558. SA2 WORK CHECK FOR OVERFLOW
  559. SX3 X2-WORKLTH+2
  560. PL X3,ERR2MNY
  561. SA6 X2+WORK+1 SEND WORD OUT
  562. SA7 A6+1
  563. SX6 X2+2 INCREMENT WORD COUNT
  564. SA6 A2
  565. BX6 X4 MAINTAIN PHRASE FLAG
  566. SA6 A4
  567. *
  568. NZ X4,MCK SEE IF DOING PHRASE
  569. MCK0 SA5 KEYWDS SEE IF SINGLE WORD OR SYNONYMS
  570. NG X5,MCK IF PROCESSING SYNONYMS
  571. SA2 KEYWDS INCREMENT NUMBER OF KEYWORDS
  572. SX6 X2+1
  573. SA6 A2
  574. SA6 WDTYPE
  575. * /--- BLOCK MATCH 00 000 78/06/13 13.43
  576. *
  577. MCK ZR X1,MDONE SEE IF END OF LINE
  578. *
  579. BX6 X1 SAVE THIS ENDING PUNCTUATION
  580. SA6 PREPUNC FOR LATER TESTING
  581. *
  582. SX2 X1-COPCOMA ANYTHING LESS IS LETTER/NUMBER
  583. NG X2,MLOOP
  584. *
  585. SA4 PHRASE PHRASES SHOULD NOT BE HERE
  586. NZ X4,ERRORC
  587. *
  588. ZR X2,MLOOP ALLOW COMMA
  589. *
  590. SA2 KEYWDS SEE IF SINGLE OR SYNONYMS
  591. NG X2,MSYNK SYNONYMOUS KEYWORDS
  592. *
  593. SX3 X1-COPLPRN SEE IF START OF SYNONYMS
  594. NZ X3,ERRORC ALL ELSE ERROR
  595. BX6 -X2 MAKE NEGATIVE
  596. SA6 A2 RESTORE IN KEYWDS
  597. EQ MLOOP
  598. *
  599. MSYNK SX3 X1-COPRPRN SEE IF DONE WITH SYN KEYWORDS
  600. NZ X3,MSYNKK
  601. SA3 KEYWDS INCREMENT KEYWORD COUNT
  602. BX6 -X2 MAKE POSITIVE AGAIN
  603. SX6 X6+1 INCREMENT COUNT
  604. SA6 A2 RESTORE IN KEYWDS
  605. SA6 WDTYPE
  606. EQ MLOOP
  607. MSYNKK SX3 X1-COPLPRN SEE IF KEYWORD LIST ((LIST))
  608. NZ X3,ERRORC ALL ELSE ERROR
  609. * /--- BLOCK MATCH 00 000 78/06/13 13.44
  610. MLISTIN SX3 COPRPRN SET UNAM END TEST
  611. RJ AUNAM ADD TO UNAM TABLE (X3 HOLDS TERMINATOR)
  612. *
  613. *
  614. LX6 30 UNIT NUMBER
  615. MX7 1 SET TO LIST WORD
  616. BX6 X6+X7
  617. SA2 WDTYPE ADD WORD TYPE
  618. BX6 X6+X2
  619. SA2 WORK GET CURRENT WORD COUNT
  620. SX3 X2-WORKLTH+1 DO OVERFLOW TEST
  621. PL X3,ERR2MNY
  622. SA6 X2+WORK+1 STORE AWAY LIST REFERENCE
  623. SX6 X2+1 INCREMENT
  624. SA6 A2 AND PUT BACK IN -WORK-
  625. *
  626. SX3 X1-COPCOMA CHECK FOR COMMA ((LISTX,LISTY))
  627. ZR X3,MLISTIN GO ON TO NEXT LIST
  628. *
  629. SX3 X1-COPRPRN MAKE SURE END CHARACTER WAS )
  630. ZR X3,MLOOP
  631. EQ ERRTERM
  632. *
  633. MDONE SA1 NEXTCOM SEE IF NEXT READ-IN LINE A CONTINUATION
  634. SA2 COMCONT
  635. BX1 X1-X2
  636. NZ X1,MDONE1
  637. *
  638. SX6 COPCOMA END OF LINE ALWAYS LIKE COMMA
  639. SA6 PREPUNC
  640. *
  641. RJ GETLINE GET NEXT CONTINUATION LINE
  642. SA1 PRETAG SET ADDRESS OF INPUT STRING FOR CONTENT
  643. EQ MLOOP BACK TO MAIN WORD INPUT LOOP
  644. * /--- BLOCK MATCH 00 000 78/06/13 13.40
  645. *
  646. MDONE1 SA2 KEYWDS MUST NOT BE IN SYNONYMS
  647. NG X2,ERRORC
  648. SA2 PHRASE
  649. NZ X2,ERRORC
  650. *
  651. SA2 WORK GET LOC AND LENGTH OF LIST TO OUTPUT
  652. ZR X2,ERRNAME MUST BE SOMETHING THERE
  653. MX7 48 MAKE SURE WILL FIT IN 12 BITS
  654. BX7 X7*X2
  655. NZ X7,ERRORC
  656. *
  657. SA3 ECSARGS GET NUMBER OF ECS ARGS ALREADY
  658. IX7 X3+X2 ADD THESE ADDITIONAL ONES
  659. SX4 X7-ECSRESL SEE THAT NO BUFFER OVERFLOW
  660. PL X4,LNGUNIT
  661. SA7 A3 UPDATE NUMBER OF ECS ARGS
  662. SA4 ECSRESB GET ADDRESS OF ECS BUFFER
  663. IX0 X4+X3 GET LOCATION TO ADD NEW STUFF
  664. SB7 X2
  665. SA0 WORK+1 CM BUFFER
  666. + WE B7 WRITE OUT
  667. RJ ECSPRTY
  668. *
  669. LX3 12 GET REL LOC OF ECS ARGS IN PLACE
  670. BX6 X3+X2 PUT TOGETHER WITH LENGTH
  671. LX6 60-XCODEL-18-12
  672. SA3 MAFLAG
  673. BX6 X3+X6 ADD GETVAR CODE
  674. EQ PUTCODE EXIT TO ADD COMMAND CODE AND STORE
  675. *
  676. MAFLAG BSS 1 HOLDS GETVAR CODE
  677. PREPUNC BSS 1 HOLDS PREVIOUS PUNCTUATION
  678. * /--- BLOCK ANSWERC 00 000 78/08/18 12.09
  679. TITLE ANSWERC
  680. *
  681. * READ-IN ANSWERC COMMAND
  682. * PRODUCE A COMMAND WORD THAT CONTAINS
  683. * 1. A GETVAR CODE
  684. * 2. A RELATIVE POINTER TO TABLE OF ANS COMMANDS IN EXTRA STO
  685. * 3. THE NUMBER OF ANSWER COMMANDS IN TABLE
  686. *
  687. * THE ANSWER COMMANDS ARE CODED EXACTLY AS EXPLAINED AT ANS01
  688. * THE NULL CASE (;;) IS CODED BY A COMPLETELY ZERO ANS COMMAND
  689. *
  690. *
  691. ANSC01 MX7 1 SET FLAG TO ANSWERC
  692. SA7 ANTYPE
  693. CALL COMPILE GET CONDITION INTO COMPILED CODE
  694. LX1 60-XCODEL
  695. BX6 X1
  696. SA6 MAFLAG SAVE GETVAR CODE FOR LATER
  697. SA1 WORDPT
  698. SA1 X1-1 SET UP ADDRESS FOR CONTENT
  699. *
  700. SA2 INX SAVE STARTING EXTRA STORAGE
  701. BX6 X2
  702. SA6 INXST
  703. *
  704. SX2 X1-1R; SEMICOLON OK HERE
  705. ZR X2,ANSC02
  706. *
  707. SX2 X1-1R, OR UNIVERSAL DELIMITER ^,
  708. NZ X2,ERRTERM WHICH IS ACCESS-COMMA
  709. SX2 A1
  710. SA2 X2-1
  711. SX2 X2-ACCESS
  712. NZ X2,ERRTERM NOTHING ELSE ALLOWED
  713. *
  714. * /--- BLOCK ANSWERC 00 000 78/08/18 12.12
  715. *
  716. ANSC02 MX7 0 WILL COME BACK ZERO WHEN TOTALLY DONE
  717. SA7 ANCEND
  718. *
  719. RJ GETOPN GET NEXT OP...LOOK FOR NULL CASE (;;)
  720. SX2 B3-COPSEMI
  721. NZ X2,ANSC03 IF NOT, ONTO NEXT ANSWER
  722. RJ GETOP ADVANCE OVER ;
  723. MX6 1 NEGATIVE COMMAND IS NULL CASE
  724. SA6 ANCEND ALSO SET FLAG TO INDICATE NOT DONE
  725. EQ ANSC04 AND STORE ZERO FOR THIS CASE
  726. *
  727. ANSC03 RJ ANSXXX COMPILE THE NEXT ANSWER COMMAND
  728. *
  729. ANSC04 SA4 INX GET CURRENT EXTRA STORAGE LOC
  730. SX7 X4+1 INCREMENT
  731. SA2 ICX
  732. IX2 X7-X2 TEST FOR BUFFER OVERFLOW
  733. PL X2,LNGUNIT
  734. SA7 A4 UPDATE INX
  735. *
  736. SA6 INFO+X4 STORE AWAY ANSWER COMMAND INFO
  737. *
  738. SA4 ANCEND SEE IF ALL DONE
  739. NZ X4,ANSC02
  740. *
  741. ANSC05 SA1 MAFLAG GET GETVAR CODE
  742. SA2 INXST GET STARTING RELATIVE POINTER TO TABLE
  743. SA3 INX GET ENDING POINTER
  744. IX3 X3-X2 CALCULATE LENGTH
  745. LX2 24
  746. LX3 12
  747. BX6 X1+X2 PACK UP ALL THE GOODIES INTO COMMAND WORD
  748. BX6 X6+X3
  749. *
  750. *
  751. *
  752. EQ PUTCODE NOW STORE AWAY COMMAND
  753. *
  754. *
  755. ANCEND BSS 1 0 IF ALL DONE
  756. INXST BSS 1 START OF EXTRA STORAGE AREA
  757. * /--- BLOCK UNAM 00 000 79/03/21 02.49
  758. TITLE AUNAM
  759. *
  760. * INPUT...
  761. * A1 HOLDS ADDRESS OF INPUT CHARACTER STRING (-1)
  762. * X3 HOLDS SPECIAL ENDING CHARACTER...) OR >
  763. *
  764. * OUTPUT...
  765. * A1 HOLDS ADDRESS OF LAST CHARACTER USED
  766. * X1 HOLDS LAST OPERATION CODE
  767. * X6 HOLDS UNIT NUMBER ASSIGNED
  768. *
  769. AUNAM EQ * MAKE UP NAME FOR USE IN UNAM TABLE
  770. * ONLY NAME STARTING WITH A SPACE
  771. * X3 SET TO SPECIAL ENDING MARK
  772. SB1 42 ONLY ALLOW 7 CHARS, WILL PUT SPACE AT START
  773. MX6 0
  774. *
  775. VUN SB3 A1 SAVE CURRENT CHARACTER ADDRESS
  776. RJ GETOP GET NEXT OPERATION CODE
  777. SX0 B2-COPSP SEE IF LEADING SPACE
  778. ZR X0,VUN LOOP TO CLEAN OFF LEADING SPACES
  779. *
  780. VULOOP ZR B2,VUMADE SEE IF END OF LINE
  781. SX0 B2-COPCOMA SEE IF COMMA
  782. ZR X0,VUMADE
  783. SX0 B2-COPSP SEE IF SPACE
  784. ZR X0,VUMADE
  785. SX0 B2
  786. IX0 X0-X3 TEST FOR SPECIAL END MARK
  787. ZR X0,VUMADE
  788. *
  789. VUMAKE SB1 B1-6 DECREMENT SHIFT COUNT
  790. NG B1,ERRNAME SEE THAT NOT OVER 7 6-BIT CODES
  791. SB3 B3+1 NOW GET 6-BIT CHARACTERS NEEDED
  792. SA2 B3
  793. LX0 B1,X2 SHIFT TO CORRECT POSITION
  794. BX6 X6+X0 ADD TO NAME-A-BUILDING
  795. SX2 A1-B3
  796. NZ X2,VUMAKE LOOP FOR CHARACTERS OF MORE THAN 6-BITS
  797. *
  798. * B3 = A1 NOW BY NECESSITY
  799. RJ GETOP GET NEXT OP CODE FROM CONTENT
  800. EQ VULOOP
  801. *
  802. VUMADE ZR X6,ERRNAME SEE IF NOTHING THERE
  803. *
  804. SX0 1R PUT A SPACE AT START OF THIS WORD
  805. LX0 42
  806. BX6 X6+X0 ONLY UNAM ENTRY STARTING WITH SPACE
  807. *
  808. SX7 B2 SAVE LAST OPERATION CODE
  809. LX7 30
  810. SX2 A1 SAVE LAST CHARACTER ADDRESS
  811. BX7 X2+X7
  812. SA7 SAVIT
  813. SX7 A1 AND SAVE ADDRESS FOR ERROR EXIT IN UNAMX
  814. SA7 WORDPT
  815. *
  816. * NAME STARTS WITH SPACE
  817. RJ UNAMX CALL WITH NAME IN X6
  818. * RETURN WITH UNIT NUMBER IN X6
  819. *
  820. SA2 SAVIT RESTORE CHAR ADDRESS AND LAST OP
  821. SA1 X2
  822. LX2 30
  823. SX1 X2
  824. EQ AUNAM
  825. *
  826. SAVIT BSS 1
  827. *
  828. * /--- BLOCK OR 00 000 82/07/13 17.16
  829. TITLE -OR-
  830. * -OR- (CODE=135)
  831. *
  832. * THE COMMAND IS LEGAL ONLY WHEN FOLLOWED BY
  833. * AN ANSWER TYPE COMMAND.
  834. *
  835. * THIS COMMAND DOES NO CHECKS TO SEE IF THE PREVIOUS
  836. * COMMAND IS ALSO A JUDGING COMMAND, WHICH IS THE
  837. * COMMON USAGE. 'THIS ALLOWS THE SEQUENCE OF A
  838. * JUDGING COMMAND FOLLOWED BY REGULAR COMMANDS
  839. * FOLLOWED BY AN -OR- FOLLOWED BY A JUDGING COMMAND
  840. * AND MORE REGULAR COMMANDS. 'IF THE SECOND JUDGING
  841. * COMMAND IS MATCHED, ONLY THE REGULAR COMMANDS
  842. * FOLLOWING IT ARE EXECUTED, WHILE IF THE FIRST
  843. * ONE IS MATCHED, BOTH SETS OF REGULAR COMMANDS
  844. * ARE EXECUTED.
  845. *
  846. ORC01 SA1 NEXTCOM WHAT IS THE NEXT COMMAND
  847. BX7 X1
  848. SA7 ORSTOP PUT IT AT THE END OF THE LIST
  849. SA2 ORLIST-1 READY TO SCAN LIST
  850. SB1 1
  851. *
  852. ORSCAN SA2 A2+B1 READ NEXT ITEM OF LIST
  853. BX2 X2-X1 COMPARE WITH NEXT COMMAND
  854. NZ X2,ORSCAN
  855. *
  856. SX2 A2-ORSTOP SEE IF HIT END OF LIST
  857. NZ X2,NOARG JUMP IF OK
  858. EQ ERRNAME FLAG ANY ERROR
  859. *
  860. * LIST OF ANSWER TYPE COMMANDS
  861. *
  862. ORLIST VFD 60/8LANSWER
  863. VFD 60/8LANSWERC
  864. VFD 60/8LWRONG
  865. VFD 60/8LWRONGC
  866. VFD 60/8LCONCEPT
  867. VFD 60/8LMISCON
  868. VFD 60/8LMATCH
  869. VFD 60/8LANSV
  870. VFD 60/8LWRONGV
  871. VFD 60/8LOK
  872. VFD 60/8LNO
  873. VFD 60/8LIGNORE
  874. VFD 60/8LEXACT
  875. VFD 60/8LEXACTC
  876. VFD 60/8LEXACTV
  877. VFD 60/8LANSU
  878. VFD 60/8LWRONGU
  879. VFD 60/8LTOUCH
  880. VFD 60/8LTOUCHW
  881. VFD 60/8LNTOUCH
  882. VFD 60/8LNTOUCHW
  883. VFD 60/8LANSWERA
  884. VFD 60/8LWRONGA
  885. ORSTOP BSSZ 1
  886. * /--- BLOCK OKWORD 00 000 81/07/08 03.04
  887. *
  888. *
  889. * -OKWORD- (CODE=223)
  890. * -NOWORD- (CODE=224)
  891. * -ARHEADA-
  892. *
  893. * UP TO 9 CHARACTERS SPECIFYING WORD TO WRITE
  894. * FOR -OK- (-NO-) JUDGMENTS.
  895. *
  896. * UP TO 5 CHARACTERS SPECIFYING WORD TO WRITE
  897. * FOR -ARHEADA-
  898. *
  899. OKWRD01 SA1 TAGCNT NUMBER OF CHARS
  900. SB3 X1 SAVE FOR END TEST
  901. MX6 0 PRE-SET FOR NO CHAR CASE
  902. ZR X1,OKWRDC2 JUMP IF NO CHARS
  903. SX2 X1-10
  904. PL X2,ERRNAME --- ERROR EXIT IF OVER 9 CHARS
  905. SB2 0
  906. SA1 COMNUM
  907. SX3 ARHDA=
  908. IX1 X1-X3 CHECK FOR SPECIAL ARHEADA CASE
  909. NZ X1,OKWORD0 IF NOT ARHEADA
  910. SX1 B3-6
  911. PL X1,ERRNAME --- ERROR EXIT IF OVER 5 CHARS
  912. EQ OKWRDC1
  913. OKWORD0 SA1 TAG CHECK FOR RIGHT MARGIN OPS
  914. LX1 6
  915. SA2 TAG+1
  916. BX1 X1+X2
  917. SX1 X1-KUP*100B-1R0
  918. SX6 1R START WITH SPACE CODE
  919. NZ X1,OKWRDC1 IF NORMAL OKWORD
  920. SX1 KUP*100B+1R1 CHANGE TO LEFT
  921. LX1 6
  922. BX6 X1+X6
  923. SB2 2 AND SKIP IN TAG FIELD
  924. OKWRDC1 SA1 TAG+B2
  925. LX6 6
  926. BX6 X6+X1
  927. SB2 B2+1
  928. LT B2,B3,OKWRDC1
  929. OKWRDC2 SA2 INX
  930. SA6 INFO+X2 STORE WORD IN EXTRA STORAGE
  931. SX7 X2+1 INCREMENT EXTRA STORAGE POINTER
  932. SA7 A2
  933. BX6 X2
  934. LX6 XCMNDL POSITION POINTER
  935. EQ PUTCODE --- EXIT TO ADD COMMAND CODE AND STORE
  936. TITLE -ANSWERA-/-WRONGA-
  937. EJECT
  938. *
  939. * -ANSWERA-/-WRONGA- COMMAND CONDENSE.
  940. *
  941. * COMMAND FORMAT';
  942. * 20/ADDRESS IN ECS ARGS OF INFORMATION WORD
  943. * 28/0
  944. * 12/COMMAND NUMBER
  945. *
  946. * ECS ARGUMENTS INFORMATION WORD';
  947. * 20/BIAS INTO ECS ARGS OF ANSWERA BUFFER
  948. * 20/GETVAR CODE FOR STORED STRING
  949. * 20/GETVAR CODE FOR NUMBER OF CHARACTERS TO READ
  950. *
  951. * USES A1,A3,A5,A7
  952. * X1,X3,X4,X5,X6,X7
  953. *
  954. * CALLS VARDO
  955. *
  956. TEMPARG BSS 1 BRIEFLY HOLDS ECS ARGUMENT
  957. ARGADD BSS 1 SAVES ECS ARGUMENT OFFSET
  958. *
  959. ANSA01 BSS 0
  960. SA3 ECSARGS GET CURRENT NUMBER OF ECS ARGS
  961. BX7 X3 CURRENT NUMBER
  962. SA7 ARGADD SAVE FOR LATER
  963. * /--- BLOCK OKWORD 00 000 81/07/08 03.04
  964. SX7 X7+1 ADD 1 FOR COMMAND EXTRA WORD
  965. SX4 X7-ECSRESL-1 CHECK FOR BUFFER OVERFLOW
  966. PL X4,LNGUNIT UNIT TOO LONG
  967. SA7 ECSARGS STORE NEW NUMBER OF ARGUMENTS
  968.  
  969. SA4 ANSABUF SEE IF ALLOCATED
  970. PL X4,ANSAVAR X4 = BUFFER ARGUMENT BASE ADDR
  971. SA7 A4 STORE OFFSET INTO ECS ARGS
  972. SX3 MAXLONG BUFFER MAX LENGTH
  973. IX7 X7+X3 ADD TO CURRENT NUMBER OF ARGS
  974. SX3 X7-ECSRESL-1 CHECK FOR BUFFER OVERFLOW
  975. PL X3,LNGUNIT UNIT TOO LONG
  976. SA7 ECSARGS STORE NEW NUMBER OF ARGUMENTS
  977.  
  978. ANSAVAR RJ VARDO COMMA SEPARATED VARIABLES
  979. SA1 VARBUF+1 PICK UP FIRST GETVAR CODE
  980. NG X1,ERRSTOR MUST BE STOREABLE
  981.  
  982. MX0 61-XCODEL+XFBIT MASK OUT I/F BIT
  983. BX1 -X0*X1 X1 = FIRST ARG GETVAR CODE
  984. SA3 VARBUF GET NUMBER OF ARGUMENTS
  985. SX3 X3-1 CHECK NUMBER OF ARGS
  986. SX2 10 GETVAR CODE FOR 10 CHARACTERS
  987. ZR X3,ANSAPUT BRANCH IF ONLY ONE ARGUMENT
  988. SX3 X3-1 CHECK FOR TOO MANY ARGS
  989. NZ X3,ERR2MNY
  990. SA2 VARBUF+2 X2 = SECOND ARG GETVAR CODE
  991. MX0 -XCODEL MASK TO *XCODEL* BITS
  992. BX2 -X0*X2 TO GET RID OF POSSIBLE LITERAL FLAG
  993.  
  994. ANSAPUT SA4 ANSABUF ECS ARG BUFFER BASE ADDRESS
  995. LX4 2*XCODEL ECS BUFFER LOCATION
  996. LX1 XCODEL STRING GETVAR CODE
  997. BX6 X4+X1 FORM PARTIAL ECS ARG
  998. BX6 X6+X2 ADD ^$ CHARS CODE, COMPLETE ARG
  999. SA6 TEMPARG STORE TEMPORARILY
  1000. SA3 ECSRESB ECS RESIDENT ARGS ADDRESS
  1001. SA5 ARGADD ECS WORD OFFSET
  1002. IX0 X3+X5 FORM INFO WORD ECS ADDRESS
  1003. SA0 A6 TEMPORARY WORD ADDRESS
  1004. LX5 2*XCODEL MOVE ECS ARG ADDRESS
  1005. BX6 X5 FORM PARTIAL COMMAND WORD
  1006. + WE 1 WRITE ECS ARGUMENT
  1007. RJ ECSPRTY
  1008.  
  1009. SA0 WORK WORK BUFFER
  1010. SA1 AZERBUF ECS ZERO BUFFER
  1011. SX0 X1 ADDRESS
  1012. + RE MAXLONG FOR FUTURE CLEAR ECS BUFFER
  1013. RJ ECSPRTY
  1014.  
  1015. SA0 WORK ZEROED WORK BUFFER
  1016. SA4 ANSABUF START OF ECS BUFFER
  1017. * /--- BLOCK OKWORD 00 000 81/07/08 03.04
  1018. IX0 X3+X4
  1019. + WE MAXLONG CLEAR ECS BUFFER
  1020. RJ ECSPRTY
  1021.  
  1022. EQ PUTCODE FINISH COMMAND WORD
  1023. *
  1024. *
  1025. * /--- BLOCK END 00 000 79/05/12 05.28
  1026. *
  1027. *
  1028. *
  1029. ENDOV
  1030. *
  1031. *
  1032. OVTABLE
  1033. *
  1034. *
  1035. END ANSWIN$
plato/source/plaopl/answin.txt ยท Last modified: 2023/08/05 18:54 by Site Administrator