Prev: 38670 Up: Map Next: 38740
38710: Print Character
Input
A Character to print
PrintCharacter 38710 PUSH HL Stash the string pointer and the character to print on the stack.
38711 PUSH AF
Check the buffer status.
38712 LD A,(63509) Jump to Controller_CharacterPrinting if *Buffer_Counter is empty.
38715 AND A
38716 JR Z,Controller_CharacterPrinting
Buffer handling.
38718 POP AF A=the character to print (from the stack).
38719 PUSH AF Keep a copy of the character to print on the stack.
38720 LD HL,(63498) HL=*Buffer_Pointer.
38723 LD (HL),A Write the character to print into the buffer.
38724 INC HL Increment the character printing buffer pointer by one.
38725 LD (63498),HL Update the *Buffer_Pointer.
Update the buffer counter.
38728 LD A,(63509) A=*Buffer_Counter.
38731 DEC A Decrease the buffer counter by one.
38732 LD (63509),A Update the *Buffer_Counter.
38735 JR Z,Handler_ControlCode Jump to Handler_ControlCode if the buffer is now empty.
38737 POP AF Restore the character to print and the string pointer from the stack.
38738 POP HL
38739 RET Return.
Prev: 38670 Up: Map Next: 38740