2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
5 Desc: signed 32 bit division/modulus functions for Amiga/m68k
9 #include "aros/m68k/asm.h"
12 .globl AROS_SLIB_ENTRY(SDivMod32,Utility,25)
13 .globl AROS_SLIB_ENTRY(SDivMod32_020,Utility,25)
15 /* Needed for SDivMod32 */
16 .globl AROS_SLIB_ENTRY(UDivMod32,Utility,26)
18 .type AROS_SLIB_ENTRY(SDivMod32,Utility,25),@function
19 .type AROS_SLIB_ENTRY(SDivMod32_020,Utility,25),@function
22 AROS_SLIB_ENTRY
(SDivMod32_020
,Utility
,25):
26 /* All we do is remember the sign and get UDivMod32 to do all the work,
27 this is actually a bit harder than just changing both, doing the
28 division and then changing the other...
30 If both are positive, do nothing,
31 if one is negative, change both,
32 if both are negative, change remainder
36 AROS_SLIB_ENTRY
(SDivMod32
,Utility
,25):
43 jsr AROS_SLIB_ENTRY
(UDivMod32
,Utility
,26)
47 jsr AROS_SLIB_ENTRY
(UDivMod32
,Utility
,26)
53 bpl.
l AROS_SLIB_ENTRY
(UDivMod32
,Utility
,26)
55 jsr AROS_SLIB_ENTRY
(UDivMod32
,Utility
,26)