Prev: 72D3 Up: Map Next: 7340
72DD: Print Message
Input
HL Text message address
Store A, DE and IX for later (see Return).
PrintMsg 72DD LD ($70DD),DE Stash DE at 70DD.
72E1 LD ($70E0),IX Stash IX at 70E0.
72E5 LD ($70DC),A Stash A at 70DC.
Important.
72E8 LD A,($B6FA)
72EB AND A
72EC JR NZ,PrintMsg_0
72EE LD ($B6FB),A
This entry point is used by the routine at 73E0.
PrintMsg_0 72F1 PUSH HL IX=HL (the text message address).
72F2 POP IX
PrintMsg_Loop 72F4 LD A,(IX+$00) Fetch the next character of the text message.
72F7 BIT 7,A Is this blah? Jump to PrintMsg_1 if not.
72F9 JR Z,PrintMsg_1
72FB AND $7F Reset bit 7.
72FD LD D,A
72FE LD E,(IX+$01)
7301 INC IX Increase IX by one to move onto the next character of the message.
7303 AND $F0
7305 CP $30
7307 JR Z,$7348
7309 CP $20
730B JR Z,$7348
730D CP $60
730F JR Z,$7348
This entry point is used by the routine at GetCommonWord.
PrintMsg_Token 7311 CALL PrintToken Call PrintToken.
PrintMsg_Next 7314 INC IX Increase IX by one to move onto the next character of the message.
7316 JR PrintMsg_Loop Jump back to PrintMsg_Loop.
Check.
PrintMsg_1 7318 CP $20 If the character is less than $20 jump to PrintMsg_PrintTable.
731A JR C,PrintMsg_PrintTable
731C CP $60 If the character is more than $60 jump to GetCommonWord.
731E JP NC,GetCommonWord
7321 CALL $72C3 Else, call 72C3.
7324 JR PrintMsg_Next Jump back to PrintMsg_Next to move onto the next character.
X
PrintMsg_PrintTable 7326 PUSH DE Stash DE on the stack for later.
7327 LD E,A E=A - DE now holds the current character as the LSB.
7328 LD D,$00
732A LD HL,$7295 HL=PrintTable
732D ADD HL,DE HL=(DE * $02)
732E ADD HL,DE
732F LD E,(HL) Loads DE with the address held in HL.
7330 INC HL
7331 LD D,(HL)
7332 EX DE,HL Exchange DE and HL.
7333 POP DE Restore the previous value of DE from the stack.
7334 CP $14 If the character is more than $14 jump to PrintMsg_Indirect_Jump.
7336 JR NC,PrintMsg_Indirect_Jump
7338 CALL PrintMsg_Indirect_Jump Call PrintMsg_Indirect_Jump.
733B JR Z,PrintMsg_Next If xxxx jump back to PrintMsg_Next to move onto the next character.
733D JR PrintMsg_Token Jump to PrintMsg_Token.
PrintMsg_Indirect_Jump 733F JP (HL) Indirect jump to the address held in HL.
Prev: 72D3 Up: Map Next: 7340