Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>com_lsr()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 COM_LSR()
 Reads the Line Status Register (LSR)
------------------------------------------------------------------------------
 Syntax

     COM_LSR(<nComPort>) --> nLSR

 Argument

     <nComPort>  Designates the port (1 to 4) that reads the Line Status
     Register (LSR).

 Returns

     COM_LSR() returns the contents of the Line Status Register.

 Description

     The Line Status Register makes the following information available:

     Table 3-3: LS Register Coding
     ------------------------------------------------------------------------
     Bit     Symb. Const              Definition
     ------------------------------------------------------------------------
      0      LSR_ERROR                Parameter error
      1      LSR_DATA_READY           Data ready
      2      LSR_OVERRUN_ERR          Overflow error
      4      LSR_PARITY_ERR           Parity error
      8      LSR_FRAMING_ERR          Framing error
     16      LSR_BREAK                BREAK recognized
     32      LSR_TRANS_HOLD_EMPTY     Transmission holder register empty
     64      LSR_TRANS_EMPTY          TX shift register empty
     ------------------------------------------------------------------------

 Notes

     .  The Line Status Register can only be examined using this
        function.

     .  Some bits in this register are reset by a read.

 Example

     nStatus  :=  COM_LSR(2)            // Read LSR port 2

     IF ISBIT(nStatus, 5)               // Set bit 5
        ? "BREAK recognized - Abort!"
     ENDIF


See Also: COM_MCR() COM_MSR()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson