Using the _direct declaration (C Analyzer enables to detect candidate for efficient _direct.)To improve the ROM code efficiency of C source, it is possible to improve by defining static variables as _direct declaration ones.
The _direct declaration variables are in 256Byte (min.). It is efficient way to define frequent used variables as _direct declaration in order.
direct declaration sample:
_direct unsigned char port_new,port_old,port1_data;
_direct unsigned int time;
Using the in-line. (C Analyzer enables to detect candidate for in-line expansion.)When defining the function of the small code size with argument as static function and implementing in-line expansion, which allow to reduce the code size.
To implement in-line expansion of static declaration function, the -xauto option need specifying before compiling the source program.
Example of in-line expansion:
static Proc7 (IntParI1, IntParI2, IntParOut)
REG OneToFifty IntLoc;
IntLoc = IntParI1 + 2;
*IntParOut = IntParI2 + IntLoc;
Using the built-in functionWhen performing a multiplication and a division by C language, the code size is too big bye using the libraries of div/mul/mod.
Therefore F2 MC-16LX family allow to use these built-in functions of _mul( )/_div( )/_mod( ). These functions enables to reduce the code size.
Example of built-in function:
unsigned int a,b;
unsigned long c;
// c=a*b; /* normal description of C language */
c=_mul(a,b); /* description of using built-in function */