' ' This program erases the CMOS memory. ' ' The CMOS memory stores the system date & time, ' memory settings, power management settings, ' HDD settings, boot order, and BIOS password. ' ' Once the CMOS memory is cleared, your computer ' will forget the current date and time. And it ' may also forget which hard drive to boot from. ' So, you will probably have to enter BIOS Setup ' and review all the settings after running ' this program. ' ' Written by Zsolt Nagy-Perge on July 17, 2015. ' ' DEFINT A-Z DECLARE SUB BYE () DECLARE SUB CENTER (Y, A$) DECLARE SUB CLRSCR (FC, BG) DECLARE FUNCTION WINDOWS (W) IF WINDOWS(1) THEN CLRSCR 15, 0 CENTER 7, "Running this program in a DOS box from Windows" CENTER 10, "has no effect. Run this program in DOS mode for it to work." CENTER 13, "PRESS ANY KEY TO EXIT..." BYE END IF CLRSCR 15, 4 CENTER 7, "W A R N I N G" CENTER 10, "This program will erase your CMOS memory!!!" CENTER 13, "Type 'YES' if you want this to happen : " LINE INPUT L$ IF NOT L$ = "YES" THEN CLRSCR 15, 0 CENTER 10, "No changes have been made to your computer." CENTER 13, "PRESS ANY KEY TO EXIT..." BYE END IF ' The CMOS memory is a 128-byte memory area that ' is sustained by a small battery on the motherboard. ' Here we're going to erase it one byte at a time. FOR A = 0 TO 127 OUT &H70, A ' Address OUT &H71, 0 ' Send data NEXT A CLRSCR 15, 2 CENTER 7, "S U C C E S S" CENTER 10, "Your CMOS memory has been erased!" CENTER 13, "PRESS ANY KEY TO EXIT..." BYE ' Waits for a key press and then terminates the program SUB BYE WHILE INKEY$ = "": WEND CLRSCR 7, 0 SYSTEM END SUB ' Print text A$ aligned in the center of line Y. SUB CENTER (Y, A$) L = LEN(A$) IF L < 79 THEN X = 40 - L / 2 ELSE X = 1 LOCATE Y, X: PRINT LEFT$(A$, 80); END SUB ' Wipes and paints the screen with a certain color. ' FC=foreground color BG=background color ' 0=black 1=blue 2=green 3=teal 4=dark red 5=purple... SUB CLRSCR (FC, BG) SCREEN 0 WIDTH 80, 25 COLOR FC, BG CLS LOCATE 1, 1, 1, 12, 13 END SUB ' Returns true if Windows is running, or returns 0 otherwise. FUNCTION WINDOWS (W) WINDOWS = INSTR(UCASE$(ENVIRON$("OS")), "WINDOWS") END FUNCTION