INCLUDE PCMAC.INC
	.MODEL SMALL
	.586
	.STACK 100h

	.DATA
msg1	DB	"Please enter first side:$"
msg2	DB	"Please enter second side:$"
msg3	DB	"Please enter third side:$"
msg4	DB	"The area of the triangle is:$"
uno	DD	?
deux	DD	?
trois	DD	?
two	DD	2.0
semi	DD	?
	.CODE
	EXTERN GetFP: NEAR, PutFP:NEAR
heron	PROC
	_Begin
	finit
	_PutStr  msg1
	call GetFP
	fst uno  	; store value of first side a in uno
	_PutStr  msg2
	call GetFP
	fst deux 	; store value of second side b in deux
	_PutStr  msg3
	call GetFP
	fst trois 	; store value of third side c in trois
	fadd	 	; ST = c+b, ST1 = a
	fadd	 	; ST = (c+b)+a
	fdiv two  	; ST = (c+b+a)/2
	fst semi	; store ST i.e (c+b+a)/2 = s in semi 
	fld uno		; ST = a, ST1 = s
	fsub		; ST = s-a
	fstp uno   	; store s-a in uno again and pop ST
	fld semi	; ST = s
	fld deux	; ST = b, ST1 = s
	fsub		; ST = s-b
	fstp deux 	; store s-b in deux again and pop ST
	fld semi	; ST = s 
	fld trois	; ST = c, ST1 = s
	fsub		; ST = s-c
	fld uno		; ST = s-a, ST1 = s-c
	fld deux	; ST = s-b, ST1 = s-a, ST2= s-c
	fld semi	; ST = s, ST1 = s-b, ST2= s-a, ST3= s-c
	fmul		; ST = s*(s-b), ST1= s-a, ST2= s-c
	fmul		; ST = s*(s-b)*(s-a), ST1= s-c
	fmul		; ST = s*(s-b)*(s-a)*(s-c)
	fsqrt		; ST = square root(s*(s-b)*(s-a)*(s-c)) = final answer
	_putStr msg4
	call PutFP	;output ST on screen
	_Exit 0
heron	ENDP
	END heron

