In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Hi pjv, I think I made an error regarding the subtraction. The sx [u]clears[/u] the C for underflow and sets C when there is no underflow. So the subtract sequence appears right. But the addition fails dacValue = $FF00 adcValue = $0100 dacValue + adcValue = $0000 with C set Using the sxb sequence add the MSB yields 0 with C set add the LSB yields 0 with C clear so the ADDB dacValue_MSB,C leaves C clear regards peter PS. Have you seen my latest reply on the IFDEF issue. I thought you were looking for a macro to autocreate a jumptable. [url=http://forums.parallax.com/forums/default.aspx?f=7&m=339008&g=339308#m339308]http://forums.parallax.com/forums/default.aspx?f=7&m=339008&g=339308#m339308[/url] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=340221#m340318 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)