Skip to navigation

Elite on the BBC Micro and NES

Text: TT41

[NES version, Bank 2]

Name: TT41 [Show more] Type: Subroutine Category: Text Summary: Print a letter according to Sentence Case
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * TT27 calls TT41

The rules for printing in Sentence Case are as follows: * If QQ17 bit 6 is set, print lower case (via TT45) * If QQ17 bit 6 is clear, then: * If character is punctuation, just print it * If character is a letter, set QQ17 bit 6 and print letter as a capital
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 Bit 7 is set
.TT41 ; If we get here, then QQ17 has bit 7 set, so we are in ; Sentence Case BIT QQ17 ; If QQ17 also has bit 6 set, jump to TT45 to print BVS TT45 ; this character in lower case ; If we get here, then QQ17 has bit 6 clear and bit 7 ; set, so we are in Sentence Case and we need to print ; the next letter in upper case JMP DASC ; Jump to DASC to print the character in A