HTBasic Help
×
Menu
Index

OUT and OUTW

Outputs a Byte or Word to an I/O Port.
 
 OUT port-address, byte-value
 OUTW port-address, word-value
 
Usage:
OUT &H300,64+16
OUTW Base+3,&HF001
 
Example:           OUT.BAS  OUTW.BAS
 
Description:
The OUT statement outputs a byte to the specified I/O port. It is equivalent to WRITEIO 8080,Port;Byte. The OUTW statement outputs a word to the specified I/O port. It is equivalent to WRITEIO -8080,Port;Word. These statements are useful for doing I/O with devices, data acquisition boards, etc. for which there is no device driver available.
 
Some operating systems, such as Windows NT protect I/O ports; applications are not allowed to read or write to them. Under such operating systems, these functions are not allowed.
 
Back-porting
to HP BASIC:
OUT and OUTW are unique to HTBasic statements that are not available in HP BASIC. They should not be used in programs that must be ported back to HP BASIC.
 
See Also: