WAIT
This page was last modified 10:15, 3 August 2021 by Mars2000you. Based on work by Gdx and NYYRIKKI and others.

Contents

Effect

Reads the specified I/O port and suspends the Basic program execution until the result of value read at <PortNumber> XOR <Value2> AND <Value1> equals zero.

Syntax

WAIT <PortNumber>,<Value1>,<Value2>

Note: Parameters can not end with a comma alone.

Parameters

<PortNumber> is the I/O port to read until the operation equals 0.

<Value1> is a value between 0 and 255. It can be a variable or an expression.

<Value2> is a optional value between 0 and 255. It can be a variable or an expression. By default it is 0.

Example

10 ' Wait until user toggles CAPS LOCK on.
20 WAIT 170,64,64

Related to

AND, INP(), OUT, SOUND, VDP(), XOR

Compatibility

MSX-BASIC 1.0 or higher