In SX Microcontrollers, SX/B Compiler and SX-Key Tool, jdemeyer wrote: I have found many methods to evaluate if a variable is less than zero but I hadn't found any topics here. Consider [code] myValue1 VAR Byte myValue2 VAR Byte myValue1=0 myValue2=0 DEC myValue2 IF myValue2 < myValue1 THEN 'some code ENDIF [/code] I would prefer that the code inside the IF execute however I have not found it to be the case. The same is true if I substitute myValue2=myValue2-1 for DEC myValue2 My questions: Can I use a combination of the Carry bit or Digital Carry bit to indicate that a value is less than zero? Does this depend on CARRYX? Is there an assembly instruction I could use to evalute the result (S/X B uses CJAE, I believe)? Joe ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=136064 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)