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.

PreProcessor<br />

#rom<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

#ROM address = {list}<br />

#ROM type address = {list}<br />

address is a ROM word address, list is a list of words separated by commas<br />

Allows the insertion of data into the .HEX file. In particular, this may be used to<br />

program the '84 data EEPROM, as shown in the following example.<br />

Note that if the #ROM address is inside the program memory space, the<br />

directive creates a segment for the data, resulting in an error if a #ORG is over<br />

the same area. The #ROM data will also be counted as used program memory<br />

space.<br />

The type option indicates the type of each item, the default is 16 bits. Using<br />

char as the type treats each item as 7 bits packing 2 chars into every pcm 14-bit<br />

word.<br />

When linking multiple compilation units be aware this directive applies to the<br />

final object file.<br />

Some special forms of this directive may be used for verifying program memory:<br />

#ROM address = checksum<br />

This will put a value at address such that the entire program memory will<br />

sum to 0x1248<br />

#ROM address = crc16<br />

This will put a value at address that is a crc16 of all the program memory<br />

except the specified address<br />

#ROM address = crc8<br />

This will put a value at address that is a crc16 of all the program memory<br />

except the specified address<br />

Examples:<br />

Example Files:<br />

Also See:<br />

#rom getnev ("EEPROM_ADDRESS")={1,2,3,4,5,6,7,8}<br />

#rom int8 0x1000={"(c)<strong>CCS</strong>, 2010"}<br />

None<br />

#ORG<br />

127

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

Saved successfully!

Ooh no, something went wrong!