Xref: utzoo comp.lang.c:20238 alt.msdos.programmer:236 comp.sys.ibm.pc:32302 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!purdue!mentor.cc.purdue.edu!pur-ee!pur-phy!murphy From: murphy@pur-phy (William J. Murphy) Newsgroups: comp.lang.c,alt.msdos.programmer,comp.sys.ibm.pc Subject: interrupt type in Turbo C Message-ID: <2388@pur-phy> Date: 28 Jul 89 17:53:20 GMT Distribution: na Organization: Purdue Univ. Phys Dept, W.Lafayette, IN Lines: 57 I am woking on a program to interface with a DataTranslation board from my Zenith PC 386. I came across a type of variable which I know nothing about. The program was written in Turbo C and TC uses a type interrupt. I looked at the manual for TC and found that this is specific to TC, so my question is how would I implement this in MicroSoft C 5.1? I have little experience programming interrupts, in fact this is my first time in MS-DOS. /* Function Prototypes */ void interrupt DTintHandler(unsigned bp, unsigned di, unsigned si, unsigned ds, unsigned es, unsigned dx, unsigned cx, unsigned bx, unsigned ax); void InitInt( int vector, void interrupt (*haddr) ()); void interrupt DTintHandler(unsigned bp, unsigned di, unsigned si, unsigned ds, unsigned es, unsigned dx, unsigned cx, unsigned bx, unsigned ax); { if (( inport(ADSCR) & BIT15) == BIT15) aderror = TRUE; if(( inport(SUPSCR) & BIT15) == BIT15) { done = TRUE; outport(SUPSCR, BIT13); } outport(MASTER, EOI); outport(SLAVE, EOI); } void InitInt( int vector, void interrupt (*haddr) ()); { unsigned regvalue; setvect(vector, haddr); disable(); regvalue = inport(MSTRMASKREG); outport(MSTRMASKREG, regvalue & 0xFB); regvalue = inport(SLVMASKREG); outport(SLVMASKREG, regvalue & !IRQ15); enable(); } Well, there are the two functions, I believe the inport and outport would be equivalent to MSC's inpw, and outpw. setvect must be taking the address which is passed and shoving it into the appropriate interrupt register. inthis case what gets passed is the following InitInt(VECTNUM, DTintHandler) where VECTNUM = 0x77. Lastly I assume that enable() and disable() perform on the enabling/disabling of interrupts. Since I don't own Turbo C, I would rather get this translated to MSC. Does anyone have experience with this? Please e-mail any ideas (can you really e-mail and idea) or thoughts on this subject. I am not a regular reader of comp.lang.c or comp.sys.ibm.pc. Thanks, Bill Murphy murphy@newton.physics.purdue.edu