I recently came across the following problem when writing assembly for MSP430F5529:
When I do CMP #0,R4 where R4 contains #0xFFED, I get the Negative bit set. I found out that if R4 contains for example 0xFFFF the negative bit doesn't get set.
I mean, since CMP is a simulated subtraction DST-SRC, subtracting zero from anything positive should never set the negative bit.
Why is this happening? And how then I reliably do an unsigned comparison? I just need to determine if the number in some register is greater than or equal any of these constants: 0x7FFF, 0xFFFF and 0xFFED.
Thanks for any hints!