HTBasic Help
×
Menu
Index

WRITEIO

Writes to a hardware register or a memory byte/word.
 
 WRITEIO interface-select-code, hardware-register; data
WRITEIO special-interface, address; data
 
 
 
Usage:
WRITEIO Centronix,0;&HAA
WRITEIO -9826,Address;New_value
WRITEIO 8080,Ioadd;BINIOR(Oldata,&H80)
Description:
Hardware Registers
The specified data value is written to a hardware interface register. READIO/WRITEIO operations should not be mixed 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. The hardware manuals for your computer should be consulted for complete documentation on the interface hardware. The Users Guide lists READIO/WRITEIO registers for the interface device drivers included with HTBasic. Optional interface device drivers include documentation for the registers.
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 card uses the same IEEE-488 chip as HP's HP-IB, 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 interface is READIO/WRITEIO compatible with HP's GPIO.
Special Interface Select Codes
There are a number of special interface select codes which can be used with the WRITEIO statement. The legal values for special-interface are given in the following paragraphs. For compatibility with earlier releases of HTBasic, WRITEIO 8080,L and WRITEIO -8080,L are still supported but should be replaced with OUT and OUTW, respectively.
POKE Memory
WRITEIO 9826,L;V and WRITEIO -9826,L;V are used to "poke" the value V into a byte or word of memory, respectively. L specifies the address of the byte/word to poke. If L is odd when doing a word operation, the even address L-1 is used. L specifies an address within the HTBasic process.
Warning: Poke should only be done on addresses returned by READIO(9827,I)! Poking 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.  Under some protected mode operating systems like Windows NT, some of these operations are not allowed.
See Also: