◄Up► ◄Contents► ◄Index► ◄Back► ─────Run-Time Library─────────────────────────────────────────────────────── /* COM.C illustrates serial port access using function: * _bios_serialcom (DOS-only) */ #include <bios.h> #include <stdio.h> void main() { unsigned status, port; for( port = 0; port < 3; port++ ) { status = _bios_serialcom( _COM_STATUS, port, 0 ); /* Report status of each serial port and test whether there is a * responding device (such as a modem) for each. If data-set-ready * and clear-to-send bits are set, a device is responding. */ printf( "COM%c status: %.4X\tActive: %s\n", (char)port + '1', status, (status & 0x0030) ? "YES" : "NO" ); } } -♦-