Prev: ED7E Up: Map Next: EDAF
ED8A: Compare Token To Vocabulary Word
Returns with carry reset on a match, set on a miss.
CompareTokenToWord ED8A LD B,$00 B=00.
ED8C PUSH DE Stash the token pointer on the stack.
CompareTokenToWord_Count ED8D LD A,(DE) Jump to CompareTokenToWord_CheckLength if *DE is a control character (< 21).
ED8E CP $21
ED90 JR C,CompareTokenToWord_CheckLength
ED92 CP $22 Jump to CompareTokenToWord_CheckLength if *DE is a quote.
ED94 JR Z,CompareTokenToWord_CheckLength
ED96 INC B Count this character and keep scanning the token.
ED97 INC DE
ED98 JR CompareTokenToWord_Count
CompareTokenToWord_CheckLength ED9A POP DE Restore the token pointer from the stack.
ED9B LD A,($5BA4) Jump to CompareTokenToWord_Miss if the token is shorter than *ParserState_MatchLength.
ED9E LD C,A
ED9F LD A,B
EDA0 CP C
EDA1 JR C,CompareTokenToWord_Miss
CompareTokenToWord_Match EDA3 LD A,(DE) Jump to CompareTokenToWord_Miss if the next characters differ.
EDA4 CP (HL)
EDA5 JR NZ,CompareTokenToWord_Miss
EDA7 INC HL Advance both pointers and keep matching.
EDA8 INC DE
EDA9 DJNZ CompareTokenToWord_Match
EDAB AND A Clear carry on a full match.
EDAC RET Return.
The token did not match this table word.
CompareTokenToWord_Miss EDAD SCF Set carry on a miss.
EDAE RET Return.
Prev: ED7E Up: Map Next: EDAF