Marcel Birthelmer wrote: >> I need some code that can compare the current temperature with the two >> set points and branch as below: >> A) Current temperature is lower than low set point >> B) Current temperature is between low and high set points >> C) Current temperature is higher than high set point >> > David, > the easiest thing to do would be to subtract your value from the high set > point, check the result (look through the instruction set listing in the > data book to see how the flags are affected by the numbers), and then > subtract the low set point from your value. > - Marcel > Aha, I need to check the result msb and not the carry bit! I was too focussed on the carry bit but that's no use here. David... -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist