home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c005 / 4.ddi / C / ISRETVEC.C < prev    next >
Encoding:
C/C++ Source or Header  |  1986-08-05  |  1.1 KB  |  45 lines

  1. /**
  2. *
  3. * Name        isretvec -- Return interrupt vector
  4. *        (Formerly called PCRETVEC.)
  5. *
  6. * Synopsis    ercode = isretvec(intype,pvector);
  7. *
  8. *        int ercode      Error code:  0 if okay,
  9. *                  1 if intype is out of 0-255 range.
  10. *        int intype      Interrupt type number
  11. *        ADS *pvector      Interrupt vector
  12. *
  13. * Description    This function returns the interrupt vector associated
  14. *        with the specified interrupt type.  The CS:IP vector is
  15. *        returned in the segment:offset components of *pvector.
  16. *
  17. *        Use ISSETVEC to set an interrupt vector.
  18. *
  19. * Returns    ercode          If intype is not in the range 0 to 255
  20. *                  1 is returned; otherwise 0.
  21. *        pvector       Interrupt vector (CS:IP address of
  22. *                  of interrupt handling routine).
  23. *
  24. * Version    3.0  (C)Copyright Blaise Computing Inc.  1983, 1984, 1986
  25. *
  26. **/
  27.  
  28. #include <bisr.h>
  29.  
  30. int isretvec(intype,pvector)
  31. int intype;
  32. ADS *pvector;
  33. {
  34.     DOSREG dos_reg;
  35.  
  36.     if (utrange(intype,0,255))
  37.        return(1);
  38.     dos_reg.ax = utbyword(0x35,intype);
  39.     dos(&dos_reg);
  40.     pvector->s = dos_reg.es;
  41.     pvector->r = dos_reg.bx;
  42.  
  43.     return(0);
  44. }
  45.