source: trunk/src/emx/src/lib/math/386/trunc.s@ 210

Last change on this file since 210 was 210, checked in by zap, 23 years ago

Removed a lot of obsolete stuff.

  • Property cvs2svn:cvs-rev set to 1.3
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 707 bytes
Line 
1/ trunc.s (emx+gcc) -- Copyright (c) 1992-1996 by Eberhard Mattes
2
3#include <emx/asm386.h>
4
5#define FUNC MATHSUFFIX2(trunc)
6
7 .globl LABEL(FUNC)
8
9 .text
10
11 ALIGN
12
13/ double _trunc (double x)
14
15#define cw1 0(%esp)
16#define cw2 2(%esp)
17/define ret_addr 4(%esp)
18#define x 8(%esp)
19
20LABEL(FUNC):
21 PROFILE_NOFRAME
22 subl $4, %esp
23 fstcw cw1
24 movw cw1, %ax
25 andw $0xf3ff, %ax
26 orw $0x0c00, %ax /* chop by truncating toward 0 */
27 movw %ax, cw2
28 fldcw cw2
29 FLD x /* x */
30 frndint
31 fldcw cw1
32 addl $4, %esp
33 EPILOGUE(FUNC)
Note: See TracBrowser for help on using the repository browser.