/COPYRIGHT 1970, DIGITAL EQUIPMENT CORP., MAYNARD, MASS.
/EDIT 1   9-25-70
	.TITLE SENSE SWITCH TEST
/USED FROM FORTRAN TO DETERMINE THE STATE OF THE AC SWITCHES (ACS)
/CAN BE USED AS EITHER AN INTEGER FUNCTION OR A LOGICAL FUNCTION
/	ISENSW(M) = .TRUE. (-1) IF ACS(M) IS UP
/	ISENSW(M) = .FALSE. (0) IF ACS(M) IS DOWN
/INTENDED TO BE USED AS FOLLOWS:
/
/	LOGICAL ISENSW
/	IF (ISENSW(2)) [EXECUTABLE STATEMENT]
/
/ACS NUMBERS CORRESPOND TO NUMBERS ON CONSOLE
/IF THE ACTUAL PARAMETER IS NEGATIVE OR IS GREATER THAN 
/17 DECIMAL, IT IS TREATED AS 0.
/
	.TITLE SENSE SWITCH TEST
	.GLOBL ISENSW, .DA
ISENSW	.BLOCK 1	/ENTRY	
	JMS*  .DA	/GET ADDR OF ARGUMENT
	JMP .+2
FORPAR	.DSA 0
	LAC*  FORPAR	/GET ARGUMENT
	TAD  (-22	/ONLY 18 SWITCHES
	SPA!CLA
	LAC*  FORPAR	/M:='IF' M<0 'OR' M>17 'THEN' 0 'ELSE' M;
	CMA
	DAC SHCT		/SET UP SHIFT COUNT
	CCL!CLA		/GENERATE ONE IN LINK
	RAR
	ISZ  SHCT	/GENERATE MASK
	JMP  .-2
	DAC   SHCT	/MASK DONE
	750004		/LAS
	AND  SHCT	/GOT IT
	SNA!CLA
	CMA
	CMA		/MAKE IT WORK AS A LOGICAL VARIABLE
	JMP*  ISENSW	/RETURN
SHCT	.BLOCK 1		/HOLDS SHIFT COUNT AND MASK
	.END
