
Commands - 12
BIT
Process Statement
SYNTAX: BIT I/O address,bit,value
BIT I/O address, bit,ON
BIT I/O address, bit,OFF
BIT I/O address, bit,NOT
PURPOSE: To set or turn on an individual bit at the specified I/O address without affecting the other bits.
REMARK S: This statement will operate only with I/O addresses, not memory addresses. This program works by
reading the last byte written to this port, performing the bit operation and writing it back to the same
I/O address. Ports like those on the 82C55 can be read back. The BIT statement cannot be used
with ports that lack read back capability.
Four syntaxes are allowed. The first syntax is the most flexible, as the value parameter can be a
variable. The next three are more descriptive, wher e ON sets the bit high, OFF sets the bit low, and
NOT writes the complement of the bit. These execute faster than the first variation and are
self– documenting.
RELATED: BIT function, INP, ON BIT, OUT
EXAMPLE: 10 BIT &10,2,1 Set bit 2 of addr ess &10 to a high state
10 BIT &10,5,A Set bit 5 of address &10 to the value of A
10 BIT &10,1,OFF Set bit 1 of address &10 to a low state.
10 BIT &10,0,NOT This reverses the value of bit 0 at address &10
ERROR: < Data negative > – if I/O address, bit or value
< Data out of range > – if value is not 0, 1, ON, NOT or OFF, or if bit > 8
< Data > 65,535> – for I/O addre ss
Comentarios a estos manuales