	.TITLE	%SAMO
/
/SET ANALOG MODE - INTERNAL SUBROUTINE
/EXECUTION TIME:  41 MICROSECONDS
/CALLING SEQUENCE: JMS* %SAMO
/   AC=DESIRED MODE: 1=PC,2=PP,3=ST,4=OP,
/                    5=HD,6=IC,7=SP
/EXIT: AC=0: NO ERROR
/        =1: ILLEGAL MODE REQUESTED
/        =2: ANALOG MODE FAILED TO SET PROPERLY
/
	.GLOBL %SAMO
/
%SAMO	XX
	SNA
	JMP ERROR   /MODE=0
	DAC MODE
	AND (777770
	SZA
	JMP ERROR    /MODE<0 OR MODE>7
	LAC MODE
	CLL!RAR
	RTR
	RTR
	RTR
	RTR
	IOT3
	JMP .-1
	SAM         /SET ANALOG MODE
	RTL
	RTL
	DAC MODE    /SAVE MODE
	IOT3
	JMP .-1
	RSW         /READ STATUS WORD
	AND (340000
	SAD MODE
	JMP .+3     /MODE IS SET
	LAC (2      /HARDWARE FAILURE
	JMP* %SAMO
	CLA         /NORMAL EXIT
	JMP* %SAMO
ERROR	LAC (1      /ILL. MODE REQUESTED
	JMP* %SAMO
MODE
IOT3=703003
RSW=703613
SAM=703706
	.END
