; square root routine - new version for test

fast_root::
	movem.l	d1-d4,-(sp)
	moveq.l	#0,d1
	moveq.l	#0,d2
	moveq.l	#15,d4			; counter for bits in root


label:	add.l	d0,d0			; method for getting top bit off
	addx.w	d1,d1			; and into d1
	add.l	d0,d0
	addx.w	d1,d1			; and next bit

	add.w	d2,d2
	move.w	d2,d3
	add.w	d3,d3

	cmp.w	d3,d1
	bls.s	label2

	addq.w	#1,d2
	addq.w	#1,d3
	sub.w	d3,d1

label2:	dbra	d4,label

	move.w	d2,d0

	movem.l	(sp)+,d1-d4
	rts
