Configuration bits declaration as CONST

Language reference ›› Constants ››
Parent Previous Next


The basic CONFIG pseudo-constant declaration may be defined in a CONST section. This pseudo-constant cannot be used as an identifier and is not defined in the program.

CONST
 CONFIG = <Numeric Expression>;

This constant maps directly to the __CONFIG directive of MPASM™ assembler; its declaration accepts any constant expression that returns a 16-bit value, which is generated as a single value for the assembler.


 CONFIG = _INTRC_OSC_NOCLKOUT AND _WDT_OFF AND _PWRTE_OFF AND _MCLRE_OFF
          AND _CP_OFF AND _BOR_OFF AND _IESO_OFF AND _FCMEN_OFF;

Will generate this code in the .asm file:

 __CONFIG h'30D4'