10 REM Attempts to detect whether osword 20 REM to read clock is supported and 30 REM osbyte to read cmos RAM 40 REM (C)1997 SPROW 50 DIMblock% 32 55 MODE7:CLS:PRINT"OSWord/OSByte for RT Clock detector"' 60 PRINT"Read/write clock mode=0 "; 70 IFFNsubcall(0)=FALSE THENPRINT;"un"; 80 PRINT;"available" 90 PRINT"Read/write clock mode=1 "; 100 IFFNsubcall(1)=FALSE THENPRINT;"un"; 110 PRINT;"available" 120 PRINT"Read/write clock mode=2 "; 130 IFFNsubcall(2)=FALSE THENPRINT;"un"; 140 PRINT;"available" 150 PRINT"Read/write cmos ram "; 160 IFFNosbyte161_162=FALSE THENPRINT;"un"; 170 PRINT;"available" 171 PRINT'"Doomsday is "; 172 IF(FNsubcall(0)=FALSE ANDFNsubcall(1)=FALSE ANDFNsubcall(2)=FALSE) ORFNosbyte161_162=FALSE THENPRINT;"un"; 174 PRINT;"suitable for your machine" 180 END 190 : 200 DEFPROCsetto255 205 REM Clear a block to 255 210 P%=block% 220 FORoffset%=0TO31:?(block%+offset%)=255:NEXT 230 ENDPROC 240 : 250 DEFFNsubcall(type%) 255 REM After the call,some,if not all,of the 255's will have been overwritten 260 PROCsetto255 270 ?block%=type%:A%=14:X%=block% MOD256:Y%=block% DIV256:CALL&FFF1 280 flag%=FALSE 290 FORtest%=1TO31:IF?(block%+test%)<>255 THENflag%=TRUE 300 =flag% 310 : 320 DEFFNosbyte161_162 325 REM Attempts to alter a byte,but is done twice just to be sure 330 A%=161:X%=30:Y%=255:old30%=(USR&FFF4 AND&FF0000)DIV&10000 340 A%=161:X%=31:Y%=255:old31%=(USR&FFF4 AND&FF0000)DIV&10000 350 A%=162:X%=30:Y%=old30%+1:CALL&FFF4 360 A%=162:X%=31:Y%=old31%+1:CALL&FFF4 370 A%=161:X%=30:Y%=255:reread30%=(USR&FFF4 AND&FF0000)DIV&10000 380 A%=161:X%=31:Y%=255:reread31%=(USR&FFF4 AND&FF0000)DIV&10000 390 IF(reread30%<>(old30%+1)) OR(reread31%<>(old31%+1)) THEN=FALSE 400 A%=162:X%=30:Y%=old30%:CALL&FFF4 410 A%=162:X%=31:Y%=old31%:CALL&FFF4 420 =TRUE