In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Slip, Remember that SX/B is a "compile in place" compiler, so if you encapsulate "big" instructions (things like PAUSE, SEROUT, SERIN, etc.) into subroutines and functions you'll save a lot of space. Since delays are a part of nearly every program I always have this subroutine in my code: [code] ' Use: DELAY_MS msecs DELAY_MS: IF __PARAMCNT = 1 THEN tmpW1 = __PARAM1 ' save byte value ELSE tmpW1 = __WPARAM12 ' save word value ENDIF PAUSE tmpW1 RETURN [/code] By using the __PARAMCNT variable (set by the compiler before the call) the subroutine can tell adjust for a byte or word being sent, and then do the PAUSE. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=176726#m176730 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)