Important Notice
The pages on this site contain documentation for very old MS-DOS software,
purely for historical purposes.
If you're looking for up-to-date documentation, particularly for programming,
you should not rely on the information found here, as it will be woefully
out of date.
_bios_serialcom
◄Summary► ◄Example► ◄Up► ◄Contents► ◄Index► ◄Back►
────────────────────────────────────────────────────────────────────────────
The _bios_serialcom routine uses INT 0x14 to provide serial
communications services. The <serial_port> argument is set to 0
for COM1, to 1 for COM2, and so on. The <service> argument can be
set to one of the following manifest constants:
_COM_INIT _COM_RECEIVE _COM_SEND _COM_STATUS
Because of the overhead associated with servicing computer
interrupts, the _bios_serialcom routine may not be able to
establish reliable communications in excess of 1,200 baud
(_COM_1200). Faster data communication rates are possible with
direct programming of serial-port controllers.
Note that this function works only with IBM(R) personal computers
and true compatibles.
The <data> argument is ignored if <service> is set to _COM_RECEIVE
or _COM_STATUS. The <data> argument for _COM_INIT is created by
combining one or more of the following constants (with the OR
operator):
_COM_CHR7 _COM_CHR8
_COM_STOP1 _COM_STOP2
_COM_NOPARITY _COM_EVENPARITY _COM_ODDPARITY
_COM_110 _COM_600 _COM_4800
_COM_150 _COM_1200 _COM_9600
_COM_300 _COM_2400
The default value of <data> is 1 stop bit, no parity, and 110 baud.
Return Value
The function returns a 16-bit integer whose high-order byte
contains status bits. The meaning of the low-order byte varies,
depending on the <service> value. The high-order bits are as
follows:
Bit Meaning If Set
15 Timed out
14 Transmission-shift register empty
13 Transmission-hold register empty
12 Break detected
11 Framing error
10 Parity error
9 Overrun error
8 Data ready
When service is _COM_SEND, bit 15 is set if data cannot be sent.
When service is _COM_RECEIVE, the byte read is returned in the
low-order bits if the call is successful. If an error occurs, any
of the bits 9, 10, 11, or 15 is set.
When <service> is _COM_INIT or _COM_STATUS, the low-order bits are
defined as follows:
Bit Meaning If Set
7 Receive-line signal detected
6 Ring indicator
5 Data-set ready
4 Clear to send
3 Change in receive-line signal detected
2 Trailing-edge ring indicator
1 Change in data-set ready status
0 Change in clear-to-send status
-♦-