The syntax of IFIDN
The IFIDN directive causes the condition block of statements to be assembled if the arguments are identical character strings (case sensitive). (if identical)
and IFDIF
The IFDIF directive causes the condition block of statements to be assembled if the arguments are different character strings (case sensitive). (if different) directives is
IFIDN < argument1 >, < argument2 >
IFDIF < argument1 >, < argument2 >
The angle brackets are required. The condition block of statements
are assembled if the arguments are identical (IFIDN) or
different (IFDIF) character strings.
These two directives are case sensitive (i.e., AX and Ax are
not identical). The case insensitive versions of these directives
are IFIDNI
The IFIDNI directive causes the condition block of statements to be assembled if the arguments are identical character strings (case insensitive). and IFDIFI
The IFDIFI directive causes the condition block of statements to be assembled if the arguments are different character strings (case insensitive). (i.e., with these directives,
AX and Ax are treated as identical).
Example: Write a macro to compute the square
of an unsigned byte operand and store the result in the operand itself
assuming that it can fit in a byte. The operand can be
a register or memory operand. |
SQUAREB MACRO operand
IFDIFI <AL>,<operand>
PUSH AX
MOV AL, operand
ENDIF
MUL operand
IFDIFI <AL>,<operand>
MOV operand, AL
POP AX
ENDIF
ENDM
| | | | | | | | | | |
The above example cannot be coded to meet the requirements
of the macro without using the IFDIFI directive.
 Directives Overhead |
Note that all directives introduce only assembly-time overhead but
not run-time overhead.
|