| ||
Conditional assembling provides the possibility of bypassing specific program fragments when assembling. There are the following types of conditional assembling:
IF expression ... ENDIF
IF expression ... ELSE ... ENDIF
IF expression 1 ... ELSEIF expression 2 ... ELSEIF expression 3 ... ELSE ... ENDIF
The expression is considered to be satisfied if the expression takes a nonzero value; otherwise , the condition is not satisfied.
MASM and TASM support several special-purpose directives for conditional assembling.
IFE expression ... ELSEIFE ... ENDIFE
The IF1 and IF2 operators check the first and the second pass of assembling.
The IFDEF operator checks whether a symbolic name is defined in the program; IFDEFN is an inverse operator.
There are other types of IF operators. The required information can be found in any reference on Assembly language.
There is the large set of directives starting with .ERR . For example, .ERRE will cause the assembling process stop and will display an error message if the condition takes the value 0.
Conditional assembling will be used in the end of this chapter to write the example program that can be translated using both MASM and TASM.
| ||