	.TITLE	ISENSW
/
/  25 OCT 77 (003; PDH) MULTIACCESS PUTS ACSW IN LOCATION 4
/  30 JUN 77 (002; PDH) IMPLEMENT FOR XVM/RSX (USE LOCATION 34 FOR ACSW)
/  25 SEP 70 - SOMEONE AT DEC (LOOKED LIKE THEIR FIRST PROGRAM!)
/
	.GLOBL	ISENSW,.DA
/
ISENSW	XX
	JMS*	.DA
	JMP	.+2
FORPAR
	CAL	SPY		/ GET AC SWITCH VALUE FROM SYSTEM
	LAC*	FORPAR		/ GET SWITCH NUMBER
	SPA
	SKP!CMA			/ MUST BE POSITIVE VALUE
	AAC	-21		/ NOT GREATER THAN 17
	SMA!SZA!TCA		/ HAVE '17-N'
	LAC	(22		/ OR 18 IF OUT OF RANGE
	XOR	(ALSS		/ GENERATE THE CORRECT SHIFT INSTRUCTION
	DAC	.+2
	CLA!IAC
	XX			/ SHIFT THE MASK TO PROPER BIT POSITION
	AND	ACSW		/ SELECT PROPER BIT FROM AC SWITCHES
	SZA
	CLC
	JMP*	ISENSW		/ LEAVE WITH VALUE IN HARDWARE AC
/
SPY	31; 0; 4;ACSW		/ SYSTEM PUTS AC SWITCH VALUE IN LOCATION 34.
	.END
