Google
 

Trailing-Edge - PDP-10 Archives - BB-J710A-BM - tools/nrt20/nrtsrv.lst
There are no other files named nrtsrv.lst in the archive.
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 2
NRTSRV	MAC	21-Sep-79 11:46	

     1						TITLE	NRTSRV - Program to provide remote network login service
     2
     3
     4
     5
     6					;COPYRIGHT (C) 1979 BY
     7					;DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
     8					;
     9					;
    10					;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
    11					;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
    12					;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
    13					;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
    14					;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
    15					;TRANSFERRED.
    16					;
    17					;
    18					;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
    19					;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
    20					;CORPORATION.
    21					;
    22					;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
    23					;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
    24
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 3
NRTSRV	MAC	21-Sep-79 11:46	

    25
    26						SALL			; Keep listing uncluttered, no macro expansion
    27						SEARCH	MONSYM,MACSYM	; Universals to search
    28						.REQUIRE SYS:MACREL	; Make LINK load these automatically
    29
    30					;
    31					; This program will allow a person to login to the system on which it is
    32					; being run from a remote node on a DECnet network. It demonstrates use
    33					; of of the TOPS-20 DECnet functionality in a program which performs a
    34					; real and useful function. The person desiring to login to this system
    35					; must run the NRT20 program, if on a TOPS-20 node, or a program of
    36					; identical functionality on a node with another operating system.
    37					;
    38
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 4
NRTSRV	MAC	21-Sep-79 11:46		DECLARED SYMBOLS

    39						SUBTTL	DECLARED SYMBOLS
    40
    41			000001			T1==1			; AC definitions
    42			000002			T2==2
    43			000003			T3==3
    44			000004			T4==4
    45			000016			CX==16
    46			000017			P==17
    47
    48			000007			MAXFRK==7		; Maximum number of server sub processes
    49			000050			SRVOSZ==50		; Output buffer size in words
    50			000240			MAXOUT==SRVOSZ*4	; Maximum number of output characters
    51			000010			SRVSIZ==10		; Size of server buffer in words
    52			000040			NPDL==40		; Size of pushdown list
    53
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 5
NRTSRV	MAC	21-Sep-79 11:46		IMPURE STORAGE

    54						SUBTTL	IMPURE STORAGE
    55
    56	000000'				SAVAC:	BLOCK 4			; AC save area
    57	000004'				DEVNAM:	BLOCK 2			; For building PTY names
    58	000006'				PTYJFN:	BLOCK 1			; The JFN of the PTY
    59	000007'				TTYJFN:	BLOCK 1			; TTY designator
    60	000010'				SRVJFN:	BLOCK 1			; The JFN of the network connection
    61	000011'				SRVINP:	BLOCK SRVSIZ		; Holds input characters
    62	000021'				OUTPUT:	BLOCK 1			; Output buffer pointer
    63	000022'				OUCNT:	BLOCK 1
    64	000023'				PC:	BLOCK 1			; The software interrupt PC save area
    65	000024'				SRVOUP:	BLOCK SRVOSZ		; Holds ouptut data
    66	000074'				FORKS:	BLOCK MAXFRK		; Save process ID's here
    67	000103'				HSTNAM:	BLOCK 2			; Host name string
    68	000105'				PDL:	BLOCK NPDL		; Pushdown list (stack)
    69
    70	000640'					RELOC 1000-140		; Start on page boundary
    71
    72	000640'	000000	000023'		LEVTAB:	PC			; Where to stash the PC
    73	000641'	000001	000776'		CHNTAB:	1,,GOTCI		; Network connect received interrupt routine
    74	000642'	000001	001040'			1,,GOTDAT		; Network data available interrupt routine
    75
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 6
NRTSRV	MAC	21-Sep-79 11:46		BEGIN - Start of NRTSRV program

    76						SUBTTL	BEGIN - Start of NRTSRV program
    77
    78	000643'	104 00 0 00 000147 	BEGIN:	RESET			; Initialize ourselves
    79	000644'	200 01 0 00 001154'		MOVE T1,[SIXBIT /NRTSRV/] ; Our name in SIXBIT
    80	000645'	104 00 0 00 000210 		SETNM			; Set jobs private name
    81	000646'	561 01 0 00 001155'		HRROI T1,[ASCIZ /SRV/]	; See if network exists
    82	000647'	104 00 0 00 000120 		STDEV			; By checking for SRV device
    83						 JRST [	SETOM T1		; Doesn't exist, so go away
    84							LGOUT			; By logging out this job
    85							 JFCL			; Should always work, but...
    86	000650'	254 00 0 00 001156'			HALTF]			; Either way, go away
    87	000651'	201 01 0 00 400000 		MOVEI T1,.FHSLF		; This process
    88	000652'	104 00 0 00 000150 		RPCAP			; Get our capabilities
    89	000653'	200 03 0 00 000002 		MOVE T3,T2		; Copy them
    90	000654'	104 00 0 00 000151 		EPCAP			; Enable all capabilities we have
    91	000655'	205 04 0 00 777771 		MOVSI T4,-MAXFRK	; Maximum processes to create
    92	000656'	205 01 0 00 200000 	FRKDO:	MOVX T1,CR%CAP		; Give them the same capabilities we have
    93	000657'	402 00 0 00 000002 		SETZM T2		; No AC's
    94	000660'	104 00 0 00 000152 		CFORK			; Create a process
    95	000661'	320 16 0 00 000676'		 ERJMP WTFRK			; If no more, done
    96	000662'	202 01 0 04 000074'		MOVEM T1,FORKS(T4)	; Save process handle
    97	000663'	514 02 0 00 000001 		HRLZ T2,T1		; Process handle of destination
    98	000664'	541 02 0 00 000001 		HRRI T2,1		; Start at page 1 in destination process
    99	000665'	200 01 0 00 001162'		MOVE T1,[.FHSLF,,1]	; Map this process to it
   100	000666'	201 03 0 00 001153'		MOVEI T3,ENDPRG-1	; Last address in use
   101	000667'	242 03 0 00 777767 		LSH T3,-11		; Make a repetition count
   102	000670'	661 03 0 00 540000 		TXO T3,PM%CNT!PM%RD!PM%WR ; Make PMAP argument
   103	000671'	104 00 0 00 000056 		PMAP			; Map the process' address space
   104	000672'	554 01 0 00 000002 		HLRZ T1,T2		; Get process handle
   105	000673'	201 02 0 00 000720'		MOVEI T2,START		; Start address
   106	000674'	104 00 0 00 000157 		SFORK			; Start the process up
   107	000675'	253 04 0 00 000656'	FRKLOP:	AOBJN T4,FRKDO		; Do all of them
   108	000676'	201 01 0 00 400000 	WTFRK:	MOVEI T1,.FHSLF		; Our process
   109	000677'	402 00 0 00 000003 		SETZM T3		; No capabilities
   110	000700'	104 00 0 00 000151 		EPCAP			; Disable all capabilities
   111	000701'	201 01 0 00 777774 		MOVEI T1,.FHINF		; All the inferior processes
   112	000702'	104 00 0 00 000155 		RFORK			; Resume them
   113	000703'	104 00 0 00 000163 		WFORK			; Wait for any inferior to halt
   114						; ..
   115
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 7
NRTSRV	MAC	21-Sep-79 11:46		RSPROC - Restart inferior process after it halted

   116						SUBTTL	RSPROC - Restart inferior process after it halted
   117
   118	000704'	201 01 0 00 777774 	RSPROC:	MOVEI T1,.FHINF		; All the inferior processes
   119	000705'	104 00 0 00 000154 		FFORK			; Freeze them
   120	000706'	205 04 0 00 777771 		MOVSI T4,-MAXFRK	; Scan process table
   121	000707'	336 01 0 04 000074'	DEDLOP:	SKIPN T1,FORKS(T4)	; This one exist?
   122	000710'	254 00 0 00 000716'		JRST DEDLO1		; No, go on
   123	000711'	104 00 0 00 000156 		RFSTS			; Yes, get its status
   124	000712'	135 01 0 00 001163'		LOAD T1,RF%STS,T1	; Get its status
   125	000713'	302 01 0 00 000002 		CAIE T1,.RFHLT		; Halted?
   126	000714'	306 01 0 00 000003 		CAIN T1,.RFFPT		; Or error?
   127						JRST [	MOVE T1,FORKS(T4) 	; Yes, get process handle again
   128							SETZM FORKS(T4)		; Clear entry
   129							KFORK			; Kill the process
   130							HRRZS T4		; Create one more process
   131							MOVEI T1,.FHSLF		; Our process
   132							RPCAP			; Get our capabilities
   133							MOVE T3,T2		; Copy them
   134							EPCAP			; Enable all capabilities we have
   135	000715'	254 00 0 00 001164'			JRST FRKDO]		; Go back and create another process
   136	000716'	253 04 0 00 000707'	DEDLO1:	AOBJN T4,DEDLOP		; Look at them all
   137	000717'	254 00 0 00 000676'		JRST WTFRK		; Wait some more
   138
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 8
NRTSRV	MAC	21-Sep-79 11:46		START - Start of code for inferior process'

   139						SUBTTL	START - Start of code for inferior process'
   140
   141					;
   142					; Note: This code runs as an inferior process to be the DECnet server
   143					;	for NRT20. Any node on the network can make a connection to this
   144					;	server to login to the system on which this program is running. A
   145					;	separate copy of this code is run for each process which will be
   146					;	a server. The DECnet object number of this server is 200. A TOPS-20
   147					;	program can access the server with the DECnet file specification -
   148					;	'DCN:node-200' where node is the node name to be logged in on. When
   149					;	the server gets a connection from the network it obtains a PTY, and
   150					;	sends a ^C character on it. It then accepts the network connection
   151					;	and waits for data to arrive on the network link. Data arriving on
   152					;	the network link is then output to the PTY and any data from the 
   153					;	PTY is sent on the network link.
   154					;
   155
   156	000720'	104 00 0 00 000141 	START:	CIS			; Clear interrupt system
   157	000721'	336 01 0 00 000010'		SKIPN T1,SRVJFN		; Have a server JFN yet?
   158	000722'	254 00 0 00 000727'		JRST START1		; No...
   159	000723'	661 01 0 00 004000 		TXO T1,CZ%ABT		; Yes, abort it
   160	000724'	104 00 0 00 000022 		CLOSF			; Close and abort the network connection
   161	000725'	255 00 0 00 000000 		 JFCL				; Ignore errors
   162	000726'	402 00 0 00 000010'		SETZM SRVJFN		; Clear the server JFN
   163	000727'	336 01 0 00 000006'	START1:	SKIPN T1,PTYJFN		; Have a PTY yet?
   164	000730'	254 00 0 00 000734'		JRST START2		; No...
   165	000731'	661 01 0 00 004000 		TXO T1,CZ%ABT		; Yes, abort it
   166	000732'	104 00 0 00 000022 		CLOSF			; Close the PTY
   167	000733'	255 00 0 00 000000 		 JFCL				; Ignore errors
   168	000734'	200 17 0 00 001175'	START2:	MOVE P,[IOWD NPDL,PDL]	; Initialize the stack pointer
   169	000735'	201 01 0 00 400000 		MOVEI T1,.FHSLF		; Our process
   170	000736'	200 02 0 00 001176'		MOVE T2,[LEVTAB,,CHNTAB] ; Address of level and channel table
   171	000737'	104 00 0 00 000125 		SIR			; Set software interrupt table addresses
   172	000740'	205 02 0 00 600000 		MOVX T2,3B1		; Channel 0 and 1
   173	000741'	104 00 0 00 000131 		AIC			; Activate software interrupt channels
   174	000742'	104 00 0 00 000126 		EIR			; Enable software interrupt system
   175	000743'	200 01 0 00 001177'		MOVE T1,[POINT ^D8,SRVOUP] ; Initial output pointer
   176	000744'	202 01 0 00 000021'		MOVEM T1,OUTPUT		; Initialize the pointer
   177	000745'	201 01 0 00 000240 		MOVEI T1,MAXOUT		; Maximum output characters
   178	000746'	202 01 0 00 000022'		MOVEM T1,OUCNT		; Initialize the output count
   179	000747'	201 01 0 00 400000 		MOVEI T1,.FHSLF		; Our process
   180	000750'	104 00 0 00 000150 		RPCAP			; Get our capabilities
   181	000751'	200 03 0 00 000002 		MOVE T3,T2		; Copy them
   182	000752'	104 00 0 00 000151 		EPCAP			; Enable all capabilities we have
   183	000753'	205 01 0 00 000001 		MOVX T1,GJ%SHT		; Short form GTJFN
   184	000754'	561 02 0 00 001200'		HRROI T2,[ASCIZ /SRV:200/] ; The NRT server file spec
   185	000755'	104 00 0 00 000020 		GTJFN			; Get a JFN for it
   186	000756'	254 00 0 00 000773'		 JRST TRYAGN			; Failed, go try to recover
   187	000757'	202 01 0 00 000010'		MOVEM T1,SRVJFN		; Save the server JFN
   188	000760'	200 02 0 00 001202'		MOVX T2,<FLD(^D8,OF%BSZ)!OF%RD!OF%WR> ; 8 bit bytes, read/write access
   189	000761'	104 00 0 00 000021 		OPENF			; Open the server JFN
   190						 JRST [	MOVE T1,SRVJFN		; Failed, get server JFN
   191							RLJFN			; Release the JFN
   192							 JFCL			; Ignore errors
   193							SETZM SRVJFN		; Clear the server JFN
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 8-1
NRTSRV	MAC	21-Sep-79 11:46		START - Start of code for inferior process'

   194	000762'	254 00 0 00 001203'			JRST TRYAGN]		; And go try to recover
   195	000763'	201 01 0 00 400000 		MOVEI T1,.FHSLF		; Our process
   196	000764'	403 02 0 00 000003 		SETZB T2,T3		; No capabilities
   197	000765'	104 00 0 00 000151 		EPCAP			; Disable all capabilities
   198	000766'	200 01 0 00 000010'		MOVE T1,SRVJFN		; Get the server JFN
   199	000767'	201 02 0 00 000024 		MOVEI T2,.MOACN		; Assign interrupt system channel numbers
   200						MOVX T3,<FLD(0,MO%CDN)!FLD(1,MO%DAV)!FLD(.MOCIA,MO%INA)> ; Connect event on 0, data 
   201	000770'	200 03 0 00 001210'	available on 1
   202	000771'	104 00 0 00 000077 		MTOPR			; Perform the device operation
   203	000772'	104 00 0 00 000306 		WAIT			; Wait for something to happen
   204
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 9
NRTSRV	MAC	21-Sep-79 11:46		TRYAGN - Wait before trying to become a server again

   205						SUBTTL	TRYAGN - Wait before trying to become a server again
   206
   207	000773'	201 01 0 00 352300 	TRYAGN:	MOVX T1,^D<1000*60*2>	; Two minutes in milliseconds
   208	000774'	104 00 0 00 000167 		DISMS			; Dismiss the process until time expires
   209	000775'	254 00 0 00 000720'		JRST START		; And go back to try again
   210
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 10
NRTSRV	MAC	21-Sep-79 11:46		GOTCI - Got a connect from the network

   211						SUBTTL	GOTCI - Got a connect from the network
   212
   213					;
   214					; Note: This routine is run at software interrupt level when a
   215					;	remote node attempts to make a connection to us.
   216
   217	000776'	260 17 0 00 001112'	GOTCI:	CALL GETPTY		; Get a PTY to use
   218						JRST [	CIS			; Failed, clear the software interrupt system
   219							HRROI T1,[ASCIZ /
   220					?No more PTYs on remote host
   221					/]					; Point to message to tell what happened
   222							MOVE T2,SRVJFN		; Get the server JFN
   223							SETZM T3		; All of the string
   224							SOUTR			; Send message on network link
   225							 ERJMP .+1		; Ignore errors
   226							MOVE T1,SRVJFN		; Get the server JFN
   227							CLOSF			; Close the network connection
   228							 JRST START			; Failed, go back to recover
   229							SETZM SRVJFN		; Clear the server JFN
   230	000777'	254 00 0 00 001220'			JRST START]		; Go back to recover
   231	001000'	202 01 0 00 000006'		MOVEM T1,PTYJFN		; Save the PTY JFN
   232	001001'	202 02 0 00 000007'		MOVEM T2,TTYJFN		; Save the TTY designator
   233	001002'	201 02 0 00 000003 		MOVEI T2,"C"-100	; Get a Control-C (^C)
   234	001003'	104 00 0 00 000051 		BOUT			; Output it to PTY to start up job
   235	001004'	200 01 0 00 000010'		MOVE T1,SRVJFN		; Get the server JFN
   236	001005'	201 02 0 00 000041 		MOVEI T2,.MOCC		; Confirm the network connection
   237	001006'	403 03 0 00 000004 		SETZB T3,T4		; No optional data
   238	001007'	104 00 0 00 000077 		MTOPR			; Do the device operation
   239	001010'	320 16 0 00 000720'		 ERJMP START			; If error, link broken, start again
   240	001011'	201 01 0 00 001067'		MOVEI T1,PTYIN		; Address of PTY input routine
   241	001012'	202 01 0 00 000023'		MOVEM T1,PC		; Change the interrupt PC value to start
   242	001013'	104 00 0 00 000013 		GJINF			; Get current job information
   243	001014'	321 04 0 00 001037'		JUMPL T4,DONCI		; If terminal attached to job, done
   244						HRROI T1,[ASCIZ /
   245	001015'	561 01 0 00 001233'	NRTSRV- CONNECTION FROM /]	; Point to message to say who's connecting
   246	001016'	104 00 0 00 000076 		PSOUT			; Output to TTY
   247	001017'	402 00 0 00 000103'		SETZM HSTNAM		; Clear host name buffer
   248	001020'	200 01 0 00 000010'		MOVE T1,SRVJFN		; Get the server JFN
   249	001021'	201 02 0 00 000026 		MOVEI T2,.MORHN		; Read network host name
   250	001022'	561 03 0 00 000103'		HRROI T3,HSTNAM		; Pointer to buffer
   251	001023'	104 00 0 00 000077 		MTOPR			; Do the device operation
   252	001024'	320 16 0 00 001025'		 ERJMP .+1			; Ignore errors
   253	001025'	561 01 0 00 000103'		HRROI T1,HSTNAM		; Pointer to host name buffer
   254	001026'	104 00 0 00 000076 		PSOUT			; Output the host name to TTY
   255	001027'	561 01 0 00 001241'		HRROI T1,[ASCIZ / ON /]	; Pointer to continuation of message text
   256	001030'	104 00 0 00 000076 		PSOUT			; Output to TTY
   257	001031'	201 01 0 00 000101 		MOVEI T1,.PRIOU		; TTY designator
   258	001032'	200 02 0 00 000006'		MOVE T2,PTYJFN		; Get the PTY JFN
   259	001033'	402 00 0 00 000003 		SETZM T3		; Full file specification format
   260	001034'	104 00 0 00 000030 		JFNS			; Output file spec associated with PTY JFN
   261						HRROI T1,[ASCIZ /
   262	001035'	561 01 0 00 001217'	/]
   263	001036'	104 00 0 00 000076 		PSOUT			; End the message nicely
   264	001037'	104 00 0 00 000136 	DONCI:	DEBRK			; Dismiss interrupt and resume processing PTY input
   265
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 11
NRTSRV	MAC	21-Sep-79 11:46		GOTDAT - Got data available from network connection

   266						SUBTTL	GOTDAT - Got data available from network connection
   267
   268					;
   269					; Note: This routine is run at software interrupt level when data is
   270					;	available to be read from the network connection.
   271					;
   272
   273	001040'	124 01 0 00 000000'	GOTDAT:	DMOVEM T1,SAVAC		; Save AC's
   274	001041'	124 03 0 00 000002'		DMOVEM T3,SAVAC+2
   275	001042'	200 01 0 00 000010'	GOTDA1:	MOVE T1,SRVJFN		; Get the server JFN
   276	001043'	201 02 0 00 000025 		MOVEI T2,.MORLS		; Read link's status
   277	001044'	104 00 0 00 000077 		MTOPR			; Do the device operation
   278	001045'	607 03 0 00 400000 		TXNN T3,MO%CON		; Connected?
   279	001046'	254 00 0 00 000720'		JRST START		; No, go start over
   280	001047'	104 00 0 00 000102 		SIBE			; Skip if input buffer empty
   281	001050'	334 00 0 00 000000 		 SKIPA			; Not empty, have some data
   282						JRST [	DMOVE T1,SAVAC		; Empty, no data, restore AC's
   283							DMOVE T3,SAVAC+2
   284	001051'	254 00 0 00 001242'			DEBRK]			; Dismiss interrupt and resume processing
   285	001052'	303 02 0 00 000050 		CAILE T2,SRVSIZ*5	; Buffer larger than number of bytes available?
   286	001053'	201 02 0 00 000050 		MOVEI T2,SRVSIZ*5	; No, get maximum buffer full
   287	001054'	210 03 0 00 000002 		MOVN T3,T2		; Get byte count
   288	001055'	200 04 0 00 000003 		MOVE T4,T3		; Save it
   289	001056'	561 02 0 00 000011'		HRROI T2,SRVINP		; Pointer to server input buffer
   290	001057'	104 00 0 00 000052 		SIN			; Read from network link
   291	001060'	320 16 0 00 000720'		 ERJMP START			; Failed, link broken, start again
   292	001061'	274 04 0 00 000003 		SUB T4,T3		; Calculate number of bytes read
   293	001062'	200 03 0 00 000004 		MOVE T3,T4		; Get byte count
   294	001063'	200 01 0 00 000006'		MOVE T1,PTYJFN		; Get PTY JFN
   295	001064'	561 02 0 00 000011'		HRROI T2,SRVINP		; Pointer to server input buffer
   296	001065'	104 00 0 00 000053 		SOUT			; Output data to PTY
   297	001066'	254 00 0 00 001042'		JRST GOTDA1		; And go back to do more
   298
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 12
NRTSRV	MAC	21-Sep-79 11:46		PTYIN - Pseudo TTY input routine

   299						SUBTTL	PTYIN - Pseudo TTY input routine
   300
   301					;
   302					; Note: This routine gets run at background level by the GOTCI routine
   303					;	changing the PC value at interrupt level when a network connection
   304					;	is accepted.
   305
   306	001067'	200 01 0 00 000006'	PTYIN:	MOVE T1,PTYJFN		; Get PTY JFN
   307	001070'	104 00 0 00 000050 		BIN			; Input a byte from PTY
   308	001071'	136 02 0 00 000021'		IDPB T2,OUTPUT		; Store byte in output buffer and save pointer
   309	001072'	377 00 0 00 000022'		SOSG OUCNT		; Output buffer full?
   310	001073'	254 00 0 00 001077'		JRST PTYIN1		; Yes, write it then
   311	001074'	200 01 0 00 000007'		MOVE T1,TTYJFN		; Get TTY designator
   312	001075'	104 00 0 00 000103 		SOBE			; Skip if TTY output buffer empty
   313	001076'	254 00 0 00 001067'		 JRST PTYIN			; Not empty, go get more characters from PTY
   314	001077'	211 03 0 00 000240 	PTYIN1:	MOVNI T3,MAXOUT		; Get negative maximum output count
   315	001100'	270 03 0 00 000022'		ADD T3,OUCNT		; Compute number of bytes in buffer
   316	001101'	200 01 0 00 000010'		MOVE T1,SRVJFN		; Get the server JFN
   317	001102'	200 02 0 00 001177'		MOVE T2,[POINT ^D8,SRVOUP] ; Get pointer to output buffer
   318	001103'	104 00 0 00 000532 		SOUTR			; Output data to network link
   319	001104'	320 16 0 00 000720'		 ERJMP START			; Failed, link died, start over
   320	001105'	200 01 0 00 001177'		MOVE T1,[POINT ^D8,SRVOUP] ; Get pointer to output buffer
   321	001106'	202 01 0 00 000021'		MOVEM T1,OUTPUT		; Reinitialize output buffer pointer
   322	001107'	201 02 0 00 000240 		MOVEI T2,MAXOUT		; Get maximum output count
   323	001110'	202 02 0 00 000022'		MOVEM T2,OUCNT		; Reinitialize output count
   324	001111'	254 00 0 00 001067'		JRST PTYIN		; Go back and get more characters from PTY
   325
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page 13
NRTSRV	MAC	21-Sep-79 11:46		GETPTY - Get a pseudo TTY designator and return opened PTY JFN

   326						SUBTTL	GETPTY - Get a pseudo TTY designator and return opened PTY JFN
   327
   328	001112'	265 16 0 00 000000*	GETPTY:	STKVAR <SAVCHR>		; Get stack variable storage
   329	001113'	000001	000001
   330	001114'	200 01 0 00 001245'		MOVE T1,[SIXBIT /PTYPAR/] ; Pseudo TTY parameter table name
   331	001115'	104 00 0 00 000016 		SYSGT			; Get system table information for PTY
   332	001116'	552 01 0 17 777776 		HRRZM T1,SAVCHR		; Save TTY number of first pseudo TTY 
   333	001117'	554 04 0 00 000001 		HLRZ T4,T1		; Get number of PTY's
   334	001120'	213 00 0 00 000004 		MOVNS T4		; Get negative of count
   335	001121'	517 00 0 00 000004 		HRLZS T4		; Make an index loop pointer
   336	001122'	205 01 0 00 600013 	GETPT1:	MOVSI T1,.DVDES+.DVPTY	; Get device designator for PTY
   337	001123'	540 01 0 00 000004 		HRR T1,T4		; Get PTY number
   338	001124'	104 00 0 00 000117 		DVCHR			; Get device characteristics of PTY
   339	001125'	607 02 0 00 010000 		TXNN T2,1B5		; Available?
   340	001126'	254 00 0 00 001152'		JRST GETPT2		; No, try next PTY then
   341	001127'	200 02 0 00 000001 		MOVE T2,T1		; Get device designator
   342	001130'	561 01 0 00 000004'		HRROI T1,DEVNAM		; Pointer to device name string buffer
   343	001131'	104 00 0 00 000121 		DEVST			; Translate device designator to string
   344	001132'	254 00 0 00 001152'		 JRST GETPT2			; Failed, try next PTY
   345	001133'	201 02 0 00 000072 		MOVEI T2,":"		; Get device string terminator character
   346	001134'	136 02 0 00 000001 		IDPB T2,T1		; Store it after device name string
   347	001135'	402 00 0 00 000002 		SETZM T2		; Get a null byte
   348	001136'	136 02 0 00 000001 		IDPB T2,T1		; Make device name string ASCIZ
   349	001137'	205 01 0 00 000001 		MOVX T1,GJ%SHT		; Short form GTJFN
   350	001140'	561 02 0 00 000004'		HRROI T2,DEVNAM		; Get pointer to PTY name string
   351	001141'	104 00 0 00 000020 		GTJFN			; Get a JFN for PTY
   352	001142'	254 00 0 00 001152'		 JRST GETPT2			; Failed, try next PTY
   353	001143'	200 03 0 00 000001 		MOVE T3,T1		; Save the PTY JFN
   354	001144'	200 02 0 00 001202'		MOVX T2,<FLD(^D8,OF%BSZ)!OF%RD!OF%WR> ; 8 bit bytes, read/write access
   355	001145'	104 00 0 00 000021 		OPENF			; Open the PTY
   356						 JRST [	MOVE T1,T3		; Failed, get PTY JFN
   357							RLJFN			; Release the PTY JFN
   358							 JFCL				; Ignore errors
   359	001146'	254 00 0 00 001246'			JRST GETPT2]		; And try next PTY
   360	001147'	201 02 0 04 400000 		MOVEI T2,.TTDES(T4)	; Get PTY index
   361	001150'	270 02 0 17 777776 		ADD T2,SAVCHR		; Get PTY designator
   362	001151'	254 00 0 00 000000*		RETSKP			; Done, return skip for success
   363
   364					; Step through all PTY's
   365
   366	001152'	253 04 0 00 001122'	GETPT2:	AOBJN T4,GETPT1		; Increment PTY number and go back if more to do
   367	001153'	263 17 0 00 000000 		RET			; No, give up, return no skip for failure
   368
   369	001154'				ENDPRG:				; End of code
   370			000643'			END BEGIN

