288
____________________________________________________________________
I/O statement
WAIT
Pauses program execution until a designated input port presents a given bit pattern.
____________________________________________________________________
Syntax:
Syntax:Syntax:
Syntax:
WAIT portnumber,ANDbyte[,XORbyte]
Parameter:
Parameter:Parameter:
Parameter:
portnumber
A numeric expression.
ANDbyte and XORbyte
A numeric expression which returns a value from 0 to 255.
Description:
Description:Description:
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
XORbyte.(Refer to Appendix D, "I/O Ports.")
ANDbyte is a bit pattern in which bits to be checked should be set to 1. XORbyte is a bit
pattern in which the same bit positions as ones set to 1 in ANDbyte should be set to the
values to be picked out.
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 continues 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, then it will be assumed as zero (0) so
that the WAIT statement may fall into an infinite loop.
Kommentare zu diesen Handbüchern