Keith Burzinski wrote: > I am using 'subwf' on a 16C54 to compare two bytes, and I saw in the > programmers manual how the Carry flag is set... the Zero flag is > still set according to the result, correct? Correct, Keith. > Really, I'm doing a greater than/less than/equal to thing, so, > first I should check the Z flag to see if the result was zero, if > it was, I'll branch, if not, then test the C flag and go from > there, right? Actually, it'll be faster to check the C flag first, then only check the Z flag if the C flag was set... That way, you only check one flag when the result is negative (a much more-likely occurence than a "0" result). > So, when using 'subwf': > If (f) - (W) is positive, > (f) > (W) / Z = 0, C = 1. > If (f) - (W) is zero, > (f) = (W) / Z = 1, C = 1. > If (f) - (W) is negative, > (f) < (W) / Z = 0, C = 0. > > Is everything I said about the flags correct? Yes, if you treat the contents of "f" and "w" as unsigned (i.e., non-negative) numbers. -Andy === Andrew Warren - fastfwd@ix.netcom.com === Fast Forward Engineering - Vista, California === http://www.geocities.com/SiliconValley/2499