Prev: 47006 Up: Map Next: 47104
47059: Handler: Dispatch Matching Phrase
Find the phrase pattern that matches the command and jump to its handler.
Handler_DispatchPhrase 47059 PUSH HL Copy the phrase table from HL into IX.
47060 POP IX
Handler_DispatchPhrase_Loop 47062 LD L,(IX+0) Call MatchPhraseTokens to match the phrase tokens.
47065 LD H,(IX+1)
47068 PUSH IX
47070 PUSH DE
47071 PUSH BC
47072 CALL MatchPhraseTokens
47075 POP BC Restore the phrase count and the handler and phrase table pointers from the stack.
47076 POP DE
47077 POP IX
47079 JR NZ,Handler_DispatchPhrase_Next Try the next phrase when this one does not match.
47081 PUSH DE Copy the handler address from DE into IX.
47082 POP IX
47084 LD L,(IX+0) Read the handler for this phrase.
47087 LD H,(IX+1)
47090 POP DE Drop the return address into the action routine, so the phrase handler returns straight to its caller.
47091 JP (HL) Jump to the handler address now in HL.
Handler_DispatchPhrase_Next 47092 INC IX Step to the next phrase entry.
47094 INC IX
47096 INC DE Advance DE to the next byte.
47097 INC DE Advance DE to the next byte.
47098 DEC BC Move BC back one byte.
47099 LD A,B See whether another phrase remains.
47100 OR C
47101 JR NZ,Handler_DispatchPhrase_Loop Match the next phrase.
47103 RET Return.
Prev: 47006 Up: Map Next: 47104