Prev: 49665 Up: Map Next: 49743
49683: Parser: Resolve Phrase
Used by the routine at Parser_MatchVocabulary.
Turn a matched word into an object name, or say it cannot be seen.
Parser_ResolvePhrase 49683 INC BC Scan the phrase list for the end marker.
49684 LD A,(47866)
49687 SUB C
49688 LD B,A
49689 LD E,A
49690 LD A,254
49692 LD HL,(47850)
49695 INC B
49696 JR Parser_ResolvePhrase_Next
Parser_ResolvePhrase_Loop 49698 INC HL Step to the next byte of the phrase.
Parser_ResolvePhrase_SkipMarker 49699 INC HL Keep skipping while this byte is the marker being sought.
49700 CP (HL)
49701 JR Z,Parser_ResolvePhrase_Loop
Parser_ResolvePhrase_Next 49703 DJNZ Parser_ResolvePhrase_SkipMarker Repeat from Parser_ResolvePhrase_SkipMarker until the phrase list is finished.
49705 JR Parser_ResolvePhrase_TestObject Jump to Parser_ResolvePhrase_TestObject to test the first object.
Parser_ResolvePhrase_NextObject 49707 INC HL Step to the next object in the phrase.
Parser_ResolvePhrase_TestObject 49708 LD A,(HL) Return when this object is in this room.
49709 CALL IsObjectInCurrentRoom
49712 RET Z
49713 INC HL Jump back to Parser_ResolvePhrase_NextObject when the end of a phrase matches.
49714 LD A,(HL)
49715 CP 254
49717 JR Z,Parser_ResolvePhrase_NextObject
49719 LD HL,48109 Print "I can't see ".
49722 CALL PrintString
49725 LD IX,(47852) Call GetTableEntry to look up the object's name.
49729 CALL GetTableEntry
49732 CALL PrintString Call PrintString to print the name.
49735 LD HL,48122 Print " here.".
49738 CALL PrintStringAndANewline
49741 SCF Set the carry flag to reject the command.
49742 RET Return.
Prev: 49665 Up: Map Next: 49743