Postit

 BBS: Inland Empire Archive
Date: 10-31-92 (10:31)             Number: 400
From: JAMES VAHN                   Refer#: 399
  To: PETER BARNEY                  Recvd: NO  
Subj: Postit                         Conf: (2) Quik_Bas
JV>  Don't run this, but look at it:
JV>  out 112,20 : out 113,0
JV>  Can you tell what it does by looking at it?

PB>  Ok, I'll bite.  WHAT does that do?

Nothing. At first.  :-)
And nothing at all if you don't have an AT.

Here's the whole story for posterity:

This bomb puts a zero into the AT's CMOS equipment byte and destroys
the CMOS checksum.  You may also lose the drive type which could
foul some users up royally. Most DON'T KNOW which drive type they
have.  The computer will gag, quite possibly requiring a service
call.

If have an AT and are in a hurry to see what it does, hang this
on the end: OUT 100,254

But before you run it, make a boot disk then compile and run this
first:

' cmos2dsk.bas  James Vahn
OPEN "cmos.dat" FOR OUTPUT AS #1
FOR CMOS = &H0 TO &H3F
        OUT &H70, CMOS              ' Save CMOS values.
        Byte% = INP(&H71)
        PRINT #1, CHR$(Byte%);
NEXT : CLOSE

Now run that little bomb I posted...  If you didn't go with
Option B, hit the reset button.  OUT 100,254 will do that for
you if you have the standard AT keyboard. After all the fuss dies
down, fix the CMOS setup so you can boot from A: and insert that
bootable disk you made and run this after you've compiled and
saved it on A:

' cmos2ram.bas   James Vahn
OPEN "cmos.dat" FOR BINARY AS #1
DIM Byte AS STRING * 1
FOR CMOS = &H0 TO &H3F
        OUT &H70, CMOS        ' Restore CMOS values.
        GET #1, , Byte
        OUT &H71, ASC(Byte)
NEXT : CLOSE

Pull the disk and hit the reset.
These two programs can be useful when changing batteries, running
programs from the Quik_Bas echo <grin>, or just fooling with CMOS
configurations.  I just wish I could figure out how to access
XCMOS which SHOULD be contiguous to the CMOS data.
i.e.
FOR CMOS = &H0 TO &HFF
should work, but it doesn't. Not here anyway.

fun stuff, eh?  Cya!

 * SLMR 2.1a *

--- Maximus 2.00
 * Origin: Inland Empire Archive (1:346/10)
Outer Court
Echo Basic Postings

Books at Amazon:

Back to BASIC: The History, Corruption, and Future of the Language

Hackers: Heroes of the Computer Revolution (including Tiny BASIC)

Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution

The Advent of the Algorithm: The Idea that Rules the World

Moths in the Machine: The Power and Perils of Programming

Mastering Visual Basic .NET