Mikroelektronika MIKROE-738 Datenbogen

Seite von 682
140
mikoC PRO for PIC32
MikroElektronika
at keyword
You can use the keyword "at" to make an alias to a variable, for example, you can write a library without using register 
names, and later in the main program to define those registers, for example:
extern char PORTAlias; // here in the library we can use its symbolic name
char PORTAlias at PORTB; // this is where PORTAlias is fully defined
...
void main() {  
...
}
Note: Bear in mind that when using 
at
 operator in your code over a variable defined through the 
extern
 modifier, 
appropriate memory specifer must be appended also. 
bit type
The mikroC PRO for PIC32 compiler provides a 
bit
 data type that may be used for variable declarations. It can not be 
used for argument lists, and function-return values.
bit bf;    // bit variable
There are no pointers to bit variables:
bit *ptr;    // invalid
An array of type bit is not valid:
bit arr [5];     // invalid
Note
- Bit variables can not be initialized. 
- Bit variables can not be members of structures and unions. 
- Bit variables do not have addresses, therefore unary operator 
&
 (address of) is not applicable to these variables. 
Related topics: Bit fields, Predefined globals and constants, Extern modifier