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 The next word is collected at WordBuffer.
62A3 LD HL,$5B60
62A6 LD ($5B99),HL
62A9 POP HL
62AA LD A,($5B8F) Message 0 is already under HL.
62AD LD B,A
62AE OR A
62AF JR Z,FindMessage_Byte
62B1 DEC HL The scan starts on the byte before the message.
FindMessage_Skip 62B2 INC HL Look at the next byte.
62B3 LD A,(HL)
62B4 CP $5E
62B6 JR Z,FindMessage_Count
62B8 CP $7E 7E ends a message too, otherwise keep scanning.
62BA JR Z,FindMessage_Count
62BC JR FindMessage_Skip
FindMessage_Count 62BE DJNZ FindMessage_Skip Count down the messages and land on the chosen one.
62C0 INC HL
FindMessage_Byte 62C1 LD A,(HL) Remember this byte and expand it.
62C2 LD ($5B90),HL
62C5 CALL ExpandToken
62C8 LD A,($5B9B) 7E ends the message.
62CB CP $7E
62CD RET Z
62CE CP $5E 5E ends the message.
62D0 RET Z
62D1 LD HL,($5B90) Otherwise expand the next byte.
62D4 INC HL
62D5 JR FindMessage_Byte
Prev: 629D Up: Map Next: 62D7