[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] mulu.l with 68000



Vincent Rivière <vincent.riviere@freesbee.fr> writes:

> On 26/01/2014 19:03, David Gálvez wrote:
>> does anybody have the routine to emulate the instruction mulu.l dx,dy
>> with a 68000?
>
> There is one in libgcc, it is named __mulsi3().
>
>         move.l a,-(sp)
>         move.l b,-(sp)
>         jsr ___mulsi3
>         addq.l #8,%sp
>
> Then compile with -lgcc (if not already the case).

You can also use umul_ppmm from longlong.h and discard the high 32 bits.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."