SW500009 Microchip Technology, SW500009 Datasheet - Page 71

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
C Language Features
lookup table is accessed after the function called has finished executing. This method allows func-
tions to be nested without overflowing the stack, however it does come at the expense of memory
and program speed.
so that calls to this function are performed using the usual call assembly instruction. Extreme care
must be used when functions are declared as fastcall, since the each nested fastcall will use one
word of available stack space. Check the call graph in the map file to ensure that the stack will not
overflow.
The midrange and high end PIC devices have larger stacks and are thus allow a higher degree of
function nesting. These devices do not use the lookup table method when calling functions.
compiler inserts the appropriate instructions to ensure this is true if required. Any functions callable
from C code that are written in assembler must also ensure that bank zero is selected before the
return.
3.8 Operators
HI-TECH C supports all the ANSI operators. The exact results of some of these are implementation
defined. The following sections illustrate code produced by the compiler.
3.8.1 Integral Promotion
When there is more than one operand to an operator, they typically must be of exactly the same type.
The compiler will automatically convert the operands, if necessary, so they have the same type. The
conversion is to a “larger” type so there is no loss of information. Even if the operands have the same
type, in some situations they are converted to a different type before the operation. This conversion
is called integral promotion. HI-TECH C performs these integral promotions where required. If you
are not aware that these changes of type have taken place, the results of some expressions are not
what would normally be expected.
of char, short int or bit-field types to either signed int or unsigned int. If the result of the
conversion can be represented by an signed int, then that is the destination type, otherwise the
conversion is to unsigned int.
To disable the lookup-table mode of operation, a function definition can be qualified as fastcall,
The function prototype for a baseline fastcall function might look something like:
The compiler assumes that bank zero will be selected after returning from any function call. The
Integral promotion is the implicit conversion of enumerated types, signed or unsigned varieties
Consider the following example.
fastcall void my_function(int a);
Operators
57

Related parts for SW500009