_bios_serialcom Sends and Receives Single Character Data (47987)
The information in this article applies to:
- The C Run-Time (CRT), when used with:
- Microsoft C for MS-DOS 5.1
- Microsoft C for MS-DOS 6.0
- Microsoft C for MS-DOS 6.0a
- Microsoft C for MS-DOS 6.0ax
- Microsoft C/C++ for MS-DOS 7.0
This article was previously published under Q47987 SUMMARY
In the Microsoft C online help and run-time library reference
documentation, _bios_serialcom() is documented as taking an unsigned
integer as the data. Even though an unsigned integer is large enough for
two characters, only one character can be sent or received with each call
to _bios_serialcom().
MORE INFORMATION
The _bios_serialcom() function sends (and receives) character data. Two
characters cannot be sent (or received) with one call because the function
call is a simple interface to the BIOS interrupt 0x14. This interrupt
expects the data to be sent (or received) to be in the AL register (an 8-
bit register). Therefore, the data is limited to 8 bits, even though the
function requires an unsigned integer as the data parameter.
The parameter is an unsigned integer because the _bios_serialcom() function
also uses the data parameter in initialization and status checks. In the
send (and read) functions of the interrupt, however, only a single byte in
the low-order 8 bits of the unsigned integer passed as the data parameter
are sent. For more information, see interrupt 0x14 in "IBM ROM BIOS" by Ray
Duncan. This book clarifies the interrupt calls that are being made, and
what is actually passed to the machine.
For more details on serial-communication programming in C, see the "C
Programmer's Guide to Serial Communications" by Joe Campbell.
Modification Type: | Major | Last Reviewed: | 12/12/2003 |
---|
Keywords: | kb16bitonly KB47987 |
---|
|