Prev: 772F Up: Map Next: 7790
7733: Parse a verb
PARSE_VERB 7733 BIT 3,E Not straight after AND -- E bit 3 is set for an ordinary command -- or inside a quotation: handle it as the verb
7735 JR NZ,PARSE_VERB_0
7737 CALL PARSING_ORDER
773A JR NZ,PARSE_VERB_0
773C LD HL,(AND_TOKENS) Straight after AND: the AND joined two commands. Go back to the checkpoint PARSE_AND saved at AND_TOKENS and end this command there, as THEN would -- so TAKE THE MAP AND DROP IT is two commands
773F LD (TOKEN_POINTER),HL
7742 LD D,$B0
7744 LD A,(AND_STATE)
7747 LD E,A
7748 LD A,(AND_FRAMES)
774B LD (COMMAND_FRAMES),A
774E LD IY,(AND_FRAME)
7752 JP PARSE_THEN
PARSE_VERB_0 7755 CALL CLEAR_ALL_EXCEPT A second verb without AND: NOT_ALLOWED_HERE, "what ?"
7758 BIT 1,E
775A JP Z,NOT_ALLOWED_HERE
775D BIT 0,E Already looked ahead for a direction?
775F JR Z,PARSE_VERB_2
PARSE_VERB_1 7761 CALL STORE_VERB Store it, and on to the next word
7764 JP NEW_NOUN_PHRASE
PARSE_VERB_2 7767 PUSH DE Look ahead, keeping the place...
7768 PUSH BC
7769 LD HL,(TOKEN_POINTER)
776C PUSH HL
PARSE_VERB_3 776D CALL NEXT_TOKEN ...past any adverbs...
7770 CP $00
7772 JR Z,PARSE_VERB_3
7774 SET 0,E
7776 CP $20 ...for a direction. None: go back, and store just the verb
7778 JR Z,PARSE_VERB_4
777A POP HL
777B LD (TOKEN_POINTER),HL
777E POP BC
777F POP DE
7780 JR PARSE_VERB_1
PARSE_VERB_4 7782 CALL STORE_VERB A direction: store the verb, and the direction at offset 2 -- RUN QUICKLY WEST
7785 POP HL
7786 POP BC
7787 POP HL
7788 LD L,$02
778A CALL STORE_WORD
778D JP NEW_NOUN_PHRASE
Prev: 772F Up: Map Next: 7790