 	.386
	.model	use32 small

	extrn	allerr : proc
	public	_modf

	.data
nm	db	"modf",0

	.code
_modf:
	enter	4,0
	lea	ecx,[ebp+8]
	sub	edx,edx
	fnstcw	[ebp-4]
	mov	ax,[ebp-4]
	and	ah,0f3h
	or	ah,0ch
	mov	[ebp-2],ax
	fldcw	[ebp-2]
	fld	qword ptr [ecx]
	fld	st(0)
	frndint

	mov	eax,[ebp+16]
	fst	qword ptr [eax]

	fsubp	st(1)

	fldcw	[ebp-4]
	lea	eax,[nm]
	call	allerr
	leave
	ret
	end