Prev: ED23 Up: Map Next: ED65
ED2D: Search Vocabulary (Verbs)
Used by the routine at JumpTable.
Jump-table target JumpTable_SearchVerbs (USR JumpTable_SearchVerbs). On a hit, BASIC GO TO n*100+1000 for verb index n (see JumpTable).
SearchVocabulary_Verbs ED2D LD A,$02 Write 02 to *ParserState_MatchLength.
ED2F LD ($5BA4),A
ED32 LD B,$2F Point HL at Table_Verbs with word limit 2F.
ED34 LD HL,$FAA9
SearchVocabulary_Loop ED37 LD A,$01 Write 01 to *ParserState_WordIndex.
ED39 LD ($5BA5),A
Compare this table word.
SearchVocabulary_TryWord ED3C PUSH HL Stash HL and BC on the stack.
ED3D PUSH BC
ED3E LD DE,($5BA7) Copy *InputBuffer_TokenStart to DE.
ED42 CALL CompareTokenToWord Call CompareTokenToWord.
ED45 POP BC Restore BC and HL from the stack.
ED46 POP HL
ED47 JR NC,SearchVocabulary_Matched Jump to SearchVocabulary_Matched if the word matched.
SearchVocabulary_SkipWord ED49 INC HL Skip ahead to the ENTER that ends this table word.
ED4A LD A,(HL)
ED4B CP $0D
ED4D JR NZ,SearchVocabulary_SkipWord
ED4F INC HL Advance HL past the ENTER.
ED50 LD A,($5BA5) Increment *ParserState_WordIndex.
ED53 INC A
ED54 LD ($5BA5),A
ED57 CP B Jump to SearchVocabulary_TryWord if there are more words to try.
ED58 JR C,SearchVocabulary_TryWord
ED5A LD BC,$0000 BC=0000 on a miss.
ED5D RET Return.
A vocabulary word matched.
SearchVocabulary_Matched ED5E LD A,($5BA5) Copy *ParserState_WordIndex into BC.
ED61 LD C,A
ED62 LD B,$00
ED64 RET Return.
Prev: ED23 Up: Map Next: ED65