status flags are useful to save cycles. Careful with to-memory operations, as they don't set the status flags. Operations to data registers (not address) do set the status flags.
bclr #0,d0 also sets D0 value before bit is cleared. Can be useful at times. In doubt: RTFM
note: in C, x ^= 1; (in-place xclusive or) is probably faster that x = 1 - x; but optimizers can detect such patterns and change the expression to the fastest one.
@mcgeezer your snippet has issues
Code:
addq.l #1,FRAME_COUNTER
move.l FRAME_COUNTER,d0 ; no "#" there!!!
and.l #1,d0
although I'd preload the counter value in D0 to save cycles, in this case
Code:
move.l FRAME_COUNTER,d0
addq.l #1,d0
move.l D0,FRAME_COUNTER
and.b #1,d0
and and.b does the same there you only need byte value of D0 for the rest of your code probably, instruction fetch is faster (4 bytes instead of 6) although btst #0,d0 probably beats both in terms of speed unless you need the masked value.