	.TITLE RDP - READ DIGITAL POINT.
/ 
/ 
/                   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.
/EDIT 001  10-15-71    W.A.DESIMONE
/CALLING SEQUENCE:	CALL RDP(LUN,IDP,LV,IEV)
/	JMP	.+5	/SUBR. RETURN.
/	ADDR. OF LUN.
/	ADDR OF DIGITAL POINT	(LOWEST=1)
/	ADDR. OF LOG. VAR.	(CLOSED=TRUE)
/	ADDR. OF EV		(OPTIONAL)
/	NEXT INSTR.
/
/RDP(LUN,IDP,LV,IEV) - READ DIGITAL POINT INDICATED (IDP) VIA
/LOGICAL UNIT #=LUN.  RETURN POLARITY AS LOGICAL VARIABLE (LV)
/(CLOSED=TRUE,OPEN=FALSE).  EVENT VAR. ARGUMENT OPTIONAL.
/
	.EJECT
	.GLOBL RDP,.DA
RDP	0		/SUBR. ENTRY.
	JMS*	.DA
	JMP	ARGEND
LUN	0		/ADDR. OF LUN.
DP	0		/ADDR. OF DIGITAL PT. (LOWEST=1)
LV	0		/ADDR. OF LOGICAL VAR. (RETURNED)
EV	0		/ADDR. OF EV (OPTIONAL).
ARGEND	LAC*	LUN	/LUN TO CPB.
	DAC	CPB2
	LAC	EV	/EV ADDR. TO CPB.
	DAC	CPB1
	DAC	CPBWF1	/TO WAITFOR CPB.
	DZM	EV	/INIT EV.
	LAC	(R)	/LOCAL ADDR. TO CPB. FOR MODULE DATA.
	DAC	CPB4
	LAC*	DP	/TAKE CALLERS DP AND DIVIDE IT BY 16(10).
	AAC	-1	/MINUS ON FIRST.
	CLL		/FOR IDIV.
	IDIV		/REMAINDER IN AC AND QUOTIENT IN MQ.
	20		/16(10).
	TAD	(LLS+2)	/BUILD LLS FOR POLARITY TEST.
	DAC	PV	/FLIP IN LINE.
	LACQ		/QUOTIENT-1 FOR MODULE #.
	DAC	CPB3	/MODULE # TO CPB.
	CAL	RD	/READ CONTACT SENSE AND DO WAITFOR
	CAL	WF	/IN ORDER TO PROCESS MODULE DATA.
	LAC	R	/DATA TO AC.
PV	XX		/LLS+2+MODULE PT. #.
	SMA!CLC		/IF SET,RETURN TRUE.
	CMA		/HERE IF NOT SET.
	DAC*	LV	/TO CALLER.
	JMP*	RDP	/EXIT.
	.EJECT
/CAL PARAM. BLOCKS
/
/READ CONTACT SENSE CAL PARAM. BLK.
RD	7400		/FUNCTION CODE.
CPB1	0		/EV ADDR.
CPB2	0		/LUN.
CPB3	0		/MODULE # (LOWEST=0)
CPB4	0		/MODULE DATA (BITS 2-17)
/
/WAITFOR CAL PARAM. BLK.
WF	20		/FUNCTION CODE.
CPBWF1	0		/EV ADDR.
/
/TEMPS.
R	0		/FOR MODULE DATA.
	.END
