11.07.2015 Views

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

PicC 9.50 dsPIC Manual.pdf

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

C Language FeaturesLinking ProgramsTable 3.12: switch typesswitch typeautodirectdescriptionuse smallest code size method (default)table lookup (fixed delay)where routine_name is the assembly name of the function or assembly routine which is to beaffected, register_list is a space-separated list of registers names (W0..W15). Those registersnot listed are assumed to be unused by the function or routine. The code generator may use theunlisted registers to hold values across a function call. Hence, if the routine does in fact use theseregisters, unreliable program execution may eventuate.The register names are not case sensitive and a warning will be produced if the register name isnot recognised. A blank list indicates that the specified function or routine uses no registers.3.12.3.7 The #pragma switch DirectiveNormally the compiler decides the code generation method for switch statements which results inthe smallest possible code size. The #pragma switch directive can be used to force the compiler touse one particular method. The general form of the switch pragma is:#pragma switch switch_typewhere switch_type is one of the available switch methods listed in Table .Specifying the direct option to the #pragma switch directive forces the compiler to generatethe table look-up style switch method. This is mostly useful where timing is an issue for switchstatements (i.e.: state machines).This pragma affects all code generated onward. The auto option may be used to revert to thedefault behaviour.3.13 Linking ProgramsThe compiler will automatically invoke the linker unless requested to stop after producing assemblercode (DSPICC -S option) or object code (DSPICC -C option).HI-TECH C, by default, generates intel HEX. Use the --OUTPUT= option to specify a differentoutput format.After linking, the compiler will automatically generate a memory usage map which shows theaddress used by, and the total sizes of, all the psects which are used by the compiled code.61

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

Saved successfully!

Ooh no, something went wrong!