Prev: 8741 Up: Map Next: 8809
87EF: Print a message from game messages table 2.
Used by the routines at main_routine and TREPUT.
Input
A Message number
BC Coordinates
M2PRIN 87EF PUSH HL Preserve HL, DE, and BC.
87F0 PUSH DE
87F1 PUSH BC
87F2 LD H,$00 Set HL to value in A (message number).
87F4 LD L,A
87F5 ADD HL,HL Multiply HL by four because each row is 4 bytes.
87F6 ADD HL,HL
87F7 LD DE,M2ESAG Add address of M2ESAG to get address of desired row in game messages table 2.
87FA ADD HL,DE
87FB LD E,(HL) Load address of message into DE.
87FC INC HL
87FD LD D,(HL)
87FE INC HL Load message length into C.
87FF LD C,(HL)
8800 EX DE,HL Swap DE into HL.
8801 LD E,C Copy message length into E.
8802 POP BC Restore coordinates in BC.
8803 CALL print_string_loop Print string.
8806 POP DE Restore DE and HL, and return.
8807 POP HL
8808 RET
Prev: 8741 Up: Map Next: 8809