HTBasic Help
×
Menu
Index

IN/OUT Operations

 
At the lowest level, the CPU in your computer must be able to input or output data. Some CPU’s, like the Motorola 680x0 processors in an HP Workstation, use memory space for all CPU I/O, even for devices. Other CPU’s, like the Intel 80x86 processors in a PC, have an I/O space in addition to memory space. PEEK/POKE access memory space; IN/OUT access I/O space. The following four statements are available in HTBasic to access I/O space.
 
INP(L)    IN byte
INPW(L)    IN word
OUT L,V    OUT byte
OUTW L,V    OUT word
 
L specifies the address of the byte or word. V specifies the value to read or write. IN/OUT operations are most typically used to access a data acquisition board plugged into your computer for which there is no HTBasic driver. Most boards come with example programs showing how to access them with IN/OUT instructions.
 
WARNING: Because incorrect use of IN and OUT can cause your system to crash, data to be lost, or damage to your computer hardware, use this function at your own risk. TransEra cannot be held liable for any consequences.