Example
This example shows conditional assembly.
1
2
3
4
5
6
If_4: .if
7 000000 0004
8
9
10
11
12
If_5: .if
13 000001 000a
14
15
16
17
18
If_6: .if
19
20
21 000002 0008
22
23
24
If_7: .if SYM1 = 2
25
26
27 000003 0005
28
Assemble Conditional Blocks
SYM1
.set
1
SYM2
.set
2
SYM3
.set
3
SYM4
.set
4
SYM4 = SYM2 * SYM2
.byte
SYM4
.else
.byte
SYM2 * SYM2 ; Unequal values
.endif
SYM1 <= 10
.byte
10
.else
.byte
SYM1
.endif
SYM3 * SYM2 != SYM4 + SYM2
.byte
SYM3 * SYM2
.else
.byte
SYM4 + SYM4
.endif
.byte
SYM1
.elseif SYM2 + SYM3 = 5
.byte
SYM2 + SYM3
.endif
.if/.elseif/.else/.endif
; Equal values
; Less than / equal
; Greater than
; Unequal value
; Equal values
Assembler Directives
4-57
Need help?
Do you have a question about the TMS320C54x and is the answer not in the manual?