Article View: comp.windows.ms.programmer
Article #2590Re: Interrupts and high-resolution timing under Windows
From: Thomas Hornschuh
Date: Wed, 08 May 1991 23:57
Date: Wed, 08 May 1991 23:57
43 lines
2863 bytes
2863 bytes
OT> I have two interrupt routines that runs fine under DOS (Turbo-pascal).
OT> They both use the Setintvect function to attach Int $1C (the user
OT> timer interrupt) to an interrupt routine.
OT>
OT> When running the same routine under TPW the debugger shows that the
OT> address is set correctly to the interrupt routine. But the routine does
OT> not seem to be activated. Has anyone has got this to work in either C
OT> or TPW? (If interest i can mail the source that works under dos).
OT>
You can use the timer interrupt in windows. But you must install a protected
mode interrupt handle with the help of the DPMI (DOS Protected Mode Interface).
DPMI is invoked via INT 31H.
You must use the functions
Name IN OUT
Get Protected Mode Int Vect. AX=0204H,BL=Int Number. CX:DX =
Selector:Offset of
handler
Set " " " " AX=0205H,BL=Int. Number
CX:DX= Selector:Offset
of new handler Carry flag = TRUE
if error
Using this functions is equal to the DOS SetInt/GetInt functions.
Don't forget to chain with a JMP FAR to the old handler at the end of your
new handler.
An alternative is, use your old code as a DOS TSR, load it before windows and
use the DPMI functions to pass control and data between your windows app and
the TSR. But this is more complicated and only usefull if your old code can't
run in protected mode.
The full DPMI specification can ordered from Intel, Santa Clara.
+-----------+ Thomas Hornschuh
| | SoftStream Development
| * | Obermarkstr. 72, D-4600 Dortmund 30, FRG
| * * | Tel ++49-231-48 64 60 Fax ++49-231-48 85 98
| * | FidoNet 2:245/36.1
+-----------+ UseNet: Thomas_Hornschuh%p1.f36.n245.z2@hippo.dfv.rwth-aachen.de
Technical Details
Message-ID:
<218197709@p1.f36.n245.z2.fidonet.org>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!uunet!mcsun!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p1.f36.n245.z2.fidonet.org!Thomas_HornschuhShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!uunet!mcsun!unido!rwthinf!slcdec!hippo!f1.n6000.z2.fidonet.org!p1.f36.n245.z2.fidonet.org!Thomas_Hornschuh From: Thomas_Hornschuh@p1.f36.n245.z2.fidonet.org (Thomas Hornschuh) Newsgroups: comp.windows.ms.programmer Subject: Re: Interrupts and high-resolution timing under Windows Message-ID: <218197709@p1.f36.n245.z2.fidonet.org> Date: 8 May 91 23:57:30 GMT Article-I.D.: p1.218197709 Reply-To: Thomas_Hornschuh%p1.f36.n245.z2@hippo.dfv.rwth-aachen.de (Thomas Hornschuh) Organization: Thomas Hornschuh, SoftStream 2, Dortmund (FRG) Lines: 44 Comment-To: Oivind_Toien@f1.n6000.z2.fidonet.org (Oivind Toien)