	.TITLE	%TAVA
/
/TRANSFER ANALOG VALUE -
/     INTERNAL SUBROUTINE
/EXECUTION TIME: DEVICE LIMITED
/CALLING SEQUENCE: JMS* %TAVA
/     AC=UNNORMALIZED POSITIVE
/          INTEGER VALUE
/EXIT AC=0: NO ERROR
/        =1: VALUE<0 OR VALUE>9999
/        =4: HARDWARE MALFUNCTION
/        =7: KEYBOARD INTERFERENCE -
/            %TAVA CANNOT PROCEED
/
	.GLOBL %BBCD,%TAVA
/
%TAVA	XX
	SPA
	JMP ERROR1  /VALUE<0
	.DEC
	TAD (-10000
	SMA
	JMP ERROR1  /VALUE>9999
	TAD (10000
	.OCT
	JMS* %BBCD
	LMQ         /SAVE BCD VALUE
	IOT3
	JMP .-1
	RSW         /READ STATUS WORD
	AND (10
	SZA
	JMP ERROR7  /POT SET BUSY
	LACQ
	IOT3
	JMP .-1
	TAV     /TRANSFER ANALOG VALUE
	LAW+17134
	DAC FAIL    /SET FAIL-SAFE=
	            /5.88 MILLISECONDS
LOOP	IOT3
	JMP .-1
	RSW         /READ STATUS WORD
	AND (40
	SNA
	JMP* %TAVA  /RCDAC SETTLED
	ISZ FAIL
	JMP LOOP
	LAC (4      /HARD. MALFUNCTION
	JMP* %TAVA
ERROR1	LAC (1      /ILL. VALUE REQ.
	JMP* %TAVA
ERROR7	LAC (7      /KEYBOARD
		/INTERFERENCE
	JMP* %TAVA
FAIL
IOT3=703003
RSW=703613
TAV=703506
	.END
