		.386p
		ASSUME	CS:CODE,DS:DATA

		PUBLIC	FxMul,FxDiv

DATA		SEGMENT
PREDIV		DD	0,10000H
DATA		ENDS

CODE		SEGMENT
		ALIGN	4
FxMul		PROC
#B		EQU	ESP+8
#A		EQU	ESP+4
#RETADR		EQU	ESP
		SUB	ECX,ECX
		MOV	EAX,[#A]
		MOV	EDX,[#B]
		IMUL	EDX
		AND	EDX,EDX
		SETL	CL
		ADD	EAX,[PREDIV+ECX*4]
		ADC	EDX,0		
		SHRD	EAX,EDX,16
		RET
FxMul		ENDP


		ALIGN	4
FxDiv		PROC
#B		EQU	ESP+8
#A		EQU	ESP+4
#RETADR		EQU	ESP
		MOV	EAX,[#A]
		CDQ
		SHLD	EDX,EAX,16
		SHL	EAX,16
		MOV	ECX,[#B]
		IDIV	ECX
		RET
FxDiv		ENDP
CODE		ENDS
		END
