2.4.8.10. - PC Port I/O
The port I/O functions allow arbitrary access to I/O ports on a PC computer, and therefore, should be used with caution. To lesson the chance of writing data to a port that might damage the computer or corrupt data, valid addresses for the following functions must be explicitly assigned in the config file.
port_get(addr)
-
Reads one byte from the PC I/O port with the address
addr
. Resets to command level if the port has not been selected in the config file. Otherwise, returns the byte read. port_getw(addr)
-
As above, but reads and returns a two-byte value.
port_put(addr, byte)
-
Writes the byte
byte
to the PC I/O port with the addressaddr
. Resets to command level if the port has not been selected for writing in the config file. Otherwise, returns zero. port_putw(addr, word)
-
As above, but writes the two-byte value
word
to the I/O port.