Commodore 128 System Manual page 326

Hide thumbs Also See for 128:
Table of Contents

Advertisement

VOL 1 Sets volume to its lowest level.
VOL 15 Set volume for SOUND and PLAY statements to its
highest level.
WAIT
Pause program execution until a data condition is satisfied
WAIT Location, mask-1 [,mask-2]
The WAIT statement causes program execution to be suspended
until a given memory address recognizes a specified bit pattern
or value, ln other words, WAIT can be used to halt the program
until some external event has occurred. This is done by
monitoring the status of bits in the Input/Output registers. The
data items used with the WAIT can be any values. For most
programmers, this statement should never be used. It causes the
program to halt until a specific memory location's bits change in
a specific way. This is used for certain I/O operations and almost
nothing else. The WAIT statement takes the value in the memory
location and performs a logical AND operation with the value in
mask-1. If mask-2 is specified, the result of the first operation is
exclusively ORed with mask-2, ln other words, mask-1 "filters
out" any bits not to be tested. Where the bit is 0 in mask-1, the
corresponding bit in the result will always be 0. The mask-2 value
flips any bits, so that an off condition can be tested for as well as
an on condition. Any bits being tested for a 0 should have a 1 in
the corresponding position in mask-2. If corresponding bits of the
mask-1 and mask-2 operands differ, the exclusive-OR operation
gives a bit result of 1. If the corresponding bits get the same
result the bit is 0. It is possible to enter an infinite pause with the
WAIT statement, in which case the RUN/STOP and RESTORE
keys can be used to recover. WAIT may require a BANK
command if the memory you wish to access is not in the
currently selected BANK.
The following examples are for 0128 mode only. The first
example WAITs until a key is pressed on the tape unit to continue
with the program. The second example will WAIT until the SHIFT
key is pressed and then released. The third example will WAIT
until either bit 7 (128) is on or bit 4 (16) is off.
17-84

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

128d

Table of Contents