
Assemble Conditional Block
.if, .else, .endif
6-23
Assembler Directives
Syntax
.if
well-defined expression
.else
.endif
Description
Three directives provide conditional assembly:
-
The .if directive marks the beginning of a conditional block. The
expres-
sion is a required parameter.
J
If the expression evaluates to
true (nonzero), the assembler as-
sembles the code that follows it (up to an .else, or an .endif).
J
If the expression evaluates to
false (0), the assembler assembles
code that follows an .else (if present), or an .endif.
-
The .else directive identifies a block of code that the assembler assembles
when the .if expression is false (0). This directive is optional in the condi-
tional block; if an expression is false and there is no .else statement, the
assembler continues with the code that follows the .endif.
-
The .endif directive terminates a conditional block.
Nested .if/.else/.endif directives are not valid.
Example
Here is an example of conditional assembly:
TRUE
.set 1
FALSE .set
0
.if TRUE
;
nop
; Assembles ’nop’ since TRUE
.else
;
B
$
; Never assembles
.endif
;
Summary of Contents for TMS320C3 Series
Page 1: ...TMS320C3x DSP Starter Kit User s Guide...
Page 18: ...1 4...
Page 28: ...2 10...
Page 82: ...5 18...
Page 140: ...Communications Kernel Source Code A 12...
Page 145: ...Schematics B 5 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 146: ...Schematics B 6...
Page 147: ...Schematics B 7 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 148: ...Schematics B 8...
Page 149: ...Schematics B 9 DSK Circuit Board Dimensions and Schematic Diagrams...
Page 150: ...Schematics B 10...
Page 154: ...B 14...
Page 160: ...C 6...
Page 166: ...Index 6...