qbasic.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
INP Function, OUT Statement
  Contents  Index  Back
─────────────────────────────────────────────────────────────────────────────
INP returns a byte read from a hardware I/O port.
OUT sends a byte to a hardware I/O port.
 
INP(port%)
OUT port%, data%
 
    ■ port%     A number in the range 0 through 65,535 that identifies
                the port.
    ■ data%     A numeric expression in the range 0 through 255 to send
                to the port.
 
Example:
    x% = INP(&H3FC)          'Read COM1 Modem Control Register.
    OUT &H3FC, (x% XOR 1)    'Change Data Terminal Ready bit.
 
See Also    WAIT