Table of Contents Previous topic Next topic
ASSEMBLER DIRECTIVES->Other Assembler Directives->IFC IFNC IFIC IFINC Conditional Assembly with String Comparison
These directives cause the assembly of the subsequent block of statements to be dependant upon the comparison of two character strings in the operand. The ENDC directive marks the end of the statement block.
Formats:
IFC | <string 1>,<string 2> | <comment> |
IFNC | <string 1>,<string 2> | <comment> |
IFIC | <string 1>,<string 2> | <comment> |
IFINC | <string 1>,<string 2> | <comment> |
1 nam ifcnc
2 ttl *** IFC and IFNC ***
3 opt mc,mex,md
4
5 sam macr
6
7 ifc \0,disc
8 ifnc \1,check
9 fail
10 endc
11 dc.b 'disc'
12 dc $1234
13 endc
14
15 ifc \0,ram
16 dc.b 'ram'
17 even
18 dc.w $5678
19 endc
20
21 endm
22
23 *** Show macro expansions
24
25 sam disc,check
ifc disc,disc
ifnc check,check
endc
00000000 64697363 dc.b 'disc'
00000004 1234 dc $1234
endc
ifc disc,ram
endc
26
27 sam disc
ifc disc,disc
ifnc ,check
Warning at line 27 Fail directive encountered
fail
endc
00000006 64697363 dc.b 'disc'
0000000A 1234 dc $1234
endc
ifc disc,ram
endc
28
29 sam ram
ifc ram,disc
ifnc \1,check
endc
ifc ram,ram
0000000C 72616D dc.b 'ram'
0000000F 00 even
00000010 5678 dc.w $5678
endc
30
31 end
Assembly complete
Bytes filed: 18
0 errors
1 warnings