In SX Microcontrollers, SX/B Compiler and SX-Key Tool, dabayliss wrote: Ok - the INC does generate the good code. The other optimization applies to all numbers under 255 though ... Another place we often found juice was in loops ... it is harder (I don't know if your compiler is one pass or two pass) but the case of a FOR loop where the loop variable is not used (or changed) can be treated specially. You can load the UPPER bound into the index variable and then use djnz; saves a couple of words and makes the loop faster. Start: mov no,#10 loop: djnz no,Loop I've had a look at the code for the WORD case ... I'm pretty sure there was a trick there too ... but I cannot presently remember it (senior moment - sorry :( ) David ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=323767#m324089 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)