View Single Post
Old 08 June 2022, 22:18   #212
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
This is a standard 64-bit shift-right operation, which you find in any m68k C-compiler's clib.
For example:
Code:
        tst.w   d3
        beq     .2
        moveq   #32,d2
        sub.l   d3,d2
        bgt.b   .1
        move.l  d0,d1
        neg.l   d2
        add.l   d0,d0
        subx.l  d0,d0
        asr.l   d2,d1
        bra.b   .2
.1:     move.l  d0,d4
        lsr.l   d3,d1
        lsl.l   d2,d4
        asr.l   d3,d0
        or.l    d4,d1
.2:     rts
EDIT: Don't know if this is faster than the jotd/ross version. Probably not. Too lazy to count.
phx is offline  
 
Page generated in 0.06293 seconds with 11 queries