> I need to check that a value, which will be a slightly variable code value, > is between an upper and a lower threshold (or not). Here's an excerpt from a "comparison" tip page I'm working on: Testing that a value lies within a range In this example, the value in the W register will be tested to determine whether it lies within the range specified by the constants loval and hival (inclusive). In other words, we're testing loval <= W <= hival. It might seem that this would take six instructions (using the methods previously described), but it can actually be done in four: addlw 256-hival addlw (hival-loval)+1 btfsc status,cf goto inrange Of course, you can change the last two lines to: btfss status,cf goto outofrange Cheers, Eric http://www.spies.com/~eric/pic/