Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ Language Reference - int_intercept http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
   int_intercept

   Usage
   #include <int.h>
   int  int_intercept(unsigned  vector, int(*funcptr)  (struct  *INT_DATA
   *pd), unsigned stacksize);

   Description
   int_intercept  links a standard C function to an interrupt vector  for
   handling  the  interrupt when the interrupt occurs. The funcptr  is  a
   pointer  to the C function that will handle the interrupt. The  vector
   argument  defines  which 8086 interrupt vector the  function  will  be
   attached to (0..255). The stacksize argument is the number of bytes of
   memory allocated for the stack within the interrupt handler. stacksize
   should  be a minimum of 256 bytes, except that if stacksize is  0,  no
   stack  is allocated, and the program stack is used. This is  essential
   for  interrupt  routines that are required to be re-entrant,  such  as
   serial handlers for example.

   If  a zero value is returned from the interrupt  handler  (*funcptr)()
   then  the previous interrupt vector for this vector is called  else  a
   return from interrupt is performed.

   Values  in registers can be read/written through the pointer  (pd)  to
   the INT_DATA struct which is passed to (*funcptr)().

   Return Value
   The value returned from int_intercept indicates success or failure.  A
   zero is returned on success otherwise -1.


Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson