PreviousNext
End condition of the 16-bit loop variable
Help > Appendix > Code Optimization > End condition of the 16-bit loop variable

FLASH-                        RAM                Speed+

 

Sometimes this can be optimized.

 

uns16 var16 = 12345;

do

{

  var16--;

} while ( var16 != -1 );

 

uns16 var16 = 12345;

do

{

  var16--;

} while ( var16.high8 != -1 );

// or

FSR1 = 12345;

do

{

  FSR1--; // efficient

} while ( FSR1H != -1 );