	.TITLE NTCON
	.ENABLE LC
	.IDENT /010688/

;
;     Description: Request DECnet logical Link Connection
;	     File: [22,310]NTCON.MAC
;	   Author: Jim Bostwick   1-JUN-1988
;	Last Edit: 15-NOV-1988 12:29:30 
;	  History: 
;		 3-AUG-1989 10:50:29 - JMB - changed location of PASMAC (again)
;		 15-NOV-88 12:00:00 - JMB - Conform to AMI Header specs. 

;		 23-JUN-1988 21:17:17  - JMB PA3UTL upgrade.
;

.REM |
{*CALL*}

Procedure NTCON (
	lun: integer;
	EFN: Event_flag;
	Out_MSG: CH16;			{ user message sent to remote task }
	VAR Conb: Net_request_block;
	VAR In_MSG: CH16;
	VAR IOSB: Io_Status_block
	);External;

{*USER*

Request a logical link with remote task. Build Conb with call to NTCONB
prior to invoking NTCON. OUT_MSG contains user data sent to remote task
(it get's it in the NTGND call). In_MSG will receive data sent by the 
remote task in it's NTACC call. 
 } 

{*WIZARD*

AST, NOFLOW, short connect blocks not implemented. 
 }

|

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

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

	.MCALL CONW$S,CRBDF$

	.include /pas$utl:PASMAC/

	CRBDF$

	PROC NTCON
	PARAM LUN, Integer
	PARAM EFN, Char
	PARAM OutMsg, 16.*Char
	PARAM Conb, Address
	PARAM InMsg, Address
	PARAM IOSB, Address

	SAVE <R0,R1,R2>
	BEGIN
	mov	sp, r0
	movb	efn(sp), r1	; get EFN 
	bic	#^C377, r1
	mov	r0, r2		; get outmsg pointer
	add	#outmsg, r2	; ...
	tstb	(r2)		; null message?
	bne	10$		; no - send it
	clr	r2		; say no message
10$:
	conw$s lun(r0),r1,iosb(r0),,<conb(r0),#n.rql,r2,#16.,inmsg(r0),#16.>

	ENDPR

	.END

