Skip to navigation

Elite on the BBC Micro and NES

Text: TT45

[BBC Micro disc version, Flight]

Name: TT45 [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: * TT41 calls TT45

This routine prints a letter in lower case. Specifically: * If QQ17 = 255, abort printing this character as printing is disabled * If this is a letter then print in lower case * Otherwise this is punctuation, so clear bit 6 in QQ17 and print
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) X Contains the current value of QQ17 QQ17 Bits 6 and 7 are set
.TT45 \ If we get here, then QQ17 has bit 6 and 7 set, so we \ are in Sentence Case and we need to print the next \ letter in lower case CPX #255 \ If QQ17 = 255 then printing is disabled, so return BEQ TT48 \ from the subroutine (as TT48 contains an RTS) CMP #'A' \ If A >= ASCII "A", then jump to TT42, which will BCS TT42 \ print the letter in lowercase \ Otherwise this is not a letter, it's punctuation, so \ this is effectively a word break. We therefore fall \ through to TT46 to print the character and set QQ17 \ to ensure the next word starts with a capital letter