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.

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

Purpose:<br />

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

address x. In this case the variable type does not change from the original<br />

definition. If the id is not known a new C variable is created and placed at address<br />

x with the type int16<br />

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

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

id and x share the same memory location.<br />

Examples:<br />

Example<br />

Files:<br />

Also See:<br />

#word data = 0x0800<br />

struct {<br />

int lowerByte : 8;<br />

int upperByte : 8;<br />

} control_word;<br />

#word control_word = 0x85<br />

...<br />

control_word.upperByte = 0x42;<br />

None<br />

#bit, #byte, #locate, #reserve, Named Registers, Type Specifiers, Type Qualifiers,<br />

Enumerated Types, Structures & Unions, Typedef<br />

#zero_ram<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

Examples:<br />

#ZERO_RAM<br />

None<br />

This directive zero's out all of the internal registers that may be used to hold variables<br />

before program execution begins.<br />

#zero_ram<br />

void main() {<br />

}<br />

Example<br />

Files:<br />

Also See:<br />

ex_cust.c<br />

None<br />

150

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

Saved successfully!

Ooh no, something went wrong!