From: "A.Appleyard" To: DJGPP AT DELORIE DOT COM Date: Wed, 20 Mar 1996 10:20:45 GMT Subject: Hooking interrupts in djgpp Message-ID: <8C63F95F0C@fs2.mt.umist.ac.uk> I know what `hooking an interrupt' is, but is there a routine in djgpp to do it thus?:- #include int zxcvbnm(Regs&R){blah(); blah(); waffle(); blah();}; /*-----*/ main(){ ......... hook_an_interrupt(0x21,zxcvbnm); and from here on, any call of an int21 interrupt will do this:- Preserve the registers in a `Regs' as described in \djgpp\include\dos.h . Call zxcvbnm() with that Regs as its argument. If zxcvbnm() returns 0, return to the user program. If zxcvbnm() returns non-zero, go to the previous entry address of int21. That would be useful.