A few more tricks...
For rare cases but useful maybe ?
Clear the lowest bit that is =1 (e.g. $1234 becomes $1230, $1000 becomes 0, etc) :
Code:
move.w d0,d1
subq.w #1,d1
and.w d1,d0
To know if the n leftmost bits of the reg are identical :
Code:
asl.b #n-1,d0 ; note : asl, not lsl !
bvc yes ; we get there if all bits were the same