Prev: 970E Up: Map Next: 9754
9736: Print Character
Input
A Character to print
PrintCharacter 9736 PUSH HL Stash the string pointer and the character to print on the stack.
9737 PUSH AF
Check the buffer status.
9738 LD A,($F815) Jump to Controller_CharacterPrinting if *Buffer_Counter is empty.
973B AND A
973C JR Z,Controller_CharacterPrinting
Buffer handling.
973E POP AF A=the character to print (from the stack).
973F PUSH AF Keep a copy of the character to print on the stack.
9740 LD HL,($F80A) HL=*Buffer_Pointer.
9743 LD (HL),A Write the character to print into the buffer.
9744 INC HL Increment the character printing buffer pointer by one.
9745 LD ($F80A),HL Update the *Buffer_Pointer.
Update the buffer counter.
9748 LD A,($F815) A=*Buffer_Counter.
974B DEC A Decrease the buffer counter by one.
974C LD ($F815),A Update the *Buffer_Counter.
974F JR Z,Handler_ControlCode Jump to Handler_ControlCode if the buffer is now empty.
9751 POP AF Restore the character to print and the string pointer from the stack.
9752 POP HL
9753 RET Return.
Prev: 970E Up: Map Next: 9754