Microsoft KB Archive/47987

From BetaArchive Wiki
Knowledge Base


_bios_serialcom Sends and Receives Single Character Data

Article ID: 47987

Article Last Modified on 12/12/2003



APPLIES TO

  • The C Run-Time (CRT), when used with:
    • Microsoft C Professional Development System 5.1
    • Microsoft C Professional Development System 6.0
    • Microsoft C Professional Development System 6.0a
    • Microsoft C Professional Development System 6.0a
    • Microsoft C/C++ Professional Development System 7.0
    • Microsoft Visual C++ 1.0 Professional Edition
    • Microsoft Visual C++ 1.5 Professional Edition



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.


Additional query words: kbinf 1.00 1.50 5.10 6.00 6.00a 6.00ax 7.00

Keywords: kb16bitonly KB47987