	.TITLE - AD15 SEQUENTIAL INPUT STATUS MAP.
/ 
/ 
/                   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 1971, DIGITAL EQUIPMENT CORP.,MAYNARD MASS.
/W.A. DESIMONE
/EDIT 001  11-18-71
/
/CALLING SEQUENCE:	CALL ADSMAP(ISA,IG,IERR,IATM,IESYN,IMOV)
/	JMS*	ADSMAP
/	JMP .+7		/SUBR. RET.
/	ADDR OF INPUT STATUS	(RETURNED)
/	ADDR OF GAIN		/1,2,4,OR 8.
/	ADDR  OF ERROR PARAMETER	/-1 RETURNED IF ERROR.(BAD GAIN)
/					/O RETURNED IF NO ERROR.
/	ADDR. OF ADD-TO-MEM. PARAMETER	/SET=NON-ZERO.
/	ADDR. OF EXTERN. SYN. PARAM.	/SET=NON-ZERO.
/	ADDR. OF MEM. OVFL. PARAM.	/SET=ZERO.
/	NEXT INSTRUCTION.
/
/LAST THREE ARGUMENTS OPTIONAL.  IF NOT SPEC., ASSUMED ZERO.
/
/ADSMAP(ISA,IG,IERR,IATM,IESYN,IMOV) - MAP AD15 I/O PARAMETERS
/INOT AD15 INPUT STATUS BUTS ASSIGNMENTS AND RETRURN AS ISA.
/IF IERR IS RETURNED NEG., ERROR IN IG SPECIFIED.  IATM,IESYN, AND
/IMOV ARGUMENTS ARE ASSUMED ZERO IF NOT SPECIFIED.
/
	.EJECT
/
	.GLOBL ADSMAP,.DA
/
ADSMAP	0		/SUBR. ENTRY.
	JMS*	.DA
	JMP	ARGEND
STA	0		/ADDR. OF INPUT STATUS(ONE FOR ALL CHANLS.)
G	0		/ADDR. OF GAIN (1,2,4, OR 8).
ERR	0		/ADDR. OF ERROR VAR. (NEG. IF ERROR).
ATM	0		/ADDR. OF ADD-TO-MEM. PARAM. (OPTIONAL)
ESYN	0		/ADDR. OF EXT. SYNC. PARAM. (OPTIONAL)
MOV	0		/ADDR. OF MEM. OVFL. PARAM. (OPTIONAL).
ARGEND	LAC*	G	/CHECK GAIN FOR 1,2,4, OR 8.  RETURN NEG.
	SAD	(1)	/NEG. ERROR VAR. IF NOT ONE OF THESE.
	JMP	G0
	SAD	(2)
	JMP	G1
	SAD	(4)
	JMP	G2
	SAD	(10)
	JMP	G3
ADERR	CLC		/SET ERR VAR. TO NEG.
	DAC*	ERR
EXIT	DZM	ATM	/REINIT. OPTIONAL ARGUMENTS.
	DZM	ESYN
	DZM	MOV
	LAC	(6200)	/BITS 6,7,10 FOR DEFAULT.(6=MEM OVF,7=DCH MODE,
	DAC	ISB	/10=SEQ. MODE.)
	JMP*	ADSMAP
/
/GAIN TABLE
GTB	0		/GAIN=1
	200000		/GAIN=2
	400000		/GAIN=4
	600000		/GAIN=8
/
/TEMP. STORAGE.
GBP	GTB		/GAIN TABLE POINTER.
ISB	6200		/TEMP. FOR INPUT STATUS BUILD.
/
G3	ISZ	GBP	/8 TO 3 MAPPING.
G2	ISZ	GBP	/4 TO 2 MAPPING.
G1	ISZ	GBP	/2 TO 1 MAPPING.
G0	LAC*	GBP	/1 TO 0 MAPPING.
	XOR	ISB	/BUILD INPUTS STATUS.  -- GAIN.
	DAC	ISB
	LAC	(GTB)	/REINIT GAIN TABLE POINTER.
	DAC	GBP
	.EJECT
/GET REST OF PARAMETERS AND SET STA APPROP.  FOR RETURN.
	LAC	ATM		/ADD TO MEM PARAM.?
	SNA
	JMP	NP1		/NO.  ASSUME OFF.  GET NXT PARAM.
	LAC*	ATM		/YES.  IF NON-ZERO, SET BIT 9.
	SZA
	LAC	(400)		/BIT 9.
	XOR	ISB		/BUILD INPUT STATUS AS WE GO.
	DAC	ISB
NP1	LAC	ESYN		/EXT. SYNC PARAM.?
	SNA			
	JMP	NP2		/NO.  ASSUME OFF.  GET NXT. PARAM.
	LAC*	ESYN		/YES. IF NON-ZERO,SET EXTERNAL.
	SZA
	LAC	(1000)		/BIT 8.
	XOR	ISB
	DAC	ISB
NP2	LAC	MOV		/MEM. OVFL. PARAM.?
	SNA
	JMP	NP3		/IF NOT SPEC.,ASSUME ENABLED.
	LAC*	MOV		/YES.  IF NON-ZERO,DISABLE.
	SZA
	LAC	(4000)		/BIT 6 OR OFF.
NP3	XOR	ISB
	DAC	ISB
	DAC*	STA	/TO USER.
	JMP	EXIT
	.END
