Subversion Repositories shark

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 pj 1
/* Project:     OSLib
2
 * Description: The OS Construction Kit
3
 * Date:                1.6.2000
4
 * Idea by:             Luca Abeni & Gerardo Lamastra
5
 *
6
 * OSLib is an SO project aimed at developing a common, easy-to-use
7
 * low-level infrastructure for developing OS kernels and Embedded
8
 * Applications; it partially derives from the HARTIK project but it
9
 * currently is independently developed.
10
 *
11
 * OSLib is distributed under GPL License, and some of its code has
12
 * been derived from the Linux kernel source; also some important
13
 * ideas come from studying the DJGPP go32 extender.
14
 *
15
 * We acknowledge the Linux Community, Free Software Foundation,
16
 * D.J. Delorie and all the other developers who believe in the
17
 * freedom of software and ideas.
18
 *
19
 * For legalese, check out the included GPL license.
20
 */
21
 
22
/*	Assembler portion of the library:
23
	function: modf!	*/
24
 
25
#include <ll/i386/linkage.h>
26
 
27
.text
28
.globl	SYMBOL_NAME(modf)
29
 
30
SYMBOL_NAME_LABEL(modf)
31
	pushl	%ebp
32
	movl	%esp,%ebp
33
	subl	$16,%esp
34
	pushl	%ebx
35
	fnstcw	-4(%ebp)
36
	fwait
37
	movw	-4(%ebp),%ax
38
	orw	$0x0c3f,%ax
39
	movw	%ax,-8(%ebp)
40
	fldcw	-8(%ebp)
41
	fwait
42
	fldl	8(%ebp)
43
	frndint
44
	fstpl	-16(%ebp)
45
	fwait
46
	movl	-16(%ebp),%edx
47
	movl	-12(%ebp),%ecx
48
	movl	16(%ebp),%ebx
49
	movl	%edx,(%ebx)
50
	movl	%ecx,4(%ebx)
51
	fldl	8(%ebp)
52
	fsubl	-16(%ebp)
53
	leal	-20(%ebp),%esp
54
	fclex
55
	fldcw	-4(%ebp)
56
	fwait
57
	popl	%ebx
58
	leave
59
	ret