
325
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.")
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 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, then 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.
Summary of Contents for BHT-BASIC 100 SERIES
Page 1: ......
Page 161: ...153 Chapter 10 Sleep Function CONTENTS 10 1 Sleep Function 154...
Page 163: ...155 Chapter 11 Resume Function CONTENTS 11 1 Resume Function 156...
Page 173: ...165 Chapter 13 Backlight Function CONTENTS 13 1 Backlight Function 166...
Page 249: ...241 Example CLOSE IF kyIn Y THEN KILL Master Dat END IF Reference Statements CLFILE...