	page	,132
	title	Test of 8087 accuracy
data	segment public
int_result	dt	?
numbig	dd	1000000
number7 dw	7
number100	dw	100
result	dq	?
r2	dq	?
control_87	dw	03BFH
data	ends
.xlist
include 87mac.lib
.list
code	segment public
	extrn	print_bcd:near
	assume	cs:code,ds:data
start:
	mov	ax,data
	mov	ds,ax			; set up segment
	fldcw	control_87		; control word
	fild	number7 		; value 7
	fidiv	number100		; .07 in ST
	fst	r2			; store as useful value
	fiadd	numbig			; add in the huge number
	fstp	result			; store number away
add_more:
	mov	cx,50000		; lots of loops
add_loop:
	fld	result			; get current result
	fadd	r2			; add in .07
	fstp	result			; store as new result
	loop	add_loop		; continue
	fld	result			; get the result
	fimul	number100		; adjust by 100
	fbstp	int_result		; store as human readable
	mov	si,offset int_result	; point to packed bcd
	call	print_bcd
	jmp	add_more
code	ends
	end	start

