Prev: 629D Up: Map Next: 62D7
62A2: Find And Print Message
Used by the routine at PrintMessage.
Skips earlier messages by counting 5E and 7E terminators, then expands each byte as a dictionary word.
FindMessage 62A2 PUSH HL Point the next word at WordBuffer (using the stack).
62A3 LD HL,$5B60
62A6 LD ($5B99),HL
62A9 POP HL
62AA LD A,($5B8F) Fetch MessageNumber into B.
62AD LD B,A
62AE OR A Jump to FindMessage_Byte if it is message 0.
62AF JR Z,FindMessage_Byte
62B1 DEC HL The scan starts on the byte before the message.
Skip earlier messages.
FindMessage_Skip 62B2 INC HL Advance to the next byte.
62B3 LD A,(HL)
62B4 CP $5E Jump to FindMessage_Count if it is 5E.
62B6 JR Z,FindMessage_Count
62B8 CP $7E Jump to FindMessage_Count if it is 7E.
62BA JR Z,FindMessage_Count
62BC JR FindMessage_Skip Jump to FindMessage_Skip.
Count down to the chosen message.
FindMessage_Count 62BE DJNZ FindMessage_Skip Jump to FindMessage_Skip until this is the chosen message.
62C0 INC HL Step onto the chosen message.
Expand this message byte.
FindMessage_Byte 62C1 LD A,(HL) Fetch this byte.
62C2 LD ($5B90),HL Write HL to *MessagePointer.
62C5 CALL ExpandToken Call ExpandToken.
62C8 LD A,($5B9B) Fetch LastCharacter.
62CB CP $7E Return if it is 7E.
62CD RET Z
62CE CP $5E 5E ends the message.
62D0 RET Z
62D1 LD HL,($5B90) Fetch MessagePointer.
62D4 INC HL Advance it.
62D5 JR FindMessage_Byte Jump to FindMessage_Byte.
Prev: 629D Up: Map Next: 62D7