Download CCS C Compiler Manual

Transcript
PreProcessor
Example
Files:
ex_psp.c
Also See:
#ERROR
#word
Syntax:
#WORD id = x
Elements:
id is a valid C identifier,
x is a C variable or a constant
Purpose:
If the id is already known as a C variable then this will locate the variable at address x. In this case
the variable type does not change from the original definition. If the id is not known a new C variable
is created and placed at address x with the type int16
Warning: In both cases memory at x is not exclusive to this variable. Other variables may be located
at the same location. In fact when x is a variable, then id and x share the same memory location.
Examples:
#word data = 0x0800
struct {
int lowerByte : 8;
int upperByte : 8;
} control_word;
#word control_word = 0x85
...
control_word.upperByte = 0x42;
Example
Files:
None
Also See:
#bit, #byte, #locate, #reserve, Named Registers, Type Specifiers, Type Qualifiers, Enumerated
Types, Structures & Unions, Typedef
129