HTBasic Help
×
Menu
Index

READIO

Reads a hardware register or a memory byte/word.
 
 READIO( interface-select-code, hardware-register )
READIO( special-interface, address )
READIO( 9827, simple-var )
 
 
Usage:
Control=READIO(Centronix,2)
Shift_flag=READIO(9826,&H417)
Example: READIO.BAS
Description:
Hardware Registers
The contents of a hardware interface register are read and returned on the specified interface. Do not mix READIO WRITEIO operations with STATUS/CONTROL operations. Do not attempt to use READIO WRITEIO registers unless you are very familiar with the hardware; use the STATUS/CONTROL registers instead. Consult the hardware manuals for your computer for complete documentation on interface hardware. The Users Guide lists the READIO WRITEIO registers for the interface device drivers included with HTBasic. For other device drivers, the documentation included with the driver lists the register definitions.
READIO WRITEIO registers in HTBasic are not compatible with HP BASIC READIO WRITEIO registers when the interface hardware is not the same. TransEra's IEEE-488 and HP's HP-IB use the same IEEE-488 chip; therefore, the READIO WRITEIO registers are identical. The serial interface hardware registers differ not only if the UART chip is different, but also if the circuitry surrounding the chip is different. The TransEra GPIO is designed to be READIO WRITEIO compatible with HP's GPIO.
Special Interface Select codes
There are a number of special interface select codes which can be read with the READIO statement. The legal values for special-interface are given in the following paragraphs. For compatibility with earlier releases of HTBasic, READIO(8080,L) and READIO(-8080,L) are still supported but have been replaced with INP and INPW, respectively.
PEEK Memory
READIO(9826,L) and READIO(-9826,L) are used to "peek" at the contents of a memory byte or word, respectively. L specifies the address of the byte/word to peek. If peeking a word and L is odd, the even address L-1 is used. Where L specifies an address within the HTBasic process.
Warning: Peek should only be done on addresses returned by READIO(9827,I)! Peeking any other location can cause your system to crash, data to be lost and damage to your computer hardware. Use of this function for any other address is unsupported, and TransEra cannot be held responsible for any consequences.
Locating a Numeric Variable
READIO(9827,I) is used to locate the variable I. READIO(9827,A(0)) is used to locate the address of the first element of A. These operations are useful when a small assembly subroutine is stored in a variable and called with WRITEIO.
See Also: