8-Bit Software Online Conversion

Clock Detection - Listing

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