Skip to navigation

Text: PrintDigit

Name: PrintDigit [Show more] Type: Subroutine Category: Text Summary: Print a numerical digit, printing zero as a capital "O"
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * PrintInputBuffer calls PrintDigit

Arguments: A The numerical digit to be printed as an ASCII code
.PrintDigit CMP #'0' \ If the character in A is not a zero, jump to zero1 to BNE zero1 \ skip the following LDA #'O' \ The character in A is a zero, so set A to ASCII "O" so \ we print zero as capital "O" instead .zero1 BIT printTextIn3D \ If bit 7 of printTextIn3D is set then we are printing BMI SpawnCharacter3D \ 3D text, so jump to SpawnCharacter3D to spawn the \ character in 3D text blocks JMP PrintCharacter \ Otherwise jump to PrintCharacter to print the single- \ byte VDU command or character in A, returning from the \ subroutine using a tail call