.ProcessCharacter CMP #200 \ If the character in A >= 200 then it represents a text BCS char1 \ token, so jump to char1 to print the token JMP PrintVduCharacter \ Otherwise the character in A is a simple one-byte \ character or VDU command, so jump to PrintVduCharacter \ to print it .char1 SBC #200 \ Set A = A - 200 \ \ As we store recursive tokens within other tokens by \ encoding then as 200 + the token number, this extracts \ the recursive token number into A, so we can print it \ \ This subtraction works because we jumped here with a \ BCS, so we know that the C flag is set TAX \ Set X to the token we want to print, to pass to the \ PrintTextToken routine TYA \ Store Y on the stack so we can retrieve it below PHA JSR PrintTextToken \ Print the text token in X PLA \ Retrieve Y from the stack, so Y now contains the TAY \ offset of the token we just printed within the parent \ token that we are still printing RTS \ Return from the subroutineName: ProcessCharacter [Show more] Type: Subroutine Category: Text Summary: Process and print a character from a text token, which can encode another text token or be a one-byte character or VDU commandContext: See this subroutine in context in the source code References: This subroutine is called as follows: * PrintTextToken calls ProcessCharacter
Arguments: A The text token character to be printed Y The offset of the current character within the text token being printed
[X]
Subroutine PrintTextToken (category: Text)
Print a recursive text token
[X]
Subroutine PrintVduCharacter (category: Text)
Print a one-byte character from a text token or a multi-byte VDU 25 command
[X]
Label char1 is local to this routine