SLAU131Y October 2004 – June 2021
The $defined directive returns true/1 or false/0 depending on whether the name exists in the current substitution symbol table or the standard symbol table. In essence $defined returns TRUE if the assembler has any user symbol in scope by that name. This differs from $isdefed in that $isdefed only tests for NON-substitution symbols. The syntax is:
$defined( substitution symbol name )
A statement such as ".if $defined(macroname)" is then similar to the C code "#ifdef macroname".
See Section 14.5.2 and Section 14.5.3 for the use of .define and .undef in assembly.