Technical information

Using NewBIOS Serial Solutions
The main registers used to control the asynchronous
services are:
AH The AH register is set to the number of the asynchronous
service required.
DX The number of the port to use. 0 means COM1, 1 means
COM2 etc.
AL, BX, CX
Other control information, depending on the service.
Returns from the services depend on the particular service.
For example for services 0H to 5H:
AH Line status, details of receiver errors, whether bytes are
ready to be sent/received.
For services 0H,3H to 5H:
AL Modem status, the values of the four RS232 handshake
inputs, and whether or not they have changed since last
read.
8086 Assembly Language._______________________
This section contains three examples of the use of BIOS
services from assembly language. Anyone not immediately
familiar with accessing interrupts from assembly language should
refer to the previous section, ’accessing asynchronous services’.
BIOS access from assembly language is fast and efficient,
allowing assembly language programs to easily control serial
ports.
Example 1, Initialising A Port.__________________________
This is a simple example that will demonstrate some of the
above points. It uses service 0H to set up the baud rate etc for
COM1, typically the first task of a program which performs
serial input/output.
;Code fragment to set up RS232 port to 1200 baud,
;even parity, 1 stop bit and 7 data bits.
;
mov ah,0H ;Mov the value ’0’ to the AH register.
;Use service 0, initialise.
Chapter 4 Page 47