In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: This will work: [code]' Use: result = MAKE_BCD char1, char2 FUNC MAKE_BCD tmpB1 = __PARAM1 tmpB2 = __PARAM2 tmpB1 = tmpB1 - "0" ' reduce to digit value tmpB3 = tmpB1 << 4 ' shift to high nib tmpB2 = tmpB2 - "0" ' reduce to digit value tmpB3 = tmpB3 | tmpB2 ' add to result RETURN tmpB3 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=282840#m282852 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)