ifc - Start if block by condition

ifc - Start if block by condition

Calling Format

ifc     status0, status1, mode

Operands

Name Description
status0 Value of status register 0 (the value is either 0 or 1).
status1 Value of status register 1 (the value is either 0 or 1).
mode Conditional mode (0: OR, 1: AND, 2: Only status register 0, 3: Only status register 1)

Overview

Runs conditional processing based on the status register values.
The value specified by status0 (or status1) is tested for equality against the value of status register 0 (or 1). When mode is 0, the result is true when either status register 0 or status register 1 matches its respective operand.
When mode is 1, both status registers must match their respective operands.
When mode is 2, status register 0 must match status0.
When mode is 3, status register 1 must match status1.
When the condition is true, the instructions between ifc and endif are executed. If there is an else instruction between ifc and endif, the instructions between ifc and else are executed.
When the condition is false, the instructions between ifc and endif are skipped and control moves to the instruction immediately after endif. If there is an else instruction between ifc and endif, the instructions between else and endif are executed.
This instruction must be followed by an endif instruction.

You can nest a combined total of up to eight ifb and ifc instructions.

At least one instruction must be inserted between ifc and endif as well as between ifc and else.

Operation

switch ( mode )
{
    case 0 :
        if ( status0 == Status_register0 || status1 == Status_register1 )
            condition = true
        break;
    case 1 :
        if ( status0 == Status_register0 && status1 == Status_register1 )
            condition = true
        break;
    case 2 :
        if ( status0 == Status_register0 )
            condition = true
        break;
    case 3 :
        if ( status1 == Status_register1 )
            condition = true
        break;
}
if ( condition == true )
{
    ...
}

Code Example

ifc     1, 1, 0    // Executes the instructions between ifc and else when status register 0 or status register 1 is equal to 1
    ...
else
    ...
endif
..

Revision History

2011/12/20
Initial version.

CONFIDENTIAL