In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote: First best thing -- wrap DIVISION into a subroutine. If you look at the list output for something like temp1 = temp2 / 10 You will find a LOT of code is generated for division. In fact, if you are using division, multiplication or modulo anywhere in your application, wrap 'em into a subroutine and you will find huge amounts of code space freed up, e.g. ' Use -- result = MATH_DIV word|byte, word|byte ' when mixing word and byte, the WORD comes first... ' tmpW1 and 2 are word vars FUNC MATH_DIV IF __PARAMCNT = 2 THEN tmpW1 = __PARAM1 tmpW2 = __PARAM2 ELSEIF __PARAMCNT = 3 THEN tmpW1 = __WPARAM12 tmpW2 = __PARAM3 ELSE tmpW1 = __WPARAM12 tmpW2 = __WPARAM34 ENDIF tmpW1 = tmpW1 / tmpW2 RETURN tmpW1 ENDFUNC ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=320764#m320836 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)