Clearing CMOS

Only for programmers and BIOS gurus with technical questions.
Post Reply
yu_raider
New visitors - please read the rules.
Posts: 1
Joined: Wed Dec 19, 2007 12:58 am

Hi, all.

I've found this code on the net and tried using it to clear CMOS without removing the battery or meddling with the jumpers:

Code: Select all

MOV AX,0
MOV AX,CX 
OUT 70,AL 
MOV AX,0 
OUT 71,AL 
INC CX 
CMP CX,100 
JB 103 
INT 20
The way I understand it, this code basically zeroes everything.
And, I've tried running it through debug.exe but nothing happened. I also tried changing the ports 70,71 to 72,73 as was stated somewhere on this forum, yet still nothing.

I also tried writing a pascal version of it, using port[$70] and port[$71], and still no luck...

Any ideas? :)
cp
BIOS Guru
Posts: 1914
Joined: Mon Oct 21, 2002 9:07 pm
Location: Germany

port 70 and 71 are only for accessing the lower 128byte of the cmos. this is (according to some VIA datasheets) an industry standard. the highest bit of port 70 is enabling or disabling NMI generation on the VIA 686 SB. and it may do other things on different SBs.
you may want to try ports 74/75. the VIA datasheet notes that port 74/75 can only be accessed if some special bits within the SB are set.

and for the code: jb 103 may not work as intended. i'd rather do the following. please note the changes in the first line and the CMP.

Code: Select all

      MOV CX,0 
LOOP: MOV AX,CX 
      OUT 70,AL 
      MOV AX,0 
      OUT 71,AL 
      INC CX 
      CMP CX,80
      JB LOOP
      INT 20 
anyone with assembler skills: please verify this :)
If you email me include [WIMSBIOS] in the subject.
Post Reply