User manual

Table Of Contents
mikroC PRO for PIC32
MikroElektronika
161
Asm code and SSA optimization
If converting code from an earlier version of the compiler, which consists of mixed asm code with the C
code, keep in mind that the generated code can substantially differ when SSA optimization option is enabled
or disabled.
This is due to the fact that SSA optimization uses certain working registers to store routine parameters
(W10-W13), rather than storing them onto the function frame.
Because of this, user must be very careful when writing asm code as existing values in the working registers
used by SSA optimization can be overwritten.
To avoid this, it is recommended that user includes desired asm code in a separate routine.
Debugging Notes
SSA also inuences the code debugging in such a way that the local variables will be available in the Watch Window
only in those parts of the procedure where they have useful value (eg. on entering the procedure, variable isn’t available
until its denition).
Variables can be allocated in one part of the procedure in register W4, and in another part of the procedure in register
W2, if the optimizer estimates that it is better that way. That means that the local variable has no static address.
Warning Messages Enhancement
Besides the smaller code, SSA also deals with the intensive code analysis, which in turn has the consequence in
enhancing the warning messages.
For example, compiler will warn the user that the uninitialized variable is used:
void main() {
int y;
if (y) // Variable y might not have been initialized
PORTD = 0;
}
Related topics: Code Optimization, PIC32 Specics, mikroC PRO for PIC32 specics, Memory type speciers