95. Auto screen-off ~~~~~~~~~~~~~~~ Further to the previous tip, Adrian Botham has written a machine-code routine which turns the screen display off if no key has been pressed within the previous minute. As soon as a key is pressed, the screen display magically reappears with its contents preserved. This helps to lengthen the useful life of the cathode ray tube by preventing 'phosphor burns'. The code occupies 88 bytes, and I have used the cassette/RS423 input buffer area at &A00. If this interferes with any of your other software, then you can try putting it somewhere else. After running the program, you can load other programs in, switch to Wordwise etc., and as long as you don't press , then the 'auto screen-off' will operate. Any of you who want to figure out how it works should read chapter 12 of the Advanced User Guide for the BBC Micro, and also chapter 9.5 and 9.6. The only spaces in the listing are absolutely essential, and note that the underline character is used in some variable names, and should not be confused with the minus sign, which looks very similar in mode 7. (The underline character is on the same key as the Pound sign.) After typing in the listing, save the program before attempting to RUN it. 100 osword=&FFF1:osbyte=&FFF4:evntv=&220 110 clock_pars=&A00:code%=clock_pars+5 120 FORpass%=0TO1:P%=code% 130 [OPTpass%*2 140 PHP:CMP#2:BEQkey_pressed 150 CMP#5:BEQminute_up:PLP:RTS 160 .key_pressed PHA:TXA:PHA:TYA:PHA 170 LDA#0:STA&FE00:LDA&FE01:BEQturn_screen_on 180 .set_time LDX#clock_pars MOD256:LDY#clock_pars DIV256 190 LDA#4:JSRosword:JMPexit 200 .turn_screen_on LDA#132:JSRosbyte 210 CPY#&41:BPLfour_seven 220 .zero_three LDA#127:STA&FE01:JMPset_time 230 .four_seven LDA#63:STA&FE01:JMPset_time 240 .minute_up PHA:TXA:PHA:TYA:PHA 250 LDA#0:STA&FE00:STA&FE01 260 .exit PLA:TAY:PLA:TAX:PLA:PLP:RTS 270 ]NEXT 280 ?evntv=code%MOD256: evntv?1=code%DIV256 290 !clock_pars=&FFFFE890:clock_pars?4=&FF 300 *FX14,2 310 *FX14,5 320 CALLcode%