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 >
Wrap
Text File
|
1992-04-03
|
1KB
|
45 lines
/*** LISTING 7 ***/
/*** ***/
/*** assert.c ***/
/*** **************************************** ***/
/*** MODEM CONTROL AND STATUS ROUTINES ***/
/*** **************************************** ***/
#include "serial.h"
extern int portbase;
/*** **************************************** ***/
/*** USE TO SET CONTROL BITS IN MCR ***/
/*** **************************************** ***/
void Assert(int request)
{
int Current_Value;
Current_Value = inp(portbase + MCR);
outp(portbase + MCR,(Current_Value | request));
}
/*** **************************************** ***/
/*** USE TO TURN OFF CONTROL BITS IN MCR ***/
/*** **************************************** ***/
void Assert_Off(int request)
{
int Current_Value;
Current_Value = inp(portbase + MCR);
outp(portbase + MCR,(Current_Value & (0xFF - request)));
}
/*** **************************************** ***/
/*** GIVES STATUS OF CONTROL BIT IN MSR ***/
/*** **************************************** ***/
int Status(int request)
{
int Current_Value;
Current_Value = (inp(portbase + MSR) & request);
return(Current_Value);
}