13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>TASKING</strong> <strong>VX</strong>-<strong>toolset</strong> <strong>for</strong> <strong>ARM</strong> <strong>User</strong> <strong>Guide</strong>.IF, .ELIF, .ELSE, .ENDIFSyntax.IF expression..[.ELIF expression] ; the .ELIF directive is optional..[.ELSE]; the .ELSE directive is optional...ENDIFDescriptionWith the .IF/.ENDIF directives you can create a part of conditional assembly code. The assemblerassembles only the code that matches a specified condition.The expression must evaluate to an absolute integer and cannot contain <strong>for</strong>ward references. If expressionevaluates to zero, the IF-condition is considered FALSE, any non-zero result of expression is consideredas TRUE.If the optional .ELSE and/or .ELIF directives are not present, then the source statements following the.IF directive and up to the next .ENDIF directive will be included as part of the source file being assembledonly if the expression had a non-zero result.If the expression has a value of zero, the source file will be assembled as if those statements betweenthe .IF and the .ENDIF directives were never encountered.If the .ELSE directive is present and expression has a nonzero result, then the statements between the.IF and .ELSE directives will be assembled, and the statement between the .ELSE and .ENDIF directiveswill be skipped. Alternatively, if expression has a value of zero, then the statements between the .IF and.ELSE directives will be skipped, and the statements between the .ELSE and .ENDIF directives will beassembled.You can nest .IF directives to any level. The .ELSE and .ELIF directive always refer to the nearestprevious .IF directive.A label is not allowed with this directive.ExampleSuppose you have an assemble source file with specific code <strong>for</strong> a test version, <strong>for</strong> a demo version and<strong>for</strong> the final version. Within the assembly source you define this code conditionally as follows:.IF TEST... ; code <strong>for</strong> the test version.ELIF DEMO... ; code <strong>for</strong> the demo version.ELSE116

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!