Search code examples
picpic18mplab-c18

what is the meaning of __18CXX and __PCB__ in picc codes


I commonly see the following lines of compiler-related codes :

#if defined(__18CXX) ... #endif

and

#if (defined(__PCB__) || defined(__PCH__) || defined(__PCM__)) ... #endif

How can I know the meaning of each one ?


Solution

  • 18CXX is a predefined macro to indicate the Microchip C18 compiler. See section 2.6 in the ‘MPLAB C18 C COMPILER USER’S GUIDE’. The others are CCS C compilers: PCB is for 12-bit opcodes, PCM is for 14-bit opcodes, and PCH is for 16-bit. See ‘CCS C Compiler Manual'.