BASIC DOS SERIAL FUNCTIONS:

          Function 00h - Set communications parameters, baud, parity etc.

               Input:    AH = 00h
                         AL = Communications parameters (defined below)
                         DX = Port number

               Output:   AX = Port status (see function 03h)

          This  function is identical to  the IBM PC  BIOS call except that
          110 baud and 150 baud have been replaced by 19200  baud and 38400
          baud respectively.  The high order  3 bits of AL specify the baud
          rate  as  follows:   See functions  1Eh and  1Fh for  an enhanced
          version of this function.

                       000 =   110 baud (bios)
                       001 =   150  ''  (bios)

                       010 =   300  ''
                       ??? =   450  ''  (unused)
                       011 =   600  ''
                       100 =  1200  ''
                       101 =  2400  ''
                       110 =  4800  ''
                       111 =  9600  ''

                       000 = 19200  '' (fossil Replaces 110 baud setting)
                       001 = 38400  '' (fossil Replaces 150 baud setting)

          The low order 5 of AL specify the following:

               Bits 4-3 define parity:       0 0  no parity
                                             0 1  odd parity
                                             1 1  even parity

               Bit 2 defines stop bits:      0    1 stop bit;
                                             1    1.5 bits for 5-bit codes,
                                                  2 for others

               Bits 1-0 character length:    0 0  5 bits
                                             0 1  6 bits
                                             1 0  7 bits
                                             1 1  8 bits

          Function 01h - Transmit character and wait.

               Input:    AH = 01h
                         AL = Character
                         DX = Port number

               Output:   AX = Port status (see function 03h)

          Upon  entry to this function, AL must contain a character that is
          to be transmitted.   If there is room in the transmit buffer, the
          character is buffered.  Otherwise, this  function will loop until
          their is  room in the buffer or until  a timeout occurs.  If set,
          the high  order bit of  the returned status indicates  a time out
          occurred.   See function 03h.   At the time of  this writing, the
          timeout is set to 30 seconds.

          Note:  X00 executes functions with  the interrupt mask  set as it
          was  when entered.   That is,  if X00  is called  will interrupts
          masked, interrupts will  remain masked during  the processing  of
          the function.  If this function is called with interrupts masked,
          it may never return.

          Function 02h - Get received character with wait.

              Receive character with wait

               Input:    AH = 02h
                         DX = Port number

               Output:   AH = Line status (same AH returned by function 3)
                         AL = Input character

          If a  character available  in the  receive buffer, this  function
          returns the next character from the  receive buffer in AL.  If no
          receive character is available, this  function will wait until  a
          character is received or  until a timeout occurs.   If a  timeout
          occurs,  the high order bit of  AH will be set  upon return.  See
          function 03h.   At the time of this writing, the timeout value is
          set to 30 seconds.

          Note:  X00 executes functions with  the interrupt mask  set as it
          was when  entered.   That is,  if X00  is called  will interrupts
          masked, interrupts will  remain masked during  the processing  of
          the function.  If this function is called with interrupts masked,
          it may never return.

          Function 03h - Return Serial Port Status.

               Input:    AH = 03h
                         DX = Port number

               Output:   AX = Status bits as follows:

                    AH = Line Status, where:
                         Bit 0 = RDA  - input data is available in buffer
                         Bit 1 = OVRN - the input buffer has been overrun
                         Bit 2 = Reserved (Parity error in BIOS INT 14h)
                         Bit 3 = Reserved (Framing error in BIOS INT 14h)
                         Bit 4 = Reserved (Break detect in BIOS INT 14h)
                         Bit 5 = THRE - room is available in output buffer
                         Bit 6 = TSRE - output buffer is empty
                         Bit 7 = Timeout (set by functions 1 and 2 only)

          Bit 7 of AH IS ALWAYS ZERO WHEN RETURNED BY FUNCTION 3.  Bit 7 of
          AH may be  set to one by other functions (like 1 and 2) that also
          return status.  When bit 7 of AH is set to one, none of the other
          15 bits returned in AX are valid.

                    AL = Modem status, where:
                         Bit 0 = Delta clear to send (not reliable)
                         Bit 1 = Delta data set ready (not reliable)
                         Bit 2 = Delta data carrier detect (not reliable)
                         Bit 3 = Always set to 1 upon return (DUMMY DCD)
                         Bit 4 = Clear to send (CTS)
                         Bit 5 = Data set ready (DSR)
                         Bit 6 = Ring indicator (RI)
                         Bit 7 = Data carrier detect (DCD)

          Bit  3  of AL  is  always  returned  set  to  1.    This  enables
          application programs  to use  bit 3  as a  carrier detect bit  on
          hardwired (null modem) links.

          Function 04h - Activate Port.

               Input:    AH = 04h
                         DX = port number

               Output:   AX = 1954h if successful
                         BL   =  maximum  function  number  supported  (not
                         counting functions 7Eh and above)
                         BH = rev of FOSSIL specification supported

          This function instructs X00  to use the FOSSIL specification  for
          the specified port.  Prior to issuing this function, any function
          that  requires a port number  in DX be will  passed on to BIOS or
          X00's  INT 14h BIOS emulator.  When this function  is called, all
          interrupts   involved  in  supporting   the  communications  port
          (specified in DX) are  set up for support by X00.   DTR is turned
          on by this function.  The baud rate is NOT set or changed by this
          function.

          If an additional call  to this function occurs (2  Inits or Init,
          Function nn, Init, etc.)  X00 will reset (clear) all  buffers and
          all flow control is turned off.  Values returned in the registers
          upon a re-init are the same as an initial init (defined above).

          NOTICE: At a future date (July 1991 or later), the author intends
          to  make  this  function  identical to  the  PS/2's  function  4.
          Function 1Ch is a  duplicate of this function.   New or  modified
          application programs should discontinue  use of this function and
          use the duplicate (1Ch) function.

          A section is the  application notes describes a simple  method of
          determining  which Activate/Deactivate  function numbers  to use.
          The described method should work on all FOSSIL implementations.

          Function 05h - Deactivate Port.

               Input:    AH = 05h
                         DX = Port number

               Output:   Nothing

          This function  instructs X00  that it  should  no longer  process
          calls for specified port (in  DX) using the FOSSIL specification.
          If the port was never activated by function 4, then this function
          is ignored.  Any  subsequent function calls, that require  a port
          number  in  DX, will  be  passed  to BIOS  or  the  BIOS INT  14h
          emulator.

          NOTICE: At a future date (July 1991 or later), the author intends
          to  make  this  function  identical  to  the  PS/2's  function 5.
          Function 1Dh is  a duplicate of this  function.  New  or modified
          application programs should discontinue use of this function  and
          use the duplicate (1Dh) function.

          A section is the  application notes describes a simple  method of
          determining  which Activate/Deactivate  function numbers  to use.
          The described method should work on all FOSSIL implementations.

-end-
