IN

BASin

IN

Function

IN checks the status of the keyboard and other input and output devices. It reads a byte from a given port address that indicates the status of the device connected to the port.

How to use IN

IN is followed by a numeric value, for example

150 LET x=IN y

The value following IN may range from 0 to 65535 inclusive, and specifies the port address that is to be read. IN then returns the byte read from this port.

Keyboard addresses

The keyboard has eight addresses, each of which may contain one of five different bytes depending on which key is pressed. The addresses are 65278, 65022, 64510, 63486, 61438, 57342, 49150 and 32766. Byte values at these addresses may be 175, 183, 187, 189 or 190.

Format

  • IN num-const
  • IN num-var
  • IN (num-expr)

See also

Chapter 23.