NO ERRORS DETECTED

PROGRAM BREAK IS 001252
CPU TIME USED 00:02.886

69P CORE USED
NRTSRV - Program to provide remote network login service	MACRO %53A(1152) 15:52 14-Feb-80 Page S-1
NRTSRV	MAC	21-Sep-79 11:46		SYMBOL TABLE

AIC	104000	000131	int	OUCNT		000022'		.DVDES		600000	sin	
BEGIN		000643'		OUTPUT		000021'		.DVPTY		000013	sin	
BIN	104000	000050	int	P		000017	spd	.FHINF		777774	sin	
BOUT	104000	000051	int	PC		000023'		.FHSLF		400000	sin	
CALL	260740	000000		PDL		000105'		.MOACN		000024	sin	
CFORK	104000	000152	int	PM%CNT	400000	000000	sin	.MOCC		000041	sin	
CHNTAB		000641'		PM%RD	100000	000000	sin	.MOCIA		000776	sin	
CIS	104000	000141	int	PM%WR	040000	000000	sin	.MORHN		000026	sin	
CLOSF	104000	000022	int	PMAP	104000	000056	int	.MORLS		000025	sin	
CR%CAP	200000	000000	sin	PSOUT	104000	000076	int	.PRIOU		000101	sin	
CX		000016	spd	PTYIN		001067'		.RFFPT		000003	sin	
CZ%ABT	004000	000000	sin	PTYIN1		001077'		.RFHLT		000002	sin	
DEBRK	104000	000136	int	PTYJFN		000006'		.STKST		001112'	ext	
DEDLO1		000716'		RESET	104000	000147	int	.TTDES		400000	sin	
DEDLOP		000707'		RET	263740	000000		
DEVNAM		000004'		RF%STS	377777	000000	sin	
DEVST	104000	000121	int	RFORK	104000	000155	int	
DISMS	104000	000167	int	RFSTS	104000	000156	int	
DONCI		001037'		RLJFN	104000	000023	int	
DVCHR	104000	000117	int	RPCAP	104000	000150	int	
EIR	104000	000126	int	RSKP		001151'	ext	
ENDPRG		001154'		RSPROC		000704'		
EPCAP	104000	000151	int	SAVAC		000000'		
ERJMP	320700	000000	int	SETNM	104000	000210	int	
FFORK	104000	000154	int	SFORK	104000	000157	int	
FORKS		000074'		SIBE	104000	000102	int	
FRKDO		000656'		SIN	104000	000052	int	
FRKLOP		000675'		SIR	104000	000125	int	
GETPT1		001122'		SOBE	104000	000103	int	
GETPT2		001152'		SOUT	104000	000053	int	
GETPTY		001112'		SOUTR	104000	000532	int	
GJ%SHT	000001	000000	sin	SRVINP		000011'		
GJINF	104000	000013	int	SRVJFN		000010'		
GOTCI		000776'		SRVOSZ		000050	spd	
GOTDA1		001042'		SRVOUP		000024'		
GOTDAT		001040'		SRVSIZ		000010	spd	
GTJFN	104000	000020	int	START		000720'		
HALTF	104000	000170	int	START1		000727'		
HSTNAM		000103'		START2		000734'		
JFNS	104000	000030	int	STDEV	104000	000120	int	
KFORK	104000	000153	int	SYSGT	104000	000016	int	
LEVTAB		000640'		T1		000001	spd	
LGOUT	104000	000003	int	T2		000002	spd	
MAXFRK		000007	spd	T3		000003	spd	
MAXOUT		000240	spd	T4		000004	spd	
MO%CDN	777000	000000	sin	TRYAGN		000773'		
MO%CON	400000	000000	sin	TTYJFN		000007'		
MO%DAV		777000	sin	WAIT	104000	000306	int	
MO%INA	000777	000000	sin	WFORK	104000	000163	int	
MTOPR	104000	000077	int	WTFRK		000676'		
NPDL		000040	spd	$SAVCH	000017	777776	spd	
OF%BSZ	770000	000000	sin	..CSC		000004	spd	
OF%RD		200000	sin	..CSN		000003	spd	
OF%WR		100000	sin	..PST		000003	spd	
OPENF	104000	000021	int	.A16		000016	spd	
BEGIN	    78#	   370
CHNTAB	    73#	   170
CR%CAP	    92
CX	    45#
CZ%ABT	   159	   165
DEDLO1	   122	   136#
DEDLOP	   121#	   136
DEVNAM	    57#	   342	   350
DONCI	   243	   264#
ENDPRG	   100	   369#
FORKS	    66#	    96	   121	   127	   128
FRKDO	    92#	   107	   135
FRKLOP	   107#
GETPT1	   336#	   366
GETPT2	   340	   344	   352	   359	   366#
GETPTY	   217	   328#
GJ%SHT	   183	   349
GOTCI	    73	   217#
GOTDA1	   275#	   297
GOTDAT	    74	   273#
HSTNAM	    67#	   247	   250	   253
LEVTAB	    72#	   170
MAXFRK	    48#	    66	    91	   120
MAXOUT	    50#	   177	   314	   322
MO%CDN	   201
MO%CON	   278
MO%DAV	   201
MO%INA	   201
NPDL	    52#	    68	   168
OF%BSZ	   188	   354
OF%RD	   188	   354
OF%WR	   188	   354
OUCNT	    63#	   178	   309	   315	   323
OUTPUT	    62#	   176	   308	   321
P	    46#	   168	   328	   332	   361
PC	    64#	    72	   241
PDL	    68#	   168
PM%CNT	   102
PM%RD	   102
PM%WR	   102
PTYIN	   240	   306#	   313	   324
PTYIN1	   310	   314#
PTYJFN	    58#	   163	   231	   258	   294	   306
RF%STS	   124
RSKP	   362
RSPROC	   118#
SAVAC	    56#	   273	   274	   282	   283
SAVCHR	   328
SRVINP	    61#	   289	   295
SRVJFN	    60#	   157	   162	   187	   190	   193	   198	   222	   226	   229	   235	   248	   275	   316
SRVOSZ	    49#	    50	    65
SRVOUP	    65#	   175	   317	   320
SRVSIZ	    51#	    61	   285	   286
START	   105	   156#	   209	   228	   230	   239	   279	   291	   319
START1	   158	   163#
START2	   164	   168#
T1	    41#	    79	    81	    83	    87	    92	    96	    97	    99	   104	   108	   111	   118	   121
	   124	   125	   126	   127	   131	   157	   159	   163	   165	   169	   175	   176	   177	   178
	   179	   183	   187	   190	   195	   198	   207	   219	   226	   231	   235	   240	   241	   244
	   248	   253	   255	   257	   261	   273	   275	   282	   294	   306	   311	   316	   320	   321
	   330	   332	   333	   336	   337	   341	   342	   346	   348	   349	   353	   356
