Keil™, An ARM® Company

C166 User's Guide

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.

DirectiveGroupDescription
ASM2SourceMarks the beginning of an inline assembly block.
ASMEXPANDSourceEnables preprocessor expansion of symbols used in ASM/ENDASM blocks.
BROWSE1ObjectEnables source browser information.
BYTEALIGNObjectEnables pointers to byte-aligned objects.
CODE1ListingIncludes generated assembly in the listing file.
COMMONRETObjectGenerates a single exit point for functions.
COMPACT1ObjectSelects the COMPACT memory model.
CONDListingIncludes (in the listing file) conditional source lines skipped by the preprocessor.
DEBUG1ObjectIncludes debugging information in the object file.
DEFINE3SourceDefines preprocessor names on the command line.
DISABLE2ObjectDisables interrupts for the duration of a single function.
DYNAMICUSRSTK1ObjectSpecifies that the program modifies the user stack pointer.
EJECT2ListingInserts a form feed character into the listing file.
ENDASM2SourceMarks the end of an inline assembly block.
EXTINSObjectTerminates EXTS and EXTP instructions at the end of each source line.
FIX166ObjectResolves problem A17 of 80C166 CA step and GOLD devices.
FIX167ObjectResolves problem CPU.3 of C167 and C165 devices.
FIX272ObjectResolves problems Kfm_BR04 and Kfm_BR05.
FIX32FObjectCorrects problems with MOV Rx,[Ry+const16] addressing on early Flash devices.
FIXBFLDObjectResolves problem CPU.21 of C16x devices.
FIX_BR03ObjectResolves problems Kfm_BR03.
FIXMDUObjectCorrects problems with MUL and DIV instructions on early Flash devices.
FIXPECObjectResolves problems with JMPs to JMPs and the PEC.
FLOAT64ObjectEnables 64-bit floating-point math support.
HCOMPACT1ObjectSelects the HCOMPACT memory model.
HLARGE1ObjectSelects the HLARGE memory model.
HOLDObjectSpecifies the default memory space for small objects.
INCDIR1SourceSets additional include file paths.
INIT2ObjectSignals variables that should be initialized at startup.
LARGE1ObjectSelects the LARGE memory model.
LISTINCLUDEListingAdds contents of include files into the listing file.
MACObjectEnables extensions for the XC16x and Suprt10 MAC unit.
MEDIUM1ObjectSelects the MEDIUM memory model.
MOD167ObjectEnables use of the enhanced C167 instruction set.
MODV2ObjectEnables use of the enhanced XC167 instruction set.
NOALIAS1ObjectIgnores write operations through pointers when optimizing.
NOAMAKE1ObjectExcludes build information from the object file.
NOASMEXPANDObjectDisables preprocessor expansion of symbols used in ASM/ENDASM blocks.
NOCONDListingExcludes (from the listing file) conditional source lines skipped by the preprocessor.
NODPPSAVE1ObjectDisables saving DPP registers in interrupts.
NOEXTEND1SourceDisables C166 extensions to ANSI C.
NOFIXDPP1ObjectGenerates code independent of DPP register contents.
NOFRAMEObjectDisables entry and exit code that saves registers in interrupts.
NOINIT2ObjectSignals variables that should not be initialized at startup.
NOOBJECT1ObjectDisables object file generation.
NOPRINT1ListingDisables listing file generation.
NOSAVEMACObjectDisables saving of MAC co-processor registers during interrupt functions.
OBJECT1ObjectSpecifies the name for the object file.
OPTIMIZEObjectSpecifies the level of optimization performed by the compiler.
ORDER1ObjectAllocates storage for variables in the order in which they are declared.
PACKObjectSpecifies the boundary for structure packing.
PAGELENGTH1ListingSpecifies the number of lines on a page in the listing file.
PAGEWIDTH1ListingSpecifies the number of characters on a line in the listing file.
PECDEF1ObjectReserves memory for PEC source and destination registers.
PREPRINT1ListingProduces a preprocessor listing file with expanded macros.
PREPRINTONLY1ListingProduces a preprocessor listing file with expanded macros and halts.
PRINT1ListingSpecifies the name for the listing file.
REENTRANTObjectGenerates reentrant functions (automatics are stored on the user stack).
REGFILE1ObjectUses the register definition file for global register optimization.
RENAMECLASSObjectChanges the name of a pre-defined memory class.
REORDERObjectReorders instructions to minimize pipeline effects.
RESTORE2ObjectRestores settings for the OPTIMIZE directive.
SAVE2ObjectSaves settings for the OPTIMIZE directive.
SAVEMACObjectSaves MAC co-processor registers during interrupt functions.
SAVESYSObjectSaves temporary results on the system stack.
SAVEUSRObjectSaves temporary results on the user stack.
SMALL1ObjectSelects the SMALL memory model.
SRC1ObjectCreates an assembler source file instead of an object file.
STATICObjectUse static memory locations for automatic variables.
SYMBOLS1ListingIncludes a symbol list in the listing file.
TABS1ListingSpecifies the tab character expansion width for the listing file.
TINY1ObjectSelects the TINY memory model.
UNSIGNED_CHAR1ObjectDefaults all char types to unsigned.
USERSTACKDPP31ObjectSpecifies that DPP3 is used for accesses to the user stack.
WARNING2ListingChanges the level of a warning.
WARNINGLEVEL1ListingSelects the level of warning detection.
XLARGE1ObjectSelects 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.