'****************************************************************************** ' QuickBasic Language Sample #2 : SAMPLE2.BAS ' ' This program will display the status of each bit in the status register and ' displays the temperature inside your computer. ' '****************************************************************************** BASEADDR = &H350 CLS PRINT "Basic Sample #2: Reading Control Register and Temperature" PRINT "This program demonstrates how to read the Control Register and" PRINT "Temperature at BASE+4 and BASE+5, respectively." PRINT "Please note that some features require that options be installed" PRINT "A keystroke will stop the program." PRINT PRINT "Press any key to start." WHILE INKEY$ = "" ' grab keystroke WEND CLS PRINT " Status Control Register Values " PRINT " " PRINT " Bit Number Value Description " PRINT " 0 1 When 0, CTR1 has timed out " PRINT " 1 1 When 0, temperature is too high OPTION 2" PRINT " 2 1 Isolated digital input #0 OPTION 4" PRINT " 3 1 Isolated digital input #1 OPTION 4" PRINT " 4 0 When 0, speed of fan is correct OPTION 4" PRINT " 5 1 When 0, the Voltage is too high OPTION 1" PRINT " 6 1 When 0, the Voltage is too low OPTION 1" PRINT " 7 1 When 0, an INT has occured " PRINT " " PRINT " Temperature inside computer is 000.0øF. OPTION 3 (=187 if not installed)" PRINT " " PRINT " Press any key to exit this program..." WHILE INKEY$ = "" FOR CurBit = 0 TO 7 LOCATE 4 + CurBit, 19 IF ((((INP(BASEADDR + 4)) AND (1 * (2 ^ CurBit))) = (1 * (2 ^ CurBit))) = -1) THEN PRINT 1 ELSE PRINT 0 END IF NEXT CurBit LOCATE 13, 34 PRINT USING "###.#"; (INP(BASEADDR + 5) * (11/15)) + 7 WEND PRINT