T2	    42#	    89	    93	    97	    98	   104	   105	   133	   170	   172	   181	   184	   188	   196
	   199	   222	   232	   233	   236	   249	   258	   276	   285	   286	   287	   289	   295	   308
	   317	   322	   323	   339	   341	   345	   346	   347	   348	   350	   354	   360	   361
T3	    43#	    89	   100	   101	   102	   109	   133	   181	   196	   201	   223	   237	   250	   259
	   274	   278	   283	   287	   288	   292	   293	   314	   315	   353	   356
T4	    44#	    91	    96	   107	   120	   121	   127	   128	   130	   136	   237	   243	   288	   292
	   293	   333	   334	   335	   337	   360	   366
TRYAGN	   186	   194	   207#
TTYJFN	    59#	   232	   311
WTFRK	    95	   108#	   137
$SAVCH	   328#
%RF%ST	   124	   125
..CSC	   124#	   124	   125	   125#
..CSN	   124#	   124
..MX1	    92#	    92	    93	   172#	   172	   173	   183#	   183	   184	   188#	   188	   189	   201#	   201
	   202	   207#	   207	   208	   349#	   349	   350	   354#	   354	   355
..MX2	    92#	    92	    93	   172#	   172	   173	   183#	   183	   184	   188#	   188	   189	   201#	   201
	   202	   207#	   208	   349#	   349	   350	   354#	   354	   355
