Prev: 29395 Up: Map Next: 29504
29405: Print Message
Input
HL Text message address
Store A, DE and IX for later (see Return).
PrintMsg 29405 LD (28893),DE Stash DE at 28893.
29409 LD (28896),IX Stash IX at 28896.
29413 LD (28892),A Stash A at 28892.
Important.
29416 LD A,(46842)
29419 AND A
29420 JR NZ,PrintMsg_0
29422 LD (46843),A
This entry point is used by the routine at 29664.
PrintMsg_0 29425 PUSH HL IX=HL (the text message address).
29426 POP IX
PrintMsg_Loop 29428 LD A,(IX+0) Fetch the next character of the text message.
29431 BIT 7,A Is this blah? Jump to PrintMsg_1 if not.
29433 JR Z,PrintMsg_1
29435 AND 127 Reset bit 7.
29437 LD D,A
29438 LD E,(IX+1)
29441 INC IX Increase IX by one to move onto the next character of the message.
29443 AND 240
29445 CP 48
29447 JR Z,29512
29449 CP 32
29451 JR Z,29512
29453 CP 96
29455 JR Z,29512
This entry point is used by the routine at GetCommonWord.
PrintMsg_Token 29457 CALL PrintToken Call PrintToken.
PrintMsg_Next 29460 INC IX Increase IX by one to move onto the next character of the message.
29462 JR PrintMsg_Loop Jump back to PrintMsg_Loop.
Check.
PrintMsg_1 29464 CP 32 If the character is less than $20 jump to PrintMsg_PrintTable.
29466 JR C,PrintMsg_PrintTable
29468 CP 96 If the character is more than $60 jump to GetCommonWord.
29470 JP NC,GetCommonWord
29473 CALL 29379 Else, call 29379.
29476 JR PrintMsg_Next Jump back to PrintMsg_Next to move onto the next character.
X
PrintMsg_PrintTable 29478 PUSH DE Stash DE on the stack for later.
29479 LD E,A E=A - DE now holds the current character as the LSB.
29480 LD D,0
29482 LD HL,29333 HL=PrintTable
29485 ADD HL,DE HL=(DE * $02)
29486 ADD HL,DE
29487 LD E,(HL) Loads DE with the address held in HL.
29488 INC HL
29489 LD D,(HL)
29490 EX DE,HL Exchange DE and HL.
29491 POP DE Restore the previous value of DE from the stack.
29492 CP 20 If the character is more than $14 jump to PrintMsg_Indirect_Jump.
29494 JR NC,PrintMsg_Indirect_Jump
29496 CALL PrintMsg_Indirect_Jump Call PrintMsg_Indirect_Jump.
29499 JR Z,PrintMsg_Next If xxxx jump back to PrintMsg_Next to move onto the next character.
29501 JR PrintMsg_Token Jump to PrintMsg_Token.
PrintMsg_Indirect_Jump 29503 JP (HL) Indirect jump to the address held in HL.
Prev: 29395 Up: Map Next: 29504