I'm trying to write a min-sort subroutine, but the CMP instruction has me confused. Does it do overflow checking for you, or do I need to check for overflows and then flip the result on overflow? The documentation that I have to work with is not very good to say the least.

Have I got this right:

signed (pseudocode)
Code:
CMP src, dest
if Z=1, jump to _end_
if V=0, jump to _sort_
EXG src,dest
_sort_:
if N=1, jump to _end_ ; dest>src
EXG src,dest
_end_:
; the register situation will be: src<=dest
I'm not quite sure how to handle the unsigned representation ...