 	.386
	.model	use32 small

	extrn	allerr : proc
	public	_fmod
	.data
nm	db	"fmod",0

	.code
_fmod:
      	push	ebp
	mov	ebp,esp
	
	lea	ecx,[ebp+8]
	lea	edx,[ebp+16]
	fld	qword ptr [edx]
	fld	qword ptr [ecx]
	fprem1
	fxch	st(1)
	fcomp	st(1)
	fldz
	fcomp	st(1)
	fnstsw	ax
	fwait
	sahf
	jz	noadj
	jc	noadj
	fld	qword ptr [edx]
	faddp	st(1)
noadj:
	lea	eax,[nm]
	call	allerr

	leave
	ret
	end