Keil Logo

Directives

The C166 Compiler provides a number of directives you may use to control source file compilation. Directives are composed of one or more letters or digits and, unless otherwise specified, may be specified after the filename on the command line or within the source file using #pragma. For example:

C166 testfile.c SYMBOLS CODE DEBUG

or

#pragma SYMBOLS CODE DEBUG

The source file to compile is testfile.c and SYMBOLS, CODE, and DEBUG are the directives.

Control directives may be divided into three groups:

  • Source controls define macros on the command line and determine the name of the file to be compiled.
  • Object controls affect the form and content of the generated object module (*.OBJ). These directives allow you to specify the optimizing level or include debugging information in the object file.
  • Listing controls govern various aspects of the listing file (*.LST), in particular its format and specific content.

Note

  • The syntax is the same for the command line and #pragma. Multiple options, however, may be specified on the #pragma line.
  • Some directives may be specified only once at the beginning of a source file. If one of these directives is specified more than once, the compiler generates a fatal error and aborts compilation.

The following table is an alphabetical list of the control directives available in the C166 Compiler.

Directive Group Description
ASM2 Source Marks the beginning of an inline assembly block.
ASMEXPAND Source Enables preprocessor expansion of symbols used in ASM/ENDASM blocks.
BROWSE1 Object Enables source browser information.
BYTEALIGN Object Enables pointers to byte-aligned objects.
CODE1 Listing Includes generated assembly in the listing file.
COMMONRET Object Generates a single exit point for functions.
COMPACT1 Object Selects the COMPACT memory model.
COND Listing Includes (in the listing file) conditional source lines skipped by the preprocessor.
DEBUG1 Object Includes debugging information in the object file.
DEFINE3 Source Defines preprocessor names on the command line.
DISABLE2 Object Disables interrupts for the duration of a single function.
DYNAMICUSRSTK1 Object Specifies that the program modifies the user stack pointer.
EJECT2 Listing Inserts a form feed character into the listing file.
ENDASM2 Source Marks the end of an inline assembly block.
EXTINS Object Terminates EXTS and EXTP instructions at the end of each source line.
EXTMAC Object Enables use of the ST10 MAC instruction set.
FIX166 Object Resolves problem A17 of 80C166 CA step and GOLD devices.
FIX167 Object Resolves problem CPU.3 of C167 and C165 devices.
FIX272 Object Resolves problems Kfm_BR04 and Kfm_BR05.
FIX32F Object Corrects problems with MOV Rx,[Ry+const16] addressing on early Flash devices.
FIXBFLD Object Resolves problem CPU.21 of C16x devices.
FIX_BR03 Object Resolves problems Kfm_BR03.
FIXMDU Object Corrects problems with MUL and DIV instructions on early Flash devices.
FIXPEC Object Resolves problems with JMPs to JMPs and the PEC.
FLOAT64 Object Enables 64-bit floating-point math support.
HCOMPACT1 Object Selects the HCOMPACT memory model.
HLARGE1 Object Selects the HLARGE memory model.
HOLD Object Specifies the default memory space for small objects.
INCDIR1 Source Sets additional include file paths.
INIT2 Object Signals variables that should be initialized at startup.
LARGE1 Object Selects the LARGE memory model.
LISTINCLUDE Listing Adds contents of include files into the listing file.
MAC Object Enables extensions for the XC166, XE166, XC2000 MAC unit.
MEDIUM1 Object Selects the MEDIUM memory model.
MOD167 Object Enables use of the enhanced C167 instruction set.
MODV2 Object Enables use of the enhanced XC167 instruction set.
NOALIAS1 Object Ignores write operations through pointers when optimizing.
NOAMAKE1 Object Excludes build information from the object file.
NOASMEXPAND Object Disables preprocessor expansion of symbols used in ASM/ENDASM blocks.
NOCOND Listing Excludes (from the listing file) conditional source lines skipped by the preprocessor.
NODPPSAVE1 Object Disables saving DPP registers in interrupts.
NOEXTEND1 Source Disables C166 extensions to ANSI C.
NOFIXDPP1 Object Generates code independent of DPP register contents.
NOFRAME Object Disables entry and exit code that saves registers in interrupts.
NOINIT2 Object Signals variables that should not be initialized at startup.
NOOBJECT1 Object Disables object file generation.
NOPRINT1 Listing Disables listing file generation.
NOSAVEMAC Object Disables saving of MAC co-processor registers during interrupt functions.
OBJECT1 Object Specifies the name for the object file.
OPTIMIZE Object Specifies the level of optimization performed by the compiler.
ORDER1 Object Allocates storage for variables in the order in which they are declared.
PACK Object Specifies the boundary for structure packing.
PAGELENGTH1 Listing Specifies the number of lines on a page in the listing file.
PAGEWIDTH1 Listing Specifies the number of characters on a line in the listing file.
PECDEF1 Object Reserves memory for PEC source and destination registers.
PREPRINT1 Listing Produces a preprocessor listing file with expanded macros.
PREPRINTONLY1 Listing Produces a preprocessor listing file with expanded macros and halts.
PRINT1 Listing Specifies the name for the listing file.
REENTRANT Object Generates reentrant functions (automatics are stored on the user stack).
REGFILE1 Object Uses the register definition file for global register optimization.
RENAMECLASS Object Changes the name of a pre-defined memory class.
REORDER Object Reorders instructions to minimize pipeline effects.
RESTORE2 Object Restores settings for the OPTIMIZE directive.
SAVE2 Object Saves settings for the OPTIMIZE directive.
SAVEMAC Object Saves MAC co-processor registers during interrupt functions.
SAVESYS Object Saves temporary results on the system stack.
SAVEUSR Object Saves temporary results on the user stack.
SMALL1 Object Selects the SMALL memory model.
SRC1 Object Creates an assembler source file instead of an object file.
STATIC Object Use static memory locations for automatic variables.
SYMBOLS1 Listing Includes a symbol list in the listing file.
TABS1 Listing Specifies the tab character expansion width for the listing file.
TINY1 Object Selects the TINY memory model.
UNSIGNED_CHAR1 Object Defaults all char types to unsigned.
USERSTACKDPP31 Object Specifies that DPP3 is used for accesses to the user stack.
WARNING2 Listing Changes the level of a warning.
WARNINGLEVEL1 Listing Selects the level of warning detection.
XLARGE1 Object Selects the XLARGE memory model.

Note

  1. These directives apply to the entire source file and may be specified only once on the command line or at the beginning of the source file using the #pragma statement. They may not be used more than once in a source file.
  2. These directives may not be specified on the command line. They may only be specified in the source file.
  3. Directives and arguments, with the exception of arguments specified with the DEFINE directive, are not case sensitive.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.