Prev: 72D3 Up: Map Next: 733F
72DD: Print Message
Input
HL Text message address
Store A, DE and IX for later (see PrintMessage_TokenByNibble_Return).
PrintMessage 72DD LD ($70DD),DE Store DE at PrintMessage_SavedDE.
72E1 LD ($70E0),IX Store IX at PrintMessage_SavedIX.
72E5 LD ($70DC),A Save A for PrintMessage_TokenByNibble_Return.
72E8 LD A,($B6FA) If B6FA is not zero, jump to PrintMessage_Body
72EB AND A
72EC JR NZ,PrintMessage_Body
72EE LD ($B6FB),A Clear the message-suppressed flag, because this message is being printed.
This entry point is used by the routine at Message_PrintAtASignedOffset.
PrintMessage_Body 72F1 PUSH HL Use the text pointer as the message pointer.
72F2 POP IX
PrintMessage_Loop 72F4 LD A,(IX+$00) Fetch the next character of the text message.
72F7 BIT 7,A Jump to PrintMessage_PlainText if bit 7 of the character is clear, so it is plain text rather than a dictionary token.
72F9 JR Z,PrintMessage_PlainText
72FB AND $7F Jump to PrintMessage_TokenByNibble if the high nibble of this token byte, with bit 7 clear, is 30.
72FD LD D,A
72FE LD E,(IX+$01)
7301 INC IX
7303 AND $F0
7305 CP $30
7307 JR Z,PrintMessage_TokenByNibble
7309 CP $20 Jump to PrintMessage_TokenByNibble if the high nibble of this token byte is 20.
730B JR Z,PrintMessage_TokenByNibble
730D CP $60 Jump to PrintMessage_TokenByNibble if the high nibble of this token byte is 60.
730F JR Z,PrintMessage_TokenByNibble
This entry point is used by the routine at GetCommonWord.
PrintMessage_Token 7311 CALL PrintToken Call PrintToken to print a dictionary token.
PrintMessage_StepToTheNextCharacter 7314 INC IX Step to the next character of the message.
7316 JR PrintMessage_Loop Jump back to PrintMessage_Loop.
PrintMessage_PlainText 7318 CP $20 If the character is less than 20 jump to PrintMessage_PrintTable.
731A JR C,PrintMessage_PrintTable
731C CP $60 Jump to GetCommonWord if the character is 60 or above, as that is a common word.
731E JP NC,GetCommonWord
7321 CALL MessagePrintOneCharacter Else, call MessagePrintOneCharacter.
7324 JR PrintMessage_StepToTheNextCharacter Jump back to PrintMessage_StepToTheNextCharacter to move onto the next character.
PrintMessage_PrintTable 7326 PUSH DE Save DE and keep A in E.
7327 LD E,A
7328 LD D,$00 The control-code offset's high byte is zero.
732A LD HL,$7295 Point HL at entry DE of PrintTable.
732D ADD HL,DE
732E ADD HL,DE Add the control code again, so this selects the handler word in PrintTable.
732F LD E,(HL) Read the low byte of the handler.
7330 INC HL Step to the high byte of the handler word.
7331 LD D,(HL) Read the high byte of the handler.
7332 EX DE,HL Point HL at the control-code handler.
7333 POP DE Restore DE from the stack, and jump to PrintMessage_Indirect_Jump if the character is not below 14.
7334 CP $14
7336 JR NC,PrintMessage_Indirect_Jump
7338 CALL PrintMessage_Indirect_Jump Call PrintMessage_Indirect_Jump to run the control-code handler.
733B JR Z,PrintMessage_StepToTheNextCharacter Jump back to PrintMessage_StepToTheNextCharacter if the control-code handler returned zero.
733D JR PrintMessage_Token Jump back to PrintMessage_Token to print a dictionary token.
View the equivalent code in;
Prev: 72D3 Up: Map Next: 733F