Available on: c128z coleco cpc msx1 sc3000 sg1000 vg5000 zx

IN

The IN command is used to read a value from a specific input/output (I/O) port. The port parameter indicates the exact address of the I/O port from which you want to acquire the data. The port address varies depending on the architecture of the computer and the connected peripheral.

When the program encounters the IN instruction, it stops executing and reads the binary value present on the specified port. The value read from the port is converted into a numeric format understandable by the program and is assigned to the value variable.

The IN command is often used to read data from sensors connected to I/O ports, such as temperature, humidity, light sensors, etc. It can be used to control the status of external devices, such as motors, relays, displays, etc. In combination with other instructions, the IN command can be used to implement serial communication with other devices.

SYNTAX

 = IN(port)


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 x = IN( &HBC00 )


ABBREVIATION: In

Join BASIC 10Liner Contest with ugBASIC!

An interesting competition is held at the beginning of each year: the BASIC 10Liner Contest. It is possible to use ugBASIC to participate in the next "BASIC10Liner" competition, in the following categories:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

IN ↔ In

Any problem?

If you have found a problem with this keyword, if you think there is a bug or, more simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!

open an issue BACK TO KEYWORDS