17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

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

#export (options)<br />

Syntax:<br />

#EXPORT (options)<br />

Elements: FILE=filname<br />

The filename which will be generated upon compile. If not given, the filname will<br />

be the name of the file you are compiling, with a .o or .hex extension (depending<br />

on output format).<br />

ONLY=symbol+symbol+.....+symbol<br />

Only the listed symbols will be visible to modules that import or link this relocatable<br />

object file. If neither ONLY or EXCEPT is used, all symbols are exported.<br />

EXCEPT=symbol+symbol+.....+symbol<br />

All symbols except the listed symbols will be visible to modules that import or link<br />

this relocatable object file. If neither ONLY or EXCEPT is used, all symbols are<br />

exported.<br />

RELOCATABLE<br />

<strong>CCS</strong> relocatable object file format. Must be imported or linked before loading into<br />

a PIC. This is the default format when the #EXPORT is used.<br />

HEX<br />

Intel HEX file format. Ready to be loaded into a PIC. This is the default format<br />

when no #EXPORT is used.<br />

RANGE=start:stop<br />

Only addresses in this range are included in the hex file.<br />

OFFSET=address<br />

Hex file address starts at this address (0 by default)<br />

ODD<br />

Only odd bytes place in hex file.<br />

EVEN<br />

Only even bytes placed in hex file.<br />

Purpose:<br />

Examples:<br />

This directive will tell the compiler to either generate a relocatable object file or a<br />

stand-alone HEX binary. A relocatable object file must be linked into your<br />

application, while a stand-alone HEX binary can be programmed directly into the<br />

PIC.<br />

The command line compiler and the PCW IDE Project Manager can also be used<br />

to compile/link/build modules and/or projects.<br />

Multiple #EXPORT directives may be used to generate multiple hex files. this may<br />

be used for 8722 like devices with external memory.<br />

#EXPORT(RELOCATABLE, ONLY=TimerTask)<br />

void TimerFunc1(void) { /* some code */ }<br />

void TimerFunc2(void) { /* some code */ }<br />

void TimerFunc3(void) { /* some code */ }<br />

104

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

Saved successfully!

Ooh no, something went wrong!