I'm working on a sort routine, sorting 16 bit values that can span the full "unsigned" range. To compare two values in the sort, I'm subtracting one from another: if the result is negative, then the second is larger than the first. I started with the 16-bit subtract routine in Myke's book: movf r2hi, w subwf r1hi, w movwf temphi movf r2lo, w subwf r1lo, w btfss status, c decf temphi ; check for negative value btfsc temphi, 7 goto Greater_Than ... but this is a "signed" routine in the sense that it looks at the high bit of the result to see if it's negative, and because he does the subtraction "backward", the czrry flag is useless. But I'm using full "unsigned" 16 bit values, so for instance if I'm subtracting 0x0001 from 0x8001, the result will get reported as negative, since the high bit is set, even though the number didn't "roll over." What I want is a 16 bit subtract that will let me check the carry flag at the end, to see if the number rolled over. Here's what I think, and I'm looking for confirmation that this will work: I can subtract the low bytes first, and if carry is set (result is "negative") then decrement the high byte of the number I'm subtracting FROM (basically perform the carry). Then I subtract the high bytes, and if the carry is set after that, then the result is negative (meaning that the number I'm subtracting is larger than the number I'm subtracting from). That's the brute force and awkwardness approach, but it seems logically sound to me. Did I miss something? Even if that will work, is there a more elegant (read: faster) way to do this? Somehow I suspect there is :-) Thanks for any help, Dave Johnson