Xref: utzoo comp.sys.ibm.pc.hardware:2283 comp.os.msdos.programmer:1521 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!wuarchive!emory!gatech!mcnc!decwrl!bacchus.pa.dec.com!shlump.nac.dec.com!grane.enet.dec.com!heintze From: heintze@grane.enet.dec.com (Siegfried Heintze) Newsgroups: comp.sys.ibm.pc.hardware,comp.os.msdos.programmer Subject: How to roll my own Clock service routine and emit tones Keywords: timers, speaker, tones Message-ID: <16408@shlump.nac.dec.com> Date: 16 Oct 90 18:16:31 GMT Sender: newsdaemon@shlump.nac.dec.com Reply-To: heintze@grane.enet.dec.com (Siegfried Heintze) Followup-To: comp.sys.ibm.pc.hardware Organization: Digital Equipment Corporation Lines: 40 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