.Print2DigitBCD PHA \ Store A on the stack so we can retrieve it later LSR A \ Shift the high nibble of A into bits 0-3, so A LSR A \ contains the first digit of the BCD number LSR A LSR A JSR PrintNumber \ Print the number in A as a single digit PLA \ Retrieve the original value of A, which contains the \ BCD number to print AND #%00001111 \ Extract the low nibble of the BCD number into A JMP PrintNumber \ Print the number in A as a single digit and return \ from the subroutine using a tail callName: Print2DigitBCD [Show more] Type: Subroutine Category: Text Summary: Print a binary coded decimal (BCD) number using two digitsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * PrintLandscapeNum calls Print2DigitBCD * SpawnSecretCode3D calls Print2DigitBCD
Arguments: A The number to print (in BCD)
[X]
Subroutine PrintNumber (category: Text)
Print a number as a single digit, printing zero as a capital "O"