Prev: 8D2A Up: Map Next: 8DAD
8D85: Handler: Match Verb
Used by the routines at GameLoop and HandlerResolveSynonym.
Match the first word token against the verb table. If a match is found, jump to its handler. If not, print "I Don't Understand" and return to the game loop.
Set up to search the verb word tokens for the first word token.
HandlerMatchVerb 8D85 LD HL,$891C Point at the list of verb word numbers.
8D88 LD BC,($62DA) Load *Count_VerbTokens into BC for the search.
8D8C LD A,($6291) Fetch *UserInput_Token_1 from the user input.
8D8F CPIR Search the verb word tokens for a matching token.
8D91 JR Z,HandlerMatchVerb_Step1 Jump to HandlerMatchVerb_Step1 if a match was found.
The token doesn't match any verb.
Print "I don't understand.".
8D93 LD HL,$62EC HL=Messaging_IDonTUnderstand.
8D96 CALL PrintStringAndANewline Call PrintStringAndANewline.
8D99 JR GameLoop Jump to GameLoop to read the next command.
A verb was matched. Calculate its index and jump to its handler.
HandlerMatchVerb_Step1 8D9B LD A,($62DA) Fetch how many verbs the game knows.
8D9E SUB C The matching verb selects its handler index.
8D9F DEC A
8DA0 LD E,A
8DA1 LD IX,($62D8) Point IX at *Pointer_JumpTable_Verbs.
8DA5 CALL GetTableEntry Call GetTableEntry.
This entry point is used by the routine at GameLoop.
HandlerMatchVerb_Step2 8DA8 LD DE,$8D2A Run the verb, then return to the game loop.
8DAB PUSH DE
8DAC JP (HL)
Prev: 8D2A Up: Map Next: 8DAD