View Single Post
Old 14 May 2022, 12:39   #2
koobo
Registered User
 
koobo's Avatar
 
Join Date: Sep 2019
Location: Finland
Posts: 363
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.
koobo is offline  
 
Page generated in 0.04620 seconds with 11 queries