I think I've come across a bug in 5.15.02 (If I'm reading my Motorola 68000 PRM correctly) when ROR is used in an admittedly strange way.
ror.b d0, d0
rol.b d0, d0
The C flag is NOT set after the ROR, but it IS set after the ROL. From my reading of the docs, the ROR should be setting the C flag too.
According to the PRM on page 4-161 "(C is ) set according to the last bit rotated out of the operand; cleared when the rotate count is zero". Also, later on on the same page "Bits rotated out of the low-order bit go to the carry bit and also back into the high-order bit.""
The rotate count is $FFFFFFFF % 64 which is 63 so the "cleared when the rotate count is 0" exception doesn't apply. All bits in the operand are 1 so the last bit out of the operand can never be 0 and hence C can never be 0 either. Am I missing something obvious here? Thanks!