Prev: 68E0 Up: Map Next: 692F
6900: Parser: Advance To Separator
Parser_AdvanceToSeparator 6900 EX DE,HL Hold the phrase while the command tokens are checked.
6901 JR Parser_AdvanceToSeparator_Step1 Continue at Parser_AdvanceToSeparator_Step1 to start at the second word of the command.
Parser_AdvanceToSeparator_Loop1 6903 INC DE Step to the next byte of the phrase.
Parser_AdvanceToSeparator_Step1 6904 LD HL,$6292 Matching starts at the second word of the command.
6907 JR Parser_AdvanceToSeparator_Step2 Continue at Parser_AdvanceToSeparator_Step2 to compare that word with the phrase.
Parser_AdvanceToSeparator_Loop2 6909 INC HL The next token of the command has to match too.
690A INC DE Step to the next word of the command.
Parser_AdvanceToSeparator_Step2 690B LD A,(DE) Read the next byte of the phrase.
690C CP (HL) Keep matching while this token agrees with the phrase.
690D JR Z,Parser_AdvanceToSeparator_Loop2
690F CP $FE This byte is a word token, not the end of the phrase.
6911 JR NZ,Parser_AdvanceToSeparator_Step3
6913 LD A,(HL) Read the token the phrase is waiting for.
6914 CP $FF Compare with FF.
6916 RET Return.
Parser_AdvanceToSeparator_Step3 6917 CP $FD This byte is not an alternative in the phrase.
6919 JR NZ,Parser_AdvanceToSeparator_Loop3
691B LD A,(HL) Read the token the phrase is waiting for.
691C CP $FF Jump back to Parser_AdvanceToSeparator_Loop1 when the phrase token is not the end marker (FF).
691E JR NZ,Parser_AdvanceToSeparator_Loop1
6920 RET Return.
Parser_AdvanceToSeparator_Loop3 6921 INC DE Match the next alternative in the phrase.
6922 LD A,(DE)
6923 CP $FE
6925 JR Z,Parser_AdvanceToSeparator_Step4
6927 CP $FD
6929 JR NZ,Parser_AdvanceToSeparator_Loop3
692B JR Parser_AdvanceToSeparator_Loop1 Continue at Parser_AdvanceToSeparator_Loop1 to try the next wording of the phrase.
Parser_AdvanceToSeparator_Step4 692D OR A Set flags from A.
692E RET Return.
Prev: 68E0 Up: Map Next: 692F