Prev: 29889 Up: Map Next: 30188
30068: Inglish: Prepare The Clause
Prepares a clause in the parser workspace before the grammar is tried.
InglishPrepareTheClause 30068 DEFB 0,0,0,0,0,0
30074 DEFB 0
30075 DEFB 0,0,0,0,0,0,0,0
30083 DEFB 0,0
This entry point is used by the routine at TurnReadAndTokeniseTheCommand.
InglishPrepareTheClause_0 30085 LD IY,47560 Point IY at the parser workspace.
30089 XOR A Clear the conjunction count.
This entry point is used by the routine at Command_FollowTheGrammarFlag.
InglishPrepareTheClause_1 30090 LD (46875),A Write A to 46875.
30093 CALL Inglish_ClearTheMatcherPhase_0 Call Inglish_ClearTheMatcherPhase_0 to clear the matcher phase.
30096 LD (46854),A Write 0 to 46854.
30099 LD E,255 The class marker starts at 255.
30101 LD A,(46874) Read the matcher path flag.
30104 AND A See whether the matcher path flag is zero.
30105 LD D,160 Class 160 is used when a game is already in progress.
30107 JP NZ,InglishMatchOneWord_MarkTheClauseByte If A is not zero jump to InglishMatchOneWord_MarkTheClauseByte.
30110 LD D,192 Class 192 is used for a fresh game.
This entry point is used by the routines at InglishMatchOneWord and Command_MatchASpecialKey.
InglishPrepareTheClause_2 30112 XOR A Write 0 to 30074.
30113 LD (30074),A
30116 LD A,E Take the class marker 255 into A.
30117 OR 199 Merge in 199.
30119 LD E,A Keep the merged class flags in E.
Test the matcher phase.
30120 LD A,(46873) Jump to InglishPrepareTheClause_BlankAParserSlot if *46873 is not 2.
30123 CP 2
30125 JR NZ,InglishPrepareTheClause_BlankAParserSlot
30127 RES 1,E Clear bit 1.
InglishPrepareTheClause_BlankAParserSlot 30129 CALL Inglish_BlankAParserSlot Call Inglish_BlankAParserSlot to blank a parser slot.
InglishPrepareTheClause_3 30132 LD HL,30075 Write 0 to 10 bytes, starting from 30075 with Blanker.
30135 LD B,10
30137 CALL Blanker
30140 SET 4,E Set bit 4.
This entry point is used by the routine at InglishTryTheNextClass.
InglishPrepareTheClause_4 30142 CALL Inglish_ReadTheNextGrammarByte Call Inglish_ReadTheNextGrammarByte to read the next grammar byte.
30145 PUSH DE Save DE.
30146 RRCA Turn the grammar byte into a jump-table offset.
30147 RRCA
30148 RRCA
30149 LD E,A Keep the jump-table offset in E.
30150 LD D,0 The grammar-table offset's high byte is zero.
30152 LD HL,30162 Point HL at entry DE of JumpTable.
30155 ADD HL,DE
30156 LD E,(HL) Read the low byte of the handler.
30157 INC HL Step to the high byte of the handler.
30158 LD D,(HL) Read the high byte of the handler.
30159 EX DE,HL Point HL at the handler.
30160 POP DE Jump to the action handler the caller addressed.
30161 JP (HL)
JumpTable 30162 DEFW InglishAcceptTheClause
30164 DEFW InglishCheckTheWordClass
30166 DEFW InglishRejectAClass
30168 DEFW InglishRestoreTheMatch
30170 DEFW InglishClearTheMatchBit
30172 DEFW InglishRunTheGrammar
30174 DEFW InglishStepOverAGroup
30176 DEFW InglishWalkTheGrammar
30178 DEFW InglishTryTheNextClass
30180 DEFW Command_MatchASpecialKey
30182 DEFW InglishSaveTheMatch
30184 DEFW InglishMatchOneWord
30186 DEFW InglishClearTheRepeatFlag
Prev: 29889 Up: Map Next: 30188