ANSWER
* /--- FILE TYPE = E
* /--- BLOCK ANSWER 00 000 76/06/17 02.37
IDENT ANSWER
TITLE ANSWER ROUTINES
*
* GET COMMON SYMBOL TABLE
*
CST
*
* /--- BLOCK NOTES 00 000 75/10/14 00.26
* JJSBUF A CONTAINS...
*
* O=STUDENT CRITERION
* 4 FOR EACH KEYWORD SPELLED CORRECTLY IN ORDER
* 3 FOR EACH KEYWORD SPELLED CORRECTLY OUT OF ORDER
* 2 FOR EACH KEYWORD MISSPELLED BUT IN ORDER
* 1 FOR EACH KEYWORD MISSPELLED AND OUT OF ORDER
*
* 1=NUMBER OF AUTHOR KEYWORDS
*
* 2=NUMBER OF STUDENT WORDS (CONTENT MAY EXCEED CONCEPT)
*
* 3=BAD BITS
* 1 SET FOR MISSPELLED WORDS
* 2 SET FOR WORDS OUT OF ORDER
* 3 SET FOR EXTRA WORDS
* 4 SET FOR INCOMPLETE ANS
* 5 SET FOR NOT-IN-VOCABULARY
*
* 5=BITS SET BY SPECS COMMAND (WHICH SEE)
*
* 11+ = JUDGEMENT ON EACH OF THE STUDENT WORDS
* DIVIDED INTO BITS AS FOLLOWS...
* TOP BIT SET FOR MISSPELLING
* NEXT 29 BITS HOLD AUTHOR KEYWORD COUNT
* BOTTOM 30 BITS HOLD AUTHOR WORD TYPE
* 1=SINGLE KEYWORD
* 2=FIRST OF SYNONYMOUS KEYWORD
* 3=REST OF SYNONYMOUS KEYWORDS
* 4=KEYWORD LIST
* 5=KEYWORD LIST
* 6=EXTRA WORD
* 7=EXTRA LIST
*
*
* /--- BLOCK EXTERNALS 00 000 77/07/20 15.15
TITLE ANS-EXTERNALS
*
EXT CONTENT,CFIRST,FONTFLG,CONTAB,CONTEST IN -CONTEN-
EXT CSSPERM IN -CONTEN-
EXT PROCESS
EXT EXIT (FILE LOGICX)
EXT EXECUTX (FILE LOGICX)
EXT OKNOOUT
EXT UNJOIN1,UNJOIN,GOTOX
EXT NGETVAR -GETVAR- CODE INTERPRETER (FILE GETVAR)
EXT ECSPRTY
EXT WORDS CALLED WITH CHAR COUNT (EXEC1)
EXT BOUNDS CALLED WITH WORD COUNT (EXEC1)
EXT ERXBADL (EXEC2)
EXT EQTOLER (FILE GETVAR)
EXT JOINX (FILE EXEC3)
EXT JEXITX (FILE EXEC1)
EXT FFERA (FILE LOGICX)
* /--- BLOCK NEXACTC 00 000 76/08/13 04.58
NEXACTC TITLE NEW EXACTC WITH UNIVERSAL SEPARATOR
*** NEW EXACTC WITH UNIVERSAL TERMINATOR
*
*
ENTRY NEXACTX
NEXACTX NGETVAR ROUNDS TO INTEGER IN X1
PL X1,NEXC1
ZR X1,NEXC1 TREAT -0 AS 0
SX1 -1 IF NEGATIVE, MAKE -1
NEXC1 SX0 1
IX1 X1+X0 ADJUST VALUE TO RANGE FROM 0 TO N-1
SA5 A5 RETRIEVE COMMAND WORD
MX0 48 X0 = MASK TO LIMIT INFO TO 12 BITS
AX5 XCMNDL
BX2 -X0*X5 X2 = NUMBER OF ENTRIES IN TABLE
AX5 12
BX3 -X0*X5 X3 = RELATIVE START OF TABLE
SB2 B5+X3 B2 = ABSOLUTE START OF TABLE
IX3 X1-X2 SEE IF NUMBER IN BOUNDS
NG X3,NEXC2 IF OK
SX1 X2-1 ELSE SET FOR LAST ENTRY
NEXC2 LX1 59 TOP BIT 0/1 FOR UPPER/LOWER
SB3 X1
SA3 B2+B3 X2 = TABLE WORD
MX0 30
PL X1,NEXC3 UPPER OR LOWER
LX3 30
NEXC3 BX3 X0*X3 CLEAR BOTTOM OF WORD
LX3 12 GET RELATIVE START OF TEXT
SA2 B5+X3 X2 = 1ST CHARACTERS OF AUTHORS ANSWER
BX3 X0*X3 CLEAR LOWER PORTION OF WORD
LX3 12
SX1 X3 NUMBER OF AUTHOR CHARACTERS
EQ EXACTER GO TO COMMON PROCESS
* /--- BLOCK EXACT 00 000 74/10/21 21.31
TITLE EXACT
* EXACT STRING MATCH JUDGING ROUTINE.
*
*
ENTRY EXACTCX THE CONDITIONAL EXACT COMMAND
*
EXACTCX NGETVAR ROUNDS TO INTEGER IN X1
PL X1,EXC1
ZR X1,EXC1 TREAT -0 AS 0
SX1 -1 IF NEGATIVE, MAKE -1
EXC1 SX0 1
IX1 X1+X0 ADJUST VALUE TO RANGE FROM 0 TO N-1
SA5 A5 RETRIEVE COMMAND WORD
MX0 48 X0 = MASK TO LIMIT INFO TO 12 BITS
AX5 XCMNDL
BX2 -X0*X5 X2 = NUMBER OF ENTRIES IN TABLE
AX5 12
BX3 -X0*X5 X3 = RELATIVE START OF TABLE
SB2 B5+X3 B2 = ABSOLUTE START OF TABLE
IX3 X1-X2 SEE IF NUMBER IN BOUNDS
NG X3,EXC2 JUMP IF OK
SX1 X2-1 ELSE SET FOR LAST ENTRY
EXC2 LX1 59 TOP BIT 0/1 FOR UPPER/LOWER
SB3 X1
SA3 B2-B3 X2 = TABLE WORD
MX0 30
PL X1,EXC3 UPPER OR LOWER
LX3 30
EXC3 BX3 X0*X3 CLEAR BOTTOM OF WORD
LX3 12 GET RELATIVE START OF TEXT
SA2 B5+X3 X2 = 1ST CHARACTERS OF AUTHORS ANSWER
BX3 X0*X3
LX3 6 GET SHIFT TO FIRST CHARACTERS
SB2 X3
LX2 X2,B2 SHIFT TO THE FIRST CHARACTER
BX3 X0*X3
LX3 4 GET CHARACTERS IN REMAINING WORDS
SB2 X3 GET CHARACTERS IN FIRST WORD
BX3 X0*X3
LX3 8 GET COUNT IN REMAINING WORDS
SX1 X3+B2 GET TOTAL AMOUNT OF CHARACTERS
EQ EXACT0
*
*
ENTRY EXACTX
*
EXACTX MX0 18 X0 = MASK TO EXTRACT 18 BITS
LX5 18
BX1 X0*X5
LX1 18 X1 = AUTHOR CHARACTER COUNT
LX0 18
BX2 X0*X5 X2 = INDEX TO START OF INFO
SA2 B5+X2 A2 = AUTHOR WORD INDEX
* /--- BLOCK EXACTER 00 000 76/10/01 03.59
*
*
* -EXACTV- ENTRY POINT
*
EXACTER SB2 10 B2 = CHARS LEFT IN WORD
*
* AT -EXACT0- THE FOLLOWING REGISTERS SHOULD HOLD
*
* X1 = TOTAL AUTHOR CHARACTER COUNT
* A2 = ADDRESS OF AUTHOR CHARACTERS
* X2 = FIRST AUTHOR CHARACTERS (LEFT JUSTIFIED)
* B2 = COUNT OF CHARACTERS IN FIRST AUTHOR WORD
*
EXACT0 SA3 TANSCNT INCREMENT ANSCNT
SX7 X3+1
SA7 A3
MX0 -6 X0 = MASK TO EXTRACT 6 BITS
SA3 TJCOUNT X3 = STUDENT CHARACTER COUNT
SB3 X3 B3 = CHAR END TEST
IX6 X1-X3 X6 = DIFFERENCE IN COUNTS
NG X6,PROCESS --- EXIT IF MORE STUDENT CHARS
ZR X3,EXACT2 JUMP IF NO STUDENT CHARS
SB1 1
SA1 JUDGE-1 A1 = STUDENT CHAR INDEX
*
EXACT1 LX2 6
BX3 -X0*X2
SA1 A1+B1 X1 = NEXT STUDENT CHAR
BX4 X1-X3
NZ X4,PROCESS --- EXIT IF NO MATCH
SB2 B2-B1 DECREMENT CHARS/WORD SWITCH
SB3 B3-B1 DECREMENT CHAR END TEST
ZR B3,EXACT2 JUMP IF ALL ACCOUNTED FOR
NZ B2,EXACT1
SA2 A2+1 X2 = NEXT AUTHOR WORD
SB2 10
EQ EXACT1
*
EXACT2 ZR X6,EXACTOK OK IF COUNTS ARE EQUAL
NZ B2,EXACT3
SA2 A2+1 LOAD NEXT AUTHOR WORD
EXACT3 LX2 6 GET NEXT AUTHOR CHAR
BX3 -X0*X2
NZ X3,PROCESS --- EXIT IF NOT A ZERO CHAR
*
EXACTOK SB7 XANSC SET TO ANS-C
SX6 -1
SA6 TJUDGED SET JUDGMENT=OK
EQ PROCESS --- EXIT TO DO ANS-C
* /--- BLOCK EXACTV 00 000 78/12/31 02.43
TITLE EXACTV
* -EXACTV- (CODE=136)
*
* EXACT MATCH AGAINST CHARACTER STRING STORED
* IN TUTOR VARIABLES. 1ST TAG ENTRY SPECIFIES
* THE STARTING VARIABLE AND THE 2ND THE NUMBER
* OF CHARACTERS.
*
*
ENTRY EXACTVX
*
EXACTVX NGETVAR A1 = STARTING ADDRESS
SX6 A1 SAVE ADDRESS
SA6 EXVSAVE
BX6 X1
SA6 EXVVAL SAVE VALUE IN CASE LITERAL
SA5 A5 RETRIEVE ORIGINAL COMMAND WORD
LX5 XCODEL
NGETVAR X1 = NUMBER OF CHARACTERS
SX1 X1+0 TO CATCH SOME WEIRD BIG NUMBERS
NG X1,ERXBADL --- ERROR EXIT IF NEGATIVE
* EXECERR USES X1
SX2 X1-11 SEE IF ONLY 1 WORD (10 CHARS)
PL X2,EXVX1
SA0 EXVVAL SET ADDRESS
EQ EXVX2
*
EXVX1 SA2 EXVSAVE GET ADDRESS FOR BOUNDS CHECK
SA0 X2
RJ WORDS BOUNDS CHECK--ERRORS DO NOT RETURN
*
EXVX2 SA2 A0 A2 = STARTING ADDRESS
EQ EXACTER --- NOW TREAT LIKE EXACT
*
*
ENTRY EXVSAVE
EXVSAVE BSS 1
EXVVAL BSS 1 VALUE SAVED FOR LITERALS
* /--- BLOCK ANSKEY 00 000 76/04/18 04.44
TITLE ANSKEY MACHINERY
* FOR NOW, ONLY BLANK -ANS- COMMAND. MUST BE FIRST
* JUDGING COMMAND AFTER ARROW, AT WHICH POINT IT SETS
* THE -ANS- KEY BIT IN NEXTKEYS, SIMILAR TO -JKEY ANS-.
* AT JUDGING TIME IT TERMINATES JUDGING IF THE KEY IS ANS.
*
EXT UNITAX1
ENTRY PANSKEY
ENTRY ANSKEYX
*
PANSKEY SX7 1
LX7 59-ANS+FUNKEY
SA1 TJKEYS
BX7 X1+X7 MERGE ANS BIT INTO NXTKEYS
SA7 A1
EQ UNITAX1
*
ANSKEYX SA1 TANSCNT INCREMENT ANSCNT
SX7 X1+1
SA7 A1
SA1 KEY CHECK FOR ANS KEY
SX1 X1-ANS
NZ X1,PROCESS SKIP IF NOT ANS KEY
SB7 XANSC IF ANS KEY, END JUDGING
MX7 59
SA7 TJUDGED SET TO OK JUDGEMENT
EQ PROCESS
*
* /--- BLOCK ANSV/WRNGV 00 000 74/07/09 11.17
TITLE ANSV/WRONGV
*
* NUMERICAL ANSWER IS SPECIFIED BY VARIABLE
* (EXPRESSION) AND TOLERANCE (ABSOLUTE OR PERCENT)
*
*
ENTRY WRONGVX
*
WRONGVX SX7 0
SA7 ANSVJ SET FOR NO (SPECIFIC)
EQ ANSVX1
*
*
ENTRY ANSVX
*
ANSVX SX7 -1
SA7 ANSVJ SET FOR OK
ANSVX1 EXEC ANS1,ANSVOV
*
ENTRY ANSVJ
ANSVJ BSS 1
*
*
TITLE OK (NO, IGNORE, REGSTATE)
* OK/NO/IGNORE/REGSTATE (CODE=127)
*
EXT JIGNRX
ENTRY OKX
OKX SB7 XANSC SET TO ANS-CONTINGENCY
* CHECK FOR -REGSTATE- COMMAND.
AX5 XCMNDL SHIFT OUT COMMAND
SX6 X5-4 4 = -REGSTATE- CODE
ZR X6,PROCESS IF -REGSTATE- COMMAND
* INCREMENT *ANSCNT* FOR -OK-, -NO-, AND -IGNORE-.
SA1 TANSCNT
SX7 X1+1
SA7 A1
* CHECK FOR -NO- AND -IGNORE- COMMANDS.
SX6 X5-2
ZR X6,NOX IF -NO- COMMAND
PL X6,JIGNRX IF -IGNORE- COMMAND
* PROCESS -OK- COMMAND.
SA6 TJUDGED SET JUDGMENT=OK
EQ NOXC
* PROCESS -NO- COMMAND - JUDGEMENT = NO.
NOX SX6 1
SA6 TJUDGED SET JUDGMENT=NO (UNIVERSAL)
NOXC RJ CRISET SET ALL TRUTH FLAGS
SA1 A0 SEE IF CRITERION ZERO (NOTHING MATCHED)
NZ X1,PROCESS THEN LEAVE FLAG IN ERROR
SX6 -1 ELSE SET FLAG TO NO ERROR
SA6 TANSOK THUS AUTHOR CAN CHECK FOR A PARTIAL
EQ PROCESS MATCH TO A PREVIOUS ANSWER
*
* /--- BLOCK WORDGET 00 000 76/06/29 01.51
TITLE WORDGET
*
* WORDGET CONVERTS THE STUDENT ANSWER INTO A LIST
* OF CONTENT WORDS STORED IN JJSBUF.
*
* JJXY HOLDS CHAR COUNT INFO AS FOLLOWS--
* 15 BITS...STARTING INDEX IN JUDGE BUFFER
* 15 BITS...ENDING INDEX IN JUDGE BUFFER
* 15 BITS...STARTING COUNT IN ORIGINAL INPUT BUFFER
* 15 BITS...ENDING COUNT IN ORIGINAL INPUT BUFFER
*
*
ENTRY WORDGET
*
WORDGET EQ *
*
SA3 TANSCNT INCREMENT ANSWER COUNTER
SX7 X3+1
SA7 A3
*
SA1 JJFBUF SEE IF ALREADY -CONTENTED-
NZ X1,WORDGET
MX6 1 SET FLAG
SA6 A1
*
BX6 X5 SAVE X5 (CANNOT JUST SA5 A5...ANSWERC)
SA6 WGSAVE
*
SA1 TJSYM GET NAME OF USERS JUDGING SYMBOLS
SA2 CONTAB GET NAME OF CURRENT SET IN CM
BX3 X1-X2
ZR X3,WDGT3 SKIP LOADING IF SET ALREADY IN
RJ GETJSYM LOAD USERS (OR SYSTEM) JUDGING SYMBOLS
*
WDGT3 MX6 0
SA6 TWCOUNT INITIALIZE TO ZERO WORDS
SA6 JJXCON SET TO NOT CONCEPTED
SA6 FONTFLG SET TO NO FONT YET
SA6 CSSPERM SET TO STANDARD LEVEL (NO SUP/SUB)
SA1 JJPREJ INITIALIZE A1 TO CHARACTER STRING ADRESS-1
*
* /--- BLOCK WORDGET 00 000 76/03/03 11.38
*
*
WDLOOP RJ CONTENT GET NEXT WORD
ZR X7,WDDN SEE IF ANYTHING THERE
*
SA2 TWCOUNT GET NUMBER OF WORDS
SX3 X2-JJSENB+1 TEST FOR BUFFER OVERFLOW
* THE +1 THEN ALLOWS FOR THE SPECIAL CASE OF
* HAVING TO GIVE ONE EXTRA MARK-UP FOR
* A MISSING WORD AT END OF ANSWER
*
PL X3,AWWERR
SA6 JJSBUF+X2 STORE CONTENT PART OF WORD
SA7 JJHBUF+X2 STORE HASH PART OF WORD
*
SA3 CFIRST GET ADDRESS OF FIRST CHARACTER IN WORD
SB1 JUDGE
SB2 X3
SB2 B2-B1 GET RELATIVE ADDRESS OF FIRST CHAR
SA3 JJCHAR+B2 GET COUNT IN ORIGINAL BUFFER
SX6 B2
LX6 45
LX3 15
BX6 X6+X3 NOW HAVE FIRST CHAR TAKEN CARE OF
*
SB2 A0-B1 GET RELATIVE ADDRESS OF CURRENT LAST CHARAC
SA3 JJCHAR+B2 GET COUNT IN ORIGINAL CHAR STRING
SX4 B2
LX4 30
BX6 X6+X4
BX6 X6+X3
SA6 JJXY+X2 STORE AWAY PACKED INFO
*
SX7 X2+1 INCREMENT WORD COUNT
SA7 A2 STORE INTO -TWCOUNT-
*
WDDN NZ X1,WDLOOP LOOP UNTIL DONE
SA3 WGSAVE RESTORE X5
BX5 X3
EQ WORDGET
*
WGSAVE BSS 1 SAVE X5 OVER CALLS TO CONTENT
*
*
*
* IF STUDENT TYPES IN OVER JJSENB-1 ENTITIES...GIVE -NO- EXIT
AWWERR SB7 XANSC SET TO ANSWER-CONTINGENCY
SX6 -2
SA6 TANSCNT COUNT OF ANSWER COMMANDS TO -1 (ONLY PLACE)
SX6 1
SA6 TJUDGED SET TO UNIVERSAL -NO-
EQ ANSMARK AND STOP JUDGING
* /--- BLOCK GETJSYM 00 000 78/02/13 17.27
TITLE GETJSYM
*
* GET THE USERS (OR SYSTEMS) JUDGING SYMBOL SET IN CM
*
ENTRY GETJSYM USED BY -WORDGET,COMPARE-
GETJSYM EQ *
SA1 TJSYM GET NAME OF USERS SET
SA2 CONTEST GET NAME OF SYSTEM SET
BX3 X1-X2
ZR X3,GETSYM5 SPECIAL IF SYSTEM SET
*
SX2 JSYMNUM SEE IF USER HAS OWN JUDGING SYMBOL TABLE
SA3 ECSULOC GET ECS ADDRESS OF -ULOC- TABLE
IX0 X2+X3 ADD DUMMY UNIT NUMBER PLUS BIAS
SA0 TJSYM WORK BUFFER
+ RE 1 READ IN
RJ ECSPRTY
SA1 A0 READ UP
ZR X1,GETSYM5 IF ZERO, SET UP FOR SYSTEM TABLE
AX1 60-ULOC1 CLEAR OFF ALL BUT ECS BIAS BITS
SA4 ECSLES GET ECS ADDRESS OF LESSON
IX0 X4+X1 GET ABSOLUTE ADDRESS OF USER TABLES
EQ GETSYM7
*
GETSYM5 SA1 ACONTAB GET ECS ADDRESS OF SYSTEM SET
BX0 X1
*
GETSYM7 SA0 CONTAB GET CM ADDRESS OF SET
+ RE 129 READ SET IN
RJ ECSPRTY
SA1 A0 MAKE SURE USERS FLAG HAS PROPER NAME
BX6 X1
SA6 TJSYM
EQ GETJSYM
* /--- BLOCK ANSEND 00 000 80/08/04 20.52
TITLE ANSEND
*
* 'THIS IS THE ENTRY POINT FOR -UNIT- OR -ARROW-
* COMMANDS THAT ARE ENCOUNTERED IN JUDGE-C.
* 'SWITCH TO ANS-C AND DO ANY SPECS CONTINGENCY.
*
*
ENTRY ANSEND
*
ANSEND CALL ARESET RESTORE SIZE,ROTATE,COLOR
SA1 TBITS SEE IF -ERASEU- BIT SET
LX1 ERSUBIT
NG X1,AERSU
*
SA2 TSPECS GET LAST SPECS
BX0 X2 INTO X0 (FOR ATT1)
*
SX6 1
SA6 TJUDGED SET JUDGMENT=NO (UNIVERSAL)
SB7 XANSC SET TO ANS-C
SX6 -1
SA6 TANSCNT SET ANSCNT TO -1
RJ CRISET
SA4 TSPLOC SEE IF SPECS COMMAND
ZR X4,ANSM1 IF NONE, ON TO MARKUP
ATSPEC MX7 0
SA7 JOIN CLEAR JOIN LIST
SA7 A4 CLEAR SPECS POINTER
SA1 TLVLESS X1 = LV STACK POINTER
ZR X1,UNJOIN1 IF NO LVARS, NO PROBLEM
*
CALL LVLOAD,-1 UNLOAD LOCAL VARIABLES
SA1 TLVLESS RESTORE ARROW LVAR STACK PTR
AX1 18
LX1 18
SA2 AJOIN
AX2 18
BX6 X1+X2
SA6 A1
EQ UNJOIN1 UNJOIN TO SPECS
*
* /--- BLOCK ANSEND 00 000 80/08/04 22.57
*
CRISET EQ * SET ALL TRUTH FLAGS FOR ANSWER
MX6 0 SET -ANSOK- TRUTH FLAG TO FALSE(BAD)
SA6 TANSOK
*
SA0 JJSBUFA SET TO JUDGING BUFFER
*
SA1 A0 SEE IF CRITERION ZERO
ZR X1,AT1
SA1 A0+3 SET CALC TRUTH FLAGS DEPENDENT ON BAD BITS
BX6 X1
SA6 TJFLAGS SET USER FLAG WORD
EQ CRISET
*
AT1 MX6 0 BE SURE ALL FLAGS UNSET
SA6 TJFLAGS
EQ CRISET
*
*
* 'ROUTINE TO RESTORE ARROW ASSOCIATED PARAMETERS
* (ALSO USED BY JUDGE IGNORE AND JUDGE EXIT IN
* FILE EXEC1).
*
*
ENTRY ARESET
*
ARESET EQ *
SA1 TBSIZE RESTORE ARROW SIZE AND ROTATE
SA2 TBROTATE
BX6 X1
BX7 X2
SA6 RSIZE
SA7 ROTATE
EQ ARESET --- EXIT
* /--- BLOCK ANSMARK 00 000 80/08/04 20.53
TITLE ANSMARK
*
* 'THIS IS THE ENTRY POINT FOR ALL JUDGING
* COMMANDS WHEN ENCOUNTERED IN ANS-C.
*
ENTRY ANSMARK
*
*
ANSMARK CALL ARESET RESTORE SIZE,ROTATE,COLOR
SA1 TBITS SEE IF -ERASEU- BIT SET
LX1 ERSUBIT
NG X1,AERSU
SA4 TSPLOC CHECK WHETHER THERE ARE SPECS TO DO
NZ X4,ATSPEC JUMP TO DO SPECS COMMANDS
*
*
ANSM1 SA1 TLVLESS RESTORE LV STACK POINTER
ZR X1,ANSM2
*
SB1 -1 UNLOAD LOCAL VARS
RJ =XLVLOAD
ANSM2 SA1 TBITS
LX1 JUDGBIT
NG X1,JOVER --- JUMP IF JARROW TYPE JUDGING
*
SA1 TJUDGED
ZR X1,ANSOUT EXIT IF -NO- JUDGEMENT (MATCH A WRONG ANS)
NG X1,ATT2 TEST FOR PERFECT ANSWER
*
* NO MARKUP IF A FORMAT ERROR WAS DETECTED BY
* -ANSWERA-/-WRONGA-.
*
SX1 X1-3 ANSWERA ERRORS START AT 3
PL X1,ATT2 --- TERMINATE RIGHT NOW WITH A '7NO'7
*
SA3 TSPECS GET LAST SPECS BITS
LX3 NOMARK SEE IF NO MARKUP BIT SET
NG X3,ANSOUT IF SET, JUST EXIT
*
SA1 JJSBUFA GET CRITERION
ZR X1,ANSOUT IF NONE, NO APPARENT MATCH
*
MX6 0
SA6 TBERRMK
EXEC ANSW1,MARKUP ELSE, BAD ANSWER...GO AND MARK-UP
* OVERLAY DOES NOT RETURN HERE
*
ATT2 SA3 TSPECS GET SPECS BITS
LX3 NOOKNO SEE IF WANT -OK- OUTPUT
NG X3,AOKK
RJ OKNOOUT
AOKK SB1 XNEXTLK CHECK FOR -NEXTNOW- CONTINGENCY
EQ B1,B7,AEXIT JUMP IF NEXTNOW CONTINGENCY
SB5 2 SET TO LEGAL CM ADDRESS
SA5 B5-1 FAKE UP A5/B5 FOR *ANSDAT*
CALL ANSDAT OUTPUT STUDENT DATA
SB7 XSEARCHC SET TO SEARCH-C
SB1 1 B1 = CONSTANT 1
SA0 AJOIN
SB2 JOIN
SB3 JOINLTH
AJRSTR SA1 A0+B3 RESTORE ARROW JOIN STRUCTURE
BX6 X1
SA6 B2+B3
SB3 B3-B1
PL B3,AJRSTR
SA2 TLVLESS RESTORE ARROW LVAR STACK PTR
AX2 18
LX2 18
AX1 18 X1 = ARROW UNIT LVAR STACK PTR
BX6 X1+X2
SA6 A2
AJR01 SA1 TEARROW SEE IF ANY END ARROW UNIT
NZ X1,AEND --- SPECIAL EXIT IF THERE IS
SA1 TIARROW CHECK IF ANY -IARROW- UNIT
SA2 TBITS
LX2 ARRTPBT CHECK ARROW/A
PL X2,AJR1 IF ARROW
* /--- BLOCK ANSMARK 00 000 80/08/04 20.53
SA1 TIARROWA FOR ARROWA
AJR1 ZR X1,AJR2 IF NO IARROW UNIT
*
BX5 X1
LX5 60-12 POSITION UNIT NUMBER
EQ GOTOX
*
AJR2 EQ UNJOIN SEARCH FROM ARROW
*
AERSU CALL NOJBUF DROP ANY JUDGE BUFFER
SA2 TBITS
LX2 FSTEBIT SEE IF FORCE FIRSTERASE IN OPERATION
PL X2,JEXITX (IN FILE EXEC1)
*
CALL CSULOAD NOW START OVER WITH THIS KEY
EQ FFERA (IN FILE LOGICX)
* /--- BLOCK AEND 00 000 78/02/08 00.40
TITLE AEND
*
* 'THIS IS THE PROCESSING WHICH IS DONE WHEN
* THERE IS AN EARROW UNIT. 'IT CORRESPONDS TO HOW
* THINGS WILL BE HANDLED WHEN THERE IS NO SEARCH-C.
* *** NOTE *** THE CODE FOR UNJOINING HAS BASICALLY
* BEEN COPIED FROM FILE EXEC1.--'R'W'B 4/6/76
*
*
AEND SA1 INHIBS
LX1 ADVSHIF
PL X1,AENDX JUMP IF ADVANCE NOT INHIBITED
SB7 XAOKC CHANGE TO ARROW OK-C
EQ EXIT --- EXIT FROM PROCESSING
*
*
* 'PROCESSING RESUMES HERE WHEN NEXT KEY PRESSED
* IN ARROW OK-C IN FILE LOGICX.
*
*
ENTRY AENDX
*
AENDX SA1 TBARROW CHECK IF AN ARROW TO ERASE
ZR X1,AENDX1 JUMP IF NONE
MX6 0
SA6 A1 CLEAR OUT ARROW
SA3 INHIBS READ INHIBIT FLAGS
LX3 ARRSHIF SHIFT FOR TEST
NG X3,AENDX1 JUMP IF NO ARROW TO ERASE
OUTCODE WFCODE OUTPUT WHERE
* SX1 1 ARROW
* OUTPUT ERSCODE ERASE 1 CHARACTER
OUTARR E ERASE THE ARROW
*
AENDX1 SA1 JOIN GET JOIN COUNT
SX6 X1-1 SUBTRACT ONE
SA6 A1 AND PUT BACK
SA4 JOINL+X6 GET LIST WORD
LX4 12 ELIMINATE RARGS CONDITION
AX4 12
*
* UNJOIN USING CONTENTS OF X4
*
MX0 48
BX6 -X0*X4
SA6 CBIAS COMMAND BIAS
AX4 12
BX6 X4 LESSON AND UNIT NUMBERS
SA1 ILESUN LOAD OLD POINTERS
BX5 X6 PUT NEW POINTERS INTO X5 FOR GETUNIT CALL
SA6 A1 STORE NEW ONES
CALL GETUNIT GET UNIT
CALL LVINCSP,-1 POP LOCAL VAR STACK
CALL LVLOAD,1 LOAD LOCAL VARS
SA4 CBIAS
SB3 X4
SA5 B5-B3 SET COMMAND POINTER
*
* X5 NOW HOLDS THE ARROW (OR JARROW) COMMAND
*
MX0 -XSPTRL
AX5 XCMNDL
BX1 -X0*X5 EXTRACT COMMAND BIAS
SB2 X1 OFFSET TO ONE BEFORE DESIRED
SA5 B5-B2 RESET COMMAND POINTER
SB7 XUNITC SET TO UNIT-C
SA1 TEARROW UNIT NUMBER FOR END OF ARROW
ZR X1,PROCESS --- RESUME PROCESSING IF NONE
BX5 X1 PUT INTO X5
LX5 -12 POSITION AT TOP
* /--- BLOCK AEND 00 000 78/02/08 00.40
EQ JOINX --- PROCESS LIKE A JOIN
*
*
CBIAS BSS 1
* /--- BLOCK ANSOUT 00 000 78/01/07 18.55
*
*
ENTRY ANSOUT FOR USE BY ANSW1,ONMARK
*
ANSOUT SA1 TSPECS GET SPECS BITS
LX1 NOOKNO GET NO -OK- -NO- OUTPUT BIT
NG X1,ANSOUT1
RJ OKNOOUT PUT OUT THE -OK- OR -NO-
*
ANSOUT1 SA1 TBITS
LX1 QUITBIT CHECK IF -JUDGE QUIT-
PL X1,AEXIT
MX6 1
BX6 -X6*X1 CLEAR -QUIT- BIT
LX6 -QUITBIT
SA6 A1
EQ AOKK GO TO INITIATE SEARCH-C
*
*
* 'FINAL EXIT FOR NEXTNOW-C AND INCORRECT ANSWERS.
*
AEXIT SX6 B7 FINAL EXIT FROM JUDGING
SA6 NCTYPE
CALL NOJBUF NO JUDGE BUFFER
CALL CSULOAD UNLOAD ANY COMMON AND STORAGE TO ECS
SB7 -1 FLAG NOT EXECUTING LESSON
CALL ANSDAT
EQ EXECUTX EXIT
*
*
* 'WHEN JUDGING IS OVER IN UNIT-C (NO ARROW) CASE,
* GO BACK TO NORMAL PROCESSING.
* 'THE JUDGE EXIT/IGNORE TYPE COMMANDS ALSO EXIT
* HERE FROM FILE EXEC1.
*
*
ENTRY JOVER
*
JOVER SA1 AJOIN RESTORE SAVED JOIN STRUCTURE
SB2 X1 B2 = JOIN COUNT
SX6 X1 BOTTOM 18 BITS OF AJOIN=JSP
SA6 JOIN
AX1 18 X1 = ARROW LVAR STACK POINTER
SA2 TLVLESS RESET LVAR STACK POINTER
AX2 18
LX2 18
BX7 X2+X1
SA7 A2
SB1 1 B1 = CONSTANT 1
JRES SA1 A1+B1
BX6 X1
SA6 A6+B1
SB2 B2-B1
NZ B2,JRES
EQ AENDX1 --- DO NON-SEARCH END-UP
* /--- BLOCK CKWORD 00 000 78/09/10 23.33
TITLE WORD-CHECK
*
* THIS ROUTINE MATCHES THE STUDENT WORD WITH THE AUTHOR
* WORD. IT IS USED BY ANSWER/WRONG/ANSWERC/MATCH/
* CONCEPT/MISCON/COMPARE.
*
* EXIT WITH X6=0....PERFECT MATCH
* EXIT WITH X6=-1...NO MATCH
* EXIT WITH X6=+N...SPELLING ERROR (THE SMALLER N THE BETTER)
* SPECIAL VALUES... 1 = CAPITALIZATION ERROR
* ... 2 = AUTHOR CAP, STUDENT SMALL
* ... 3 = CLOSE NUMBERS
* ... ALL OTHER NUMBERS START ABOUT 80+
*
* A0,X0,B1,B2,B3,A5,A1-X1,A2-X2,A3-X3,A4-X4 MUST
* BE AT EXIT AS AT ENTRY
* A1-X1,A2-X2 HOLDS STUDENT WORD
* A3-X3,A4-X4 HOLDS AUTHOR WORD
*
*
* ***NOTE*** THE FIRST 4 OR 5 LINES ALSO EXIST IN
* THE CONCEPT JUDGING ROUTINE FOR REASONS OF SPEED.
* IF THE FIRST LINES ARE CHANGED...THEY SHOULD ALSO
* BE CHANGED THERE.
* /--- BLOCK CKWORD 00 000 78/08/28 15.43
*
HASHBTS EQU 27 TOP 27 BITS CAN BE CONSIDERED A HASH
SYNBITS EQU 11 BITS NEEDED FOR BASE SYNONYM NUMBER
*
DNO SX6 -1 SET TO NO MATCH
*
ENTRY CKWORDX
CKWORDX EQ *
BX5 X1-X3 SEE IF STUDENT AUTHOR WORDS AGREE
NZ X5,DSP
MX6 HASHBTS
BX6 X6*X4
BX6 X6-X2
ZR X6,CKWORDX PERFECT MATCH, EXIT X6=0
*
MX7 HASHBTS-1 SEE IF ONLY CAPATILAZATION DIFFERENCE
BX6 X7*X6
NZ X6,DSP
*
BX5 X4 GET AUTHOR WORD
LX5 HASHBTS-1 GET CAP BIT
NG X5,CKWDC
SX6 1 SET CAPITALIZATION ERROR
EQ CKWORDX
CKWDC SX6 2 SET AUTHOR CAP, STUDENT SMALL ERROR
EQ CKWORDX
*
DSP BX6 X4 SEE IF THIS IS A NUMBER
LX6 1
NG X6,MCKNUM GO TO NUMBER CHECKER
*
MX6 8 SEE IF WITHIN RANGE OF AGREEMENT
BX7 -X6*X5 GET DIFFERENCE BITS
CX7 X7 COUNT THEM UP
SX5 X7-6 ALLOW UP TO 5 BITS DIFFERENCE
PL X5,DNO OVER THAT IS DIFFERENT WORD
*
BX5 X1 NOW GET DIFFERENCE IN VOWEL COUNT
BX6 X3
AX5 56
AX6 56
IX7 X5-X6
PL X7,CND0 GUARANTEE POSITIVE
BX7 -X7
CND0 SX6 X7-2 ALLOW ONLY 1 OFF IN VOWELS
PL X6,DNO
*
LX7 1 DOUBLE VOWEL DIFFERENCE FOR START OF -FIX-
*
MX6 4 NOW GET CONSONANT DIFFERENCE
BX5 -X6*X1
BX6 -X6*X3
AX5 52
AX6 52
IX5 X5-X6
PL X5,CND1 GUARANTEE POSITIVE
BX5 -X5
CND1 SX6 X5-3
PL X6,DNO ALLOW ONLY 2 CONSONANTS OFF
IX7 X7+X5 ADD CONSONANCE DIFFERENCE INTO -FIX-
* /--- BLOCK CKWORD 00 000 78/08/25 16.26
*
BX6 X2-X4 GET FIRST CHARS OF STUDENT - AUTHOR
LX6 17
AX6 54
NZ X6,CND2
NG X6,CND2
SX7 X7-4 SUB 4
*
*
CND2 MX6 23 GET CONSONANT/VOWEL COUNT
BX5 -X6*X2
BX6 -X6*X4
AX5 34
AX6 34
IX6 X5-X6
PL X6,CND3
BX6 -X6
CND3 LX6 1 DOUBLE ANY DIFFERENCE IN C/V
*
IX7 X7+X6 AND ADD TO -FIX-
*
MX6 8 GET CONFLICT COUNT AGAIN
BX5 X1-X3
BX5 -X6*X5
CX5 X5
IX6 X5+X7 ADD -FIX- TO CONFLICT COUNT
SX6 X6-6
PL X6,DNO ALLOW ONLY OFF BY 5
*
LX5 1 DOUBLE NUMBER OF CONFLICT BITS
IX7 X5+X7 ADD -FIX- TO 2 * CONFLICT
*
SX5 X7+4 SEE IF PERFECT UP TO HERE
ZR X5,CND4 HENCE, ONLY SUP/SUB/DIACRIT ERROR
*
MX6 8
BX5 -X6*X1 GET STUDENT BITS
CX5 X5 GET COUNT
SX6 X5-3
NG X6,DNO MUST HAVE AT LEAST 3 BITS
*
IX6 X5-X7 STUDENT BITS>=(2CONFLICT+FIX)
NG X6,DNO
*
MX6 8 GET NUMBER OF AUTHOR BITS
BX5 -X6*X3
CX5 X5
SX6 X5-4
NG X6,DNO MUST HAVE AT LEAST 4
*
IX6 X5-X7 AUTHOR BITS>=(2CONFLICT+FIX)
NG X6,DNO
*
CND4 SX5 A1 SAVE A1
SA1 TSPECS GET SPECS NOSPELL BIT
BX6 X1
SA1 X5 RESTORE A1-X1
LX6 NOSPELL
NG X6,DNO
*
* /--- BLOCK CKWORD 00 000 78/08/29 00.43
*
SX6 X7+100 KEEP THE LOW NUMBERS FOR
* SPECIAL THINGS
*
* SEARCH THROUGH A LIST OF COMMON WORDS. IF A
* PERFECT MATCH TO ANY OF THESE WORDS, THEN DO
* NOT DO ANY SPELLING CHECKS BECAUSE THE WORD
* IS A COMMON WORD SPELLED CORRECTLY.
*
* SAVE REGISTERS
SX7 A0
SA7 CKSAV
BX7 X0
SA7 CKSAV+1
SX7 A1
SA7 CKSAV+2
SX7 A2
SA7 CKSAV+3
SX7 A3
SA7 CKSAV+4
*
SA0 CKABUF SET A0 POINTER
BX7 X1-X2 PREPARE ONE WORD CONCEPT WORD
MX5 60-SYNBITS
BX7 X5*X7
SA2 XSIMP GET ECS ADDRESS OF COMMON WORD BUFFER
BX0 X2 WORDS ARE IN LESSON -SYSLIB-
+ RE 9 READ IN HEADER AND VOWEL TABLE
RJ ECSPRTY
SA2 A0 BRING UP WORD
ZR X2,VONWD IF ZERO, THEN NO WORDS THERE
AX1 56 GET VOWEL COUNT FROM STUDENT WORD
SA1 CKABUF+1+X1 GET PROPER TABLE ENTRY
SX2 X1 GET RELATIVE START OF WORDS OF THIS VOWEL N
IX3 X0+X2 MAKE ABSOLUTE
AX1 30 GET NUMBER OF WORDS OF THIS VOWEL COUNT
IX1 X3+X1 GET ABSOLUTE END OF SEARCH
SX2 1
IX1 X1+X2 ADD 1
*
IX0 X1-X3 GET COUNT OF WORDS
*
CKLWDS AX0 1 BINARY SEARCH
ZR X0,VONWD SEE IF LIST EXHAUSTED
IX0 X3+X0 GET WORD
+ RE 1
RJ ECSPRTY
SA2 A0 BRING WORD UP
BX2 X2*X5 CLEAR OFF BOTTOM BITS
IX2 X7-X2
ZR X2,VDIFFW IF FIND, THEN NOT A MISSPELLING
PL X2,CKLPL
BX1 X0 RESET BOTTOM OF LIST
IX0 X1-X3
EQ CKLWDS
CKLPL BX3 X0 RESET TOP
IX0 X1-X3
EQ CKLWDS
*
VDIFFW SX6 -1 SET TO DIFFERENT WORD
VONWD SA3 CKSAV RESTORE DESTROYED REGISTERS
SA0 X3
SA3 CKSAV+1
BX0 X3
SA3 CKSAV+2
SA1 X3
SA3 CKSAV+3
SA2 X3
SA3 CKSAV+4
SA3 X3
EQ CKWORDX
*
CKSAV BSS 5 HOLDS SAVED REGISTERS
CKABUF BSS 9 READIN BUF FOR VOCAB DIRECTORY
* /--- BLOCK CKWORD 00 000 78/08/28 14.53
*
*
MCKNUM LX6 1 ---NUMBER CHECKER---
MX7 1
BX6 X7*X6 GET SIGN BIT OF NUMBER
BX6 X3+X6 NOW HAVE AUTHOR NUMBER RESTORED
*
BX5 X2
LX5 1
PL X5,DNO NOT A NUMBER
LX5 1
BX5 X7*X5
BX5 X1+X5 NOW HAVE STUDENT NUMBER RESTORED
*
FX7 X5-X6 GET DIFFERENCE
PL X7,MCKN1 MAKE IT ABSOLUTE
BX7 -X7
MCKN1 SX5 A1 SAVE REGISTER -A1-
SA1 EQTOLER GET ABSOLUTE TOLERANCE
RX1 X7-X1 AND SEE IF DIFFERENCE AS SMALL
NG X1,MNUMOK
*
PL X6,MCKN2 MAKE AUTHOR NUMBER ABSOLUTE
BX6 -X6
MCKN2 SA1 TSPECS GET SPECS BITS
LX1 TOLER SEE IF AUTHOR WANTS ONE PERCENT TOLERANCE
PL X1,MCKDIF
SA1 MDHUN GET ONE PERCENT
FX1 X1*X6 ONE PERCENT OF AUTHOR NUMBER
FX1 X1-X7 SUBTRACT DIFFERENCE
PL X1,MNUMOK OK IF WITHIN ONE PERCENT
*
MCKDIF SA1 TSPECS GET SPECS BITS
LX1 NODIFF SEE IF AUTHOR DOES NOT WANT DIFFERENCE
NG X1,MNUMNO MARKED LIKE SPELLING ERROR
SA1 MDTEN GET TEN PERCENT
FX1 X1*X6 GET TEN PERCENT OF AUTHOR NUMBER
FX1 X1-X7 SUBTRACT DIFFERENCE
NG X1,MNUMNO
SX6 3 SET TO A LOW MISSPELLING
SA1 X5 RESTORE REGISTER -A1- -X1-
EQ CKWORDX
*
MNUMOK SA1 X5 RESTORE -A1- -X1-;
MX6 0 SET TO PERFECT MATCH
EQ CKWORDX
*
MNUMNO SA1 X5 RESTORE -A1- -X1-
EQ DNO SET TO NO MATCH AND EXIT
*
MDHUN DATA 0.01 ONE PERCENT
MDTEN DATA 0.1 TEN PERCENT
* /--- BLOCK OVERLAYS 00 000 76/05/04 01.35
TITLE OVERLAYS
*
* 'EXECUTE COMMANDS IN ANS1 OVERLAY.
*
*
ENTRY OPENX
OPENX EXEC ANS1,OPENOV -OPEN- COMMAND
*
*
ENTRY CNCEPTX
CNCEPTX EXEC ANS1,CONCPOV -CONCEPT- COMMAND
*
*
ENTRY CLOSEX
CLOSEX EXEC ANS1,CLOSEOV -CLOSE- COMMAND
*
*
ENTRY LOADAX
LOADAX EXEC ANS1,LOADAOV -LOADA- COMMAND
*
*
ENTRY STORENX
STORENX EXEC ANS1,STRNOV -STOREN- COMMAND
*
*
ENTRY SPECX
SPECX EXEC ANS1,SPECXOV -SPECS- COMMAND
*
*
ENTRY GETWDX
GETWDX EXEC ANS1,GETWDOV -GETWORD- COMMAND
*
*
ENTRY GETMKX
GETMKX EXEC ANS1,GETMKOV -GETMARK- COMMAND
*
*
ENTRY GETLOCX
GETLOCX EXEC ANS1,GETLCOV -GETLOC- COMMAND
*
*
ENTRY COMPX
COMPX EXEC ANSW1,COMPOV -COMPARE- COMMAND
*
*
END