PreviousNext
Variable access reorder
Help > Appendix > Code Optimization > Variable access reorder

FLASH-                        RAM                Speed+

 

Try to group access to the variables from the same bank to avoid excess MOVLB instructions. By the way, C compilers by definition are free to reorder statements to optimize generated code.

 

uns8 savedTX;

...

RTHOPS = 0xFF; // @bank5 !=

TX = savedTX;  // @bank11 != @bank5 ==

RTDEF = 2;     // @bank5

uns8 savedTX;

...

TX = savedTX;  // @bank11 != @bank5 ==

RTHOPS = 0xFF; // @bank5 ==

RTDEF = 2;     // @bank5