{{htmlmetatags>metatag-robots=()
metatag-title=(IN | ugBASIC User Manual)
metatag-keywords=(ugBASIC,Commodore 64,Commodore PLUS/4,ZX Spectrum)
metatag-description=(Manual page for IN)
metatag-media-og:image=(:ugbasic:logo-ugbasic-fb.png)
metatag-og:title=(IN | ugBASIC User Manual)
metatag-og:description=(Manual page for IN)
}}
====== ugBASIC User Manual ======
===== IN =====
===== SYNTAX =====
= IN(port)
==== PURPOSE ====
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.
==== EXAMPLE ====
x = IN( &HBC00 )
==== ABBREVIATION ====
In
==== AVAILABLE ON ====
* Commodore 128 (Zilog Z80)
* ColecoVision
* Amstrad CPC 664
* MSX
* SEGA SC-3000
* SEGA SG-1000
* VG-5000
* ZX Spectrum 48
==== ANY PROBLEM? ====
If you have encountered a problem using this command, if you think there is a bug or the explanation is unclear, please [[https://github.com/spotlessmind1975/ugbasic/issues/new?title=ISSUE ON IN|open an issue]] for this keyword on GitHub. Thank you!===== POWERED BY =====
[[:ugbasic:user:index|{{ :ugbasic:user:logo-ugbasic.png?nolink&600 |}}]]