/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/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
