*** dpcmp.s
* 	Double Precision Compare
*	for Alcyon C
*
*	Copyright Atari Corp. 1987,1988
*
*	void dpcmp(d1,d2)
*	double d1, d2;
*
*	MDJohnson       2/15/88
***

	.include fpmacro

; dpcmp(x,y)
	fpinit	dpcmp
	fpidle				; wait for idle state
	move.w	#$5400,FPCMD		; x -> fp0
	ckcir	#$9608			; ready for double
	move.l	4(sp),FPOP		; write first half
	move.l	8(sp),FPOP		; write second half

	fpidle				; wait for idle state
	move.w	#$5438,FPCMD		; x == y ?
	ckcir	#$9608			; ready for double
	move.l	12(sp),FPOP		; write first half
	move.l	16(sp),FPOP		; write second half

	fpidle				; wait for idle state
	move.w	#$A800,FPCMD
	ckcir	#$B104			; ready for single
	move.l	FPOP,d0			; read first half
	rol.l	#8,d0			; <31:24> -> <7:0>
	andi.w	#$0E,d0			; mask
	move.w	d0,ccr			; update processor flags
	rts

