🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.programmer
Article #403

about reprogramming the timer tick (channel 0)

#403
From: Eric Ng
Date: Sat, 05 May 1990 10:26
39 lines
2031 bytes
I am writing an application in which it would be advantageous to
reprogram the timer's channel 0 to tick at more than 18.2 times per
second (for argument's sake, let's assume quadruple that rate, 72.8
times per second).

With no Tech Ref (but some Kermit and Freemacs source), I wrangled
out the below code fragment:

   mov dx,0043
   mov al,36	; timer channel 0, low before high, square wave, binary
   out dx,al
   mov dx,0040
   mov al,07	; low byte of 0x4007 = 1,193,280/72.8
   out dx,al
   mov al,40	; high byte of 0x4007
   out dx,al

After executing this code fragment, I notice that I have achieved (at
least partial) success:  the clock runs about four times faster.

In my application I plan to grab the 0x08 interrupt and issue
the old 0x08 interrupt every fourth time through so that the time of
day and other timer-dependent things aren't botched up.  Now, what my
question is, I want to restore the timer channel 0 rate upon exit:
how do I read the original rate from channel 0?  I mean, I can just
assume 18.2, but I'm sure this could lead to problems...  Also, is
there anything that I am doing that is painfully wrong?  I mean, the
above came out of plain guesswork, so I'm assuming that I did
something wrong...

Can anyone who has done this before help me?

Thanks in advance, -eric



--
Eric Ng, 1906 Milvia Street, Berkeley, California 94704
..!ucbvax!irss.njit.edu!erc -or- erc@irss.njit.edu
Technical Details
Message-ID: <24762@pasteur.Berkeley.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!sdd.hp.com!ucsd!helios.ee.lbl.gov!pasteur!zooey.Berkeley.EDU!c162-dr

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!samsung!sdd.hp.com!ucsd!helios.ee.lbl.gov!pasteur!zooey.Berkeley.EDU!c162-dr
From: c162-dr@zooey.Berkeley.EDU (Eric Ng)
Newsgroups: comp.sys.ibm.pc.programmer,alt.msdos.programmer
Subject: about reprogramming the timer tick (channel 0)
Message-ID: <24762@pasteur.Berkeley.EDU>
Date: 5 May 90 10:26:36 GMT
Sender: news@pasteur.Berkeley.EDU
Reply-To: erc@irss.njit.edu (Eric Ng)
Distribution: na
Organization: University of California, Berkeley
Lines: 39
X-Local-Date: 5 May 90 03:26:36 PDT