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/WRITEIOoperations should not be mixed withSTATUS/CONTROLoperations. Do not attempt to useREADIO/WRITEIOregisters unless you are very familiar with the hardware. Use theSTATUS/CONTROLregisters instead. The hardware manuals for your computer should be consulted for complete documentation on the interface hardware. TheUsers GuidelistsREADIO/WRITEIOregisters for the interface device drivers included with HTBasic. Optional interface device drivers include documentation for the registers.
READIO/WRITEIOregisters in HTBasic are not compatible with HP BASICREADIO/WRITEIOregisters 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 theREADIO/WRITEIOregisters 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 isREADIO/WRITEIOcompatible with HP's GPIO.
Special Interface Select Codes
There are a number of special interface select codes which can be used with theWRITEIOstatement. The legal values for special-interface are given in the following paragraphs. For compatibility with earlier releases of HTBasic,WRITEIO8080,L andWRITEIO-8080,L are still supported but should be replaced withOUTandOUTW, respectively.
POKE Memory
WRITEIO9826,L;V andWRITEIO-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 byREADIO(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.