Prev: 79A9 Up: Map Next: 7A14
79B6: Inglish: Score The Current Action
Used by the routines at InglishApplyAMatch and Inglish_SaveTheClauseAndAct.
Scores the current action against the action table, stores the winning action and object, and clears the message gate.
Update the second object.
Inglish_ScoreTheCurrentAction 79B6 LD A,$FF Write FF to *B6E9 and *CurrentObject.
79B8 LD ($B6E9),A
79BB LD ($B6E8),A
79BE CALL Inglish_ClearTheMatchBuffer Call Inglish_ClearTheMatchBuffer to clear the match buffer.
79C1 CALL Inglish_SaveTheClauseWindow Call Inglish_SaveTheClauseWindow to save the clause window.
79C4 RET Z Return if Inglish_SaveTheClauseWindow found no match.
79C5 LD A,$01 The first action id is 01.
79C7 PUSH IX Turn the action-table pointer into an offset from Actions.
79C9 POP HL
79CA LD DE,$AB53
79CD SBC HL,DE
79CF JR Z,Inglish_ScoreTheCurrentAction_UpdateCurrentAction Jump to Inglish_ScoreTheCurrentAction_UpdateCurrentAction if the pointer is the action table.
79D1 LD DE,$0008 Each action record is 08 bytes.
Inglish_ScoreTheCurrentAction_CountOnFromOne 79D4 INC A Count on from 01.
79D5 SBC HL,DE Take 08 off the offset.
79D7 JR NZ,Inglish_ScoreTheCurrentAction_CountOnFromOne Jump back to Inglish_ScoreTheCurrentAction_CountOnFromOne until the offset is used up (each 08 bytes is one more action id).
Inglish_ScoreTheCurrentAction_UpdateCurrentAction 79D9 LD ($B6E7),A Update *CurrentAction.
79DC LD ($B6E6),A Update *B6E6.
79DF LD ($795E),IX Remember this record in the grammar object pointer.
79E3 CALL Inglish_SplitTheClauseFlags Call Inglish_SplitTheClauseFlags to split the clause flags.
79E6 CALL Inglish_NoteTheFirstNoun Call Inglish_NoteTheFirstNoun to note the first noun.
79E9 XOR A Clear *B6FA.
79EA LD ($B6FA),A
79ED LD A,($B71D) Read *B71D.
79F0 AND $0C Jump to Inglish_ScoreTheCurrentAction_ClearTheZeroFlag when bits 2 and 3 of the phrase scratch are clear.
79F2 JR Z,Inglish_ScoreTheCurrentAction_ClearTheZeroFlag
79F4 LD A,($7952) Read the saved phrase byte.
79F7 LD ($B71C),A Update *B71C.
79FA RLCA Expose the high bit of the saved phrase byte.
79FB AND $01 Keep only bit 0.
79FD LD ($7953),A Update the phrase-byte flag.
Inglish_ScoreTheCurrentAction_ResolveTheFirstNoun 7A00 CALL Inglish_ResolveTheFirstNoun Call Inglish_ResolveTheFirstNoun to resolve the first noun.
7A03 JP NZ,Inglish_CopyTheParserSlot_ReadTheConjunctionCount Jump to Inglish_CopyTheParserSlot_ReadTheConjunctionCount if Inglish_ResolveTheFirstNoun returned with the zero flag clear (a grammar marker was not 01).
Test the phrase scratch byte.
7A06 LD A,($B71C) Jump to Inglish_ScoreTheCurrentAction_ClearTheZeroFlag if *B71C is zero.
7A09 AND A
7A0A JR Z,Inglish_ScoreTheCurrentAction_ClearTheZeroFlag
7A0C CALL Inglish_SearchThePreviousSlot Call Inglish_SearchThePreviousSlot to search the previous slot.
7A0F JR NZ,Inglish_ScoreTheCurrentAction_ResolveTheFirstNoun Jump back to Inglish_ScoreTheCurrentAction_ResolveTheFirstNoun if Inglish_SearchThePreviousSlot found the current object in the previous parser record.
Inglish_ScoreTheCurrentAction_ClearTheZeroFlag 7A11 OR $01 Clear the zero flag.
7A13 RET Return.
Prev: 79A9 Up: Map Next: 7A14