Having fun by myself here, bumped into this when looking at some source:
Code:
_FindMSBSet:
move.b d1,d0
beq.s 2$
moveq #7,d0
1$:
asl.b #1,d1
dbcs d0,1$
2$:
rts
Input is a byte in d1, output in d0 is the bit index of the first bit that is set in input.