Signal flags
************

Client-defined signal flags
===========================

The client can define any number of signal flags to use. The number of signals MUST be declared explicitly in the client code, and MUST NOT change in stateful or asynchronous execution environments.

In the assembly code, signals may only be referred to by their numerical value. The numeric value of client-defined signals must have numeric value 8 or greater.

Flow control
------------

Signal flags enables the client to control the execution flow as a side-effect of the execution of external code symbols.

Branching is defined using either the CATCH or CROAK instructions.

The client specifies whether or not a set flag should be reset on next yield. If not, it is the responsiblity of the client to reset the flag when necessary.

Built-in signal flags
=====================

For the numeric values of the signals, please refer to the signals appendix.

Flag name
Description
Lifetime
Writeable?
READIN
Input is being processed.
From first INCMP until: an INCMP match or an invalid input exception is triggered.
no
INMATCH
Input matched an INCMP instruction.
Next instruction.
no
TERMINATE
Terminate execution before the following instruction.
Until explicit reseet.
no
DIRTY
Rendered output is available.
Until output is processed.
no
WAIT
Halt execution before the following instruction, and yield control to client.
Until control is yielded.
no
LOADFAIL
An unexpected error has occurred during execution of an external code symbol.
Next instruction.
no
LANG
Output from an external code symbol is a valid language code, and language should be changed accordingly.
Next instruction.
yes