/
/ VERSION 5A 4-27-77  PT
/
	ADSK=6534
	ADRB=6533
	ADST=6532
	ADLM=6531
	ADCL=6530
	SAM=100
	LINC=6141
	ESF=4
	PDP=2
	SECT8	ADC		/AD SAMPLER (UNBUFFERED, UNCOLCKED)
	BASE	0
	STARTD
	FLDA	0		/GET RETURN ADDRESS
	FSTA	ADCRET
	FADD	L2		/GET ADDR OF ARG POINTER
	FSTA	0
	FLDA%	0		/GET ADDR OF CHANNEL NUMBER
	FSTA	0
	STARTF
	FLDA%	0		/GET THE CHANNEL NUMBER
	ALN	0		/FIX IT
	FSTA	CHANEL		/STORE IT FOR ADC8
	TRAP4	ADC8		/GO TO PDP8 CODE TO DO THE SAMPLING
	FLDA	SAMPLE
	FNORM			/GET THE SAMPLE AND NORMALIZE IT
	FDIV	L511		/SCALE BETWEEN -1 AND +1
ADCRET,	JA	.
L2,	0;2
L511,	F	511.
SAMPLE,	13;0;0
CHANEL,	0;0;0
ADC8,	0			/PDP8 MODE END OF ADC
	IFSW	8 <
	ADCL			/CLEAR AD LOGIC
	TAD	CHANEL+2		/SET MULTIPLEXOR CHANNEL
	ADLM
	ADST			/START CONVERSION
	ADSK			/WAIT FOR IT
	JMP	.-1
	ADRB			/READ CONVERTOR BUFFER>
	IFNSW	8 <
	TAD	CHANEL+2	/CREATE FIRST SAM
	TAD	SAM0
	DCA	DOSAM
	IOF
	LINC			/ENTER LINC MODE WITHOUT INTERRUPTS
	ESF			/DISABLE FAST SAM
DOSAM,	0
	PDP
	ION			/BACK IN 8 MODE, TURN ON INTERRUPTS>
	DCA	SAMPLE+1	/SAVE SAMPLE
	CIF CDF
	JMP%	ADC8
	IFNSW	8 <
SAM0,	SAM	0>
