	.title	stddev
;+
;	subroutine stddev(buf)
;-
ap=%5
buf=2
;
	.psect	$r.rod,con,ro,rel,lcl,d
asn:	.asciz	"asn "
eqs:	.asciz	"=sy:"
	.even
	.psect	$r.roi,con,ro,rel,lcl,i
	.enabl	lsb
;
;
stddev::
	sub	#20.,sp			; space for MCR line
	mov	sp,r2			; address of MCR buffer
	mov	r2,r1			; destination address
	mov	#asn,r0			; source
	call	copy			; copy it
	mov	buf(ap),r0		; source
	call	copy			; copy it
	mov	#eqs,r0			; source
	call	copy			; copy it
	mov	r2,r1			; address of MCR line
	call	r$spwn			; spawn it to MCR
	add	#20.,sp			; restore stack
	return
;
;
;	routine to concatenate strings
;
;
copy:
	movb	(r0)+,(r1)+		; copy character
	bne	copy			; if not EOS, go again
	tstb	-(r1)			; back up to EOS
	return
	.end
