System Clock Speeds Up When Using Task Swapper (77246)



The information in this article applies to:
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0

This article was previously published under Q77246

SYMPTOMS

Your system's time and date increment at an unusually fast rate when Task Swapper is used. Your real-time clock is not affected, and rebooting the system sets the time and date back to their correct values.

CAUSE

The Task Swapper in MS-DOS Shell can cause the system clock to speed up on systems where the speaker port (61H) is not properly initialized to an "off" state.

WORKAROUND

Task Swapper has code to manage programs that reprogram the timer. This code is dependent upon the value returned by the speaker port (61H). In particular, the lower two bits of this port (bits 0 and 1) control the speaker. When the computer is first turned on, both of these bits should be cleared (zeroed) to indicate the speaker is off. If your computer's hardware does not properly initialize the speaker port, you can use the MS-DOS Debug utility to create a program that will. Follow the instructions below to create SPKROFF.COM.

    At the command prompt, start Debug by typing the following command and pressing ENTER:

    debug


    Enter the Debug commands as outlined below:
    Debug          Command
       Prompts        to Enter        Comments
       -------        --------        --------
    
       -              a 100            Assemble beginning at CS:0100
       nnnn:0100      in ax,61         Read port 61H into AX register
       nnnn:0102      and al,fc        Clear bits 0 and 1 - leave rest alone
       nnnn:0104      out 61,al        Write new value to port 61H
       nnnn:0106      int 20           Call DOS int 20H - terminate program
       nnnn:0108      <ENTER>          Press ENTER to end assemble process
       -              n spkroff.com    Name file SPKROFF.COM
       -              rcx              Replace CX register
       CX 0000
       :              0008             Place 0008 into CX register
       -              w                Write file
       Writing 00008 bytes
       -              q                Quit DEBUG
    
Each time you reboot your computer you should execute SPKROFF.COM before starting Shell. It may work best to execute SPKROFF.COM from your AUTOEXEC.BAT file. If you load Shell from AUTOEXEC.BAT, be sure to place the line that executes SPKROFF.COM before the line that executes Shell.

Modification Type: Major Last Reviewed: 10/10/2003
Keywords: KB77246