11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

C Language FeaturesPreprocessingTable 3.9: Preprocessor directivesDirective Meaning Example# preprocessor null directive, do #nothing#assert generate error if condition false #assert SIZE > 10#asm signifies the beginning of in-lineassembly#asmmov r0, r1h#endasm#define define preprocessor macro #define SIZE 5#define FLAG#define add(a,b) ((a)+(b))#elif short for #else #if see #ifdef#else conditionally include source lines see #if#endasm terminate in-line assembly see #asm#endif terminate conditional source see #ifinclusion#error generate an error message #error Size too big#if include source lines if constantexpression true#ifdefinclude source lines if preprocessorsymbol defined#if SIZE < 10c = process(10)#elseskip();#endif#ifdef FLAGdo_loop();#elif SIZE == 5skip_loop();#endif#ifndef include source lines if preprocessorsymbol not defined#ifndef FLAGjump();#endif#include include text file into source #include #include "project.h"#line 3 final#line specify line number and filenamefor listing#nn (where nn is a number) short for #20#line nn#pragma compiler specific options 3.12.3#undef undefines preprocessor symbol #undef FLAG#warning generate a warning message #warning Length not set55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!