.if
.else
.endif

Conditional code and data generation.
The .if, .else and .endif keywords are used to control the generation of code and data.
        .if <expr>
                <block1>
        .else
                <block2>
        .endif
when the .if statment is encountered the expression <expr> is evaluated and if non-zero all the statements in <block1> are processed. If the expression <expr> is zero then all the statements in <block2> are processed. .if statements may be nested to any level (they can occure in <block1> and <block2> and can themselves contain other .if statements in their <block1> and <block2>).
e.g.

        .if <expr>

                .if <expr>
                        <block1>
                .else
                        .if <expr>
                                <block1>
                        .else
                                <block2>
                        .endif
                .endif

        .else
                <block2>
        .endif
.if statements can omit the <block2> group of statemets and where this is
done the .else statement can also be omitted.
e.g.
        .if <expr>
                <block1>
        .endif
.if statements tend to be mostly used in macros to generate code or data depending on the parameters passed to them
e.g.

foo     .macro  arg1, arg2

        .if     arg1 <= arg2
        .dw     arg1
        .dw     arg2
        .else
        .dw     arg2
        .dw     arg1
        .endif

        .endm