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.

PreprocessingC Language FeaturesTable 3.8: Predefined SFR namesRegisterpclpchsrAddress0x2E0x300x42assembler code from within the same C module that includes , simply use the symbolwith an underscore character prepended to the name. For example:#include void main(void){PORTA = 0x55;asm("mov #0xAA,w0");asm("mov w0, _PORTA);3.12 PreprocessingAll C source files are preprocessed before compilation. Assembler files can also be preprocessed ifthe -P command-line option is issued.3.12.1 Preprocessor DirectivesHI-TECH <strong>dsPIC</strong>C accepts several specialised preprocessor directives in addition to the standarddirectives. All of these are listed in Table 3.9.Macro expansion using arguments can use the # character to convert an argument to a string, andthe ## sequence to concatenate tokens.3.12.2 Predefined MacrosThe compiler drivers define certain symbols to the preprocessor (CPP), allowing conditional compilationbased on chip type etc. The symbols listed in Table 3.10 show the more common symbolsdefined by the drivers. Each symbol, if defined, is equated to 1 unless otherwise stated.54

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

Saved successfully!

Ooh no, something went wrong!