[comp.os.msdos.programmer] How to roll my own Clock service routine and emit tones

heintze@grane.enet.dec.com (Siegfried Heintze) (10/17/90)

I have some questions about timers in the IBM PC/AT and its clones.  I wasn't
sure if this is a
hardware or software question.

(1)  What is the name of the chip they use to generate the clock interrupt every
18.2 ms?
(2)  Where can I get documentation on it?
(3)  I would like to establish my own clock interupt service routine that calls
the 
      default clock routine at the appropriate intervals by use of a counter. 
The purpose of
      this is to gain control at intervals with a granularity greater than 18.2
ms.
      (a)   What is the address of the countdown register?
      (b)   How do I read the current value and write a new value to this 
countdown register?
              I suspect I would use some inport and outport instructions.
      (c)   What is the location of the interupt vector element that holds the
address of the clock
              routine?  I would suppose I use one of the MSDOS services to fetch
the old value and
              write the address of my routine.  I don't recal which service this
is, but I remember
              seeing an example of this in the TURBO C++ documentation.

On a slightly different - but possibly related subject:

(4)  How does BORLAND implement their  sound and nosound routines in TC++?  
These routines
       allow you to generate a study tone while other CPU processing is in
progress.
(5)  How would I write a program that emits an uninterupted tone whose pitch is
controlled
       by the vertical position of the mouse on the screen?

                                                                               
Thanks much,

                                                                               
Sieg