Using Directives

This chapter explains available directives for the preprocessor and the main, or native, assembler. Remember these key points:

When you submit source files to the assembler, the code goes through the preprocessor. Then the preprocessor-output code goes through the native assembler. This leads to a general rule of not mixing preprocessor and native-assembler directives.

For example, consider the simple symbol-definition test as in the following listing.

Listing: Mixed-Directive Example
#define        ABC  MyVal  

      .ifdef  ABC           ;Definition test

Before the native assembler sees this code, the C preprocessor converts the line .ifdef ABC to .ifdef MyVal. This means that the native assembler tests for a definition of MyVal, not ABC.

For a definition test of ABC, you should use either the preprocessor directives or the native assembler syntax.

Listing: Preprocessor-Directive Example
#define        ABC  MyVal  

#ifdef  ABC           ;Definition test
Listing: Native-Assembler-Directive Example
ABC  =   1

      .ifdef  ABC           ;Definition test

In this chapter: