In SX Microcontrollers, SX/B Compiler and SX-Key Tool, dabayliss wrote: Fair enough - if the goal is to pull people into the Assembly then the more straightforward translation makes sense. However :) given I finally remembered I will just note the 2 word for-loop 'trick' - where you do - MOV seconds_LSB,#1 ; for seconds = 1 to 1000 CLR seconds_MSB __FOR_seconds_1: INC seconds_LSB ; next ADDB seconds_MSB,Z CJB seconds_MSB,#(1000 >> 8),@__FOR_seconds_1 CJA seconds_MSB,#(1000 >> 8),@__NEXT_seconds_1 CJBE seconds_LSB,#(1000 & 255),@__FOR_seconds_1 __NEXT_seconds_1: you can - mov no1,#4 mov w,#1000-3*256+1 skip oloop: mov w,#255 mov no,w loop: djnz no,Loop djnz no1,oloop saves about 50% of the code and reduce timings somewhat .... ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=323767#m324135 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)