Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. ;*****************************************************************************
  2. ;*
  3. ;*                            Open Watcom Project
  4. ;*
  5. ;*    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
  6. ;*
  7. ;*  ========================================================================
  8. ;*
  9. ;*    This file contains Original Code and/or Modifications of Original
  10. ;*    Code as defined in and that are subject to the Sybase Open Watcom
  11. ;*    Public License version 1.0 (the 'License'). You may not use this file
  12. ;*    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
  13. ;*    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
  14. ;*    provided with the Original Code and Modifications, and is also
  15. ;*    available at www.sybase.com/developer/opensource.
  16. ;*
  17. ;*    The Original Code and all software distributed under the License are
  18. ;*    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  19. ;*    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
  20. ;*    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
  21. ;*    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
  22. ;*    NON-INFRINGEMENT. Please see the License for the specific language
  23. ;*    governing rights and limitations under the License.
  24. ;*
  25. ;*  ========================================================================
  26. ;*
  27. ;* Description:  WHEN YOU FIGURE OUT WHAT THIS FILE DOES, PLEASE
  28. ;*               DESCRIBE IT HERE!
  29. ;*
  30. ;*****************************************************************************
  31.  
  32.  
  33. ; These compiler support routines are called by the Fast code generator
  34. ; when compiling with the -fpc option.
  35. ;
  36.         name    fdmath
  37.  
  38.         extrn   __FDA : near
  39.         extrn   __FDS : near
  40.         extrn   __FDM : near
  41.         extrn   __FDD : near
  42.         extrn   __FDC : near
  43.  
  44. _TEXT   segment use32 dword public 'CODE'
  45.         assume  cs:_TEXT
  46.  
  47.         public  __FADD
  48. __FADD  proc    near
  49.         push    ecx             ; save regs
  50.         push    ebx             ; ...
  51.         mov     ebx,12[esp]     ; load op2
  52.         mov     ecx,16[esp]     ; ...
  53.         call    __FDA           ; do the add
  54.         pop     ebx             ; restore regs
  55.         pop     ecx             ; ...
  56.         ret     8               ; return and remove op2
  57. __FADD  endp
  58.  
  59.         public  __FSUB
  60. __FSUB  proc    near
  61.         push    ecx             ; save regs
  62.         push    ebx             ; ...
  63.         mov     ebx,12[esp]     ; load op2
  64.         mov     ecx,16[esp]     ; ...
  65.         call    __FDS           ; do the subtract
  66.         pop     ebx             ; restore regs
  67.         pop     ecx             ; ...
  68.         ret     8               ; return and remove op2
  69. __FSUB  endp
  70.  
  71.         public  __FSUBR
  72. __FSUBR proc    near
  73.         push    ecx             ; save regs
  74.         push    ebx             ; ...
  75.         mov     ecx,edx         ; load op2
  76.         mov     ebx,eax         ; ...
  77.         mov     eax,12[esp]     ; load op1
  78.         mov     edx,16[esp]     ; ...
  79.         call    __FDS           ; do the subtract
  80.         pop     ebx             ; restore regs
  81.         pop     ecx             ; ...
  82.         ret     8               ; return and remove op1
  83. __FSUBR endp
  84.  
  85.         public  __FMUL
  86. __FMUL  proc    near
  87.         push    ecx             ; save regs
  88.         push    ebx             ; ...
  89.         mov     ebx,12[esp]     ; load op2
  90.         mov     ecx,16[esp]     ; ...
  91.         call    __FDM           ; do the multiply
  92.         pop     ebx             ; restore regs
  93.         pop     ecx             ; ...
  94.         ret     8               ; return and remove op2
  95. __FMUL  endp
  96.  
  97.         public  __FDIV
  98. __FDIV  proc    near
  99.         push    ecx             ; save regs
  100.         push    ebx             ; ...
  101.         mov     ebx,12[esp]     ; load op2
  102.         mov     ecx,16[esp]     ; ...
  103.         call    __FDD           ; do the divide
  104.         pop     ebx             ; restore regs
  105.         pop     ecx             ; ...
  106.         ret     8               ; return and remove op2
  107. __FDIV  endp
  108.  
  109.         public  __FDIVR
  110. __FDIVR proc    near
  111.         push    ecx             ; save regs
  112.         push    ebx             ; ...
  113.         mov     ecx,edx         ; load op2
  114.         mov     ebx,eax         ; ...
  115.         mov     eax,12[esp]     ; load op1
  116.         mov     edx,16[esp]     ; ...
  117.         call    __FDD           ; do the divide
  118.         pop     ebx             ; restore regs
  119.         pop     ecx             ; ...
  120.         ret     8               ; return and remove op1
  121. __FDIVR endp
  122.  
  123.         public  __FCMP
  124. __FCMP  proc    near
  125.         push    ecx             ; save regs
  126.         push    ebx             ; ...
  127.         mov     ebx,12[esp]     ; load op2
  128.         mov     ecx,16[esp]     ; ...
  129.         call    __FDC           ; do the compare
  130.         pop     ebx             ; restore regs
  131.         pop     ecx             ; ...
  132.         ret     8               ; return and remove op2
  133. __FCMP  endp
  134.  
  135.         public  __FCMPR
  136. __FCMPR proc    near
  137.         push    ecx             ; save regs
  138.         push    ebx             ; ...
  139.         mov     ecx,edx         ; load op2
  140.         mov     ebx,eax         ; ...
  141.         mov     eax,12[esp]     ; load op1
  142.         mov     edx,16[esp]     ; ...
  143.         call    __FDC           ; do the compare
  144.         pop     ebx             ; restore regs
  145.         pop     ecx             ; ...
  146.         ret     8               ; return and remove op1
  147. __FCMPR endp
  148.  
  149. _TEXT   ends
  150.         end
  151.