Article View: comp.windows.ms.programmer
Article #2108Re: MS Win and Interrupt
From: Ian McDonald
Date: Mon, 15 Apr 1991 22:06
Date: Mon, 15 Apr 1991 22:06
62 lines
2143 bytes
2143 bytes
In article <16489@chaph.usc.edu>, syau@aludra.usc.edu (Shu-Jye Syau) writes:
> Hi :
> I am trying to use MS window to write a voice card program .
> I need to know how to set the interrupt vector for hardware interrupt .
> ( when voice comes in , ADC interrupt PC to info PC to get 8-bit data)
> Please Help .
>
Below is the code I used to set up vectors. I am using mine for a voice card
as well - A Scott Instruments board.
Sorry I couln't reply by EMail - I have no priveledge to do that.
/* winvect.c */
/* A replacement for Microsoft's routines which are not in Windows libraries
History
iam 08 Jan 91 Created
*/
#include <windows.h>
#include "winvect.h"
void(_interrupt _far *_dos_getvect(unsigned intnum))() {
void _far *vect;
/* Dos function 35 is Get vector function. Specify the interrupt in al
and the vector will be returned in es:bx */
_asm {
mov ax,intnum
mov ah,35h
int 21h
mov vect+2,es
mov vect,bx
}
return(vect);
}
void _dos_setvect(unsigned intnum,void(_interrupt _far *handler)()) {
/* Dos function 25 is set vector. Put interrupt number in al,
vector in ds:dx */
_asm {
push ds
mov ax,intnum
mov ah,25h
lds dx,handler
int 21h
pop ds
}
}
--
-------------------------------------------------------------------------
Ian McDonald |
52 Cook Street| / /\ /\
Hamilton | This space free for advertising !! / / \/ \
New Zealand | / / \
+64-71-563438 | I can receive mail but can't reply to it.
Technical Details
Message-ID:
<1991Apr16.100652.3442@waikato.ac.nz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!waikato.ac.nz!iamReferences:
<16489@chaph.usc.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!waikato.ac.nz!iam From: iam@waikato.ac.nz (Ian McDonald) Newsgroups: comp.windows.ms.programmer Subject: Re: MS Win and Interrupt Message-ID: <1991Apr16.100652.3442@waikato.ac.nz> Date: 16 Apr 91 10:06:51 +1200 References: <16489@chaph.usc.edu> Organization: University of Waikato, New Zealand Lines: 62