..PST	   124#	   124
..STKN	   328#	   328	   329	   330
..STKQ	   328#	   328	   330
..STKR	   328#	   330
..TX1	   102#	   102	   103	   159#	   159	   160	   165#	   165	   166	   278#	   278	   279	   339#	   339
	   340
..TX2	   102#	   102	   103	   159#	   159	   160	   165#	   165	   166	   278#	   278	   279	   339#	   339
	   340
.A16	   328
.DVDES	   336
.DVPTY	   336
.FHINF	   111	   118
.FHSLF	    87	    99	   108	   131	   169	   179	   195
.MOACN	   199
.MOCC	   236
.MOCIA	   201
.MORHN	   249
.MORLS	   276
.PRIOU	   257
.PSECT	    92	    93	   102	   103	   159	   160	   165	   166	   172	   173	   183	   184	   188	   189
	   201	   202	   207	   208	   278	   279	   339	   340	   349	   350	   354	   355
.RFFPT	   126
.RFHLT	   125
.STKST	   328
.TTDES	   360
AIC	   173
BIN	   307
BOUT	   234
CALL	   217
CFORK	    94
CIS	   156	   218
CLOSF	   160	   166	   227
DEBRK	   264	   284
DEVST	   343
DISMS	   208
DVCHR	   338
EIR	   174
EPCAP	    90	   110	   134	   182	   197
ERJMP	    95	   225	   239	   252	   291	   319
FFORK	   119
FLD	   188	   201	   354
GJINF	   242
GTJFN	   185	   351
HALTF	    86
JFNS	   260
KFORK	   129
LGOUT	    84
LOAD	   124
MOVX	    92	   172	   183	   188	   200	   207	   349	   354
MTOPR	   202	   238	   251	   277
OPENF	   189	   355
PMAP	   103
POINTR	   124
POS	   124	   188	   201	   354
PSOUT	   246	   254	   256	   263
RESET	    78
RET	   367
RETSKP	   362
RFORK	   112
RFSTS	   123
RLJFN	   191	   357
RPCAP	    88	   132	   180
SAVCHR	   328#	   328	   332	   361
SETNM	    80
SFORK	   106
SIBE	   280
SIN	   290
SIR	   171
SOBE	   312
SOUT	   296
SOUTR	   224	   318
STDEV	    82
STKVAR	   328
SYSGT	   331
TXNN	   278	   339
TXO	   102	   159	   165
WAIT	   203
WFORK	   113
WID	   124
..CAS1	   124
..LDB	   124
..STR0	   124
..TSIZ	   124
..TX	   102	   159	   165	   278	   339
.CASE	   124
.STKV1	   328
.STKV2	   328
.STKV3	   328