#include "asm.h" // int int64 muls64_m(int a, int b); .text .global muls64_m muls64_m: movel 4(sp), d0 movel 8(sp), d1 movel #0x20, macsr // Put MAC in fraction mode subl a0, a0 movel a0, acc // Zero acc macl d0, d1 // Form upper half of product mulul d0, d1 // Form lower half movel macsr, ccr // Overflow? bvsb 1f // Yes movel acc, d0 asrl #1, d0 // Correct for binary point position rts 1: movel #0x40000000, d0 // Correct for overflow rts