![]() |
Routines |
| Prev: 60798 | Up: Map | Next: 60847 |
|
Used by the routines at SearchVocabulary_Verbs, AdvanceInputPointer, MatchTokenInBasicList and BasicHelper.
Compare the token at DE to the table word at HL. Counts token characters until space, quote or control, requires at least *ParserState_MatchLength characters, then matches that many bytes. Returns with carry reset on a match, set on a miss.
|
||||
| CompareTokenToWord | 60810 | LD B,0 | Clear the length counter and stash the token pointer. | |
| 60812 | PUSH DE | |||
| CompareTokenToWord_Count | 60813 | LD A,(DE) | Jump to CompareTokenToWord_CheckLength if *DE is a control character (< 33). | |
| 60814 | CP 33 | |||
| 60816 | JR C,CompareTokenToWord_CheckLength | |||
| 60818 | CP 34 | Jump to CompareTokenToWord_CheckLength if *DE is a quote. | ||
| 60820 | JR Z,CompareTokenToWord_CheckLength | |||
| 60822 | INC B | Count this character and keep scanning the token. | ||
| 60823 | INC DE | |||
| 60824 | JR CompareTokenToWord_Count | |||
| CompareTokenToWord_CheckLength | 60826 | POP DE | Restore the token pointer; jump to CompareTokenToWord_Miss if it is too short. | |
| 60827 | LD A,(23460) | |||
| 60830 | LD C,A | |||
| 60831 | LD A,B | |||
| 60832 | CP C | |||
| 60833 | JR C,CompareTokenToWord_Miss | |||
| CompareTokenToWord_Match | 60835 | LD A,(DE) | Jump to CompareTokenToWord_Miss if the next characters differ. | |
| 60836 | CP (HL) | |||
| 60837 | JR NZ,CompareTokenToWord_Miss | |||
| 60839 | INC HL | Advance both pointers and keep matching. | ||
| 60840 | INC DE | |||
| 60841 | DJNZ CompareTokenToWord_Match | |||
| 60843 | AND A | Clear carry on a full match. | ||
| 60844 | RET | Return. | ||
| CompareTokenToWord_Miss | 60845 | SCF | Set carry on a miss. | |
| 60846 | RET | Return. | ||
| Prev: 60798 | Up: Map | Next: 60847 |