Skip to navigation


Text: TT42

[6502 Second Processor version]

Name: TT42 [Show more] Type: Subroutine Category: Text Summary: Print a letter in lower case
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT45 calls TT42 * TT41 calls via TT44

Arguments: A The character to be printed. Can be one of the following: * 7 (beep) * 10-13 (line feeds and carriage returns) * 32-95 (ASCII capital letters, numbers and punctuation)
Other entry points: TT44 Jumps to TT26 to print the character in A (used to enable us to use a branch instruction to jump to TT26)
.TT42 CMP #'A' \ If A < ASCII "A", then this is punctuation, so jump BCC TT44 \ to TT26 (via TT44) to print the character as is, as \ we don't care about the character's case CMP #'Z'+1 \ If A >= (ASCII "Z" + 1), then this is also BCS TT44 \ punctuation, so jump to TT26 (via TT44) to print the \ character as is, as we don't care about the \ character's case ADC #32 \ Add 32 to the character, to convert it from upper to \ lower case .TT44 JMP TT26 \ Print the character in A