View Single Post
Old 08 June 2022, 23:03   #214
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,975
Quote:
Originally Posted by phx View Post
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.
If this is for C compilers then change "bra.b .2" to "rts".
Don_Adan is offline  
 
Page generated in 0.07606 seconds with 11 queries