17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

address is a ROM location memory address. Start and end are used to specify<br />

a range in memory to be used.<br />

start is the first ROM location and end is the last ROM location to be used.<br />

nosleep is used to prevent the compiler from inserting a sleep at the end of<br />

main()<br />

Bootload produces a bootloader-friendly hex file (in order, full block size).<br />

NOSLEEP_LOCK is used instead of A sleep at the end of a main A infinite loop.<br />

Purpose:<br />

PIC18XXX devices with external ROM or PIC18XXX devices with no internal<br />

ROM can direct the compiler to utilize the ROM. When linking multiple<br />

compilation units, this directive must appear exactly the same in each compilation<br />

unit.<br />

Examples:<br />

#build(memory=0x20000:0x2FFFF) //Assigns memory space<br />

#build(reset=0x200,interrupt=0x208) //Assigns start<br />

//location<br />

//of reset and<br />

//interrupt<br />

//vectors<br />

#build(reset=0x200:0x207, interrupt=0x208:0x2ff)<br />

//Assign limited space<br />

//for reset and<br />

//interrupt vectors.<br />

#build(memory=0x20000:0x2FFFF) //Assigns memory space<br />

Example<br />

Files:<br />

Also See:<br />

None<br />

#LOCATE, #RESERVE, #ROM, #ORG<br />

#byte<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

#byte id = x<br />

id is a valid C identifier,<br />

x is a C variable or a constant<br />

If the id is already known as a C variable then this will locate the variable at address<br />

x. In this case the variable type does not change from the original definition. If the id is<br />

not known a new C variable is created and placed at address x with the type int (8 bit)<br />

Warning: In both cases memory at x is not exclusive to this variable. Other variables<br />

may be located at the same location. In fact when x is a variable, then id and x share<br />

the same memory location.<br />

96

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

Saved successfully!

Ooh no, something went wrong!