In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: Multiplication, division and related operators generate a fair bit of code; you might want to encapsulate ** into a function. Delcare it like this: [code]MULT_HIGH FUNC 2, 2, 4 ' shell for **[/code] The function code looks like this: [code]' Use: result = MULT_HIGH value1, value2 ' -- if passing word and byte, pass word value as first parameter FUNC MULT_HIGH IF __paramcnt = 2 THEN tmpW2 = __param1 tmpW3 = __param2 ELSEIF __paramcnt = 3 THEN tmpW2 = __wparam12 tmpW3 = __param3 ELSE tmpW2 = __wparam12 tmpW3 = __wparam34 ENDIF tmpW2 = tmpW2 ** tmpW3 RETURN tmpW2 ENDFUNC[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=272864#m272872 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)