INF: _bios_serialcom Sends and Receives Single Character Data

ID Number: Q47987

5.00 5.10 6.00 6.00a 6.00ax 7.00

MS-DOS

Summary:

In the Microsoft C online help and run-time library reference manual

for C versions 5.0, 5.1, 6.0, 6.0a, 6.0ax, and C/C++ version 7.0, and

QuickC versions 2.0, 2.01, 2.5, and 2.51, _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 reference words: 5.00 5.10 6.00 6.00a 6.00ax 2.00 2.01

2.50 2.51 7.00