Skip to navigation

BBC Micro Elite

Text: TT42

Name: TT42 [View in context] Type: Subroutine Category: Text Summary: Print a letter in lower case
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 \ to lower case .TT44 JMP TT26 \ Print the character in A