	.TITLE NTOPN
	.ENABLE LC
	.IDENT /010688/

;
;     Description: Access DECnet Network
;	     File: [22,310]NTOPN.MAC
;	   Author: Jim Bostwick   1-JUN-1988 
;	Last Edit: 12-JUN-1989 18:19:17 
;	  History: 
;		 3-AUG-1989 10:50:29 - JMB - changed location of PASMAC (again)
;		  8-DEC-1988 19:33:53 - JMB add NT.LCB (use long con. block)
;		 15-NOV-1988 12:00:00 - JMB - Conform to AMI Header specs. 
;		 23-JUN-1988 21:17:40 - JMB PA3UTL upgrade.
;

.REM |
{*CALL*}

Procedure NTOPN (
	lun: Integer;
	efn: Event_flag;
	links: integer;
	wait_recover: integer;
	VAR IOSB: IO_Status_block
	);External;

{*USER*

 Must be the first network call (other than NTCONB) issued by a task. 
Establishes the task as an active network task. 
 LUN specifies the network mailbox lun, which will receive all network
messages (as opposed to network data) for all links for this task. 
 EFN will be set when the OPN$ call completes. 
 LINKS sets the maximum number of simultaneous links for the task. DECnet
will reject connect requests which would exceed LINKS without notifying
the task. Specify zero (0) for NO limit on the links. 
 WAIT_RECOVER specifies the number of minutes (0..32767.) for DECnet to 
wait after physical link loss before aborting the logical links. Normally,
a small value (< 5 min. ) will suffice. A value of zero specifies that
the logical link(s) are to be aborted 'immediately' upon physical link 
loss. 
 } 

{*WIZARD*

 This call specifies that LONG connect blocks will be used by default. 
}

|

;
; Assemble with PASMAC.MAC as prefix file.
;

	.library /lb:[1,1]netlib.mlb/
	.include /pas$utl:pasmac.mac/

  
	.mcall OPNW$S,NETDF$

  	NETDF$

	PROC NTOPN
	PARAM Lun, Integer
	PARAM EFN, Char
	PARAM Links, Integer
	PARAM lrp, Integer
	PARAM IOSB, Address

	SAVE <R0,R1>

	BEGIN
	mov	sp, r0
	movb	efn(sp), r1	; get EFN
	bic 	#^C377, r1
	OPNW$S lun(r0),r1,iosb(r0),,<links(r0),lrp(r0),#NT.LCB>

	ENDPR

	.END

