I am reading a book: [xchg rax, rax]. The following is the 0x03 snippet of the book and I can't make sense out of this one.
sub rdx,rax
sbb rcx,rcx
and rcx,rdx
add rax,rcx
I have been working on this since a week now (couple of minutes everyday). I have studied about some things trying to solve it: signed representation of numbers, how subtraction works, role of CF after a subtraction. According to this answer and the list given here. I don't see the point of checking CF after a subtraction, except in the cases of maybe overflows.
In what situations is checking the carry flag useful after a subtraction?