>> Or, if that's too hard to remember, just think of the Carry flag >> after a subtraction as a "non-negative" flag. After a subtract, >> Carry will be set if the result is positive or zero, and will be >> clear if the result is negative. E.g., > >And if that's too hard to remember, use my SKIP_WLE (skip if W was less >than or equal to other value) and SKIP_WGT macros. These expand to single >BTFSx STATUS, C instructions, but alleviate the need to figure out which >way C gets set on a subtract each time. Just do a SUBLW or SUBWF followed >by SKIP_WLE or SKIP_WGT. These macros work well. The only time I had a hiccup was subtracting 16 bit values passing through zero, and trying to detect this. Unfortunately there is no "subtract with carry" to take the flag status of the low byte operation through to the high byte subtract when both high bytes are zero. The solution was to OR the high and low byte together and then check for zero. >These any many other handy macros can be found >in STD.INS.ASPIC at http://www.embedinc.com.pic. Should that not be http://www.embedinc.com/pic. unless you have changed your site name :)) -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body