	PAGE	,132
	TITLE	Division test routine
IF1
INCLUDE 87MAC.LIB
ENDIF
ZZZ	SEGMENT STACK
	DW	64 DUP(?)
ZZZ	ENDS
CODE	SEGMENT PUBLIC
	ASSUME	CS:CODE,DS:CODE,ES:CODE
	EXTRN	TEN_TO_X:NEAR
NUMERATOR	DW	1234
DENOMINATOR	DW	5678
	ORG	10H
BCD_RESULT	DT	?
TEN8		DD	100000000
DIVIDE_TEST	PROC	FAR
	PUSH	DS
	SUB	AX,AX
	PUSH	AX
	MOV	AX,CS
	MOV	DS,AX
	MOV	ES,AX
DO_AGAIN:
	FINIT
	FILD	NUMERATOR
	FILD	DENOMINATOR
	INT	3

	ORG	100H
	FDIVRP	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	110H
	FDIVP	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	120H
	FDIV	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	130H
	FDIVR	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	140H
	FSUBP	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	150H
	FSUBRP	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	160H
	FSUB	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
	ORG	170H
	FSUBR	ST1,ST0
	FIMUL	TEN8
	FBSTP	BCD_RESULT
	JMP	DO_AGAIN
DIVIDE_TEST	ENDP
CODE	ENDS
	END	DIVIDE_TEST
