Prev: 41564 Up: Map Next: 41589
41575: Print String
Standard printing loop, which prints the fetched character byte and loops until the termination byte is reached (255).
Input
HL Pointer to string to be printed
PrintString 41575 PUSH AF Push the character to print on the stack.
41576 JR FetchByteToPrint Jump to FetchByteToPrint.
Just keep looping and printing the fetched character until the termination byte is reached (255).
PrintString_Loop 41578 CALL PrintCharacter Call PrintCharacter.
41581 INC HL Move the string pointer to the next character.
FetchByteToPrint 41582 LD A,(HL) Load a character from the string pointer into A.
41583 CP 255 Jump back to PrintString_Loop until the string termination character (255) has been reached.
41585 JR NZ,PrintString_Loop
41587 POP AF Restore the character to print from the stack.
41588 RET Return.
View the equivalent code in;
Prev: 41564 Up: Map Next: 41589