Propeller Manual

Table Of Contents
3: Assembly Language Reference – Conditions (IF_x)
Conditions ( IF_x )
Every Propeller Assembly instruction has an optional “condition” field that is used to
dynamically determine whether or not it executes when it is reached at run time. The basic
syntax for Propeller Assembly instructions is:
Label Condition Instruction Operands Effects
The optional Condition field can contain one of 32 conditions (see IF_x (Conditions), page
295) and defaults to
IF_ALWAYS when no condition is specified. During compilation, the 4-bit
Value representing the condition is used in place of the –CON– field’s default bits in the
instruction’s opcode.
This feature, along with proper use of instructions’ optional Effects field, makes Propeller
Assembly very powerful. For example, the C and Z flags can be affected at will and later
instructions can be conditionally executed based on those results.
When an instruction’s condition evaluates to
FALSE, the instruction dynamically becomes a
NOP, elapsing 4 clock cycles but affecting no flags or registers. This makes the timing of
multi-decision code very deterministic since the same path of execution (same execution
time) can be used and yet can achieve one of many possible outcomes.
See IF_x (Conditions) on page 295 for more information.
Propeller Manual v1.1 · Page 287