Prev: 55860 Up: Map Next: 56006
55933: Match The Dictionary Word
Used by the routine at SkipSpaces.
Compares the typed word with this dictionary entry and keeps the match when it is longer than the one already saved.
MatchDictionaryWord 55933 PUSH HL Read the input length.
55934 PUSH DE
55935 LD A,(56339)
55938 LD B,A
55939 LD A,(56340) Jump ahead to MatchDictionaryWord_NoMatch if the first value is at least the second.
55942 CP B
55943 JR NC,MatchDictionaryWord_NoMatch
55945 LD B,1 Point DE at the word buffer (WordBuffer) and HL at 23618.
55947 LD DE,23563
55950 LD HL,23618
MatchDictionaryWord_CompareLetters 55953 LD A,(DE) Jump ahead to MatchDictionaryWord_AcceptLength if this dictionary letter is zero.
55954 AND A
55955 JR Z,MatchDictionaryWord_AcceptLength
55957 CP (HL) Jump ahead to MatchDictionaryWord_AcceptLength if the dictionary letter differs.
55958 JR NZ,MatchDictionaryWord_AcceptLength
55960 INC HL Step to the next letter, count one more and jump back to MatchDictionaryWord_CompareLetters.
55961 INC DE
55962 INC B
55963 JR MatchDictionaryWord_CompareLetters
Accepts the saved index while it is still within the match length.
MatchDictionaryWord_AcceptLength 55965 LD A,(56340) Go to MatchDictionaryWord_RememberLength if the match length equals the saved count.
55968 CP B
55969 JR Z,MatchDictionaryWord_RememberLength
55971 JR C,MatchDictionaryWord_RememberLength Jump ahead to MatchDictionaryWord_RememberLength if the first value is below the second.
MatchDictionaryWord_NoMatch 55973 POP DE Restore the text pointer from the stack.
55974 POP HL
55975 XOR A Clear A.
55976 RET Return.
Take the input length and remember it in the space marker.
MatchDictionaryWord_RememberLength 55977 LD A,B Take the dictionary index and store it in the workspace byte at 56340.
55978 LD (56340),A
MatchDictionaryWord_NextEntry 55981 POP HL Go to MatchDictionaryWord_Matched if bit 7 of the next byte is clear.
55982 PUSH HL
55983 INC HL
55984 BIT 7,(HL)
55986 DEC HL
55987 JR Z,MatchDictionaryWord_Matched
55989 INC HL Step on two places, step to the next entry and take the dictionary index.
55990 INC HL
55991 LD E,(HL)
55992 INC HL
55993 LD D,(HL)
55994 LD HL,23999
55997 ADD HL,DE Jump back to MatchDictionaryWord_NextEntry to step to the next entry and step back one entry.
55998 EX (SP),HL
55999 JR MatchDictionaryWord_NextEntry
Keep the match flags before returning.
MatchDictionaryWord_Matched 56001 POP DE Restore the saved pointers from the stack.
56002 POP HL
56003 OR %00000001 Reset the zero flag.
56005 RET Return.
Prev: 55860 Up: Map Next: 56006