WAITM (Wait for Multiple Events) Macro

The macro enables your program or task to wait for one of a number of events to occur.

Control returns to the task when at least one of the event control blocks specified in the WAITM macro is posted. Refer to the WAIT (Wait for Event) Macro for a description of the types of event control blocks and the restrictions on their use.

WAITM processing can wait for ECBs in 24-bit or 31-bit addressing mode physically resident above or below 16 MB.
  • When WAITM is issued in AMODE 24, the passed ECB addresses or list address are treated as 24-bit addresses. The first byte following the last address in the list must be nonzero to indicate the end of the list.
  • When WAITM is issued in AMODE 31, the passed ECB addresses or list address are treated as 31-bit address. The first bit of the last address in the list must be nonzero to indicate the end of the list.

On return, register 1 holds a posted entry of the ECB list. If register 1 holds the last list entry, the high-order bit is set (only for user-defined ECB lists).

When control returns to a waiting task, register 1 points to the posted event control block (byte 2, bit 0 set to 1).
Note: Telecommunication ECBs must not be waited for, because their format does not satisfy a WAITM.

Format

Read syntax diagramSkip visual syntax diagramnameWAITM, ecbn1listname(1)
Notes:
  • 1 You can specify up to 16 ECB's.

Requirements for the caller

AMODE:
24 or 31
RMODE:
24 or ANY
ASC Mode:
Primary

Parameters

ecb1,ecb2,... | listname | (1)
The operand provides the addresses of the ECBs to be waited upon. The names of ecb1, ecb2... are assumed when at least two operands are supplied. Up to 16 names can be coded.

If only one operand is supplied, it is assumed to be the name (listname) of a list of consecutive fullword addresses that point to the ECBs to be waited upon.