home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_10_09 / 1009049b < prev    next >
Text File  |  1992-04-03  |  1KB  |  45 lines

  1. /***                 LISTING 7                ***/
  2. /***                                          ***/
  3. /***                 assert.c                 ***/
  4. /*** **************************************** ***/
  5. /***    MODEM CONTROL AND STATUS ROUTINES     ***/
  6. /*** **************************************** ***/
  7. #include "serial.h"
  8.  
  9. extern int portbase;
  10.  
  11. /*** **************************************** ***/
  12. /***      USE TO SET CONTROL BITS IN MCR      ***/
  13. /*** **************************************** ***/
  14. void Assert(int request)
  15. {
  16.  int Current_Value;
  17.  
  18.  Current_Value = inp(portbase + MCR);
  19.  
  20.  outp(portbase + MCR,(Current_Value | request));
  21. }
  22.  
  23. /*** **************************************** ***/
  24. /***   USE TO TURN OFF CONTROL BITS IN MCR    ***/
  25. /*** **************************************** ***/
  26. void Assert_Off(int request)
  27. {
  28.  int Current_Value;
  29.  
  30.  Current_Value = inp(portbase + MCR);
  31.  
  32.  outp(portbase + MCR,(Current_Value & (0xFF - request)));
  33. }
  34.  
  35. /*** **************************************** ***/
  36. /***    GIVES STATUS OF CONTROL BIT IN MSR    ***/
  37. /*** **************************************** ***/
  38. int Status(int request)
  39. {
  40.  int Current_Value;
  41.  
  42.  Current_Value = (inp(portbase + MSR) & request);
  43.  
  44.  return(Current_Value);
  45. }