Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002     .file   "div_small.S"
0003 /*---------------------------------------------------------------------------+
0004  |  div_small.S                                                              |
0005  |                                                                           |
0006  | Divide a 64 bit integer by a 32 bit integer & return remainder.           |
0007  |                                                                           |
0008  | Copyright (C) 1992,1995                                                   |
0009  |                       W. Metzenthen, 22 Parker St, Ormond, Vic 3163,      |
0010  |                       Australia.  E-mail billm@jacobi.maths.monash.edu.au |
0011  |                                                                           |
0012  |                                                                           |
0013  +---------------------------------------------------------------------------*/
0014 
0015 /*---------------------------------------------------------------------------+
0016  |    unsigned long FPU_div_small(unsigned long long *x, unsigned long y)    |
0017  +---------------------------------------------------------------------------*/
0018 
0019 #include "fpu_emu.h"
0020 
0021 .text
0022 SYM_FUNC_START(FPU_div_small)
0023     pushl   %ebp
0024     movl    %esp,%ebp
0025 
0026     pushl   %esi
0027 
0028     movl    PARAM1,%esi /* pointer to num */
0029     movl    PARAM2,%ecx /* The denominator */
0030 
0031     movl    4(%esi),%eax    /* Get the current num msw */
0032     xorl    %edx,%edx
0033     divl    %ecx
0034 
0035     movl    %eax,4(%esi)
0036 
0037     movl    (%esi),%eax /* Get the num lsw */
0038     divl    %ecx
0039 
0040     movl    %eax,(%esi)
0041 
0042     movl    %edx,%eax   /* Return the remainder in eax */
0043 
0044     popl    %esi
0045 
0046     leave
0047     RET
0048 SYM_FUNC_END(FPU_div_small)