Difference between revisions of "WAIT"
imported>Cyperium |
imported>Cyperium |
||
Line 22: | Line 22: | ||
− | ''See also:'' [[Scancodes]](demo) | + | ''See also:'' [[Scancodes]](demo), [[INP]], [[OUT]] |
Revision as of 17:52, 19 October 2009
The WAIT statement suspends program execution while monitoring a port.
The WAIT statement is often used to wait for the monitor's vertical retrace and either waits for the monitor's vertical retrace to begin or end.
General syntax: WAIT port, and-expression[,xor expression]
The and-expression is combined with the data at the port using the operational AND and only if the result is non-zero is the next statement executed.
If the xor-expression is used it is combined with the data from the port using the operational XOR, and then the result is combined using the value from the and-expression using operational AND, if (and only if) the result is non-zero after this process the program continues.
Syntax for vertical retrace:
- WAIT &H3DA, 8 ' finishes whenever the screen isn't being written to
- WAIT &H3DA, 8, 8 ' finishes whenever the screen is being written to
- Either statement can be used to try to reduce screen flickering.
- If both statements are used, try changing the order.
See also: Scancodes(demo), INP, OUT