Specifications
Chapter 14. Statement Reference
326
Syntax:
WAIT portnumber,ANDbyte[,XORbyte]
Parameter:
portnumber
A numeric expression
ANDbyte and XORbyte
A numeric expression which returns a value from 0 to 255.
Description:
WAIT suspends a user program while monitoring the input port designated by
portnumber until the port presents the bit pattern given by ANDbyte and XOR-
byte
. (Refer to Appendix D, "I/O Ports.")
Each bit in
ANDbyte corresponds to a port bit you want to turn on. Each bit in
XORbyte corresponds to a port bit you want to turn off.
The byte at the input port is first XORed with the
XORbyte parameter. Next, the
result is ANDed with the value of
ANDbyte parameter.
If the final result is zero (0), the
WAIT statement rereads the input port and contin-
ues the same process. If it is nonzero, control passes to the statement following the
WAIT.
• If XORbyte option is omitted, the WAIT statement uses a value of zero (0).
WAIT 1,x ’ = WAIT 1,x,0
• If an invalid port number or bit data is specified, it will be assumed as zero (0) so
that the WAIT statement may fall into an infinite loop.
I/O statement
WAIT
Pauses program execution until a designated input port presents a given bit pattern.