Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/nml/nmufil.lst
There are no other files named nmufil.lst in the archive.
								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   1
								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (1)

;	  0001	! RATS:<BANKS.MCB.NCPNML>NMUFIL.BLI.4 12-Nov-84 13:06:05, Edit by BANKS
;	  0002	!
;	  0003	! Ident 12.
;	  0004	!    The whole range check thing seems to make TKB36 run into a bug. 
;	  0005	!    NMLMCB task builds ok, but no image is output.  Disable the range
;	  0006	!    checking until we can fix TKB36.
;	  0007	!
;	  0008	! RATS:<BANKS.MCB.NCPNML>NMUFIL.BLI.3  9-Nov-84 13:27:05, Edit by BANKS
;	  0009	!
;	  0010	! Ident 11.
;	  0011	!    Upline dump hacks made NMLMCB.TSK too large.  Change the previous edit
;	  0012	!    so that user name, account and password strings which fail the range
;	  0013	!    check will be reported with the same error, instead of one error for
;	  0014	!    each.  This is in the name of saving memory in NMLMCB.
;	  0015	! 
;	  0016	! RATS:<BANKS.MCB.NMLMCB>NMUFIL.BLI.2 24-Oct-84 09:10:41, Edit by BANKS
;	  0017	!
;	  0018	! Ident 10.
;	  0019	!    Range check the length of the user name, password and account strings
;	  0020	!    in PARSE_FILE_SPECIFICATION so that we don't accidentally write garbage
;	  0021	!    into the connection block for the network file access.
;	  0022	!
;	  0023	! NET:<BRANDT.DEVELOPMENT>NMUFIL.BLI.1 8-Jun-82 11:59:30, Edit by BRANDT
;	  0024	!
;	  0025	! Ident 09.
;	  0026	!   Remove defn of literals for NODE_ID buffer.  They are never used
;	  0027	!   and are now defined in NMLCOM which causes duplicate defs in this
;	  0028	!   module.
;	  0029	!
;	  0030	! NET:<PECKHAM.DEVELOPMENT>NMUFIL.BLI.2  5-Jun-82 12:59:37, Edit by PECKHAM
;	  0031	!
;	  0032	! Ident 08.
;	  0033	! No code change - eliminate empty compound expression in NMU$FILE_WRITE
;	  0034	! to produce clean BLIS16 compilation.
;	  0035	!
;	  0036	! NET:<DECNET20-V3P0.XPT>NMUFIL-REAL.BLI.2 15-Jan-82 17:17:11, Edit by VOBA
;	  0037	!
;	  0038	! Ident 07.
;	  0039	! Change PARSE_ACCESS_CONTROL to use blanks as delimiters rather than
;	  0040	! semicolons.
;	  0041	!
;	  0042	! NET:<DECNET20-V3P0.XPT>NMUFIL.BLI.2  8-Jan-82 10:35:40, Edit by WEBBER
;	  0043	!
;	  0044	! Ident 06.
;	  0045	! Fix FILE_OPEN so that the data buffer is allocated before the file is
;	  0046	! opened.  This allows the lower-level open routine to set up the buffer
;	  0047	! descriptor.
;	  0048	!
;	  0049	! NET:<GROSSMAN>NMUFIL.BLI.2  9-Dec-81 01:11:50, Edit by GROSSMAN
;	  0050	!
;	  0051	! Put a conditional around the definition of FLD for Tops-10 only. FLD is
;	  0052	! defined in TENDEF on Tops-10 in exactly the same manner as it is here, so
								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   2
								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (1)

;	  0053	! no conflict should occur between the various systems that this code runs on.
;	  0054	!
;	  0055	! NET:<DECNET20-V3P1.BASELEVEL-2.MCB>NMUFIL.BLI.17  9-Oct-81 11:21:00, Edit by GUNN
;	  0056	!
;	  0057	! Ident 05.
;	  0058	! Change file position variables to accomodate more than 16 bits in MCB
;	  0059	! version and perform 32 bit arithmetic.
;	  0060	! Remove $RESPONSE_X macro, it is in NMULIB.
;	  0061	!
;	  0062	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUFIL.BLI.9 12-Aug-81 09:57:56, Edit by JENNESS
;	  0063	!
;	  0064	! Ident 04.
;	  0065	! Fix CH$BYTE to generate the proper code in the MCB (-16 bit) version.
;	  0066	!
;	  0067	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUFIL.BLI.5  8-Aug-81 14:02:05, Edit by GUNN
;	  0068	!
;	  0069	! Put $RESPONSE_X macro def in sources since it won't compile for NMLLIB.L16.
;	  0070	!
;	  0071	! NET:<DECNET20-V3P1.NML>NMUFIL.BLI.3  8-Aug-81 16:52:53, Edit by GUNN
;	  0072	!
;	  0073	! Ident 03.
;	  0074	! Change syntax of remote file spec as bypass caused by not being able to
;	  0075	! parse access control information with embedded spaces. Only works if
;	  0076	! last token on line.
;	  0077	!
;	  0078	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUFIL.BLI.5  8-Aug-81 14:02:05, Edit by GUNN
;	  0079	!
;	  0080	! Put $RESPONSE_X macro def in sources since it won't compile for NMLLIB.L16.
;	  0081	!
;	  0082	! NET:<DECNET20-V3P1.NML>NMUFIL.BLI.2  8-Aug-81 13:07:31, Edit by GUNN
;	  0083	!
;	  0084	! Ident 02.
;	  0085	! Modify $RESPONSE macros to provide error number for MCB.
;	  0086	!
;	  0087	! NET:<DECNET20-V3P1.NMU>NMUFIL.BLI.2 31-Jul-81 10:08:02, Edit by JENNESS
;	  0088	!
;	  0089	! Ident 01
;	  0090	! Change REMOTE_BUFFER_LENGTH to 512 to match configuration message size.
;	  0091	!
;	  0092	! Ident 00
;	  0093	! Code copied from BL2SRC:NMUFIL.B36. This module represents significant
;	  0094	! changes to implement buffered I/O and remote file access.
;	  0095	!
								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   3
								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (2)

;	  0096	
;	  0097	module NMUFIL	(
;	  0098			ident = 'X03.09'
;	  0099			) =
;	  0100	begin
;	  0101	
;	  0102	!
;	  0103	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0104	!                    DIGITAL EQUIPMENT CORPORATION
;	  0105	!                        Maynard, Massachusetts
;	  0106	!
;	  0107	!     This software is furnished under a license and may  be  used
;	  0108	!     and copied only in accordance with the terms of such license
;	  0109	!     and with the inclusion of the above copyright notice.   This
;	  0110	!     software  or any other copies thereof may not be provided or
;	  0111	!     otherwise made available to any other person.  No  title  to
;	  0112	!     and ownership of the software is hereby transferred.
;	  0113	!
;	  0114	!     The information  in  this  software  is  subject  to  change
;	  0115	!     without  notice  and should not be construed as a commitment
;	  0116	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0117	!
;	  0118	!     DIGITAL assumes no responsibility for the use or reliability
;	  0119	!     of  its  software  on  equipment  which  is  not supplied by
;	  0120	!     DIGITAL.
;	  0121	!
;	  0122	
;	  0123	!++
;	  0124	! Facility: LSG DECnet Network Management
;	  0125	!
;	  0126	! Abstract:
;	  0127	!
;	  0128	!	This module provides a common interface for file system access.
;	  0129	!
;	  0130	! Environment:	User Mode on TOPS-20, TOPS-10, RSX-11/MCB
;	  0131	!
;	  0132	! Author: Steven M. Jenness & Dale C. Gunn, Creation date: 19-Jun-81
;	  0133	!
;	  0134	!--
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   4
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (3)

;	  0135	
;	  0136	!
;	  0137	! Include files:
;	  0138	!
;	  0139	
;	  0140	library 'NMULIB';                       ! Get all required definitions
;	  0141	
;	  0142	!
;	  0143	! Table of contents
;	  0144	!
;	  0145	
;	  0146	switches list (require);                ! Allow listing of specific code
;	  0147	
;	  0148	forward routine
;	  0149	        NMU$FILE_INITIALIZE : novalue,  ! Initialize file interface
;	  0150		NMU$FILE_OPEN,                  ! Open file for access
;	  0151	        PARSE_FILE_SPECIFICATION,       ! File syntax parser
;	  0152	        PARSE_ACCESS_CONTROL,           ! Access control parser
;	  0153		NMU$FILE_READ,
;	  0154		NMU$FILE_WRITE,
;	  0155	        SETUP_WRITE_BUFFER : novalue,
;	  0156		NMU$FILE_SEEK,
;	  0157		NMU$FILE_SKIP,
;	  0158		NMU$FILE_CLOSE,
;	  0159		FILE_ERROR,
;	  0160		FIND_FILE_DATA_BLOCK,
;	  0161	        !
;	  0162	        ! System specific routines.
;	  0163	        !
;	  0164	        ALLOC_BUFFER,
;	  0165	        DEALLOC_BUFFER,
;	  0166	        OPEN_FILE,
;	  0167	        READ_FILE,
;	  0168	        WRITE_FILE,
;	  0169	        CLOSE_FILE,
;	  0170	        FAL_ACCESS;
;	  0171	
;	  0172	!
;	  0173	! Macros:
;	  0174	!
;	  0175	
;	  0176	!
;	  0177	! $32BIT_INTEGER - Build field for a 32 bit integer.
;	  0178	!
;	  0179	
;	  0180	macro
;	M 0181	     $32BIT_INTEGER =
;	M 0182	         %if $MCB
;	M 0183	         %then $sub_block (2)           ! Aligned 2 words for PDP-16
;	M 0184	         %else $integer
;	  0185	         %fi %;
;	  0186	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   5
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (3)

;	  0187	!	$P (mask) - Calculate bit position of a literal mask
;	  0188	!
;	  0189	!		where mask is a literal or symbol which defines a
;	  0190	!               field as a series of contiguous bits
;	  0191	!
;	  0192	!		returns pos, which may be used in a context such
;	  0193	!               as, ADDRESS<pos,siz>, or FIELD_NAME = [ADDR,pos,siz,sgn]
;	  0194	!
;	  0195	
;	M 0196	macro $P (MASK) =
;	  0197	      %nbitsu (MASK  and  - MASK) - 1 % ;
;	  0198	
;	  0199	
;	  0200	!	$S (mask) - Calculate size in bits of a literal mask
;	  0201	!
;	  0202	!		where mask is a literal or symbol which defines a
;	  0203	!               field as a series of contiguous bits
;	  0204	!
;	  0205	!		returns siz, which may be used in a context such
;	  0206	!               as, ADDRESS<pos,siz>, or FIELD_NAME = [ADDR,pos,siz,sgn]
;	  0207	!
;	  0208	
;	M 0209	macro $S (MASK) =
;	  0210	      %nbitsu (MASK) - %nbitsu (MASK  and  - MASK) + 1 % ;
;	  0211	
;	  0212	
;	  0213	!	$P$S (mask) - Calculate bit position and size of a literal mask
;	  0214	!
;	  0215	!		where mask is a literal or symbol which defines a
;	  0216	!               field as a series of contiguous bits
;	  0217	!
;	  0218	!		returns "pos , siz", which may be used in a context such
;	  0219	!               as, ADDRESS<pos,siz>, or FIELD_NAME = [ADDR,pos,siz,sgn]
;	  0220	!
;	  0221	!		E.g, XCB_1 = [2,$P$S(XCB_MASK),0]
;	  0222	
;	M 0223	macro $P$S (MASK) =
;	  0224	      $P (MASK) , $S (MASK) % ;
;	  0225	
;	  0226	! The following macro is already defined on Tops-10 in TENDEF.
;	  0227	%if not $TOPS10 %then
;	  0228	macro
;	M 0229	     FLD (VAL, MASK) =
;	  0230	         ((VAL) ^ (%nbitsu(MASK  and  - MASK) - 1)) %;
;	  0231	%fi
;	  0232	
;	L 0233	%if not $MCB
;	U 0234	%then
;	U 0235	macro
;	U 0236	     CH$BYTE [B1,B2,B3,B4] =
;	U 0237	         ((B1 ^ (%bpval-8))
;	U 0238	          %if not %null(B2)
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   6
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (3)

;	U 0239	          %then
;	U 0240	               or (B2 ^ (%bpval-16))
;	U 0241	          %if not %null(B3)
;	U 0242	          %then
;	U 0243	               or (B3 ^ (%bpval-24))
;	U 0244	          %if not %null(B4)
;	U 0245	          %then
;	U 0246	               or (B4 ^ (%bpval-32))
;	U 0247	          %fi %fi %fi) %;
;	  0248	%else
;	  0249	macro
;	M 0250	     CH$BYTE [B1, B2] =
;	M 0251	         (B1
;	M 0252	          %if not %null (B2)
;	M 0253	          %then
;	M 0254	               or (B2 ^ 8)
;	  0255	          %fi) %;
;	  0256	%fi
;	  0257	
;	  0258	macro
;	M 0259	     FILE_SYS_SPEC_FIELDS =
;	M 0260	         FD_JFN = [$integer],           ! JFN of file
;	M 0261	         %if not $MCB
;	M 0262	         %then
;	M 0263	         FD_NAME = [$string (MAX_FILE_NAME_LENGTH + 1)], ! Buffer for file name
;	M 0264	         %fi
;	M 0265	         FD_PAGE_COUNT = [$integer]     ! Number of pages in file
;	  0266	         %;
;	  0267	
;	  0268	macro
;	M 0269	     FILE_DATA_BLOCK = block [FILE_DATA_BLOCK_SIZE]
;	  0270	                       field (FILE_DATA_FIELDS) %;
;	  0271	
;	  0272	macro
;	M 0273	     BUFFER_DATA_BLOCK = block [BUFFER_DATA_BLOCK_SIZE]
;	  0274	                         field (BUFFER_DATA_FIELDS) %;
;	  0275	
;	  0276	macro
;	M 0277	     FILE_BUFFER_BLOCK = block [FILE_DATA_BLOCK_SIZE+BUFFER_DATA_BLOCK_SIZE]
;	  0278	                         field (FILE_DATA_FIELDS,BUFFER_DATA_FIELDS) %;
;	  0279	
;	  0280	macro
;	M 0281	     FILE_NAME_BLOCK = block [FILE_NAME_FIELDS_SIZE]
;	  0282	                       field (FILE_NAME_FIELDS) %;
;	  0283	
;	  0284	!
;	  0285	! Equated symbols:
;	  0286	!
;	  0287	
;	  0288	%module_name ('NMUFIL');
;	  0289	
;	  0290	literal
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   7
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (3)

;	  0291	       REMOTE_BUFFER_LENGTH = 512,
;	  0292	       REMOTE_BUFFER_ALLOCATION = ch$allocation (REMOTE_BUFFER_LENGTH,8) * %upval;
;	  0293	
;	  0294	!
;	  0295	! Operating System Interface Definitions 
;	  0296	!
;	  0297	
;	U 0298	%if $TOPS20 %then
;	U 0299	
;	U 0300	DECLARE_JSYS (GTJFN, OPENF, BIN, BOUT, CLOSF, SFPTR, RFPTR)
;	U 0301	
;	U 0302	literal
;	U 0303	       PAGE_SIZE = 512;
;	U 0304	
;	  0305	%else 
;	U 0306	%if $TOPS10 %then
;	  0307	%else
;	  0308	%if $MCB %then
;	  0309	%fi %fi %fi
;	  0310	
;	  0311	literal
;	  0312	       DAP_OPEN = 1,
;	  0313	       DAP_PUT = 2,
;	  0314	       DAP_GET = 3,
;	  0315	       DAP_CLOSE = 4;
;	  0316	
;	  0317	literal
;	  0318	       MAX_FILE_NAME_LENGTH = 255;
;	  0319	
;	  0320	!
;	  0321	! FILE DATA BLOCK Structure Field Names
;	  0322	!
;	  0323	
;	  0324	$field
;	  0325	      FILE_DATA_FIELDS =
;	  0326	          set
;	  0327	          FILE_SYS_SPEC_FIELDS,             ! System specific fields
;	  0328	          FD_TYPE = [$byte],                ! ** File type **
;	  0329	          FD_ACCESS = [$tiny_integer],      ! Accessing method
;	  0330	          FD_FORMAT = [$tiny_integer],      ! Format of data in file
;	  0331	          FD_BYTE_SIZE = [$tiny_integer],   ! Byte size as per format
;	  0332	          FD_RESPONSE = [$pointer],         ! Pointer to NICE response buffer
;	  0333	          FD_CURRENT_POSITION = [$32BIT_INTEGER], ! Current byte offset as set by
;	  0334	                                            ! READ, SEEK, SKIP, or WRITE
;	  0335	          FD_FILE_POSITION = [$32BIT_INTEGER], ! Position of next read from file
;	  0336	          FD_LENGTH = [$32BIT_INTEGER],     ! Size of file in bytes
;	  0337	          FD_CURRENT_BUFFER = [$address],   ! Address of current BD block
;	C 0338	%( Not yet used.
;	C 0339	          FD_CHKPT_THRESHOLD = [$32BIT_INTEGER], ! Max bytes written before chkpnt
;	  0340	)%
;	  0341	          FD_DAP_STATE = [$tiny_integer],   ! DAP access state
;	  0342	          FD_LOCAL = [$bit],                ! Local/remote file access
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   8
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (3)

;	  0343	          FD_SEEK_DONE = [$bit]             ! Seek operation has been done
;	  0344	          tes;
;	  0345	
;	  0346	literal
;	  0347	       FILE_DATA_BLOCK_SIZE = $field_set_size,
;	  0348	       FILE_DATA_BLOCK_ALLOCATION = $field_set_units;
;	  0349	
;	  0350	literal
;	  0351	       FILE_ACCESS_READ_ONLY = 1,       ! File is read only
;	  0352	       FILE_ACCESS_WRITE_ONLY = 2,      ! File is write only
;	  0353	       FILE_ACCESS_RANDOM = 3;          ! Read/write and backwards seeks
;	  0354	
;	  0355	literal
;	  0356	       FILE_FORMAT_BYTE_STREAM = 1,     ! 8 bit byte stream
;	  0357	       FILE_FORMAT_18_FOR_16 = 2,       ! 18 bits in file for 16 bit data
;	  0358	       FILE_FORMAT_SWAPPED_BYTES = 3,   ! 16 bit bytes swapped
;	  0359	       FILE_FORMAT_WORD = 4;            ! Word mode (%bpval)
;	  0360	
;	  0361	!
;	  0362	! BUFFER DATA BLOCK Structure Field Names
;	  0363	!
;	  0364	
;	  0365	$field
;	  0366	      BUFFER_DATA_FIELDS =
;	  0367	          set
;	  0368	          BD_NEXT = [$address],             ! Address of next BD in ring
;	  0369	          BD_ADDRESS = [$address],          ! Buffer base address
;	  0370	          BD_LENGTH = [$integer],           ! Buffer length in bytes
;	  0371	          BD_ALLOCATION = [$integer],       ! Buffer size in allocation units
;	  0372	          BD_FILE_POSITION = [$32BIT_INTEGER],    ! Buffer position in file
;	  0373	          BD_MAX_POSITION = [$32BIT_INTEGER], ! End of buffer position in file 
;	  0374	          BD_BIAS = [$integer],             ! Buffer bias to start of data
;	  0375	          BD_CURRENT_POSITION = [$integer], ! Current position in buffer
;	  0376	          BD_POINTER = [$pointer],          ! Current pointer to buffer
;	  0377	          BD_DATA_COUNT = [$integer],       ! Bytes read/written in buffer
;	  0378	          BD_REMAINING_COUNT = [$integer],  ! Bytes yet to be read from
;	  0379	                                            ! or written to buffer
;	  0380	          BD_CHANGED_COUNT = [$integer],    ! Number of bytes written in buffer
;	  0381	          BD_CHANGED = [$bit],              ! Buffer has changes flag
;	  0382	          BD_VALID = [$bit],                ! Buffer has valid data
;	  0383	          BD_END_OF_FILE = [$bit]           ! End of file flag
;	  0384	          tes;
;	  0385	
;	  0386	literal
;	  0387	       BUFFER_DATA_BLOCK_SIZE = $field_set_size,
;	  0388	       BUFFER_DATA_BLOCK_ALLOCATION = $field_set_units;
;	  0389	
;	  0390	!
;	  0391	! File name block fields
;	  0392	!
;	  0393	
;	  0394	$field
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page   9
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (3)

;	  0395	      FILE_NAME_FIELDS =
;	  0396	      set
;	  0397	      FN_LENGTH = [$integer],           ! Length of file specification string
;	  0398	      FN_HOST_LENGTH = [$integer],
;	  0399	      FN_USER_LENGTH = [$integer],
;	  0400	      FN_ACCOUNT_LENGTH = [$integer],
;	  0401	      FN_PASSWORD_LENGTH = [$integer],
;	  0402	      FN_NAME_LENGTH = [$integer],
;	  0403	      FN_POINTER = [$pointer],          ! Pointer file spec string
;	  0404	      FN_HOST_POINTER = [$pointer],
;	  0405	      FN_USER_POINTER = [$pointer],
;	  0406	      FN_ACCOUNT_POINTER = [$pointer],
;	  0407	      FN_PASSWORD_POINTER = [$pointer],
;	  0408	      FN_NAME_POINTER = [$pointer]
;	  0409	      tes;
;	  0410	
;	  0411	literal
;	  0412	       FILE_NAME_FIELDS_SIZE = $field_set_size,
;	  0413	       FILE_NAME_FIELDS_ALLOCATION = $field_set_units;
;	  0414	
;	  0415	!
;	  0416	! Remote file access definitions
;	  0417	!
;	  0418	
;	  0419	literal
;	  0420	       FAL_OBJECT = 17,
;	  0421	       DAP_BFR_LENGTH = 512,
;	  0422	       DAP_BFR_SIZE = ch$allocation (DAP_BFR_LENGTH,8),
;	  0423	       DAP_BFR_ALLOCATION = DAP_BFR_SIZE * %upval ;
;	  0424	
;	  0425	
;	  0426	!
;	  0427	! Own storage:
;	  0428	!
;	  0429	
;	  0430	own
;	  0431	   FILE_TABLE: initial (0) ;            ! Base address of file table data base
;	  0432	
;	  0433	!
;	  0434	! External references:
;	  0435	!
;	  0436	
;	  0437	external
;	  0438	        %debug_data_base;
;	  0439	
;	  0440	external routine
;	  0441	         %if not $MCB %then NMU$TEXT, %fi
;	  0442	         NMU$TABLE_ROUTINES,
;	  0443	         NMU$NETWORK_UTILITIES,         ! DECnet logical link interface
;	  0444	         NMU$MEMORY_MANAGER;
;	  0445	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  10
X03.09								12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (4)

;	  0446	
;	  0447	%global_routine ('NMU$FILE_INITIALIZE') : novalue =
;	  0448	
;	  0449	!++
;	  0450	! Functional description:
;	  0451	!
;	  0452	!	Initializes the file system at start up or restart time.
;	  0453	!       The internal file table data base is cleared and reset to
;	  0454	!       an initial state.
;	  0455	!
;	  0456	! Formal parameters: none
;	  0457	! Implicit inputs: none
;	  0458	!
;	  0459	! Routine value: none
;	  0460	! Side effects: none
;	  0461	!
;	  0462	!--
;	  0463	
;	  0464	    begin
;	  0465	
;	  0466	    NMU$TABLE_CLEAR (FILE_TABLE) ;
;	  0467	
;	P 0468	    %debug (FILE_TRACE,
;	  0469	            (TRACE_INFO ('File system interface initialized')));
;	  0470	
;	  0471	    end;				! End of NMU$FILE_INITIALIZE


						.TITLE	NMUFIL
						.IDENT	/X03.09/


000000						.PSECT	$OWN$,  D  
000000	000000 				FILE.TABLE:
						.WORD	0


						.GLOBL	DEBUG, UT.CLEAR, UT.INSERT, UT.FETCH
						.GLOBL	UT.DELETE, UT.CHANGE, UT.MAX, UN.INIT
						.GLOBL	UN.LOCAL, UN.OPEN, UN.ACCEPT, UN.REJECT
						.GLOBL	UN.READ, UN.WRITE, UN.ABORT, UN.CLOSE
						.GLOBL	UN.STATUS, UN.VALIDATE, UM.RESET
						.GLOBL	UM.INITIALIZE, UM.GET, UM.RELEASE


						.SBTTL	UF.INI NMU$FILE_INITIALIZE as UF_INI
000000						.PSECT	$CODE$,  RO 

000000	012746  000000'			UF.INI::MOV	#FILE.TABLE,-(SP)		;					0466
000004	004767  000000G				JSR	PC,UT.CLEAR
000010	005726 					TST	(SP)+				;					0464
000012	000207 					RTS	PC				;					0447
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  11
X03.09		NMU$FILE_INITIALIZE as UF_INI			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (4)

; Routine Size:  6 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  2 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  12
X03.09		NMU$FILE_INITIALIZE as UF_INI			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (5)

;	  0472	
;	  0473	%global_routine ('NMU$FILE_OPEN', FILE_TYPE, HOST, FILE_NAME, RSP_PTR) =
;	  0474	
;	  0475	!++
;	  0476	! Functional description:
;	  0477	!
;	  0478	!	This routine opens a file to be read. The FILE_TYPE specifies
;	  0479	!	the accessing technique. If the file can not be opened a NICE
;	  0480	!       response message is built using RSP_PTR.
;	  0481	!
;	  0482	! Formal parameters:
;	  0483	!
;	  0484	!       .FILE_NAME    Pointer to file spec string (counted ASCII)
;	  0485	!       .FILE_TYPE    Type of file
;	  0486	!                         FILE_PERMANENT_DATA_BASE
;	  0487	!                         FILE_SYSTEM_IMAGE
;	  0488	!                         FILE_DUMP_IMAGE
;	  0489	!                         FILE_SECONDARY_LOADER
;	  0490	!                         FILE_TERTIARY_LOADER
;	  0491	!                         FILE_SECONDARY_DUMPER
;	  0492	!       .RSP_PTR      Pointer to NICE response buffer
;	  0493	!
;	  0494	! Implicit inputs: none
;	  0495	!
;	  0496	! Routine value:
;	  0497	!
;	  0498	!       gtr 0   File identifier to be used on any future reference
;	  0499	!       leq 0   Error occured while opening file
;	  0500	!
;	  0501	! Side effects: none
;	  0502	!
;	  0503	!--
;	  0504	
;	  0505	    begin
;	  0506	
;	  0507	    local
;	  0508	         FN: FILE_NAME_BLOCK,
;	  0509	         FILE : ref FILE_DATA_BLOCK,
;	  0510	         FILE_ID;
;	  0511	
;	P 0512	    %debug (FILE_TRACE,
;	P 0513	            (TRACE_INFO ('Opening file %#A',
;	P 0514	                         ch$rchar (.FILE_NAME),
;	  0515	                         ch$plus (.FILE_NAME,1))));
;	  0516	
;	  0517	    !
;	  0518	    ! Check to see if the file name has been specified.
;	  0519	    !
;	  0520	
;	  0521	    if .FILE_NAME eql 0 or ch$rchar (.FILE_NAME) eql 0
;	  0522	    then
;	  0523	        begin
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  13
X03.09		NMU$FILE_OPEN as UF_OPEN			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (5)

;	P 0524	        $RESPONSE_X (.RSP_PTR, NICE$_FOE, .FILE_TYPE,
;	  0525	                     'File specification missing', 201);
;	  0526	        FILE_ID = 0;
;	  0527	        return .FILE_ID;
;	  0528	        end;
;	  0529	
;	  0530	    !
;	  0531	    ! Check if file name is not too long.
;	  0532	    !
;	  0533	
;	  0534	    if ch$rchar (.FILE_NAME) gtr MAX_FILE_NAME_LENGTH
;	  0535	    then
;	  0536	        begin
;	P 0537	        $RESPONSE_X (.RSP_PTR, NICE$_FOE, .FILE_TYPE,
;	  0538	                     'File specification too long', 202);
;	  0539	        FILE_ID = 0;
;	  0540	        return .FILE_ID;
;	  0541	        end;
;	  0542	
;	  0543	    !
;	  0544	    ! Allocate a file block and fill it in with known information.
;	  0545	    !
;	  0546	
;	  0547	    FILE = NMU$MEMORY_GET (FILE_DATA_BLOCK_ALLOCATION);
;	  0548	    FILE [FD_TYPE] = .FILE_TYPE;        ! Save file type
;	  0549	    FILE [FD_RESPONSE] = .RSP_PTR ;     ! Save NICE response pointer
;	  0550	
;	  0551	    FN[FN_POINTER] =.FILE_NAME;
;	  0552	    FN[FN_LENGTH] = ch$rchar_a (FN[FN_POINTER]); ! Get length from I-field
;	  0553	
;	  0554	    selectone .FILE_TYPE of
;	  0555	        set
;	  0556	        [FILE_SYSTEM_IMAGE,
;	  0557	         FILE_SECONDARY_LOADER,
;	  0558	         FILE_TERTIARY_LOADER,
;	  0559	         FILE_SECONDARY_DUMPER] :
;	  0560	             begin
;	  0561	             FILE [FD_ACCESS] = FILE_ACCESS_READ_ONLY ;
;	  0562	             FILE [FD_FORMAT] = FILE_FORMAT_18_FOR_16 ;
;	  0563	             FILE [FD_BYTE_SIZE] = 8;
;	  0564	             end;
;	  0565	
;	  0566	        [FILE_PERMANENT_DATA_BASE] :
;	  0567	             begin
;	  0568	             FILE [FD_ACCESS] = FILE_ACCESS_RANDOM ;
;	  0569	             FILE [FD_FORMAT] = FILE_FORMAT_SWAPPED_BYTES ; ! ** ?Word Mode? **
;	  0570	             FILE [FD_BYTE_SIZE] = %bpval;
;	  0571	             end;
;	  0572	        [FILE_DUMP_IMAGE] :
;	  0573	             begin
;	  0574	             FILE [FD_ACCESS] = FILE_ACCESS_WRITE_ONLY ;
;	  0575	             FILE [FD_FORMAT] = FILE_FORMAT_18_FOR_16 ;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  14
X03.09		NMU$FILE_OPEN as UF_OPEN			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (5)

;	  0576	             FILE [FD_BYTE_SIZE] = 8;
;	  0577	             end;
;	  0578	    tes;
;	  0579	
;	L 0580	    %if $TOPS20
;	U 0581	    %then
;	U 0582	    ch$copy (.FN[FN_LENGTH], .FN[FN_POINTER], 0,
;	U 0583	             min ((.FN[FN_LENGTH] + 1), (MAX_FILE_NAME_LENGTH + 1)),
;	U 0584	             ch$ptr (FILE [FD_NAME]));
;	  0585	    %fi
;	  0586	
;	  0587	    !
;	  0588	    ! Parse the file specification and extract the node id and
;	  0589	    ! access control information. If node name is present set
;	  0590	    ! remote access mode.
;	  0591	    !
;	  0592	
;	  0593	    if not PARSE_FILE_SPECIFICATION (.FILE, FN)
;	  0594	    then
;	  0595	        begin
;	  0596	        NMU$MEMORY_RELEASE (.FILE, FILE_DATA_BLOCK_ALLOCATION);
;	  0597	        FILE_ID = 0;
;	  0598	        return .FILE_ID;
;	  0599	        end;
;	  0600	
;	  0601	    if .FN [FN_HOST_LENGTH] eql 0
;	  0602	    then
;	  0603	        FILE [FD_LOCAL] = $true
;	  0604	    else
;	  0605	        begin
;	  0606	        FILE [FD_LOCAL] = $false;
;	  0607	        FILE [FD_DAP_STATE] = 0;
;	  0608	        end;
;	  0609	
;	  0610	    !
;	  0611	    ! Initialize the buffer ring. It is now a ring of 1 item.
;	  0612	    !
;	  0613	
;	  0614	    FILE [FD_CURRENT_BUFFER] = 0;
;	  0615	    ALLOC_BUFFER (.FILE);
;	  0616	
;	  0617	
;	  0618	    !
;	  0619	    ! Open the file
;	  0620	    !
;	  0621	
;	  0622	    %MOVI32 (0 , FILE [FD_LENGTH]);     ! Initialize length of file to zero.
;	  0623	
;	  0624	    if not OPEN_FILE (.FILE, FN)
;	  0625	    then
;	  0626	        begin
;	  0627	        DEALLOC_BUFFER (.FILE);
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  15
X03.09		NMU$FILE_OPEN as UF_OPEN			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (5)

;	  0628	        NMU$MEMORY_RELEASE (.FILE, FILE_DATA_BLOCK_ALLOCATION);
;	  0629	        FILE_ID = 0;
;	  0630	        return .FILE_ID;
;	  0631	        end;
;	  0632	
;	  0633	    !
;	  0634	    ! Initialize the user's position in the file.
;	  0635	    ! Initialize NMU$FILE's position in the file.
;	  0636	    ! Indicate that no seeks have been done yet.
;	  0637	    !
;	  0638	
;	  0639	    %MOVI32 (0 , FILE [FD_CURRENT_POSITION]);
;	  0640	    %MOVI32 (0 , FILE [FD_FILE_POSITION]);
;	  0641	    FILE [FD_SEEK_DONE] = $false;
;	  0642	
;	  0643	    !
;	  0644	    ! Insert file block into the file table data base and return the
;	  0645	    ! index into the data base
;	  0646	    !
;	  0647	
;	  0648	    FILE_ID = NMU$TABLE_INSERT (FILE_TABLE, .FILE);
;	  0649	
;	P 0650	    %debug (FILE_TRACE,
;	P 0651	            (TRACE_INFO ('File id %O assigned to FD block at %O',
;	P 0652	                         .FILE_ID,
;	  0653	                         .FILE)));
;	  0654	
;	  0655	    return .FILE_ID
;	  0656	
;	  0657	    end;				! End of NMU$FILE_OPEN


						.GLOBL	$CBDSG


						.SBTTL	UF.OPEN NMU$FILE_OPEN as UF_OPEN
000000	004167  000000G			UF.OPEN::
						JSR	R1,$SAVE5			;					0473
000004	162706  000030 				SUB	#30,SP
000010	016605  000050 				MOV	50(SP),R5			; FILE.NAME,*				0521
000014	001402 					BEQ	1$
000016	105715 					TSTB	(R5)
000020	001024 					BNE	2$
000022	016600  000046 			1$:	MOV	46(SP),R0			; RSP.PTR,STRPTR			0525
000026	112720  000363 				MOVB	#363,(R0)+			; *,STRPTR
000032	016601  000054 				MOV	54(SP),R1			; FILE.TYPE,DETAIL
000036	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000040	010102 					MOV	R1,R2				; DETAIL,*
000042	000302 					SWAB	R2
000044	110220 					MOVB	R2,(R0)+			; *,STRPTR
000046	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000052	012701  000311 				MOV	#311,R1
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  16
X03.09		NMU$FILE_OPEN as UF_OPEN			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (5)

000056	012702  000001 				MOV	#1,R2
000062	004767  000000G				JSR	PC,$CBDSG
000066	005003 					CLR	R3				; FILE.ID				0526
000070	000577 					BR	13$				;					0523
000072	012746  000032 			2$:	MOV	#32,-(SP)			;					0547
000076	004767  000000G				JSR	PC,UM.GET
000102	010002 					MOV	R0,R2				; *,FILE
000104	012704  000004 				MOV	#4,R4				;					0548
000110	060204 					ADD	R2,R4				; FILE,*
000112	016601  000056 				MOV	56(SP),R1			; FILE.TYPE,*
000116	110114 					MOVB	R1,(R4)
000120	016662  000050  000010 			MOV	50(SP),10(R2)			; RSP.PTR,*(FILE)			0549
000126	010566  000016 				MOV	R5,16(SP)			; *,FN+14				0551
000132	005266  000016 				INC	16(SP)				; FN+14					0552
000136	016600  000016 				MOV	16(SP),R0			; FN+14,*
000142	116066  177777  000002 			MOVB	-1(R0),2(SP)			; *,FN
000150	105066  000003 				CLRB	3(SP)				; FN
000154	020127  000001 				CMP	R1,#1				;					0554
000160	001406 					BEQ	3$
000162	020127  000003 				CMP	R1,#3
000166	002406 					BLT	4$
000170	020127  000005 				CMP	R1,#5
000174	003003 					BGT	4$
000176	111764  000001 			3$:	MOVB	(PC),1(R4)			;					0561
000202	000422 					BR	6$				;					0562
000204	005701 				4$:	TST	R1				;					0554
000206	001012 					BNE	5$
000210	112764  000003  000001 			MOVB	#3,1(R4)			;					0568
000216	112762  000003  000006 			MOVB	#3,6(R2)			; *,*(FILE)				0569
000224	112762  000020  000007 			MOVB	#20,7(R2)			; *,*(FILE)				0570
000232	000414 					BR	7$				;					0554
000234	020127  000002 			5$:	CMP	R1,#2
000240	001011 					BNE	7$
000242	112764  000002  000001 			MOVB	#2,1(R4)			;					0574
000250	112762  000002  000006 		6$:	MOVB	#2,6(R2)			; *,*(FILE)				0575
000256	112762  000010  000007 			MOVB	#10,7(R2)			; *,*(FILE)				0576
000264	010216 				7$:	MOV	R2,(SP)				; FILE,*				0593
000266	012746  000004 				MOV	#4,-(SP)
000272	060616 					ADD	SP,(SP)				; FN,*
000274	004767  000000V				JSR	PC,PARSE.FILE.SPECIFICATION
000300	005726 					TST	(SP)+
000302	006000 					ROR	R0
000304	103041 					BHIS	10$				;					0596
000306	012701  000030 				MOV	#30,R1				;					0603
000312	060201 					ADD	R2,R1				; FILE,*
000314	005766  000004 				TST	4(SP)				; FN+2					0601
000320	001003 					BNE	8$
000322	052711  000400 				BIS	#400,(R1)			;					0603
000326	000403 					BR	9$				;					0601
000330	042711  000400 			8$:	BIC	#400,(R1)			;					0606
000334	105011 					CLRB	(R1)				;					0607
000336	005062  000026 			9$:	CLR	26(R2)				; *(FILE)				0614
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  17
X03.09		NMU$FILE_OPEN as UF_OPEN			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (5)

000342	010216 					MOV	R2,(SP)				; FILE,*				0615
000344	004767  000000V				JSR	PC,ALLOC.BUFFER
000350	005062  000022 				CLR	22(R2)				; *(FILE)				0622
000354	005062  000024 				CLR	24(R2)				; *(FILE)
000360	010216 					MOV	R2,(SP)				; FILE,*				0624
000362	012746  000004 				MOV	#4,-(SP)
000366	060616 					ADD	SP,(SP)				; FN,*
000370	004767  000000V				JSR	PC,OPEN.FILE
000374	005726 					TST	(SP)+
000376	006000 					ROR	R0
000400	103412 					BLO	11$
000402	010216 					MOV	R2,(SP)				; FILE,*				0627
000404	004767  000000V				JSR	PC,DEALLOC.BUFFER
000410	010216 				10$:	MOV	R2,(SP)				; FILE,*				0628
000412	012746  000032 				MOV	#32,-(SP)
000416	004767  000000G				JSR	PC,UM.RELEASE
000422	005003 					CLR	R3				; FILE.ID				0629
000424	000420 					BR	12$				;					0624
000426	005062  000012 			11$:	CLR	12(R2)				; *(FILE)				0639
000432	005062  000014 				CLR	14(R2)				; *(FILE)
000436	005062  000016 				CLR	16(R2)				; *(FILE)				0640
000442	005062  000020 				CLR	20(R2)				; *(FILE)
000446	042711  001000 				BIC	#1000,(R1)			;					0641
000452	012716  000000'				MOV	#FILE.TABLE,(SP)		;					0648
000456	010246 					MOV	R2,-(SP)			; FILE,*
000460	004767  000000G				JSR	PC,UT.INSERT
000464	010003 					MOV	R0,R3				; *,FILE.ID
000466	022626 				12$:	CMP	(SP)+,(SP)+			;					0473
000470	010300 				13$:	MOV	R3,R0				; FILE.ID,*				0505
000472	062706  000030 				ADD	#30,SP				;					0473
000476	000207 					RTS	PC
; Routine Size:  160 words,	Routine Base:  $CODE$ + 0014
; Maximum stack depth per invocation:  21 words


;	  0658	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  18
X03.09		NMU$FILE_OPEN as UF_OPEN			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

;	  0659	
;	P 0660	%routine ('PARSE_FILE_SPECIFICATION', FILE : ref FILE_DATA_BLOCK,
;	  0661	                                      FN : ref FILE_NAME_BLOCK) =
;	  0662	
;	  0663	!++
;	  0664	! Functional description:
;	  0665	!
;	  0666	!	Parses a network file specification of the form:
;	  0667	!
;	  0668	!		NODE"USER;PASSWORD;ACCOUNT"::DIR:FILNAM.TYP
;	  0669	!
;	  0670	!	File specification fields in the file name block are 
;	  0671	!       filled in.
;	  0672	!
;	  0673	! Formal parameters:
;	  0674	!
;	  0675	!	.FILE    Address of File Data Block
;	  0676	!       .FN      Address of File Name Block
;	  0677	!
;	  0678	! Implicit inputs: none
;	  0679	!
;	  0680	! Routine value:
;	  0681	!
;	  0682	!	$true     if file syntax is valid
;	  0683	!       $false    otherwise
;	  0684	!
;	  0685	! Side effects: none
;	  0686	!
;	  0687	!--
;	  0688	
;	  0689	    begin
;	  0690	
;	  0691	    local
;	  0692	         BEG_PTR,
;	  0693	         TMP_PTR,
;	  0694	         TMP_LTH ;
;	  0695	
;	  0696	    !
;	  0697	    ! Save pointer to file specification string and it's total length.
;	  0698	    !
;	  0699	
;	  0700	    TMP_PTR = BEG_PTR = .FN [FN_POINTER] ;
;	  0701	    TMP_LTH = .FN [FN_LENGTH] ;
;	  0702	
;	  0703	    !
;	  0704	    ! Search for a double colon ('::') to determine if it's 
;	  0705	    ! a network file specification.
;	  0706	    !
;	  0707	
;	  0708	    if not ch$fail (TMP_PTR = ch$find_sub (.TMP_LTH,.BEG_PTR,2,CH$ASCII('::')))
;	  0709	    then begin
;	  0710	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  19
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

;	  0711	         !
;	  0712	         ! Found a double colon, so this is a network file specification.
;	  0713	         ! Save pointer to host node name.
;	  0714	         ! TMP_LTH will be set to length of file spec string up to '::'.
;	  0715	         ! Calculate length of file name portion of string.
;	  0716	         !
;	  0717	
;	  0718	         FN [FN_HOST_POINTER] = .BEG_PTR ;
;	  0719	         TMP_LTH = ch$diff (.TMP_PTR,.BEG_PTR);
;	  0720	         FN [FN_NAME_LENGTH] = .FN [FN_LENGTH] - (.TMP_LTH + 2);
;	  0721	
;	  0722	         !
;	  0723	         ! Determine if the optional access control information is present.
;	  0724	         !
;	  0725	
;	  0726	         if ch$fail (TMP_PTR = ch$find_sub (.TMP_LTH,.BEG_PTR,1,CH$ASCII('"')))
;	  0727	         then begin
;	  0728	
;	  0729	              !
;	  0730	              ! If no access control info then set length of host node name
;	  0731	              ! and lengths of user, password, and account as zero.
;	  0732	              !
;	  0733	
;	  0734	              FN [FN_HOST_LENGTH] = .TMP_LTH;
;	  0735	              FN [FN_USER_LENGTH] = 0;
;	  0736	              FN [FN_ACCOUNT_LENGTH] = 0;
;	  0737	              FN [FN_PASSWORD_LENGTH] = 0;
;	  0738	              end
;	  0739	         else begin
;	  0740	
;	  0741	              !
;	  0742	              ! Access control is present. Save length of host node name.
;	  0743	              ! Bump pointer past '"', and adjust for remaining length of
;	  0744	              ! the access control string.
;	  0745	              !
;	  0746	
;	  0747	              FN [FN_HOST_LENGTH] = ch$diff (.TMP_PTR,.BEG_PTR);
;	  0748	              TMP_PTR = ch$plus (.TMP_PTR,1) ;
;	  0749	              TMP_LTH = .TMP_LTH - (.FN [FN_HOST_LENGTH] + 1);
;	  0750	
;	  0751	              !
;	  0752	              ! Ensure that the access control string is terminated by '"'.
;	  0753	              ! If not return with error, otherwise parse the three
;	  0754	              ! access control fields.
;	  0755	              !
;	  0756	
;	  0757	              if ch$fail (ch$find_sub (.TMP_LTH,.TMP_PTR,1,CH$ASCII('"')))
;	  0758	              then begin
;	P 0759	                   $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FOE, .FILE[FD_TYPE],
;	  0760	                                'Access control terminator missing', 203);
;	  0761	                   return $false
;	  0762	                   end;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  20
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

;	  0763	
;	  0764	              PARSE_ACCESS_CONTROL (TMP_PTR,TMP_LTH,
;	  0765	                                    FN [FN_USER_POINTER],
;	  0766	                                    FN [FN_USER_LENGTH]);
;	  0767	
;	  0768	              PARSE_ACCESS_CONTROL (TMP_PTR,TMP_LTH,
;	  0769	                                    FN [FN_PASSWORD_POINTER],
;	  0770	                                    FN [FN_PASSWORD_LENGTH]);
;	  0771	
;	  0772	              PARSE_ACCESS_CONTROL (TMP_PTR,TMP_LTH,
;	  0773	                                    FN [FN_ACCOUNT_POINTER],
;	  0774	                                    FN [FN_ACCOUNT_LENGTH]);
;	  0775	!              if (.FN [FN_USER_LENGTH] gtr 39) or (.FN [FN_PASSWORD_LENGTH]  gtr 39) or (.FN [FN_ACCOUNT_LENGTH] g
;	  0776	!              then begin
;	  0777	!                   $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FOE, .FILE[FD_TYPE],
;	  0778	!                                'Access control string greater than 39 characters', 213);
;	  0779	!                   return $false
;	  0780	!                   end;
;	  0781	              end;
;	  0782	
;	  0783	         if .FN [FN_HOST_LENGTH] gtr 6
;	  0784	         then begin
;	P 0785	              $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FOE, .FILE[FD_TYPE],
;	  0786	                           'Node name greater than 6 characters', 204);
;	  0787	              return $false
;	  0788	              end;
;	  0789	
;	  0790	         !
;	  0791	         ! Store pointer to remainder of file name string.
;	  0792	         !
;	  0793	
;	  0794	         FN [FN_NAME_POINTER] = ch$plus (.TMP_PTR,2);
;	  0795	
;	  0796	         end
;	  0797	    else begin
;	  0798	
;	  0799	         !
;	  0800	         ! If no '::' found then this is just a plain old local file
;	  0801	         ! specification.
;	  0802	         !
;	  0803	
;	  0804	         FN [FN_HOST_LENGTH] = 0;
;	  0805	         FN [FN_NAME_POINTER] = .BEG_PTR;
;	  0806	         FN [FN_NAME_LENGTH] = .TMP_LTH;
;	  0807	         end;
;	  0808	
;	  0809	    if .FN [FN_NAME_LENGTH] leq 0
;	  0810	    then begin
;	P 0811	         $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FOE, .FILE[FD_TYPE],
;	  0812	                      'File name missing', 205);
;	  0813	         return $false
;	  0814	         end
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  21
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

;	  0815	    else if .FN [FN_NAME_LENGTH] gtr 255
;	  0816	         then begin
;	P 0817	              $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FOE, .FILE[FD_TYPE],
;	  0818	                           'File name greater than 255 characters', 206);
;	  0819	              return $false
;	  0820	              end;
;	  0821	
;	  0822	    return $true
;	  0823	
;	  0824	    end;				! End of PARSE_FILE_SPECIFICATION



000000						.PSECT	$PLIT$,  RO ,  D  
000000	   072     072 			P.AAA:	.ASCII	/::/
000002	   042     000 			P.AAB:	.ASCII	/"/<00>
000004	   042     000 			P.AAC:	.ASCII	/"/<00>


						.SBTTL	PARSE.FILE.SPECIFICATION PARSE_FILE_SPECIFICATION
000514						.PSECT	$CODE$,  RO 

000000	004167  000000G			PARSE.FILE.SPECIFICATION:
						JSR	R1,$SAVE5			;					0661
000004	016604  000016 				MOV	16(SP),R4			; FN,*					0700
000010	016401  000014 				MOV	14(R4),R1			; *,BEG.PTR
000014	010146 					MOV	R1,-(SP)			; BEG.PTR,TMP.PTR
000016	011446 					MOV	(R4),-(SP)			; *,TMP.LTH				0701
000020	012746  000012 				MOV	#12,-(SP)			;					0720
000024	060416 					ADD	R4,(SP)
000026	012705  000002 				MOV	#2,R5				;					0734
000032	060405 					ADD	R4,R5
000034	011446 					MOV	(R4),-(SP)			; TMP.LTH,*				0708
000036	010146 					MOV	R1,-(SP)			; BEG.PTR,*
000040	012746  000002 				MOV	#2,-(SP)
000044	012746  000000'				MOV	#P.AAA,-(SP)
000050	004767  000000G				JSR	PC,BL$FSB
000054	062706  000010 				ADD	#10,SP
000060	010066  000004 				MOV	R0,4(SP)			; *,TMP.PTR
000064	001002 					BNE	1$
000066	000167  000502 				JMP	8$
000072	010164  000016 			1$:	MOV	R1,16(R4)			; BEG.PTR,*				0718
000076	010066  000002 				MOV	R0,2(SP)			; TMP.PTR,TMP.LTH			0719
000102	160166  000002 				SUB	R1,2(SP)			; BEG.PTR,TMP.LTH
000106	016602  000002 				MOV	2(SP),R2			; TMP.LTH,*				0720
000112	011400 					MOV	(R4),R0
000114	160200 					SUB	R2,R0
000116	010076  000000 				MOV	R0,@0(SP)
000122	162776  000002  000000 			SUB	#2,@0(SP)
000130	010246 					MOV	R2,-(SP)			;					0726
000132	010146 					MOV	R1,-(SP)			; BEG.PTR,*
000134	012746  000001 				MOV	#1,-(SP)
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  22
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

000140	012746  000002'				MOV	#P.AAB,-(SP)
000144	004767  000000G				JSR	PC,BL$FSB
000150	062706  000010 				ADD	#10,SP
000154	010066  000004 				MOV	R0,4(SP)			; *,TMP.PTR
000160	001010 					BNE	2$
000162	010215 					MOV	R2,(R5)				;					0734
000164	005064  000004 				CLR	4(R4)				;					0735
000170	005064  000006 				CLR	6(R4)				;					0736
000174	005064  000010 				CLR	10(R4)				;					0737
000200	000537 					BR	5$				;					0726
000202	016615  000004 			2$:	MOV	4(SP),(R5)			; TMP.PTR,*				0747
000206	160115 					SUB	R1,(R5)				; BEG.PTR,*
000210	005266  000004 				INC	4(SP)				; TMP.PTR				0748
000214	016600  000002 				MOV	2(SP),R0			; TMP.LTH,*				0749
000220	161500 					SUB	(R5),R0
000222	010066  000002 				MOV	R0,2(SP)			; *,TMP.LTH
000226	005366  000002 				DEC	2(SP)				; TMP.LTH
000232	016646  000002 				MOV	2(SP),-(SP)			; TMP.LTH,*				0757
000236	016646  000006 				MOV	6(SP),-(SP)			; TMP.PTR,*
000242	012746  000001 				MOV	#1,-(SP)
000246	012746  000004'				MOV	#P.AAC,-(SP)
000252	004767  000000G				JSR	PC,BL$FSB
000256	062706  000010 				ADD	#10,SP
000262	005700 					TST	R0
000264	001031 					BNE	4$
000266	016603  000026 				MOV	26(SP),R3			; FILE,*				0760
000272	016300  000010 				MOV	10(R3),R0			; *,STRPTR
000276	112720  000363 				MOVB	#363,(R0)+			; *,STRPTR
000302	010301 					MOV	R3,R1				; FILE,*
000304	116101  000004 				MOVB	4(R1),R1			; *,DETAIL
000310	042701  177400 				BIC	#177400,R1			; *,DETAIL
000314	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000316	010102 					MOV	R1,R2				; DETAIL,*
000320	000302 					SWAB	R2
000322	110220 					MOVB	R2,(R0)+			; *,STRPTR
000324	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000330	012701  000313 				MOV	#313,R1
000334	012702  000001 			3$:	MOV	#1,R2
000340	004767  000000G				JSR	PC,$CBDSG
000344	000167  000404 				JMP	12$				;					0758
000350	012746  000006 			4$:	MOV	#6,-(SP)			;					0764
000354	060616 					ADD	SP,(SP)				; TMP.PTR,*
000356	012746  000006 				MOV	#6,-(SP)
000362	060616 					ADD	SP,(SP)				; TMP.LTH,*
000364	012746  000020 				MOV	#20,-(SP)			;					0765
000370	060416 					ADD	R4,(SP)
000372	012746  000004 				MOV	#4,-(SP)			;					0766
000376	060416 					ADD	R4,(SP)
000400	004767  000000V				JSR	PC,PARSE.ACCESS.CONTROL		;					0764
000404	012716  000014 				MOV	#14,(SP)			;					0768
000410	060616 					ADD	SP,(SP)				; TMP.PTR,*
000412	012746  000014 				MOV	#14,-(SP)
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  23
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

000416	060616 					ADD	SP,(SP)				; TMP.LTH,*
000420	012746  000024 				MOV	#24,-(SP)			;					0769
000424	060416 					ADD	R4,(SP)
000426	012746  000010 				MOV	#10,-(SP)			;					0770
000432	060416 					ADD	R4,(SP)
000434	004767  000000V				JSR	PC,PARSE.ACCESS.CONTROL		;					0768
000440	012716  000022 				MOV	#22,(SP)			;					0772
000444	060616 					ADD	SP,(SP)				; TMP.PTR,*
000446	012746  000022 				MOV	#22,-(SP)
000452	060616 					ADD	SP,(SP)				; TMP.LTH,*
000454	012746  000022 				MOV	#22,-(SP)			;					0773
000460	060416 					ADD	R4,(SP)
000462	012746  000006 				MOV	#6,-(SP)			;					0774
000466	060416 					ADD	R4,(SP)
000470	004767  000000V				JSR	PC,PARSE.ACCESS.CONTROL		;					0772
000474	062706  000024 				ADD	#24,SP				;					0739
000500	021527  000006 			5$:	CMP	(R5),#6				;					0783
000504	003424 					BLE	7$
000506	016603  000026 				MOV	26(SP),R3			; FILE,*				0786
000512	016300  000010 				MOV	10(R3),R0			; *,STRPTR
000516	112720  000363 				MOVB	#363,(R0)+			; *,STRPTR
000522	010301 					MOV	R3,R1				; FILE,*
000524	116101  000004 				MOVB	4(R1),R1			; *,DETAIL
000530	042701  177400 				BIC	#177400,R1			; *,DETAIL
000534	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000536	010102 					MOV	R1,R2				; DETAIL,*
000540	000302 					SWAB	R2
000542	110220 					MOVB	R2,(R0)+			; *,STRPTR
000544	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000550	012701  000314 				MOV	#314,R1
000554	000667 				6$:	BR	3$
000556	016664  000004  000026 		7$:	MOV	4(SP),26(R4)			; TMP.PTR,*				0794
000564	062764  000002  000026 			ADD	#2,26(R4)
000572	000406 					BR	9$				;					0708
000574	005015 				8$:	CLR	(R5)				;					0804
000576	010164  000026 				MOV	R1,26(R4)			; BEG.PTR,*				0805
000602	016676  000002  000000 			MOV	2(SP),@0(SP)			; TMP.LTH,*				0806
000610	005776  000000 			9$:	TST	@0(SP)				;					0809
000614	003024 					BGT	10$
000616	016603  000026 				MOV	26(SP),R3			; FILE,*				0812
000622	016300  000010 				MOV	10(R3),R0			; *,STRPTR
000626	112720  000363 				MOVB	#363,(R0)+			; *,STRPTR
000632	010301 					MOV	R3,R1				; FILE,*
000634	116101  000004 				MOVB	4(R1),R1			; *,DETAIL
000640	042701  177400 				BIC	#177400,R1			; *,DETAIL
000644	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000646	010102 					MOV	R1,R2				; DETAIL,*
000650	000302 					SWAB	R2
000652	110220 					MOVB	R2,(R0)+			; *,STRPTR
000654	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000660	012701  000315 				MOV	#315,R1
000664	000623 					BR	3$
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  24
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (6)

000666	027627  000000  000377 		10$:	CMP	@0(SP),#377			;					0815
000674	003424 					BLE	11$
000676	016603  000026 				MOV	26(SP),R3			; FILE,*				0818
000702	016300  000010 				MOV	10(R3),R0			; *,STRPTR
000706	112720  000363 				MOVB	#363,(R0)+			; *,STRPTR
000712	010301 					MOV	R3,R1				; FILE,*
000714	116101  000004 				MOVB	4(R1),R1			; *,DETAIL
000720	042701  177400 				BIC	#177400,R1			; *,DETAIL
000724	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000726	010102 					MOV	R1,R2				; DETAIL,*
000730	000302 					SWAB	R2
000732	110220 					MOVB	R2,(R0)+			; *,STRPTR
000734	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000740	012701  000316 				MOV	#316,R1
000744	000703 					BR	6$
000746	012700  000001 			11$:	MOV	#1,R0				;					0689
000752	000401 					BR	13$
000754	005000 				12$:	CLR	R0				;					0661
000756	062706  000006 			13$:	ADD	#6,SP
000762	000207 					RTS	PC
; Routine Size:  250 words,	Routine Base:  $CODE$ + 0514
; Maximum stack depth per invocation:  20 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  25
X03.09		PARSE_FILE_SPECIFICATION			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (7)

;	  0825	
;	  0826	%routine ('PARSE_ACCESS_CONTROL', IPTR, ILEN, OPTR, OLEN) =
;	  0827	
;	  0828	!++
;	  0829	! Functional description:
;	  0830	!
;	  0831	! 	Parses individual portions of the access control field.
;	  0832	!       IPTR and ILEN are updated to point past the parsed field.
;	  0833	!
;	  0834	
;	  0835	! Formal parameters:
;	  0836	!
;	  0837	!       .IPTR    Address of Pointer to beginning of remainder of access 
;	  0838	!                  control field
;	  0839	!       .ILEN    Address of Length of remainder of access control fields
;	  0840	!       .OPTR    Address of Pointer to access control field
;	  0841	!       .OLEN    Address of Length of access control field
;	  0842	!
;	  0843	! Implicit inputs: none
;	  0844	!
;	  0845	! Routine value: none
;	  0846	! Side effects: none
;	  0847	!
;	  0848	!--
;	  0849	
;	  0850	    begin
;	  0851	
;	  0852	    local
;	  0853	         PTR,
;	  0854	         CHR;
;	  0855	
;	  0856	    CHR = ch$rchar (..IPTR);            ! Get leading character
;	  0857	    while ((.CHR eql %c' ') or (.CHR eql %O'11')) and (..ILEN gtr 0)
;	  0858	    do begin                            ! Skip leading blanks
;	  0859	       .IPTR = ch$plus (..IPTR,1);      ! Advance pointer
;	  0860	       .ILEN = ..ILEN - 1;              ! Update remaining length
;	  0861	       CHR = ch$rchar (..IPTR);         ! Get next character
;	  0862	       end;
;	  0863	
;	  0864	    ! Check for delimeters, i.e. blank and tab characters, or terminating
;	  0865	    ! character, i.e. double quote character
;	  0866	
;	  0867	    if (..ILEN leq 0)
;	  0868	    or (ch$fail (PTR = ch$find_sub (..ILEN,..IPTR,1,CH$ASCII(' ')))
;	  0869	    and ch$fail (PTR = ch$find_sub (..ILEN,..IPTR,1,CH$ASCII(%char(%O'11'))))
;	  0870	    and ch$fail (PTR = ch$find_sub (..ILEN,..IPTR,1,CH$ASCII('"'))))
;	  0871	    then begin                          ! If cannot find field delimeter,
;	  0872	         .OLEN = 0;                     !  then indicate zero length field
;	  0873	         return $false;
;	  0874	         end
;	  0875	    else begin                          ! Found either delimeter or terminator
;	  0876	         .OLEN = ch$diff (.PTR,..IPTR); ! Return length of field
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  26
X03.09		PARSE_ACCESS_CONTROL				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (7)

;	  0877	         .OPTR = ..IPTR;                ! Return pointer of field
;	  0878	         .IPTR = ch$plus (.PTR,1) ;     ! Fix up pointer to remaining string
;	  0879	         .ILEN = ..ILEN - (..OLEN + 1); ! Fix up remaining length of string
;	  0880	         return $true;
;	  0881	         end;
;	  0882	
;	  0883	    end;				! End of PARSE_ACCESS_CONTROL



000006						.PSECT	$PLIT$,  RO ,  D  
000006	   040     000 			P.AAD:	.ASCII	/ /<00>
000010	   011     000 			P.AAE:	.ASCII	<11><00>
000012	   042     000 			P.AAF:	.ASCII	/"/<00>


						.SBTTL	PARSE.ACCESS.CONTROL PARSE_ACCESS_CONTROL
001500						.PSECT	$CODE$,  RO 

000000	004167  000000G			PARSE.ACCESS.CONTROL:
						JSR	R1,$SAVE4			;					0826
000004	016602  000022 				MOV	22(SP),R2			; IPTR,*				0856
000010	005000 					CLR	R0				; CHR
000012	157200  000000 				BISB	@0(R2),R0			; *,CHR
000016	016604  000020 				MOV	20(SP),R4			; ILEN,*				0860
000022	020027  000040 			1$:	CMP	R0,#40				; CHR,*					0857
000026	001403 					BEQ	2$
000030	020027  000011 				CMP	R0,#11				; CHR,*
000034	001011 					BNE	3$
000036	005776  000020 			2$:	TST	@20(SP)				; ILEN
000042	003406 					BLE	3$
000044	005212 					INC	(R2)				;					0859
000046	005314 					DEC	(R4)				;					0860
000050	005000 					CLR	R0				; CHR					0861
000052	157200  000000 				BISB	@0(R2),R0			; *,CHR
000056	000761 					BR	1$				;					0857
000060	016603  000014 			3$:	MOV	14(SP),R3			; OLEN,*				0872
000064	005714 					TST	(R4)				;					0867
000066	003444 					BLE	4$
000070	011446 					MOV	(R4),-(SP)			;					0868
000072	011246 					MOV	(R2),-(SP)
000074	012746  000001 				MOV	#1,-(SP)
000100	012746  000006'				MOV	#P.AAD,-(SP)
000104	004767  000000G				JSR	PC,BL$FSB
000110	062706  000010 				ADD	#10,SP
000114	010001 					MOV	R0,R1				; *,PTR
000116	001033 					BNE	5$
000120	011446 					MOV	(R4),-(SP)			;					0869
000122	011246 					MOV	(R2),-(SP)
000124	012746  000001 				MOV	#1,-(SP)
000130	012746  000010'				MOV	#P.AAE,-(SP)
000134	004767  000000G				JSR	PC,BL$FSB
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  27
X03.09		PARSE_ACCESS_CONTROL				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (7)

000140	062706  000010 				ADD	#10,SP
000144	010001 					MOV	R0,R1				; *,PTR
000146	001017 					BNE	5$
000150	011446 					MOV	(R4),-(SP)			;					0870
000152	011246 					MOV	(R2),-(SP)
000154	012746  000001 				MOV	#1,-(SP)
000160	012746  000012'				MOV	#P.AAF,-(SP)
000164	004767  000000G				JSR	PC,BL$FSB
000170	062706  000010 				ADD	#10,SP
000174	010001 					MOV	R0,R1				; *,PTR
000176	001003 					BNE	5$
000200	005013 				4$:	CLR	(R3)				;					0872
000202	005000 					CLR	R0				;					0867
000204	000207 					RTS	PC
000206	010100 				5$:	MOV	R1,R0				; PTR,*					0876
000210	161200 					SUB	(R2),R0
000212	010013 					MOV	R0,(R3)
000214	011276  000016 				MOV	(R2),@16(SP)			; *,OPTR				0877
000220	010112 					MOV	R1,(R2)				; PTR,*					0878
000222	005212 					INC	(R2)
000224	011400 					MOV	(R4),R0				;					0879
000226	161300 					SUB	(R3),R0
000230	010014 					MOV	R0,(R4)
000232	005314 					DEC	(R4)
000234	012700  000001 				MOV	#1,R0				;					0867
000240	000207 					RTS	PC				;					0826
; Routine Size:  81 words,	Routine Base:  $CODE$ + 1500
; Maximum stack depth per invocation:  10 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  28
X03.09		PARSE_ACCESS_CONTROL				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (8)

;	  0884	
;	  0885	%global_routine ('NMU$FILE_READ', FILE_ID, DEST_PTR, DEST_COUNT, RSP_PTR) =
;	  0886	
;	  0887	!++
;	  0888	! Functional description:
;	  0889	!
;	  0890	!        This routine reads a byte stream, of maximum length specified
;	  0891	!        by caller, from a file into callers buffer. The actual number
;	  0892	!        of bytes read is returned to caller.
;	  0893	!
;	  0894	! Formal parameters:
;	  0895	!
;	  0896	!       .FILE_ID      File identifier
;	  0897	!       .DEST_PTR     Pointer to buffer to receive the file data
;	  0898	!       .DEST_COUNT   Number of bytes to read into buffer
;	  0899	!       .RSP_PTR      Pointer to NICE response buffer
;	  0900	!
;	  0901	! Implicit inputs: none
;	  0902	!
;	  0903	! Routine value:
;	  0904	!
;	  0905	!        gtr 0    Error occured while reading file
;	  0906	!        eql 0    End of file encountered
;	  0907	!        lss 0    Number of bytes actually read from file
;	  0908	!
;	  0909	! Side effects: none
;	  0910	!
;	  0911	!--
;	  0912	
;	  0913	    begin
;	  0914	
;	  0915	    local
;	  0916	         FILE : ref FILE_DATA_BLOCK,
;	  0917	         XFR_COUNT;
;	  0918	
;	P 0919	    %debug (FILE_TRACE,
;	P 0920	            (TRACE_INFO ('File id %O read request for %D bytes',
;	P 0921	                         .FILE_ID,
;	  0922	                         .DEST_COUNT)));
;	  0923	
;	  0924	    !
;	  0925	    ! Initialize the count of bytes to be transferred on this read.
;	  0926	    !
;	  0927	
;	  0928	    XFR_COUNT = .DEST_COUNT;
;	  0929	
;	  0930	    !
;	  0931	    ! Setup pointer to file data base
;	  0932	    !
;	  0933	
;	  0934	    if (FILE = FIND_FILE_DATA_BLOCK (.FILE_ID, .RSP_PTR)) eql 0
;	  0935	    then
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  29
X03.09		NMU$FILE_READ as UF_READ			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (8)

;	  0936	        return -1 ;
;	  0937	
;	  0938	    !
;	  0939	    ! Set pointer to response buffer in file data block.
;	  0940	    !
;	  0941	
;	  0942	    FILE [FD_RESPONSE] = .RSP_PTR;
;	  0943	
;	  0944	    !
;	  0945	    ! Set up and maintain the address of the current BD block
;	  0946	    ! for the file.
;	  0947	    !
;	  0948	
;	  0949	    begin                               ! bind BUFFER context
;	  0950	    bind
;	  0951	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK ;
;	  0952	
;	  0953	
;	  0954	    !
;	  0955	    ! Check if buffer needs to be filled with data before
;	  0956	    ! transfer can take place.
;	  0957	    !
;	  0958	
;	  0959	    if .FILE [FD_SEEK_DONE] or not .BUFFER [BD_VALID] 
;	  0960	    then
;	  0961	        begin
;	  0962	        if not READ_FILE (.FILE)
;	  0963	        then
;	  0964	            return -1;
;	  0965	        end;
;	  0966	
;	  0967	    !
;	  0968	    ! Transfer the specified number of bytes
;	  0969	    !
;	  0970	
;	  0971	    while .XFR_COUNT gtr 0
;	  0972	    do
;	  0973	      begin
;	  0974	
;	  0975	      !
;	  0976	      ! If no more bytes to be read from current buffer and the buffer
;	  0977	      ! has been written into then write the buffer out.
;	  0978	      ! If at EOF exit now, else read more data from file to
;	  0979	      ! fill buffer.
;	  0980	      !
;	  0981	
;	  0982	      if .BUFFER [BD_REMAINING_COUNT] leq 0
;	  0983	      then
;	  0984	          begin
;	  0985	          if .BUFFER [BD_CHANGED]
;	  0986	          then
;	  0987	              begin
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  30
X03.09		NMU$FILE_READ as UF_READ			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (8)

;	  0988	              if not WRITE_FILE (.FILE)
;	  0989	              then
;	  0990	                  return -1;
;	  0991	              end;
;	  0992	
;	  0993	          if .BUFFER [BD_END_OF_FILE]
;	  0994	          then
;	  0995	              exitloop;
;	  0996	
;	  0997	          if not READ_FILE (.FILE)
;	  0998	          then
;	  0999	              return -1;
;	  1000	
;	  1001	          end;
;	  1002	
;	  1003	      begin                             ! bind BUFFER context
;	  1004	      bind
;	  1005	          BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK ;
;	  1006	
;	  1007	      local
;	  1008	           MOVE_COUNT;
;	  1009	
;	  1010	      !
;	  1011	      ! BUFFER must be bound each time through the loop since the
;	  1012	      ! current buffer data block pointed to by the file data block
;	  1013	      ! may get changed.
;	  1014	      !
;	  1015	
;	  1016	      MOVE_COUNT = min (.XFR_COUNT, .BUFFER [BD_REMAINING_COUNT]);
;	  1017	
;	P 1018	      %debug (FILE_TRACE,
;	P 1019	              (TRACE_INFO ('Moving %D bytes to user buffer from buffer position %D',
;	  1020	                           .MOVE_COUNT, .BUFFER [BD_CURRENT_POSITION])));
;	  1021	
;	P 1022	      %debug ((FILE_TRACE and FILE_DATA_TRACE),
;	P 1023	              (FORMAT_BUFFER ('User buffer data',,
;	  1024	                              0, .BUFFER [BD_POINTER], .MOVE_COUNT)));
;	  1025	
;	  1026	      DEST_PTR = ch$move (.MOVE_COUNT,
;	  1027	                          .BUFFER [BD_POINTER],
;	  1028	                          .DEST_PTR);
;	  1029	
;	  1030	      BUFFER [BD_REMAINING_COUNT] = .BUFFER [BD_REMAINING_COUNT] - .MOVE_COUNT;
;	  1031	      BUFFER [BD_POINTER] = ch$plus (.BUFFER [BD_POINTER], .MOVE_COUNT);
;	  1032	      BUFFER [BD_CURRENT_POSITION] = .MOVE_COUNT;
;	  1033	      %ADDI32 (.MOVE_COUNT , FILE [FD_CURRENT_POSITION]);
;	  1034	      XFR_COUNT = .XFR_COUNT - .MOVE_COUNT;
;	  1035	
;	P 1036	      %debug (FILE_TRACE,
;	P 1037	              (TRACE_INFO ('%D bytes remaining in buffer',
;	  1038	                           .BUFFER [BD_REMAINING_COUNT])));
;	  1039	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  31
X03.09		NMU$FILE_READ as UF_READ			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (8)

;	  1040	      end;                              ! bind BUFFER context
;	  1041	
;	  1042	      end;
;	  1043	
;	  1044	    end;                                ! bind BUFFER context
;	  1045	
;	  1046	    !
;	  1047	    ! Return the count of bytes read.
;	  1048	    !
;	  1049	
;	  1050	    return .DEST_COUNT - .XFR_COUNT;
;	  1051	
;	  1052	    end;				! End of NMU$FILE_READ


						.GLOBL	$ADD32


						.SBTTL	UF.READ NMU$FILE_READ as UF_READ
000000	004167  000000G			UF.READ::
						JSR	R1,$SAVE5			;					0885
000004	162706  000010 				SUB	#10,SP
000010	016605  000030 				MOV	30(SP),R5			; DEST.COUNT,XFR.COUNT			0928
000014	016646  000034 				MOV	34(SP),-(SP)			; FILE.ID,*				0934
000020	016646  000030 				MOV	30(SP),-(SP)			; RSP.PTR,*
000024	004767  000000V				JSR	PC,FIND.FILE.DATA.BLOCK
000030	022626 					CMP	(SP)+,(SP)+
000032	010004 					MOV	R0,R4				; *,FILE
000034	001467 					BEQ	5$				;					0936
000036	016664  000026  000010 			MOV	26(SP),10(R4)			; RSP.PTR,*(FILE)			0942
000044	012716  000026 				MOV	#26,(SP)			;					0951
000050	060416 					ADD	R4,(SP)				; FILE,*
000052	032764  001000  000030 			BIT	#1000,30(R4)			; *,*(FILE)				0959
000060	001006 					BNE	1$
000062	017600  000000 				MOV	@0(SP),R0
000066	132760  000002  000034 			BITB	#2,34(R0)
000074	001006 					BNE	2$
000076	010446 				1$:	MOV	R4,-(SP)			; FILE,*				0962
000100	004767  000000V				JSR	PC,READ.FILE
000104	005726 					TST	(SP)+
000106	006000 					ROR	R0
000110	103041 					BHIS	5$				;					0964
000112	010466  000002 			2$:	MOV	R4,2(SP)			; FILE,*				1033
000116	062766  000012  000002 			ADD	#12,2(SP)
000124	005705 				3$:	TST	R5				; XFR.COUNT				0971
000126	003510 					BLE	8$
000130	017600  000000 				MOV	@0(SP),R0			;					0982
000134	005760  000030 				TST	30(R0)
000140	003030 					BGT	6$
000142	010001 					MOV	R0,R1				;					0985
000144	132761  000001  000034 			BITB	#1,34(R1)
000152	001406 					BEQ	4$
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  32
X03.09		NMU$FILE_READ as UF_READ			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (8)

000154	010446 					MOV	R4,-(SP)			; FILE,*				0988
000156	004767  000000V				JSR	PC,WRITE.FILE
000162	005726 					TST	(SP)+
000164	006000 					ROR	R0
000166	103012 					BHIS	5$				;					0990
000170	132761  000004  000034 		4$:	BITB	#4,34(R1)			;					0993
000176	001064 					BNE	8$				;					0995
000200	010446 					MOV	R4,-(SP)			; FILE,*				0997
000202	004767  000000V				JSR	PC,READ.FILE
000206	005726 					TST	(SP)+
000210	006000 					ROR	R0
000212	103403 					BLO	6$
000214	012700  177777 			5$:	MOV	#-1,R0				;					0999
000220	000456 					BR	9$
000222	017601  000000 			6$:	MOV	@0(SP),R1			;					1016
000226	010500 					MOV	R5,R0				; XFR.COUNT,*
000230	020061  000030 				CMP	R0,30(R1)
000234	003402 					BLE	7$
000236	016100  000030 				MOV	30(R1),R0
000242	010003 				7$:	MOV	R0,R3				; *,MOVE.COUNT
000244	010346 					MOV	R3,-(SP)			; MOVE.COUNT,*				1028
000246	017602  000002 				MOV	@2(SP),R2			;					1027
000252	016246  000024 				MOV	24(R2),-(SP)			;					1028
000256	016646  000036 				MOV	36(SP),-(SP)			; DEST.PTR,*
000262	004767  000000G				JSR	PC,BL$MOV
000266	010066  000040 				MOV	R0,40(SP)			; *,DEST.PTR				1026
000272	160361  000030 				SUB	R3,30(R1)			; MOVE.COUNT,*				1030
000276	060362  000024 				ADD	R3,24(R2)			; MOVE.COUNT,*				1031
000302	017600  000006 				MOV	@6(SP),R0			;					1032
000306	010360  000022 				MOV	R3,22(R0)			; MOVE.COUNT,*
000312	010366  000012 				MOV	R3,12(SP)			; MOVE.COUNT,$$MOVI32.TARGET		1033
000316	005066  000014 				CLR	14(SP)				; $$MOVI32.TARGET+2
000322	012700  000012 				MOV	#12,R0
000326	060600 					ADD	SP,R0				; $$ADDI32.C,*
000330	016601  000010 				MOV	10(SP),R1
000334	004767  000000G				JSR	PC,$ADD32
000340	160305 					SUB	R3,R5				; MOVE.COUNT,XFR.COUNT			1034
000342	062706  000006 				ADD	#6,SP				;					0973
000346	000666 					BR	3$				;					0971
000350	016600  000030 			8$:	MOV	30(SP),R0			; DEST.COUNT,*				1050
000354	160500 					SUB	R5,R0				; XFR.COUNT,*
000356	062706  000010 			9$:	ADD	#10,SP				;					0885
000362	000207 					RTS	PC
; Routine Size:  122 words,	Routine Base:  $CODE$ + 1742
; Maximum stack depth per invocation:  14 words


;	  1053	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  33
X03.09		NMU$FILE_READ as UF_READ			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (9)

;	  1054	
;	  1055	%global_routine ('NMU$FILE_WRITE', FILE_ID, SOURCE_PTR, WRITE_COUNT, RSP_PTR) =
;	  1056	
;	  1057	!++
;	  1058	! Functional description:
;	  1059	!
;	  1060	!	Writes a byte stream, of length specified by caller, into a file.
;	  1061	!
;	  1062	! Formal parameters:
;	  1063	!
;	  1064	!	.FILE_ID       File identifier
;	  1065	!       .WRITE_COUNT   Number of bytes to write to the file
;	  1066	!       .SOURCE_PTR    Pointer to byte string to be written to file
;	  1067	!       .RSP_PTR       Pointer to NICE response buffer
;	  1068	!
;	  1069	! Implicit inputs: none
;	  1070	!
;	  1071	! Routine value:
;	  1072	!
;	  1073	!	$true    if data was written successfully to file
;	  1074	!       $false   otherwise
;	  1075	!
;	  1076	! Side effects: none
;	  1077	!
;	  1078	!--
;	  1079	
;	  1080	    begin
;	  1081	
;	  1082	    local
;	  1083	         FILE : ref FILE_DATA_BLOCK,
;	  1084	         XFR_COUNT,
;	  1085	         SETUP_NEEDED;
;	  1086	
;	P 1087	    %debug (FILE_TRACE,
;	P 1088	            (TRACE_INFO ('Write request on file id %O, %D bytes',
;	P 1089	                         .FILE_ID,
;	  1090	                         .WRITE_COUNT)));
;	  1091	
;	  1092	    !
;	  1093	    ! Setup pointer to file data base
;	  1094	    !
;	  1095	
;	  1096	    if (FILE = FIND_FILE_DATA_BLOCK (.FILE_ID, .RSP_PTR)) eql 0
;	  1097	    then return $false;
;	  1098	
;	  1099	    !
;	  1100	    ! Set pointer to response buffer in file data block.
;	  1101	    ! Initialize the count of bytes to be transferred on this write.
;	  1102	    !
;	  1103	
;	  1104	    XFR_COUNT = .WRITE_COUNT;
;	  1105	    FILE [FD_RESPONSE] = .RSP_PTR;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  34
X03.09		NMU$FILE_WRITE as UF_WRITE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (10)

;	  1106	
;	  1107	    begin                               ! bind BUFFER context
;	  1108	    bind
;	  1109	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK ;
;	  1110	
;	  1111	    if .BUFFER [BD_VALID]
;	  1112	    then
;	  1113	        begin
;	P 1114	        %debug (FILE_TRACE,
;	  1115	                (TRACE_INFO ('Buffer valid')));
;	  1116	
;	  1117	        if .FILE [FD_SEEK_DONE]
;	  1118	        then
;	  1119	            begin
;	  1120	            FILE [FD_SEEK_DONE] = $false;
;	  1121	            SETUP_NEEDED = $true;
;	  1122	
;	  1123	            if (%CMP32 (FILE [FD_CURRENT_POSITION] , lss , BUFFER [BD_FILE_POSITION]))
;	  1124	               or
;	  1125	               (%CMP32 (FILE [FD_CURRENT_POSITION] , gtr , BUFFER [BD_MAX_POSITION]))
;	  1126	            then
;	  1127	                begin
;	P 1128	                %debug (FILE_TRACE,
;	  1129	                        (TRACE_INFO ('File seek moved pointer out of current buffer')));
;	  1130	                if not WRITE_FILE (.FILE)
;	  1131	                then return $false;
;	  1132	                end
;	  1133	            else
;	  1134	                begin
;	P 1135	                %debug (FILE_TRACE,
;	  1136	                        (TRACE_INFO ('File seek done within current buffer bounds')));
;	  1137	                0
;	  1138	                end
;	  1139	            end
;	  1140	        else
;	  1141	            SETUP_NEEDED = $false;
;	  1142	        end
;	  1143	    else
;	  1144	        begin
;	P 1145	        %debug (FILE_TRACE,
;	  1146	                (TRACE_INFO ('Buffer invalid')));
;	  1147	        SETUP_NEEDED = $true;
;	  1148	        end;
;	  1149	
;	  1150	    if .SETUP_NEEDED
;	  1151	    then SETUP_WRITE_BUFFER (.FILE);
;	  1152	
;	  1153	    end;                                ! End of bind BUFFER context
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  35
X03.09		NMU$FILE_WRITE as UF_WRITE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (11)

;	  1154	
;	  1155	    !
;	  1156	    ! Transfer the specified number of bytes into the buffer.
;	  1157	    !
;	  1158	
;	  1159	    while .XFR_COUNT gtr 0
;	  1160	    do
;	  1161	      begin
;	  1162	      bind
;	  1163	          BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK ;
;	  1164	
;	  1165	      local
;	  1166	           MOVE_COUNT;
;	  1167	
;	  1168	      !
;	  1169	      ! BUFFER must be bound each time through the loop since the
;	  1170	      ! current buffer data block pointed to by the file data block
;	  1171	      ! may get changed.
;	  1172	      !
;	  1173	
;	  1174	      MOVE_COUNT = min (.XFR_COUNT, .BUFFER [BD_REMAINING_COUNT]);
;	  1175	
;	P 1176	      %debug (FILE_TRACE,
;	P 1177	              (TRACE_INFO ('Moving %D bytes from user buffer to buffer position %D',
;	  1178	                           .MOVE_COUNT, .BUFFER [BD_CURRENT_POSITION])));
;	  1179	
;	P 1180	      %debug ((FILE_TRACE and FILE_DATA_TRACE),
;	P 1181	              (FORMAT_BUFFER ('User buffer data',,
;	  1182	                              0, .SOURCE_PTR, .MOVE_COUNT)));
;	  1183	
;	  1184	      BUFFER [BD_POINTER] = ch$move (.MOVE_COUNT,
;	  1185	                                     .SOURCE_PTR,
;	  1186	                                     .BUFFER [BD_POINTER]);
;	  1187	      SOURCE_PTR = ch$plus (.SOURCE_PTR, .MOVE_COUNT);
;	  1188	      XFR_COUNT = .XFR_COUNT - .MOVE_COUNT ;
;	  1189	
;	  1190	      BUFFER [BD_CURRENT_POSITION] = .MOVE_COUNT;
;	  1191	
;	  1192	      BUFFER [BD_DATA_COUNT] = .BUFFER [BD_DATA_COUNT] + .MOVE_COUNT;
;	  1193	      BUFFER [BD_REMAINING_COUNT] = .BUFFER [BD_REMAINING_COUNT] - .MOVE_COUNT;
;	  1194	      BUFFER [BD_CHANGED_COUNT] = .BUFFER [BD_CHANGED_COUNT] + .MOVE_COUNT;
;	  1195	      BUFFER [BD_CHANGED] = $true;
;	  1196	
;	P 1197	      %debug (FILE_TRACE,
;	P 1198	              (TRACE_INFO ('%D bytes remaining in buffer',
;	  1199	                           .BUFFER [BD_REMAINING_COUNT])));
;	  1200	
;	  1201	      %ADDI32 (.MOVE_COUNT , FILE [FD_CURRENT_POSITION]);
;	  1202	
;	  1203	      !
;	  1204	      ! If no more bytes can be written into this buffer
;	  1205	      ! write this buffer out.
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  36
X03.09		NMU$FILE_WRITE as UF_WRITE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (11)

;	  1206	      !
;	  1207	
;	  1208	      if .BUFFER [BD_REMAINING_COUNT] leq 0
;	  1209	      then
;	  1210	          begin
;	  1211	          if not WRITE_FILE (.FILE)
;	  1212	          then return $false;
;	  1213	
;	  1214	          SETUP_WRITE_BUFFER (.FILE);
;	  1215	          end;
;	  1216	
;	  1217	      end;
;	  1218	
;	  1219	    return $true
;	  1220	
;	  1221	    end;				! End of NMU$FILE_WRITE


						.GLOBL	$SUB32, $SGN32


						.SBTTL	UF.WRITE NMU$FILE_WRITE as UF_WRITE
000000	004167  000000G			UF.WRITE::
						JSR	R1,$SAVE5			;					1055
000004	162706  000006 				SUB	#6,SP
000010	016646  000032 				MOV	32(SP),-(SP)			; FILE.ID,*				1096
000014	016646  000026 				MOV	26(SP),-(SP)			; RSP.PTR,*
000020	004767  000000V				JSR	PC,FIND.FILE.DATA.BLOCK
000024	022626 					CMP	(SP)+,(SP)+
000026	010005 					MOV	R0,R5				; *,FILE
000030	001505 					BEQ	2$				;					1097
000032	016616  000026 				MOV	26(SP),(SP)			; WRITE.COUNT,XFR.COUNT			1104
000036	016665  000024  000010 			MOV	24(SP),10(R5)			; RSP.PTR,*(FILE)			1105
000044	016502  000026 				MOV	26(R5),R2			; *(FILE),*				1111
000050	132762  000002  000034 			BITB	#2,34(R2)
000056	001475 					BEQ	4$
000060	032765  001000  000030 			BIT	#1000,30(R5)			; *,*(FILE)				1117
000066	001467 					BEQ	3$
000070	042765  001000  000030 			BIC	#1000,30(R5)			; *,*(FILE)				1120
000076	012703  000001 				MOV	#1,R3				; *,SETUP.NEEDED			1121
000102	012704  000012 				MOV	#12,R4				;					1123
000106	060504 					ADD	R5,R4				; FILE,*
000110	011466  000002 				MOV	(R4),2(SP)			; *,$$MOV32.TARGET
000114	016466  000002  000004 			MOV	2(R4),4(SP)			; *,$$MOV32.TARGET+2
000122	012700  000010 				MOV	#10,R0
000126	060200 					ADD	R2,R0
000130	012701  000002 				MOV	#2,R1
000134	060601 					ADD	SP,R1				; $$CMP32.C,*
000136	004767  000000G				JSR	PC,$SUB32
000142	012701  000002 				MOV	#2,R1
000146	060601 					ADD	SP,R1				; $$CMP32.C,*
000150	004767  000000G				JSR	PC,$SGN32
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  37
X03.09		NMU$FILE_WRITE as UF_WRITE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (11)

000154	005700 					TST	R0
000156	002424 					BLT	1$
000160	011466  000002 				MOV	(R4),2(SP)			; *,$$MOV32.TARGET			1125
000164	016466  000002  000004 			MOV	2(R4),4(SP)			; *,$$MOV32.TARGET+2
000172	012700  000014 				MOV	#14,R0
000176	060200 					ADD	R2,R0
000200	012701  000002 				MOV	#2,R1
000204	060601 					ADD	SP,R1				; $$CMP32.C,*
000206	004767  000000G				JSR	PC,$SUB32
000212	012701  000002 				MOV	#2,R1
000216	060601 					ADD	SP,R1				; $$CMP32.C,*
000220	004767  000000G				JSR	PC,$SGN32
000224	005700 					TST	R0
000226	003413 					BLE	5$
000230	010546 				1$:	MOV	R5,-(SP)			; FILE,*				1130
000232	004767  000000V				JSR	PC,WRITE.FILE
000236	005726 					TST	(SP)+
000240	006000 					ROR	R0
000242	103405 					BLO	5$
000244	000514 				2$:	BR	12$				;					1131
000246	005003 				3$:	CLR	R3				; SETUP.NEEDED				1141
000250	000402 					BR	5$				;					1111
000252	012703  000001 			4$:	MOV	#1,R3				; *,SETUP.NEEDED			1147
000256	006003 				5$:	ROR	R3				; SETUP.NEEDED				1150
000260	103004 					BCC	6$
000262	010546 					MOV	R5,-(SP)			; FILE,*				1151
000264	004767  000000V				JSR	PC,SETUP.WRITE.BUFFER
000270	005726 					TST	(SP)+
000272	010501 				6$:	MOV	R5,R1				; FILE,*				1201
000274	062701  000012 				ADD	#12,R1
000300	005716 				7$:	TST	(SP)				; XFR.COUNT				1159
000302	003472 					BLE	11$
000304	016502  000026 				MOV	26(R5),R2			; *(FILE),*				1174
000310	012703  000030 				MOV	#30,R3
000314	060203 					ADD	R2,R3
000316	011600 					MOV	(SP),R0				; XFR.COUNT,*
000320	020013 					CMP	R0,(R3)
000322	003401 					BLE	8$
000324	011300 					MOV	(R3),R0
000326	010004 				8$:	MOV	R0,R4				; *,MOVE.COUNT
000330	010446 					MOV	R4,-(SP)			; MOVE.COUNT,*				1186
000332	016646  000032 				MOV	32(SP),-(SP)			; SOURCE.PTR,*
000336	016246  000024 				MOV	24(R2),-(SP)
000342	004767  000000G				JSR	PC,BL$MOV
000346	010062  000024 				MOV	R0,24(R2)			;					1184
000352	060466  000036 				ADD	R4,36(SP)			; MOVE.COUNT,SOURCE.PTR			1187
000356	160466  000006 				SUB	R4,6(SP)			; MOVE.COUNT,XFR.COUNT			1188
000362	010462  000022 				MOV	R4,22(R2)			; MOVE.COUNT,*				1190
000366	060462  000026 				ADD	R4,26(R2)			; MOVE.COUNT,*				1192
000372	160413 					SUB	R4,(R3)				; MOVE.COUNT,*				1193
000374	060462  000032 				ADD	R4,32(R2)			; MOVE.COUNT,*				1194
000400	152762  000001  000034 			BISB	#1,34(R2)			;					1195
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  38
X03.09		NMU$FILE_WRITE as UF_WRITE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (11)

000406	010466  000010 				MOV	R4,10(SP)			; MOVE.COUNT,$$MOVI32.TARGET		1201
000412	005066  000012 				CLR	12(SP)				; $$MOVI32.TARGET+2
000416	012700  000010 				MOV	#10,R0
000422	060600 					ADD	SP,R0				; $$ADDI32.C,*
000424	004767  000000G				JSR	PC,$ADD32
000430	005713 					TST	(R3)				;					1208
000432	003013 					BGT	10$
000434	010516 					MOV	R5,(SP)				; FILE,*				1211
000436	004767  000000V				JSR	PC,WRITE.FILE
000442	006000 					ROR	R0
000444	103403 					BLO	9$
000446	062706  000006 				ADD	#6,SP				;					1212
000452	000411 					BR	12$
000454	010516 				9$:	MOV	R5,(SP)				; FILE,*				1214
000456	004767  000000V				JSR	PC,SETUP.WRITE.BUFFER
000462	062706  000006 			10$:	ADD	#6,SP				;					1161
000466	000704 					BR	7$				;					1159
000470	012700  000001 			11$:	MOV	#1,R0				;					1080
000474	000401 					BR	13$
000476	005000 				12$:	CLR	R0				;					1055
000500	062706  000006 			13$:	ADD	#6,SP
000504	000207 					RTS	PC
; Routine Size:  163 words,	Routine Base:  $CODE$ + 2326
; Maximum stack depth per invocation:  13 words


;	  1222	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  39
X03.09		NMU$FILE_WRITE as UF_WRITE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (12)

;	  1223	
;	  1224	%routine ('SETUP_WRITE_BUFFER', FILE : ref FILE_DATA_BLOCK) : novalue =
;	  1225	
;	  1226	!++
;	  1227	! Functional description:
;	  1228	!
;	  1229	! Formal parameters:
;	  1230	!
;	  1231	!       .FILE    Address of file data block
;	  1232	!
;	  1233	! Implicit inputs: none
;	  1234	!
;	  1235	! Routine value: none
;	  1236	!
;	  1237	! Side effects: none
;	  1238	!
;	  1239	!--
;	  1240	    begin
;	  1241	
;	  1242	    local
;	  1243	         TEMP32 : THIRTY_TWO_BIT;
;	  1244	
;	  1245	    bind
;	  1246	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK,
;	  1247	        BYTE_SIZE = %if $MCB %then 8 %else .FILE [FD_BYTE_SIZE] %fi ;
;	  1248	
;	  1249	    !
;	  1250	    ! Define limits of buffer with respect to location in the file.
;	  1251	    !
;	  1252	
;	  1253	    %MOV32 (FILE [FD_FILE_POSITION] , BUFFER [BD_FILE_POSITION]);
;	  1254	    %MOV32 (BUFFER [BD_FILE_POSITION] , BUFFER [BD_MAX_POSITION]);
;	  1255	    %ADDI32 ((.BUFFER [BD_LENGTH] - .BUFFER [BD_BIAS] - 1) , BUFFER [BD_MAX_POSITION]);
;	  1256	
;	C 1257	%(
;	C 1258	    BUFFER [BD_MAX_POSITION] = .BUFFER [BD_FILE_POSITION] +
;	C 1259	                               .BUFFER [BD_LENGTH] -
;	C 1260	                               .BUFFER [BD_BIAS] - 1;
;	  1261	)%
;	  1262	
;	  1263	    !
;	  1264	    ! Define pointers into buffer, taking into account the fact
;	  1265	    ! that a seek may have been done (data transfer does not start
;	  1266	    ! at the beginning of the buffer).
;	  1267	    !
;	  1268	
;	  1269	    %MOV32 (BUFFER [BD_FILE_POSITION] , TEMP32);
;	  1270	    %SUB32 (FILE [FD_CURRENT_POSITION] , TEMP32);
;	  1271	    %MOVF32 (TEMP32 , BUFFER [BD_DATA_COUNT]);
;	C 1272	%( N.B. - Old code
;	C 1273	    BUFFER [BD_DATA_COUNT] = .FILE [FD_CURRENT_POSITION] -
;	C 1274	                             .BUFFER [BD_FILE_POSITION];
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  40
X03.09		SETUP_WRITE_BUFFER				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (12)

;	  1275	)%
;	  1276	    BUFFER [BD_CURRENT_POSITION] = .BUFFER [BD_DATA_COUNT];
;	  1277	    BUFFER [BD_REMAINING_COUNT] = .BUFFER [BD_LENGTH] -
;	  1278	                                  .BUFFER [BD_DATA_COUNT] -
;	  1279	                                  .BUFFER [BD_BIAS];
;	  1280	    BUFFER [BD_POINTER] = ch$ptr (.BUFFER [BD_ADDRESS],
;	  1281	                                  .BUFFER [BD_CURRENT_POSITION] + .BUFFER [BD_BIAS],
;	  1282	                                  BYTE_SIZE);
;	  1283	
;	  1284	    !
;	  1285	    ! Indicate no changes have been made, the pointers into the
;	  1286	    ! buffer are now valid and point to the end of the file.
;	  1287	    !
;	  1288	
;	  1289	    BUFFER [BD_CHANGED_COUNT] = 0;
;	  1290	    BUFFER [BD_VALID] = $true;
;	  1291	    BUFFER [BD_CHANGED] = $false;
;	  1292	    BUFFER [BD_END_OF_FILE] = $true;
;	  1293	
;	P 1294	    %debug (FILE_TRACE,
;	  1295	            (TRACE_INFO ('Buffer validated')));
;	  1296	
;	  1297	    end;                                ! End of SETUP_WRITE_BUFFER


	000010 				BYTE.SIZE=	    10


						.SBTTL	SETUP.WRITE.BUFFER SETUP_WRITE_BUFFER
000000	004167  000000G			SETUP.WRITE.BUFFER:
						JSR	R1,$SAVE5			;					1224
000004	162706  000006 				SUB	#6,SP
000010	016602  000024 				MOV	24(SP),R2			; FILE,*				1246
000014	016203  000026 				MOV	26(R2),R3			;					1253
000020	012705  000010 				MOV	#10,R5
000024	060305 					ADD	R3,R5
000026	016215  000016 				MOV	16(R2),(R5)
000032	016265  000020  000002 			MOV	20(R2),2(R5)
000040	012701  000014 				MOV	#14,R1				;					1254
000044	060301 					ADD	R3,R1
000046	011511 					MOV	(R5),(R1)
000050	016561  000002  000002 			MOV	2(R5),2(R1)
000056	012704  000020 				MOV	#20,R4				;					1255
000062	060304 					ADD	R3,R4
000064	016300  000004 				MOV	4(R3),R0
000070	161400 					SUB	(R4),R0
000072	010046 					MOV	R0,-(SP)			; *,$$MOVI32.TARGET
000074	005316 					DEC	(SP)				; $$MOVI32.TARGET
000076	005066  000002 				CLR	2(SP)				; $$MOVI32.TARGET+2
000102	010600 					MOV	SP,R0				; $$ADDI32.C,*
000104	004767  000000G				JSR	PC,$ADD32
000110	011566  000004 				MOV	(R5),4(SP)			; *,$$MOV32.TARGET			1269
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  41
X03.09		SETUP_WRITE_BUFFER				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (12)

000114	016566  000002  000006 			MOV	2(R5),6(SP)			; *,$$MOV32.TARGET+2
000122	062702  000012 				ADD	#12,R2				;					1270
000126	012701  000004 				MOV	#4,R1
000132	060601 					ADD	SP,R1				; TEMP32,*
000134	010200 					MOV	R2,R0
000136	004767  000000G				JSR	PC,$SUB32
000142	012701  000026 				MOV	#26,R1				;					1271
000146	060301 					ADD	R3,R1
000150	016611  000004 				MOV	4(SP),(R1)			; $$MOVF32.SOURCE,*
000154	011163  000022 				MOV	(R1),22(R3)			;					1276
000160	016300  000004 				MOV	4(R3),R0			;					1277
000164	161100 					SUB	(R1),R0
000166	161400 					SUB	(R4),R0				;					1278
000170	010063  000030 				MOV	R0,30(R3)			;					1277
000174	011100 					MOV	(R1),R0				;					1281
000176	061400 					ADD	(R4),R0
000200	066300  000002 				ADD	2(R3),R0			;					1282
000204	010063  000024 				MOV	R0,24(R3)			;					1280
000210	005063  000032 				CLR	32(R3)				;					1289
000214	012700  000034 				MOV	#34,R0				;					1290
000220	060300 					ADD	R3,R0
000222	142710  000001 				BICB	#1,(R0)				;					1291
000226	152710  000006 				BISB	#6,(R0)				;					1292
000232	062706  000010 				ADD	#10,SP				;					1224
000236	000207 					RTS	PC
; Routine Size:  80 words,	Routine Base:  $CODE$ + 3034
; Maximum stack depth per invocation:  11 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  42
X03.09		SETUP_WRITE_BUFFER				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (13)

;	  1298	
;	  1299	%global_routine ('NMU$FILE_SEEK', FILE_ID, BYTE_POSITION, RSP_PTR) =
;	  1300	
;	  1301	!++
;	  1302	! Functional description:
;	  1303	!
;	  1304	!	Sets the current position within a file to an arbitrary
;	  1305	!       byte position. Subsequent reads or writes will begin at
;	  1306	!       the new byte position within the file.
;	  1307	!
;	  1308	! Formal parameters:
;	  1309	!
;	  1310	!	.FILE_ID         File identifier
;	  1311	!	.BYTE_POSITION   The byte offset at which the file is to positioned
;	  1312	!
;	  1313	! Implicit inputs: none
;	  1314	!
;	  1315	! Routine value:
;	  1316	!
;	  1317	!	$true     File positioned successfully
;	  1318	!       $false    Invalid ID or failure during seek
;	  1319	!
;	  1320	! Side effects: none
;	  1321	!
;	  1322	!--
;	  1323	
;	  1324	    begin
;	  1325	    local
;	  1326	         FILE : ref FILE_DATA_BLOCK;
;	  1327	
;	P 1328	    %debug (FILE_TRACE,
;	P 1329	            (TRACE_INFO ('File id %O seek request to byte position %D',
;	P 1330	                         .FILE_ID,
;	  1331	                         .BYTE_POSITION)));
;	  1332	
;	  1333	    !
;	  1334	    ! Setup pointer to file data base
;	  1335	    !
;	  1336	
;	  1337	    if (FILE = FIND_FILE_DATA_BLOCK (.FILE_ID, .RSP_PTR)) eql 0
;	  1338	    then
;	  1339	        return $false;
;	  1340	
;	  1341	    !
;	  1342	    ! Set pointer to response buffer in file data block.
;	  1343	    !
;	  1344	
;	  1345	    FILE [FD_RESPONSE] = .RSP_PTR;
;	  1346	
;	  1347	    !
;	  1348	    ! Ensure that the file is not positioned backwards if it
;	  1349	    ! is a remote file. DAP does not support it.
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  43
X03.09		NMU$FILE_SEEK as UF_SEEK			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (13)

;	  1350	    !
;	  1351	
;	  1352	    if (not .FILE [FD_LOCAL])
;	  1353	       and
;	  1354	       (%CMPI32 (FILE [FD_CURRENT_POSITION] , gtr , .BYTE_POSITION))
;	  1355	    then
;	  1356	        begin
;	P 1357	        $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FIO, .FILE [FD_TYPE],
;	  1358	                     'Illegal operation on remote file', 207);
;	  1359	        return $false
;	  1360	        end;
;	  1361	
;	  1362	    !
;	  1363	    ! Set current byte position within file.
;	  1364	    !
;	  1365	
;	  1366	    %MOVI32 (.BYTE_POSITION , FILE [FD_CURRENT_POSITION]);
;	  1367	    FILE [FD_SEEK_DONE] = $true;
;	  1368	
;	P 1369	    %debug (FILE_TRACE,
;	P 1370	            (local
;	P 1371	                  CP;
;	P 1372	             %MOVF32 (FILE [FD_CURRENT_POSITION] , CP);
;	P 1373	             TRACE_INFO ('File at byte position %D',
;	  1374	                         .CP)));
;	  1375	
;	  1376	    return $true
;	  1377	
;	  1378	    end;				! End of NMU$FILE_SEEK


						.SBTTL	UF.SEEK NMU$FILE_SEEK as UF_SEEK
000000	004167  000000G			UF.SEEK::
						JSR	R1,$SAVE3			;					1299
000004	024646 					CMP	-(SP),-(SP)
000006	016646  000022 				MOV	22(SP),-(SP)			; FILE.ID,*				1337
000012	016646  000020 				MOV	20(SP),-(SP)			; RSP.PTR,*
000016	004767  000000V				JSR	PC,FIND.FILE.DATA.BLOCK
000022	022626 					CMP	(SP)+,(SP)+
000024	010003 					MOV	R0,R3				; *,FILE
000026	001464 					BEQ	2$				;					1339
000030	016663  000016  000010 			MOV	16(SP),10(R3)			; RSP.PTR,*(FILE)			1345
000036	032763  000400  000030 			BIT	#400,30(R3)			; *,*(FILE)				1352
000044	001042 					BNE	1$
000046	016616  000020 				MOV	20(SP),(SP)			; BYTE.POSITION,$$MOVI32.TARGET		1354
000052	005066  000002 				CLR	2(SP)				; $$MOVI32.TARGET+2
000056	062700  000012 				ADD	#12,R0
000062	010601 					MOV	SP,R1				; $$CMPI32.C,*
000064	004767  000000G				JSR	PC,$SUB32
000070	010601 					MOV	SP,R1				; $$CMPI32.C,*
000072	004767  000000G				JSR	PC,$SGN32
000076	005700 					TST	R0
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  44
X03.09		NMU$FILE_SEEK as UF_SEEK			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (13)

000100	002024 					BGE	1$
000102	016300  000010 				MOV	10(R3),R0			; *(FILE),STRPTR			1358
000106	112720  000356 				MOVB	#356,(R0)+			; *,STRPTR
000112	005001 					CLR	R1				; DETAIL
000114	156301  000004 				BISB	4(R3),R1			; *(FILE),DETAIL
000120	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000122	010102 					MOV	R1,R2				; DETAIL,*
000124	000302 					SWAB	R2
000126	110220 					MOVB	R2,(R0)+			; *,STRPTR
000130	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000134	012701  000317 				MOV	#317,R1
000140	012702  000001 				MOV	#1,R2
000144	004767  000000G				JSR	PC,$CBDSG
000150	000413 					BR	2$				;					1356
000152	016663  000020  000012 		1$:	MOV	20(SP),12(R3)			; BYTE.POSITION,*(FILE)			1366
000160	005063  000014 				CLR	14(R3)				; *(FILE)
000164	052763  001000  000030 			BIS	#1000,30(R3)			; *,*(FILE)				1367
000172	012700  000001 				MOV	#1,R0				;					1324
000176	000401 					BR	3$
000200	005000 				2$:	CLR	R0				;					1299
000202	022626 				3$:	CMP	(SP)+,(SP)+
000204	000207 					RTS	PC
; Routine Size:  67 words,	Routine Base:  $CODE$ + 3274
; Maximum stack depth per invocation:  9 words


;	  1379	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  45
X03.09		NMU$FILE_SEEK as UF_SEEK			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (14)

;	  1380	
;	  1381	%global_routine ('NMU$FILE_SKIP', FILE_ID, BYTE_COUNT, RSP_PTR) =
;	  1382	
;	  1383	!++
;	  1384	! Functional description:
;	  1385	!
;	  1386	!	This routine skips forward the specified number of bytes
;	  1387	!       in the file associated with the FILE_ID.
;	  1388	!
;	  1389	! Formal parameters:
;	  1390	!
;	  1391	!	.FILE_ID         File identifier
;	  1392	!       .BYTE_COUNT      Number of bytes to skip
;	  1393	!
;	  1394	! Implicit inputs: none
;	  1395	!
;	  1396	! Routine value:
;	  1397	!
;	  1398	!	$true     Bytes skipped successfully
;	  1399	!       $false    Invalid ID or failure during skip
;	  1400	!
;	  1401	! Side effects: none
;	  1402	!
;	  1403	!--
;	  1404	
;	  1405	    begin
;	  1406	    local
;	  1407	         FILE : ref FILE_DATA_BLOCK;
;	  1408	
;	P 1409	    %debug (FILE_TRACE,
;	P 1410	            (TRACE_INFO ('File id %O skip request %D bytes',
;	P 1411	                         .FILE_ID,
;	  1412	                         .BYTE_COUNT)));
;	  1413	
;	  1414	    !
;	  1415	    ! Setup pointer to file data base
;	  1416	    !
;	  1417	
;	  1418	    if (FILE = FIND_FILE_DATA_BLOCK (.FILE_ID, .RSP_PTR)) eql 0
;	  1419	    then
;	  1420	        return $false;
;	  1421	
;	  1422	    !
;	  1423	    ! Set pointer to response buffer in file data block.
;	  1424	    !
;	  1425	
;	  1426	    FILE [FD_RESPONSE] = .RSP_PTR;
;	  1427	
;	  1428	    !
;	  1429	    ! Increment current position in file by count of bytes specified.
;	  1430	    !
;	  1431	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  46
X03.09		NMU$FILE_SKIP as UF_SKIP			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (14)

;	  1432	    %ADDI32 (.BYTE_COUNT , FILE [FD_CURRENT_POSITION]);
;	  1433	    FILE [FD_SEEK_DONE] = $true;
;	  1434	
;	P 1435	    %debug (FILE_TRACE,
;	P 1436	            (local
;	P 1437	                  CP;
;	P 1438	             %MOVF32 (FILE [FD_CURRENT_POSITION] , CP);
;	P 1439	             TRACE_INFO ('File at byte position %D',
;	  1440	                         .CP)));
;	  1441	
;	  1442	    return $true
;	  1443	
;	  1444	    end;				! End of NMU$FILE_SKIP


						.SBTTL	UF.SKIP NMU$FILE_SKIP as UF_SKIP
000000	004167  000000G			UF.SKIP::
						JSR	R1,$SAVE2			;					1381
000004	024646 					CMP	-(SP),-(SP)
000006	016646  000020 				MOV	20(SP),-(SP)			; FILE.ID,*				1418
000012	016646  000016 				MOV	16(SP),-(SP)			; RSP.PTR,*
000016	004767  000000V				JSR	PC,FIND.FILE.DATA.BLOCK
000022	022626 					CMP	(SP)+,(SP)+
000024	010002 					MOV	R0,R2				; *,FILE
000026	001423 					BEQ	1$				;					1420
000030	016662  000014  000010 			MOV	14(SP),10(R2)			; RSP.PTR,*(FILE)			1426
000036	016616  000016 				MOV	16(SP),(SP)			; BYTE.COUNT,$$MOVI32.TARGET		1432
000042	005066  000002 				CLR	2(SP)				; $$MOVI32.TARGET+2
000046	010600 					MOV	SP,R0				; $$ADDI32.C,*
000050	010201 					MOV	R2,R1				; FILE,*
000052	062701  000012 				ADD	#12,R1
000056	004767  000000G				JSR	PC,$ADD32
000062	052762  001000  000030 			BIS	#1000,30(R2)			; *,*(FILE)				1433
000070	012700  000001 				MOV	#1,R0				;					1405
000074	000401 					BR	2$
000076	005000 				1$:	CLR	R0				;					1381
000100	022626 				2$:	CMP	(SP)+,(SP)+
000102	000207 					RTS	PC
; Routine Size:  34 words,	Routine Base:  $CODE$ + 3502
; Maximum stack depth per invocation:  8 words


;	  1445	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  47
X03.09		NMU$FILE_SKIP as UF_SKIP			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (15)

;	  1446	
;	  1447	%global_routine ('NMU$FILE_CLOSE', FILE_ID, RSP_PTR) =
;	  1448	
;	  1449	!++
;	  1450	! Functional description:
;	  1451	!
;	  1452	!	Closes a file and invalidates further access. Resources are
;	  1453	!       released and any buffered data is written to file.
;	  1454	!
;	  1455	! Formal parameters:
;	  1456	!
;	  1457	!	.FILE_ID    File identifier
;	  1458	!       .RSP_PTR    Pointer to NICE response buffer
;	  1459	!
;	  1460	! Implicit inputs: none
;	  1461	!
;	  1462	! Routine value:
;	  1463	!
;	  1464	!       $true     File closed successfully
;	  1465	!       $false    Invalid file id or unable to close file
;	  1466	!
;	  1467	! Side effects: none
;	  1468	!
;	  1469	!--
;	  1470	
;	  1471	    begin
;	  1472	    local
;	  1473	         FILE : ref FILE_DATA_BLOCK;
;	  1474	
;	P 1475	    %debug (FILE_TRACE,
;	P 1476	            (TRACE_INFO ('File id %O close requested',
;	  1477	                         .FILE_ID,)));
;	  1478	
;	  1479	    !
;	  1480	    ! Setup pointer to file data base
;	  1481	    !
;	  1482	
;	  1483	    if (FILE = FIND_FILE_DATA_BLOCK (.FILE_ID, .RSP_PTR)) eql 0
;	  1484	    then
;	  1485	        return $false;
;	  1486	
;	  1487	    !
;	  1488	    ! Set pointer to response buffer in file data block.
;	  1489	    !
;	  1490	
;	  1491	    FILE [FD_RESPONSE] = .RSP_PTR;
;	  1492	
;	  1493	    !
;	  1494	    ! Set up and maintain the address of the current BD block
;	  1495	    ! for the file.
;	  1496	    !
;	  1497	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  48
X03.09		NMU$FILE_CLOSE as UF_CLOSE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (15)

;	  1498	    begin
;	  1499	    bind
;	  1500	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK ;
;	  1501	
;	  1502	    !
;	  1503	    ! If buffer has been modified by write then flush it out to file.
;	  1504	    !
;	  1505	
;	  1506	    if .BUFFER [BD_VALID] and .BUFFER [BD_CHANGED]
;	  1507	    then
;	  1508	        begin
;	  1509	        if not WRITE_FILE (.FILE)
;	  1510	        then
;	  1511	            return $false;
;	  1512	        end;
;	  1513	
;	  1514	    !
;	  1515	    ! Perform actions necessary to close the file.
;	  1516	    !
;	  1517	
;	  1518	    if not CLOSE_FILE (.FILE)
;	  1519	    then
;	  1520	        return $false;
;	  1521	
;	  1522	    !
;	  1523	    ! Deallocate all storage associated with the file.
;	  1524	    ! Delete FD from table. Release storage for FD.
;	  1525	    !
;	  1526	
;	  1527	    DEALLOC_BUFFER (.FILE);
;	  1528	
;	  1529	    NMU$TABLE_DELETE (FILE_TABLE, .FILE_ID);
;	  1530	
;	  1531	    NMU$MEMORY_RELEASE (.FILE, FILE_DATA_BLOCK_ALLOCATION);
;	  1532	
;	P 1533	    %debug (FILE_TRACE,
;	P 1534	            (TRACE_INFO ('File on JFN %O closed',
;	  1535	                         .FILE [FD_JFN])));
;	  1536	
;	  1537	    end;                                ! End buffer context
;	  1538	
;	  1539	    return $true
;	  1540	
;	  1541	    end;				! End of NMU$FILE_CLOSE


						.SBTTL	UF.CLOSE NMU$FILE_CLOSE as UF_CLOSE
000000	010146 				UF.CLOSE::
						MOV	R1,-(SP)			;					1447
000002	016646  000006 				MOV	6(SP),-(SP)			; FILE.ID,*				1483
000006	016646  000006 				MOV	6(SP),-(SP)			; RSP.PTR,*
000012	004767  000000V				JSR	PC,FIND.FILE.DATA.BLOCK
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  49
X03.09		NMU$FILE_CLOSE as UF_CLOSE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (15)

000016	022626 					CMP	(SP)+,(SP)+
000020	010001 					MOV	R0,R1				; *,FILE
000022	001454 					BEQ	2$				;					1485
000024	016661  000004  000010 			MOV	4(SP),10(R1)			; RSP.PTR,*(FILE)			1491
000032	016100  000026 				MOV	26(R1),R0			; *(FILE),*				1506
000036	132760  000002  000034 			BITB	#2,34(R0)
000044	001412 					BEQ	1$
000046	132760  000001  000034 			BITB	#1,34(R0)
000054	001406 					BEQ	1$
000056	010146 					MOV	R1,-(SP)			; FILE,*				1509
000060	004767  000000V				JSR	PC,WRITE.FILE
000064	005726 					TST	(SP)+
000066	006000 					ROR	R0
000070	103031 					BHIS	2$				;					1511
000072	010146 				1$:	MOV	R1,-(SP)			; FILE,*				1518
000074	004767  000000V				JSR	PC,CLOSE.FILE
000100	005726 					TST	(SP)+
000102	006000 					ROR	R0
000104	103023 					BHIS	2$				;					1520
000106	010146 					MOV	R1,-(SP)			; FILE,*				1527
000110	004767  000000V				JSR	PC,DEALLOC.BUFFER
000114	012716  000000'				MOV	#FILE.TABLE,(SP)		;					1529
000120	016646  000010 				MOV	10(SP),-(SP)			; FILE.ID,*
000124	004767  000000G				JSR	PC,UT.DELETE
000130	010116 					MOV	R1,(SP)				; FILE,*				1531
000132	012746  000032 				MOV	#32,-(SP)
000136	004767  000000G				JSR	PC,UM.RELEASE
000142	062706  000006 				ADD	#6,SP				;					1447
000146	012700  000001 				MOV	#1,R0				;					1471
000152	000401 					BR	3$
000154	005000 				2$:	CLR	R0				;					1447
000156	012601 				3$:	MOV	(SP)+,R1
000160	000207 					RTS	PC
; Routine Size:  57 words,	Routine Base:  $CODE$ + 3606
; Maximum stack depth per invocation:  5 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  50
X03.09		NMU$FILE_CLOSE as UF_CLOSE			12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (16)

;	  1542	
;	  1543	%routine ('FILE_ERROR', FILE_ID, RSP_PTR) =
;	  1544	
;	  1545	!++
;	  1546	! Functional description:
;	  1547	!
;	  1548	!	Builds a NICE response message which describes a file
;	  1549	!       error condition as set in the file data block.
;	  1550	!
;	  1551	! Formal parameters:
;	  1552	!
;	  1553	!	.FILE_ID     File identifier
;	  1554	!       .RSP_PTR     Pointer to NICE response buffer
;	  1555	!	.RTN_COD     NICE error response code
;	  1556	!
;	  1557	! Implicit inputs: none
;	  1558	!
;	  1559	! Routine value:
;	  1560	!
;	  1561	!	$true always
;	  1562	!
;	  1563	! Side effects: none
;	  1564	!
;	  1565	!--
;	  1566	
;	  1567	    begin
;	  1568	
;	  1569	    return $TRUE
;	  1570	
;	  1571	    end;				! End of FILE_ERROR


						.SBTTL	FILE.ERROR FILE_ERROR
000000	012700  000001 			FILE.ERROR:
						MOV	#1,R0				;					1567
000004	000207 					RTS	PC				;					1543
; Routine Size:  3 words,	Routine Base:  $CODE$ + 3770
; Maximum stack depth per invocation:  0 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  51
X03.09		FILE_ERROR					12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (17)

;	  1572	
;	  1573	%routine ('FIND_FILE_DATA_BLOCK', FILE_ID, RSP_PTR) =
;	  1574	
;	  1575	!++
;	  1576	! Functional description:
;	  1577	!
;	  1578	!	Sets up the address of the FILE DATA BLOCK based on the
;	  1579	!       file identifier.
;	  1580	!
;	  1581	! Formal parameters:
;	  1582	!
;	  1583	!	.FILE_ID    File identifier
;	  1584	!       .RSP_PTR    Pointer to NICE response buffer
;	  1585	!
;	  1586	! Implicit inputs: none
;	  1587	!
;	  1588	! Routine value:
;	  1589	!
;	  1590	!       gtr 0	Address of FILE DATA BLOCK
;	  1591	!       eql 0   if not found
;	  1592	!
;	  1593	! Side effects: none
;	  1594	!
;	  1595	!--
;	  1596	
;	  1597	    begin
;	  1598	
;	  1599	    local
;	  1600	         FILE ;
;	  1601	
;	  1602	    !
;	  1603	    ! Setup the file data base pointer
;	  1604	    !
;	  1605	
;	  1606	    if not NMU$TABLE_FETCH (FILE_TABLE, .FILE_ID, FILE)
;	  1607	    then
;	  1608	        begin
;	C 1609	        %( N.B. - Is this error a user caused error or does it indicate
;	C 1610	           some internal error. If it is internally caused this should
;	C 1611	           probably cause either a TASK_ERROR or a TASK_INFO followed
;	  1612	           by command abort. )%
;	  1613	
;	P 1614	        %debug (FILE_TRACE,
;	P 1615	                (TRACE_INFO ('Table lookup of FD for FILE_ID %O failed',
;	  1616	                             .FILE_ID)));
;	  1617	
;	P 1618	        $RESPONSE_X (.RSP_PTR, NICE$_FIO, 0,
;	  1619	                     'Invalid file ID', 208);
;	  1620	        return 0
;	  1621	        end;
;	  1622	
;	  1623	    return .FILE
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  52
X03.09		FIND_FILE_DATA_BLOCK				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (17)

;	  1624	
;	  1625	    end;				! End of FIND_FILE_DATA_BLOCK


						.SBTTL	FIND.FILE.DATA.BLOCK FIND_FILE_DATA_BLOCK
000000	004167  000000G			FIND.FILE.DATA.BLOCK:
						JSR	R1,$SAVE2			;					1573
000004	005746 					TST	-(SP)
000006	012746  000000'				MOV	#FILE.TABLE,-(SP)		;					1606
000012	016646  000016 				MOV	16(SP),-(SP)			; FILE.ID,*
000016	012746  000006 				MOV	#6,-(SP)
000022	060616 					ADD	SP,(SP)				; FILE,*
000024	004767  000000G				JSR	PC,UT.FETCH
000030	062706  000006 				ADD	#6,SP
000034	006000 					ROR	R0
000036	103417 					BLO	1$
000040	016600  000012 				MOV	12(SP),R0			; RSP.PTR,STRPTR			1619
000044	112720  000356 				MOVB	#356,(R0)+			; *,STRPTR
000050	105020 					CLRB	(R0)+				; STRPTR
000052	105020 					CLRB	(R0)+				; STRPTR
000054	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000060	012701  000320 				MOV	#320,R1
000064	012702  000001 				MOV	#1,R2
000070	004767  000000G				JSR	PC,$CBDSG
000074	000402 					BR	2$				;					1608
000076	011600 				1$:	MOV	(SP),R0				; FILE,*				1597
000100	000401 					BR	3$
000102	005000 				2$:	CLR	R0				;					1573
000104	005726 				3$:	TST	(SP)+
000106	000207 					RTS	PC
; Routine Size:  36 words,	Routine Base:  $CODE$ + 3776
; Maximum stack depth per invocation:  8 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  53
X03.09		FIND_FILE_DATA_BLOCK				12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (18)

;	  1626	
;	  1627	
;	U 1628	%if $TOPS20 %then
;	U 1629	require 'FILT20' 
;	  1630	        %else %if $MCB %then
;	  1631	              require 'FILMCB' 
;	U 1632	              %else %if $TOPS10 %then
;	U 1633	                    require 'FILT10' 
;	  1634	                    %fi %fi %fi ;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  54
X03.09		FIND_FILE_DATA_BLOCK				14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (1)

;	 R1635	!                    COPYRIGHT (c) 1980, 1981, 1982, 1985
;	 R1636	!                    DIGITAL EQUIPMENT CORPORATION
;	 R1637	!                        Maynard, Massachusetts
;	 R1638	!
;	 R1639	!     This software is furnished under a license and may  be  used
;	 R1640	!     and copied only in accordance with the terms of such license
;	 R1641	!     and with the inclusion of the above copyright notice.   This
;	 R1642	!     software  or any other copies thereof may not be provided or
;	 R1643	!     otherwise made available to any other person.  No  title  to
;	 R1644	!     and ownership of the software is hereby transferred.
;	 R1645	!
;	 R1646	!     The information  in  this  software  is  subject  to  change
;	 R1647	!     without  notice  and should not be construed as a commitment
;	 R1648	!     by DIGITAL EQUIPMENT CORPORATION.
;	 R1649	!
;	 R1650	!     DIGITAL assumes no responsibility for the use or reliability
;	 R1651	!     of  its  software  on  equipment  which  is  not supplied by
;	 R1652	!     DIGITAL.
;	 R1653	
;	 R1654	!
;	 R1655	!     - Close the network connection if OPEN_FILE's call to FAL_ACCESS
;	 R1656	!       fails.
;	 R1657	! A11 - Add response buffer and length as parameters to NETWORK_OPEN.
;	 R1658	! A10 - Add REQUIRE of FALACC.BLI module.
;	 R1659	! A09 - Add code to set BUFFER [BD_VALID], FILE [FD_LENGTH], and
;	 R1660	!       FILE [FD_FILE_POSITION] after calling FAL_ACCESS in
;	 R1661	!       WRITE_FILE routine.
;	 R1662	! D08 - Remove %DEBUG calls, not used in MCB.
;	 R1663	! A07 - Remove FAL_ACCESS routine and move it to module FALACC.
;	 R1664	!
;	 R1665	
;	 R1666	!
;	 R1667	! This is the MCB System Specific portion of the NMUFIL utility module.
;	 R1668	!
;	 R1669	
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  55
X03.09		FIND_FILE_DATA_BLOCK				14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (2)

;	 R1670	
;	 R1671	%routine ('ALLOC_BUFFER', FILE : ref FILE_DATA_BLOCK) =
;	 R1672	
;	 R1673	!++
;	 R1674	! FUNCTIONAL DESCRIPTION:
;	 R1675	!
;	 R1676	!
;	 R1677	! FORMAL PARAMETERS
;	 R1678	!
;	 R1679	!	NONE.
;	 R1680	!
;	 R1681	! IMPLICIT INPUTS
;	 R1682	!
;	 R1683	!	NONE.
;	 R1684	!
;	 R1685	! ROUTINE VALUE:
;	 R1686	!
;	 R1687	!	NONE.
;	 R1688	!
;	 R1689	! SIDE EFFECTS:
;	 R1690	!
;	 R1691	!	NONE.
;	 R1692	!
;	 R1693	!--
;	 R1694	
;	 R1695	    begin
;	 R1696	    bind
;	 R1697	        FIRST_BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK;
;	 R1698	
;	 R1699	    local
;	 R1700	         BUFFER : ref BUFFER_DATA_BLOCK;
;	 R1701	
;	 R1702	    BUFFER = NMU$MEMORY_GET (BUFFER_DATA_BLOCK_ALLOCATION);
;	 R1703	
;	 R1704	    BUFFER [BD_VALID] = $FALSE;
;	 R1705	
;	 R1706	    selectone .FILE [FD_LOCAL] of
;	 R1707	        set
;	 R1708	        [$TRUE] :                       ! Local file access
;	 R1709	            begin
;	 R1710		    return $FALSE
;	 R1711	            end;
;	 R1712	        [$FALSE] :                      ! Remote file access
;	 R1713	            begin
;	 R1714	            if (BUFFER [BD_ADDRESS] = NMU$MEMORY_GET (REMOTE_BUFFER_ALLOCATION)) eql 0
;	 R1715	            then
;	 R1716	                begin
;	 R1717	                return $FALSE
;	 R1718	                end;
;	 R1719	
;	 R1720	            BUFFER [BD_ALLOCATION] = REMOTE_BUFFER_ALLOCATION;
;	 R1721	            BUFFER [BD_LENGTH] = REMOTE_BUFFER_LENGTH;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  56
X03.09		ALLOC_BUFFER					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (2)

;	 R1722	            end;
;	 R1723	        tes;
;	 R1724	
;	 R1725	    !
;	 R1726	    ! Link buffer into buffer ring
;	 R1727	    !
;	 R1728	
;	 R1729	    if .FIRST_BUFFER eql 0
;	 R1730	    then
;	 R1731	        begin
;	 R1732	        FIRST_BUFFER = .BUFFER;
;	 R1733	        BUFFER [BD_NEXT] = .BUFFER;
;	 R1734	        end
;	 R1735	    else
;	 R1736	        begin
;	 R1737	        BUFFER [BD_NEXT] = .FIRST_BUFFER [BD_NEXT];
;	 R1738	        FIRST_BUFFER [BD_NEXT] = .BUFFER;
;	 R1739	        end;
;	 R1740	
;	 R1741	    return $TRUE
;	 R1742	
;	 R1743	    end;				!End of ALLOC_BUFFER


						.SBTTL	ALLOC.BUFFER ALLOC_BUFFER
000000	004167  000000G			ALLOC.BUFFER:
						JSR	R1,$SAVE2			;					1671
000004	016602  000010 				MOV	10(SP),R2			; FILE,*				1697
000010	062702  000026 				ADD	#26,R2
000014	012746  000035 				MOV	#35,-(SP)			;					1702
000020	004767  000000G				JSR	PC,UM.GET
000024	010001 					MOV	R0,R1				; *,BUFFER
000026	142761  000002  000034 			BICB	#2,34(R1)			; *,*(BUFFER)				1704
000034	016600  000012 				MOV	12(SP),R0			; FILE,*				1706
000040	116000  000031 				MOVB	31(R0),R0
000044	042700  177776 				BIC	#177776,R0
000050	020027  000001 				CMP	R0,#1
000054	001002 					BNE	2$
000056	005726 				1$:	TST	(SP)+				;					1710
000060	000434 					BR	6$				;					1709
000062	005700 				2$:	TST	R0				;					1706
000064	001015 					BNE	3$
000066	012716  001000 				MOV	#1000,(SP)			;					1714
000072	004767  000000G				JSR	PC,UM.GET
000076	010061  000002 				MOV	R0,2(R1)			; *,*(BUFFER)
000102	001765 					BEQ	1$				;					1717
000104	012761  001000  000006 			MOV	#1000,6(R1)			; *,*(BUFFER)				1720
000112	012761  001000  000004 			MOV	#1000,4(R1)			; *,*(BUFFER)				1721
000120	011200 				3$:	MOV	(R2),R0				;					1729
000122	001003 					BNE	4$
000124	010112 					MOV	R1,(R2)				; BUFFER,*				1732
000126	010111 					MOV	R1,(R1)				; BUFFER,BUFFER				1733
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  57
X03.09		ALLOC_BUFFER					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (2)

000130	000404 					BR	5$				;					1729
000132	017211  000000 			4$:	MOV	@0(R2),(R1)			; *,BUFFER				1737
000136	010172  000000 				MOV	R1,@0(R2)			; BUFFER,*				1738
000142	005726 				5$:	TST	(SP)+				;					1671
000144	012700  000001 				MOV	#1,R0				;					1695
000150	000207 					RTS	PC
000152	005000 				6$:	CLR	R0				;					1671
000154	000207 					RTS	PC
; Routine Size:  55 words,	Routine Base:  $CODE$ + 4106
; Maximum stack depth per invocation:  5 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  58
X03.09		ALLOC_BUFFER					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (3)

;	 R1744	
;	 R1745	%routine ('DEALLOC_BUFFER', FILE : ref FILE_DATA_BLOCK) =
;	 R1746	
;	 R1747	!++
;	 R1748	! FUNCTIONAL DESCRIPTION:
;	 R1749	!
;	 R1750	!
;	 R1751	! FORMAL PARAMETERS
;	 R1752	!
;	 R1753	!	NONE.
;	 R1754	!
;	 R1755	! IMPLICIT INPUTS
;	 R1756	!
;	 R1757	!	NONE.
;	 R1758	!
;	 R1759	! ROUTINE VALUE:
;	 R1760	!
;	 R1761	!	NONE.
;	 R1762	!
;	 R1763	! SIDE EFFECTS:
;	 R1764	!
;	 R1765	!	NONE.
;	 R1766	!
;	 R1767	!--
;	 R1768	
;	 R1769	    begin
;	 R1770	    bind
;	 R1771	        BUFFER_RING = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK ;
;	 R1772	
;	 R1773	    local
;	 R1774	        BUFFER : ref BUFFER_DATA_BLOCK ;
;	 R1775	
;	 R1776	    BUFFER = .BUFFER_RING;
;	 R1777	
;	 R1778	    selectone .FILE [FD_LOCAL] of
;	 R1779	        set
;	 R1780	        [$TRUE] :                       ! Local file access
;	 R1781	            begin
;	 R1782		    return $FALSE
;	 R1783	            end;
;	 R1784	        [$FALSE] :                      ! Remote file access
;	 R1785	            begin
;	 R1786	            NMU$MEMORY_RELEASE (.BUFFER [BD_ADDRESS], .BUFFER [BD_ALLOCATION]);
;	 R1787	            end;
;	 R1788	        tes;
;	 R1789	
;	 R1790	    BUFFER [BD_ADDRESS] = 0;
;	 R1791	    BUFFER [BD_LENGTH] = 0;
;	 R1792	    BUFFER [BD_ALLOCATION] = 0;
;	 R1793	
;	 R1794	    if .BUFFER [BD_NEXT] eql .BUFFER
;	 R1795	    then BUFFER_RING = 0
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  59
X03.09		DEALLOC_BUFFER					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (3)

;	 R1796	    else BUFFER_RING = .BUFFER [BD_NEXT];
;	 R1797	
;	 R1798	    NMU$MEMORY_RELEASE (.BUFFER, BUFFER_DATA_BLOCK_ALLOCATION);
;	 R1799	
;	 R1800	    return $TRUE
;	 R1801	
;	 R1802	    end;				!End of DEALLOC_BUFFER


						.SBTTL	DEALLOC.BUFFER DEALLOC_BUFFER
000000	004167  000000G			DEALLOC.BUFFER:
						JSR	R1,$SAVE2			;					1745
000004	016602  000010 				MOV	10(SP),R2			; FILE,*				1771
000010	062702  000026 				ADD	#26,R2
000014	011201 					MOV	(R2),R1				; *,BUFFER				1776
000016	016600  000010 				MOV	10(SP),R0			; FILE,*				1778
000022	116000  000031 				MOVB	31(R0),R0
000026	042700  177776 				BIC	#177776,R0
000032	020027  000001 				CMP	R0,#1
000036	001435 					BEQ	4$				;					1781
000040	005700 					TST	R0				;					1778
000042	001007 					BNE	1$
000044	016146  000002 				MOV	2(R1),-(SP)			; *(BUFFER),*				1786
000050	016146  000006 				MOV	6(R1),-(SP)			; *(BUFFER),*
000054	004767  000000G				JSR	PC,UM.RELEASE
000060	022626 					CMP	(SP)+,(SP)+			;					1785
000062	005061  000002 			1$:	CLR	2(R1)				; *(BUFFER)				1790
000066	005061  000004 				CLR	4(R1)				; *(BUFFER)				1791
000072	005061  000006 				CLR	6(R1)				; *(BUFFER)				1792
000076	021101 					CMP	(R1),R1				; BUFFER,BUFFER				1794
000100	001002 					BNE	2$
000102	005012 					CLR	(R2)				;					1795
000104	000401 					BR	3$				;					1794
000106	011112 				2$:	MOV	(R1),(R2)			; BUFFER,*				1796
000110	010146 				3$:	MOV	R1,-(SP)			; BUFFER,*				1798
000112	012746  000035 				MOV	#35,-(SP)
000116	004767  000000G				JSR	PC,UM.RELEASE
000122	022626 					CMP	(SP)+,(SP)+			;					1745
000124	012700  000001 				MOV	#1,R0				;					1769
000130	000207 					RTS	PC
000132	005000 				4$:	CLR	R0				;					1745
000134	000207 					RTS	PC
; Routine Size:  47 words,	Routine Base:  $CODE$ + 4264
; Maximum stack depth per invocation:  6 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  60
X03.09		DEALLOC_BUFFER					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (4)

;	 R1803	
;	 R1804	%routine ('OPEN_FILE', FILE : ref FILE_DATA_BLOCK, FN : ref FILE_NAME_BLOCK) =
;	 R1805	
;	 R1806	!++
;	 R1807	! FUNCTIONAL DESCRIPTION:
;	 R1808	!
;	 R1809	!	Performs system specific functions to allow access to a
;	 R1810	!       file. Sets various fields within the FILE_BLOCK. A NICE
;	 R1811	!       response message is written if the open fails.
;	 R1812	!
;	 R1813	! FORMAL PARAMETERS
;	 R1814	!
;	 R1815	!	FILE - Address of a file data block.
;	 R1816	!
;	 R1817	! IMPLICIT INPUTS
;	 R1818	!
;	 R1819	!	NONE.
;	 R1820	!
;	 R1821	! ROUTINE VALUE:
;	 R1822	!
;	 R1823	!	$TRUE, if file is successfully opened;
;	 R1824	!       $FALSE, otherwise.
;	 R1825	!
;	 R1826	! SIDE EFFECTS:
;	 R1827	!
;	 R1828	!	NONE.
;	 R1829	!
;	 R1830	!--
;	 R1831	
;	 R1832	    begin
;	 R1833	
;	 R1834	    selectone .FILE [FD_LOCAL] of
;	 R1835	        set
;	 R1836	        [1] :                           ! Local file access
;	 R1837	            begin
;	 R1838		    return $FALSE        
;	 R1839	            end;
;	 R1840	        [0] :                               ! Remote file access
;	 R1841	            begin
;	 R1842	            local
;	 R1843	                 CONN_BLK : CONNECT_BLOCK,
;	 R1844	                 NODE_BFR : vector [NODE_ID_BUFFER_SIZE],
;	 R1845	                 NODE_PTR,
;	 R1846	                 LENGTH,
;	 R1847	                 TEMP;                  ! A convenient temporary
;	 R1848	
;	 R1849	            !
;	 R1850	            ! Open a logical link to FAL at the remote node.
;	 R1851	            !
;	 R1852	
;	 R1853	            CONN_BLK [CB_OBJECT] = FAL_OBJECT;
;	 R1854	            CONN_BLK [CB_DESCRIPTOR_LENGTH] = 0;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  61
X03.09		OPEN_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (4)

;	 R1855	            CONN_BLK [CB_TASK_LENGTH] = 0;
;	 R1856	
;	 R1857	            !
;	 R1858	            ! Attempt to map node name to node address
;	 R1859	            !
;	 R1860	
;	 R1861	            NODE_PTR = ch$ptr (NODE_BFR,,8);
;	 R1862	            PUTB (0,NODE_PTR);
;	 R1863	            PUTB (0,NODE_PTR);
;	 R1864	            PUTB (.FN [FN_HOST_LENGTH],NODE_PTR);
;	 R1865	            ch$move (.FN [FN_HOST_LENGTH], .FN [FN_HOST_POINTER], .NODE_PTR) ;
;	 R1866	            LENGTH = NODE_ID_BUFFER_LENGTH ; ! Get buffer length
;	 R1867	
;	CR1868	%( N.B. - This needs to have NMULIB include NMXINT.REQ
;	CR1869	
;	CR1870	            $NML$MAP_NODE_ID (LENGTH, ! Map node number to name
;	 R1871	                              .NODE_PTR) ;)%
;	 R1872	
;	 R1873	            CONN_BLK [CB_HOST] = ch$ptr (NODE_BFR,,8);
;	 R1874	            CONN_BLK [CB_HOST_LENGTH] = .LENGTH;
;	 R1875	            CONN_BLK [CB_USERID_LENGTH] = .FN [FN_USER_LENGTH];
;	 R1876	            CONN_BLK [CB_USERID] = .FN [FN_USER_POINTER];
;	 R1877	            CONN_BLK [CB_ACCOUNT_LENGTH] = .FN [FN_ACCOUNT_LENGTH];
;	 R1878	            CONN_BLK [CB_ACCOUNT] = .FN [FN_ACCOUNT_POINTER];
;	 R1879	            CONN_BLK [CB_PASSWORD_LENGTH] = .FN [FN_PASSWORD_LENGTH];
;	 R1880	            CONN_BLK [CB_PASSWORD] = .FN [FN_PASSWORD_POINTER];
;	 R1881	            CONN_BLK [CB_DATA_LENGTH] = 0;
;	 R1882	
;	 R1883	            if (FILE [FD_JFN] = NMU$NETWORK_OPEN (SOURCE_LINK, CONN_BLK,
;	 R1884			ch$ptr(.FILE[FD_RESPONSE],,8), %ref(120), NICE$_LCF)) lss 0
;	 R1885	            then begin
;	PR1886	                 $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FOE, .FILE [FD_TYPE],
;	 R1887	                              'Could not connect to remote FAL', 209);
;	 R1888	                 return $FALSE
;	 R1889	                 end;
;	 R1890	
;	 R1891	
;	 R1892	
;	 R1893	            !
;	 R1894	            ! Open file on remote HOST.
;	 R1895	            !
;	 R1896	
;	 R1897	            if not FAL_ACCESS (.FILE, DAP_OPEN,
;	 R1898	                               .FN [FN_NAME_POINTER],
;	 R1899	                               .FN [FN_NAME_LENGTH])
;	 R1900	            then
;	 R1901	                begin
;	 R1902	                !
;	 R1903	                ! Since we're telling the caller that the open was unsuccessful,
;	 R1904	                ! it stands to reason that he'll assume that there isn't any
;	 R1905	                ! active connection.  We should close what we got.
;	 R1906	                CLOSE_FILE (.FILE);
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  62
X03.09		OPEN_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (4)

;	 R1907	                return $FALSE;
;	 R1908	                end;
;	 R1909	            end;
;	 R1910	        tes;
;	 R1911	
;	 R1912	    $TRUE
;	 R1913	
;	 R1914	    end;				!End of OPEN_FILE


						.SBTTL	OPEN.FILE OPEN_FILE
000000	004167  000000G			OPEN.FILE:
						JSR	R1,$SAVE4			;					1804
000004	162706  000242 				SUB	#242,SP
000010	016603  000260 				MOV	260(SP),R3			; FILE,*				1834
000014	116300  000031 				MOVB	31(R3),R0
000020	042700  177776 				BIC	#177776,R0
000024	020027  000001 				CMP	R0,#1
000030	001561 					BEQ	3$				;					1837
000032	005700 					TST	R0				;					1834
000034	001163 					BNE	5$
000036	012766  000021  000020 			MOV	#21,20(SP)			; *,CONN.BLK+4				1853
000044	005066  000050 				CLR	50(SP)				; CONN.BLK+34				1854
000050	005066  000024 				CLR	24(SP)				; CONN.BLK+10				1855
000054	012700  000002 				MOV	#2,R0				; *,NODE.PTR				1861
000060	060600 					ADD	SP,R0				; NODE.BFR,NODE.PTR
000062	105020 					CLRB	(R0)+				; NODE.PTR				1862
000064	105020 					CLRB	(R0)+				; NODE.PTR				1863
000066	016604  000256 				MOV	256(SP),R4			; FN,*					1864
000072	116420  000002 				MOVB	2(R4),(R0)+			; *,NODE.PTR
000076	016446  000002 				MOV	2(R4),-(SP)			;					1865
000102	016446  000016 				MOV	16(R4),-(SP)
000106	010046 					MOV	R0,-(SP)			; NODE.PTR,*
000110	004767  000000G				JSR	PC,BL$MOV
000114	012700  000011 				MOV	#11,R0				; *,LENGTH				1866
000120	012766  000010  000022 			MOV	#10,22(SP)			; *,CONN.BLK				1873
000126	060666  000022 				ADD	SP,22(SP)			; NODE.BFR,CONN.BLK
000132	010066  000024 				MOV	R0,24(SP)			; LENGTH,CONN.BLK+2			1874
000136	016466  000004  000036 			MOV	4(R4),36(SP)			; *,CONN.BLK+14				1875
000144	016466  000020  000034 			MOV	20(R4),34(SP)			; *,CONN.BLK+12				1876
000152	016466  000006  000046 			MOV	6(R4),46(SP)			; *,CONN.BLK+24				1877
000160	016466  000022  000044 			MOV	22(R4),44(SP)			; *,CONN.BLK+22				1878
000166	016466  000010  000052 			MOV	10(R4),52(SP)			; *,CONN.BLK+30				1879
000174	016466  000024  000050 			MOV	24(R4),50(SP)			; *,CONN.BLK+26				1880
000202	005066  000042 				CLR	42(SP)				; CONN.BLK+20				1881
000206	012716  000002 				MOV	#2,(SP)				;					1883
000212	012746  000024 				MOV	#24,-(SP)
000216	060616 					ADD	SP,(SP)				; CONN.BLK,*
000220	016346  000010 				MOV	10(R3),-(SP)
000224	012766  000170  000012 			MOV	#170,12(SP)			;					1884
000232	012746  000014 				MOV	#14,-(SP)
000236	060616 					ADD	SP,(SP)
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  63
X03.09		OPEN_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (4)

000240	012746  177632 				MOV	#-146,-(SP)			;					1883
000244	004767  000000G				JSR	PC,UN.OPEN
000250	062706  000010 				ADD	#10,SP
000254	010013 					MOV	R0,(R3)
000256	002024 					BGE	1$				;					1884
000260	016300  000010 				MOV	10(R3),R0			; *,STRPTR				1887
000264	112720  000363 				MOVB	#363,(R0)+			; *,STRPTR
000270	005001 					CLR	R1				; DETAIL
000272	156301  000004 				BISB	4(R3),R1			; *,DETAIL
000276	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
000300	010102 					MOV	R1,R2				; DETAIL,*
000302	000302 					SWAB	R2
000304	110220 					MOVB	R2,(R0)+			; *,STRPTR
000306	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
000312	012701  000321 				MOV	#321,R1
000316	012702  000001 				MOV	#1,R2
000322	004767  000000G				JSR	PC,$CBDSG
000326	000420 					BR	2$				;					1883
000330	010316 				1$:	MOV	R3,(SP)				;					1897
000332	012746  000001 				MOV	#1,-(SP)
000336	016446  000026 				MOV	26(R4),-(SP)
000342	016446  000012 				MOV	12(R4),-(SP)
000346	004767  000000V				JSR	PC,FAL.ACCESS
000352	062706  000006 				ADD	#6,SP
000356	006000 					ROR	R0
000360	103407 					BLO	4$
000362	010316 					MOV	R3,(SP)				;					1906
000364	004767  000000V				JSR	PC,CLOSE.FILE
000370	062706  000006 			2$:	ADD	#6,SP				;					1897
000374	005000 				3$:	CLR	R0				;					1901
000376	000404 					BR	6$
000400	062706  000006 			4$:	ADD	#6,SP				;					1841
000404	012700  000001 			5$:	MOV	#1,R0				;					1804
000410	062706  000242 			6$:	ADD	#242,SP
000414	000207 					RTS	PC
; Routine Size:  135 words,	Routine Base:  $CODE$ + 4422
; Maximum stack depth per invocation:  94 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  64
X03.09		OPEN_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (5)

;	 R1915	
;	 R1916	%routine ('READ_FILE', FILE : ref FILE_DATA_BLOCK) =
;	 R1917	
;	 R1918	!++
;	 R1919	! FUNCTIONAL DESCRIPTION:
;	 R1920	!
;	 R1921	!
;	 R1922	! FORMAL PARAMETERS
;	 R1923	!
;	 R1924	!	NONE.
;	 R1925	!
;	 R1926	! IMPLICIT INPUTS
;	 R1927	!
;	 R1928	!	NONE.
;	 R1929	!
;	 R1930	! ROUTINE VALUE:
;	 R1931	!
;	 R1932	!	NONE.
;	 R1933	!
;	 R1934	! SIDE EFFECTS:
;	 R1935	!
;	 R1936	!	NONE.
;	 R1937	!
;	 R1938	!--
;	 R1939	
;	 R1940	    begin
;	 R1941	    bind
;	 R1942	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK,
;	 R1943	        BYTE_SIZE = %if $MCB %then 8 %else .FILE [FD_BYTE_SIZE] %fi ;
;	 R1944	
;	 R1945	    local
;	 R1946	         FILE_PAGE,
;	 R1947	         BUFFER_PAGE,
;	 R1948	         FLAG_COUNT;
;	 R1949	
;	 R1950	    !
;	 R1951	    ! Handle case of seek being done. If the data in the buffer is valid
;	 R1952	    ! and the file current position falls within the range of this buffer
;	 R1953	    ! then all that needs to be done is to update the remaining count,
;	 R1954	    ! and buffer current position.
;	 R1955	    !
;	 R1956	
;	 R1957	    if .FILE [FD_SEEK_DONE]
;	 R1958	    then
;	 R1959	        begin
;	 R1960	
;	 R1961	        FILE [FD_SEEK_DONE] = $FALSE;
;	 R1962	
;	 R1963	        if (%CMP32 (FILE [FD_CURRENT_POSITION] , geq , BUFFER [BD_FILE_POSITION]))
;	 R1964	           and
;	 R1965	           (%CMP32 (FILE [FD_CURRENT_POSITION] , leq , BUFFER [BD_MAX_POSITION]))
;	 R1966	        then
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  65
X03.09		READ_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (5)

;	 R1967	            begin
;	 R1968	            local
;	 R1969	                 TEMP,
;	 R1970	                 TEMP32 : THIRTY_TWO_BIT;
;	 R1971	
;	 R1972	            %MOV32 (FILE [FD_CURRENT_POSITION] , TEMP32);
;	 R1973	            %SUB32 (BUFFER [BD_FILE_POSITION] , TEMP32);
;	 R1974	            %MOVF32 (TEMP32 , BUFFER [BD_CURRENT_POSITION]);
;	CR1975	%(          BUFFER [BD_CURRENT_POSITION] = .FILE [FD_CURRENT_POSITION] -
;	 R1976	                                           .BUFFER [BD_FILE_POSITION];)%
;	 R1977	
;	 R1978	            BUFFER [BD_REMAINING_COUNT] = .BUFFER [BD_DATA_COUNT] -
;	 R1979	                                          .BUFFER [BD_CURRENT_POSITION];
;	 R1980	
;	 R1981	            BUFFER [BD_POINTER] = ch$ptr (.BUFFER [BD_ADDRESS],
;	 R1982	                                          (.BUFFER [BD_CURRENT_POSITION] +
;	 R1983	                                           .BUFFER [BD_BIAS]),
;	 R1984	                                          BYTE_SIZE);
;	 R1985	            return $TRUE
;	 R1986	            end;
;	 R1987	        end;
;	 R1988	
;	 R1989	    selectone .FILE [FD_LOCAL] of
;	 R1990	        set
;	 R1991	        [$TRUE] :                       ! Local file access
;	 R1992	            begin
;	 R1993		    return $FALSE
;	 R1994	            end;
;	 R1995	        [$FALSE] :                      ! Remote file access
;	 R1996	            begin
;	 R1997	            local
;	 R1998	                 TEMP32 : THIRTY_TWO_BIT;
;	 R1999	
;	 R2000	            do
;	 R2001	              begin
;	 R2002	
;	 R2003	              %MOV32 (FILE [FD_FILE_POSITION] , BUFFER [BD_FILE_POSITION]);
;	 R2004	
;	 R2005	              if not FAL_ACCESS (.FILE, DAP_GET, .BUFFER [BD_LENGTH],
;	 R2006	                                 ch$ptr (.BUFFER [BD_ADDRESS],,8))
;	 R2007	              then
;	 R2008	                  begin
;	 R2009	                  return $FALSE;
;	 R2010	                  end;
;	 R2011	
;	 R2012	              %MOV32 (BUFFER [BD_FILE_POSITION] , FILE [FD_FILE_POSITION]);
;	 R2013	              %ADDI32 (.BUFFER [BD_DATA_COUNT] , FILE [FD_FILE_POSITION]);
;	 R2014	
;	 R2015	              %MOV32 (BUFFER [BD_FILE_POSITION] , BUFFER [BD_MAX_POSITION]);
;	 R2016	              %ADDI32 (.BUFFER [BD_DATA_COUNT] , BUFFER [BD_MAX_POSITION]);
;	 R2017	
;	CR2018	%(              BUFFER [BD_MAX_POSITION] = .BUFFER [BD_FILE_POSITION] +
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  66
X03.09		READ_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (5)

;	CR2019	                                         .BUFFER [BD_DATA_COUNT];
;	 R2020	)%
;	 R2021	              end
;	 R2022	            until (%CMP32 (FILE [FD_CURRENT_POSITION] , geq , BUFFER [BD_FILE_POSITION])
;	 R2023	                   and
;	 R2024	                   %CMP32 (FILE [FD_CURRENT_POSITION] , lss , BUFFER [BD_MAX_POSITION]));
;	 R2025	
;	 R2026	            %MOV32 (FILE [FD_CURRENT_POSITION] , TEMP32);
;	 R2027	            %SUB32 (BUFFER [BD_FILE_POSITION] , TEMP32);
;	 R2028	            %MOVF32 (TEMP32 , BUFFER [BD_CURRENT_POSITION]);
;	CR2029	%(            BUFFER [BD_CURRENT_POSITION] = .FILE [FD_CURRENT_POSITION] -
;	 R2030	                                           .BUFFER [BD_FILE_POSITION];)%
;	 R2031	            BUFFER [BD_REMAINING_COUNT] = .BUFFER [BD_DATA_COUNT] -
;	 R2032	                                          .BUFFER [BD_CURRENT_POSITION];
;	 R2033	            BUFFER [BD_POINTER] = ch$ptr (.BUFFER [BD_ADDRESS],
;	 R2034	                                          (.BUFFER [BD_CURRENT_POSITION] +
;	 R2035	                                          .BUFFER [BD_BIAS]),
;	 R2036	                                          BYTE_SIZE);
;	 R2037	
;	 R2038	            end;
;	 R2039	        tes;
;	 R2040	
;	 R2041	    !
;	 R2042	    ! Buffer now has valid data.
;	 R2043	    ! File is now positioned by amount of data read.
;	 R2044	    !
;	 R2045	
;	 R2046	    BUFFER [BD_VALID] = $TRUE;
;	 R2047	
;	 R2048	    return $TRUE
;	 R2049	
;	 R2050	    end;				!End of READ_FILE


	000010 				BYTE.SIZE=	    10


						.SBTTL	READ.FILE READ_FILE
000000	004167  000000G			READ.FILE:
						JSR	R1,$SAVE5			;					1916
000004	162706  000020 				SUB	#20,SP
000010	016604  000036 				MOV	36(SP),R4			; FILE,*				1942
000014	012766  000026  000006 			MOV	#26,6(SP)			;					1940
000022	060466  000006 				ADD	R4,6(SP)
000026	012705  000030 				MOV	#30,R5				;					1957
000032	060405 					ADD	R4,R5
000034	032715  001000 				BIT	#1000,(R5)
000040	001523 					BEQ	1$
000042	042715  001000 				BIC	#1000,(R5)			;					1961
000046	012702  000012 				MOV	#12,R2				;					1963
000052	060402 					ADD	R4,R2
000054	011266  000014 				MOV	(R2),14(SP)			; *,$$MOV32.TARGET
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  67
X03.09		READ_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (5)

000060	016266  000002  000016 			MOV	2(R2),16(SP)			; *,$$MOV32.TARGET+2
000066	017603  000006 				MOV	@6(SP),R3
000072	062703  000010 				ADD	#10,R3
000076	012701  000014 				MOV	#14,R1
000102	060601 					ADD	SP,R1				; $$CMP32.C,*
000104	010300 					MOV	R3,R0
000106	004767  000000G				JSR	PC,$SUB32
000112	012701  000014 				MOV	#14,R1
000116	060601 					ADD	SP,R1				; $$CMP32.C,*
000120	004767  000000G				JSR	PC,$SGN32
000124	005700 					TST	R0
000126	002470 					BLT	1$
000130	011266  000014 				MOV	(R2),14(SP)			; *,$$MOV32.TARGET			1965
000134	016266  000002  000016 			MOV	2(R2),16(SP)			; *,$$MOV32.TARGET+2
000142	017600  000006 				MOV	@6(SP),R0
000146	062700  000014 				ADD	#14,R0
000152	012701  000014 				MOV	#14,R1
000156	060601 					ADD	SP,R1				; $$CMP32.C,*
000160	004767  000000G				JSR	PC,$SUB32
000164	012701  000014 				MOV	#14,R1
000170	060601 					ADD	SP,R1				; $$CMP32.C,*
000172	004767  000000G				JSR	PC,$SGN32
000176	005700 					TST	R0
000200	003043 					BGT	1$
000202	011266  000014 				MOV	(R2),14(SP)			; *,$$MOV32.TARGET			1972
000206	016266  000002  000016 			MOV	2(R2),16(SP)			; *,$$MOV32.TARGET+2
000214	012701  000014 				MOV	#14,R1				;					1973
000220	060601 					ADD	SP,R1				; TEMP32,*
000222	010300 					MOV	R3,R0
000224	004767  000000G				JSR	PC,$SUB32
000230	017600  000006 				MOV	@6(SP),R0			;					1974
000234	012703  000022 				MOV	#22,R3
000240	060003 					ADD	R0,R3
000242	016613  000014 				MOV	14(SP),(R3)			; $$MOVF32.SOURCE,*
000246	010001 					MOV	R0,R1				;					1978
000250	016002  000026 				MOV	26(R0),R2
000254	161302 					SUB	(R3),R2
000256	010261  000030 				MOV	R2,30(R1)
000262	010002 					MOV	R0,R2				;					1981
000264	010201 					MOV	R2,R1
000266	011303 					MOV	(R3),R3				;					1982
000270	066003  000020 				ADD	20(R0),R3
000274	066103  000002 				ADD	2(R1),R3			;					1984
000300	010362  000024 				MOV	R3,24(R2)			;					1981
000304	000167  000516 				JMP	4$				;					1967
000310	032715  000400 			1$:	BIT	#400,(R5)			;					1989
000314	001402 					BEQ	2$				;					1992
000316	000167  000512 				JMP	5$
000322	010466  000004 			2$:	MOV	R4,4(SP)			;					2003
000326	062766  000016  000004 			ADD	#16,4(SP)
000334	010466  000002 				MOV	R4,2(SP)			;					2022
000340	062766  000012  000002 			ADD	#12,2(SP)
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  68
X03.09		READ_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (5)

000346	017616  000006 			3$:	MOV	@6(SP),(SP)			;					2003
000352	062716  000010 				ADD	#10,(SP)
000356	017676  000004  000000 			MOV	@4(SP),@0(SP)
000364	011600 					MOV	(SP),R0
000366	016601  000004 				MOV	4(SP),R1
000372	016160  000002  000002 			MOV	2(R1),2(R0)
000400	010446 					MOV	R4,-(SP)			;					2005
000402	012746  000003 				MOV	#3,-(SP)
000406	017600  000012 				MOV	@12(SP),R0
000412	016046  000004 				MOV	4(R0),-(SP)
000416	010003 					MOV	R0,R3				;					2006
000420	016346  000002 				MOV	2(R3),-(SP)			;					2005
000424	004767  000000V				JSR	PC,FAL.ACCESS
000430	062706  000010 				ADD	#10,SP
000434	006000 					ROR	R0
000436	103176 					BHIS	5$				;					2008
000440	017676  000000  000004 			MOV	@0(SP),@4(SP)			;					2012
000446	016600  000004 				MOV	4(SP),R0
000452	011601 					MOV	(SP),R1
000454	016160  000002  000002 			MOV	2(R1),2(R0)
000462	017600  000006 				MOV	@6(SP),R0			;					2013
000466	012705  000026 				MOV	#26,R5
000472	060005 					ADD	R0,R5
000474	011566  000010 				MOV	(R5),10(SP)			; *,$$MOVI32.TARGET
000500	005066  000012 				CLR	12(SP)				; $$MOVI32.TARGET+2
000504	012700  000010 				MOV	#10,R0
000510	060600 					ADD	SP,R0				; $$ADDI32.C,*
000512	016601  000004 				MOV	4(SP),R1
000516	004767  000000G				JSR	PC,$ADD32
000522	017602  000006 				MOV	@6(SP),R2			;					2015
000526	062702  000014 				ADD	#14,R2
000532	017612  000000 				MOV	@0(SP),(R2)
000536	011600 					MOV	(SP),R0
000540	016062  000002  000002 			MOV	2(R0),2(R2)
000546	011566  000010 				MOV	(R5),10(SP)			; *,$$MOVI32.TARGET			2016
000552	005066  000012 				CLR	12(SP)				; $$MOVI32.TARGET+2
000556	012700  000010 				MOV	#10,R0
000562	060600 					ADD	SP,R0				; $$ADDI32.C,*
000564	010201 					MOV	R2,R1
000566	004767  000000G				JSR	PC,$ADD32
000572	017666  000002  000010 			MOV	@2(SP),10(SP)			; *,$$MOV32.TARGET			2022
000600	016600  000002 				MOV	2(SP),R0
000604	016066  000002  000012 			MOV	2(R0),12(SP)			; *,$$MOV32.TARGET+2
000612	012701  000010 				MOV	#10,R1
000616	060601 					ADD	SP,R1				; $$CMP32.C,*
000620	011600 					MOV	(SP),R0
000622	004767  000000G				JSR	PC,$SUB32
000626	012701  000010 				MOV	#10,R1
000632	060601 					ADD	SP,R1				; $$CMP32.C,*
000634	004767  000000G				JSR	PC,$SGN32
000640	005700 					TST	R0
000642	002641 					BLT	3$
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  69
X03.09		READ_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (5)

000644	017666  000002  000010 			MOV	@2(SP),10(SP)			; *,$$MOV32.TARGET			2024
000652	016600  000002 				MOV	2(SP),R0
000656	016066  000002  000012 			MOV	2(R0),12(SP)			; *,$$MOV32.TARGET+2
000664	012701  000010 				MOV	#10,R1
000670	060601 					ADD	SP,R1				; $$CMP32.C,*
000672	010200 					MOV	R2,R0
000674	004767  000000G				JSR	PC,$SUB32
000700	012701  000010 				MOV	#10,R1
000704	060601 					ADD	SP,R1				; $$CMP32.C,*
000706	004767  000000G				JSR	PC,$SGN32
000712	005700 					TST	R0
000714	002214 					BGE	3$
000716	017666  000002  000014 			MOV	@2(SP),14(SP)			; *,$$MOV32.TARGET			2026
000724	016600  000002 				MOV	2(SP),R0
000730	016066  000002  000016 			MOV	2(R0),16(SP)			; *,$$MOV32.TARGET+2
000736	012701  000014 				MOV	#14,R1				;					2027
000742	060601 					ADD	SP,R1				; TEMP32,*
000744	011600 					MOV	(SP),R0
000746	004767  000000G				JSR	PC,$SUB32
000752	017600  000006 				MOV	@6(SP),R0			;					2028
000756	012702  000022 				MOV	#22,R2
000762	060002 					ADD	R0,R2
000764	016612  000014 				MOV	14(SP),(R2)			; $$MOVF32.SOURCE,*
000770	011501 					MOV	(R5),R1				;					2031
000772	161201 					SUB	(R2),R1
000774	010160  000030 				MOV	R1,30(R0)
001000	010001 					MOV	R0,R1				;					2033
001002	011202 					MOV	(R2),R2				;					2034
001004	066002  000020 				ADD	20(R0),R2
001010	066302  000002 				ADD	2(R3),R2			;					2036
001014	010261  000024 				MOV	R2,24(R1)			;					2033
001020	152760  000002  000034 			BISB	#2,34(R0)			;					2046
001026	012700  000001 			4$:	MOV	#1,R0				;					1940
001032	000401 					BR	6$
001034	005000 				5$:	CLR	R0				;					1916
001036	062706  000020 			6$:	ADD	#20,SP
001042	000207 					RTS	PC
; Routine Size:  274 words,	Routine Base:  $CODE$ + 5040
; Maximum stack depth per invocation:  19 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  70
X03.09		READ_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (6)

;	 R2051	
;	 R2052	%routine ('WRITE_FILE', FILE : ref FILE_DATA_BLOCK) =
;	 R2053	
;	 R2054	!++
;	 R2055	! Functional description
;	 R2056	!
;	 R2057	!        This routine writes a buffer (the current one) to the specified
;	 R2058	!        location in the file.  The whole page is written to the file.
;	 R2059	!
;	 R2060	!        Note:  This routine does not handle multi-buffering!!
;	 R2061	!               This routine does not handle non-contiguous writes!!
;	 R2062	!
;	 R2063	! Formal parameters
;	 R2064	!
;	 R2065	!    .FILE    Address of file data block
;	 R2066	!
;	 R2067	! Implicit inputs:
;	 R2068	!
;	 R2069	!  File level
;	 R2070	!
;	 R2071	!    FD_LOCAL            flag to indicate local or remote file system
;	 R2072	!    FD_FORMAT           value indicating type of file being written
;	 R2073	!    FD_JFN              TOPS20 JFN of output file
;	 R2074	!    FD_BYTE_SIZE        number of bits per byte in buffer
;	 R2075	!    FD_RESPONSE         pointer to response buffer (on errors only)
;	 R2076	!    FD_TYPE             DECnet NM file type (on errors only)
;	 R2077	!
;	 R2078	!  Buffer level
;	 R2079	!
;	 R2080	!    BD_FILE_POSITION    where to start writting data in file
;	 R2081	!    BD_ADDRESS          address of buffer page containing data
;	 R2082	!    BD_DATA_COUNT       number of bytes in buffer to be written
;	 R2083	!    
;	 R2084	! Implicit outputs:
;	 R2085	!
;	 R2086	!  File level
;	 R2087	!
;	 R2088	!    FD_PAGE_COUNT       number of pages that have been written to file
;	 R2089	!    FD_LENGTH           number of bytes that have been written to file
;	 R2090	!    FD_FILE_POSITION    byte position of page after written page 
;	 R2091	!
;	 R2092	!  Buffer level
;	 R2093	!
;	 R2094	!    BD_VALID            set to false to indicate buffer data block no
;	 R2095	!                          longer describes a valid buffer
;	 R2096	!
;	 R2097	! Routine value
;	 R2098	!
;	 R2099	!    $true    if the write succeeds
;	 R2100	!    $false   if the write fails, response pointer in the file data
;	 R2101	!               block is used to illuminate the error.
;	 R2102	!
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  71
X03.09		WRITE_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (6)

;	 R2103	!--
;	 R2104	
;	 R2105	    begin
;	 R2106	    bind
;	 R2107	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK;
;	 R2108	
;	 R2109	    local
;	 R2110	         FILE_PAGE,
;	 R2111	         BUFFER_PAGE,
;	 R2112	         FLAG_COUNT;
;	 R2113	
;	 R2114	    if .FILE [FD_LOCAL]
;	 R2115	    then
;	 R2116	        return $FALSE
;	 R2117	    else
;	 R2118	        begin
;	 R2119	        local
;	 R2120	             RTN_COD;
;	 R2121	
;	 R2122	        RTN_COD = FAL_ACCESS (.FILE, DAP_PUT, .BUFFER [BD_LENGTH],
;	 R2123	                              ch$ptr (.BUFFER [BD_ADDRESS],,8));
;	 R2124	        BUFFER [BD_VALID] = $FALSE;
;	 R2125	        %ADDI32 (.BUFFER [BD_DATA_COUNT] , FILE [FD_LENGTH]);
;	 R2126	
;	 R2127	        %MOV32 (BUFFER [BD_FILE_POSITION] , FILE [FD_FILE_POSITION]);
;	 R2128	        %ADDI32 (.BUFFER [BD_DATA_COUNT] , FILE [FD_FILE_POSITION]);
;	CR2129	%(
;	CR2130	        FILE [FD_FILE_POSITION] = .BUFFER [BD_FILE_POSITION] +
;	 R2131	                                  .BUFFER [BD_DATA_COUNT];)%
;	 R2132	        return .RTN_COD;
;	 R2133	        end;
;	 R2134	
;	 R2135	    end;				!End of WRITE_FILE


						.SBTTL	WRITE.FILE WRITE_FILE
000000	004167  000000G			WRITE.FILE:
						JSR	R1,$SAVE4			;					2052
000004	024646 					CMP	-(SP),-(SP)
000006	016603  000020 				MOV	20(SP),R3			; FILE,*				2107
000012	032763  000400  000030 			BIT	#400,30(R3)			;					2114
000020	001402 					BEQ	1$
000022	005000 					CLR	R0
000024	000461 					BR	2$
000026	010346 				1$:	MOV	R3,-(SP)			;					2122
000030	012746  000002 				MOV	#2,-(SP)
000034	016302  000026 				MOV	26(R3),R2
000040	016246  000004 				MOV	4(R2),-(SP)
000044	016246  000002 				MOV	2(R2),-(SP)
000050	004767  000000V				JSR	PC,FAL.ACCESS
000054	010004 					MOV	R0,R4				; *,RTN.COD
000056	142762  000002  000034 			BICB	#2,34(R2)			;					2124
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  72
X03.09		WRITE_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (6)

000064	016266  000026  000010 			MOV	26(R2),10(SP)			; *,$$MOVI32.TARGET			2125
000072	005066  000012 				CLR	12(SP)				; $$MOVI32.TARGET+2
000076	012700  000010 				MOV	#10,R0
000102	060600 					ADD	SP,R0				; $$ADDI32.C,*
000104	010301 					MOV	R3,R1
000106	062701  000022 				ADD	#22,R1
000112	004767  000000G				JSR	PC,$ADD32
000116	012701  000016 				MOV	#16,R1				;					2127
000122	060301 					ADD	R3,R1
000124	016211  000010 				MOV	10(R2),(R1)
000130	016261  000012  000002 			MOV	12(R2),2(R1)
000136	016266  000026  000010 			MOV	26(R2),10(SP)			; *,$$MOVI32.TARGET			2128
000144	005066  000012 				CLR	12(SP)				; $$MOVI32.TARGET+2
000150	012700  000010 				MOV	#10,R0
000154	060600 					ADD	SP,R0				; $$ADDI32.C,*
000156	004767  000000G				JSR	PC,$ADD32
000162	062706  000010 				ADD	#10,SP				;					2118
000166	010400 					MOV	R4,R0				; RTN.COD,*				2114
000170	022626 				2$:	CMP	(SP)+,(SP)+			;					2052
000172	000207 					RTS	PC
; Routine Size:  62 words,	Routine Base:  $CODE$ + 6104
; Maximum stack depth per invocation:  12 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  73
X03.09		WRITE_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (7)

;	 R2136	
;	 R2137	%routine ('CLOSE_FILE', FILE : ref FILE_DATA_BLOCK) =
;	 R2138	
;	 R2139	!++
;	 R2140	! Functional description:
;	 R2141	!
;	 R2142	!
;	 R2143	! Formal parameters:
;	 R2144	!
;	 R2145	!       .FILE    Address of file data block
;	 R2146	!
;	 R2147	! Implicit inputs:
;	 R2148	!
;	 R2149	!
;	 R2150	! Routine value:
;	 R2151	!
;	 R2152	!       $true    close succeeded
;	 R2153	!       $false   close failed
;	 R2154	!
;	 R2155	! Note:  Even if this routine fails, the file is no longer open
;	 R2156	!        for access.  Close failure means that any changes written
;	 R2157	!        to a file may not be saved.
;	 R2158	!
;	 R2159	!--
;	 R2160	
;	 R2161	    begin
;	 R2162	
;	 R2163	    if .FILE [FD_LOCAL]
;	 R2164	    then
;	 R2165	        return $FALSE
;	 R2166	    else
;	 R2167	        begin
;	 R2168	
;	 R2169	        !
;	 R2170	        ! Close file with FAL. Don't care if it fails.
;	 R2171	        !
;	 R2172	
;	 R2173	        FAL_ACCESS (.FILE,DAP_CLOSE,0,0);
;	 R2174	
;	 R2175	        !
;	 R2176	        ! Close the logical link to FAL.
;	 R2177	        !
;	 R2178	
;	 R2179	        NMU$NETWORK_CLOSE (.FILE [FD_JFN], 0, 0);
;	 R2180	
;	 R2181	        end;
;	 R2182	
;	 R2183	    return $TRUE
;	 R2184	
;	 R2185	    end;				!End of CLOSE_FILE
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  74
X03.09		CLOSE_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (7)

						.SBTTL	CLOSE.FILE CLOSE_FILE
000000	010146 				CLOSE.FILE:
						MOV	R1,-(SP)			;					2137
000002	016601  000004 				MOV	4(SP),R1			; FILE,*				2163
000006	032761  000400  000030 			BIT	#400,30(R1)
000014	001021 					BNE	1$				;					2165
000016	010146 					MOV	R1,-(SP)			;					2173
000020	012746  000004 				MOV	#4,-(SP)
000024	005046 					CLR	-(SP)
000026	005046 					CLR	-(SP)
000030	004767  000000V				JSR	PC,FAL.ACCESS
000034	011116 					MOV	(R1),(SP)			;					2179
000036	005046 					CLR	-(SP)
000040	005046 					CLR	-(SP)
000042	004767  000000G				JSR	PC,UN.CLOSE
000046	062706  000014 				ADD	#14,SP				;					2167
000052	012700  000001 				MOV	#1,R0				;					2161
000056	000401 					BR	2$
000060	005000 				1$:	CLR	R0				;					2137
000062	012601 				2$:	MOV	(SP)+,R1
000064	000207 					RTS	PC
; Routine Size:  27 words,	Routine Base:  $CODE$ + 6300
; Maximum stack depth per invocation:  8 words
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  75
X03.09		CLOSE_FILE					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (8)

;	 R2186	
;	 R2187	
;	 R2188	require 'FALACC';                       ! Include common FAL access routine
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  76
X03.09		CLOSE_FILE					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2189	!                    COPYRIGHT (c) 1980, 1981, 1982, 1985
;	 R2190	!                    DIGITAL EQUIPMENT CORPORATION
;	 R2191	!                        Maynard, Massachusetts
;	 R2192	!
;	 R2193	!     This software is furnished under a license and may  be  used
;	 R2194	!     and copied only in accordance with the terms of such license
;	 R2195	!     and with the inclusion of the above copyright notice.   This
;	 R2196	!     software  or any other copies thereof may not be provided or
;	 R2197	!     otherwise made available to any other person.  No  title  to
;	 R2198	!     and ownership of the software is hereby transferred.
;	 R2199	!
;	 R2200	!     The information  in  this  software  is  subject  to  change
;	 R2201	!     without  notice  and should not be construed as a commitment
;	 R2202	!     by DIGITAL EQUIPMENT CORPORATION.
;	 R2203	!
;	 R2204	!     DIGITAL assumes no responsibility for the use or reliability
;	 R2205	!     of  its  software  on  equipment  which  is  not supplied by
;	 R2206	!     DIGITAL.
;	 R2207	
;	 R2208	! RATS:<BANKS.MCB.NCPNML>FALACC.BLI.2 14-Nov-84 14:20:38, Edit by BANKS
;	 R2209	!
;	 R2210	! Add omitted deallocates as per RJP.
;	 R2211	!
;	 R2212	! NET:<DECNET20-V3P0.XPT>FALACC.BLI.11 25-Jan-82 10:08:40, Edit by WEBBER
;	 R2213	!
;	 R2214	! Changed "status received" code from 209 to 212.
;	 R2215	!
;	 R2216	! NET:<DECNET20-V3P0.XPT>FALACC.BLI.8 13-Jan-82 14:26:04, Edit by WEBBER
;	 R2217	!
;	 R2218	! Fixed the OPEN processing to:
;	 R2219	!   Expect an ACK after the ATTRIBUTES message;
;	 R2220	!   Once the ACK has been received, send out either a CTL/GET or CTL/PUT,
;	 R2221	!     depending on the open type.  No response is expected to this message.
;	 R2222	! Fixed the GET and PUT processing not to send the CTL/GET or CTL/PUT.
;	 R2223	!
;	 R2224	! NET:<DECNET20-V3P0.XPT>FALACC.BLI.5  8-Jan-82 16:20:12, Edit by WEBBER
;	 R2225	!
;	 R2226	! Added RESPONSE if an error Status message is received from the remote
;	 R2227	! FAL.
;	 R2228	!
;	 R2229	! NET:<DECNET20-V3P0.XPT>FALACC.BLI.2  6-Jan-82 15:59:31, Edit by WEBBER
;	 R2230	!
;	 R2231	! Fixed send of CTL/PUT not to expect a response from the remote.
;	 R2232	! Also fix ACC-CMP send to expect a response.
;	 R2233	!
;	 R2234	! This is the common DAP access portion of the NMUFIL utility module.
;	 R2235	!
;	 R2236	
;	 R2237	%routine ('FAL_ACCESS', FILE : ref FILE_DATA_BLOCK, OP, PTR, LEN) =
;	 R2238	
;	 R2239	!++
;	 R2240	! FUNCTIONAL DESCRIPTION:
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  77
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2241	!
;	 R2242	!
;	 R2243	! FORMAL PARAMETERS
;	 R2244	!
;	 R2245	!	NONE.
;	 R2246	!
;	 R2247	! IMPLICIT INPUTS
;	 R2248	!
;	 R2249	!	NONE.
;	 R2250	!
;	 R2251	! ROUTINE VALUE:
;	 R2252	!
;	 R2253	!	NONE.
;	 R2254	!
;	 R2255	! SIDE EFFECTS:
;	 R2256	!
;	 R2257	!	NONE.
;	 R2258	!
;	 R2259	!--
;	 R2260	
;	 R2261	    begin
;	 R2262	    bind
;	 R2263	        BUFFER = (FILE [FD_CURRENT_BUFFER]) : ref BUFFER_DATA_BLOCK,
;	 R2264	        CONFIG_MSG = uplit (CH$BYTE (1,0,0,2,8,6,5,6,0,3,0,%O'42')),
;	 R2265	        CONFIG_LEN = 12,
;	 R2266	        ATTRIB_MSG = uplit (CH$BYTE (2,0,%O'13',2,0,%O'200',1)),
;	 R2267	        ATTRIB_LEN = 7,
;	 R2268	        CONTROL_GET_MSG = uplit (CH$BYTE (4,0,1,1,3)),
;	 R2269	        CONTROL_GET_LEN = 5,
;	 R2270	        CONTROL_PUT_MSG = uplit (CH$BYTE (4,0,4,1,3)),
;	 R2271	        CONTROL_PUT_LEN = 5,
;	 R2272	        ACCOMP_MSG = uplit (CH$BYTE (7,0,1)),
;	 R2273	        ACCOMP_LEN = 3;
;	 R2274	
;	 R2275	    $field
;	 R2276	          FLAG_FIELDS =
;	 R2277	              set
;	 R2278	              ALL = [$bits(%bpval)],    ! All the flags
;	 R2279	              $overlay (ALL)
;	 R2280	              SEND = [$bit],            ! Send a DAP message
;	 R2281	              RECEIVE = [$bit],         ! Receive a DAP message
;	 R2282	              ALLOCATE = [$bit],        ! Allocate a DAP buffer
;	 R2283	              DEALLOCATE = [$bit],      ! Deallocate a DAP buffer
;	 R2284	              BUFFER_ALLOCATED = [$bit], ! DAP_BFR contains address of buffer
;	 R2285	              SUCCESS = [$bit],         ! Return TRUE/FALSE value
;	 R2286	              DONE = [$bit]             ! File function complete
;	 R2287	              tes;
;	 R2288	
;	 R2289	    local
;	 R2290	         TEMP,                          ! A convenient temporary
;	 R2291	         FLAGS : block [1] field (FLAG_FIELDS),
;	 R2292	         DAP_BFR,
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  78
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2293	         DAP_PTR,
;	 R2294	         DAP_LEN;
;	 R2295	
;	 R2296	    bind
;	 R2297	        OSTYPE = TEMP,                  ! OSTYPE in configuration msg
;	 R2298	        FAC = TEMP;                     ! FAC in access message
;	 R2299	
;	PR2300	    %debug (FILE_TRACE,
;	PR2301	            (TRACE_INFO ('FAL request operation: %O',
;	 R2302	                         .OP)));
;	 R2303	
;	 R2304	    FLAGS [ALL] = 0;                    ! Clear all flags to FALSE
;	 R2305	    FLAGS [SUCCESS] = $TRUE;            ! Be optimistic
;	 R2306	    DAP_BFR = 0;                        ! No buffer allocated
;	 R2307	
;	 R2308	    do
;	 R2309	      begin
;	 R2310	
;	PR2311	      %debug (FILE_TRACE,
;	 R2312	              (TRACE_INFO ('FAL Access State: %D', .FILE [FD_DAP_STATE])));
;	 R2313	
;	 R2314	      case .FILE [FD_DAP_STATE] from -2 to 9 of
;	 R2315	          set
;	 R2316	          [-1] :                        ! Error - failed
;	 R2317	              begin
;	 R2318	              FLAGS [SUCCESS] = $FALSE;
;	 R2319	              FLAGS [DONE] = $TRUE;
;	 R2320	              if .FLAGS [BUFFER_ALLOCATED]
;	 R2321	              then
;	 R2322	                  FLAGS [DEALLOCATE] = $TRUE;
;	 R2323	              end;
;	 R2324	          [0] :                         ! Initial - unopened
;	 R2325	              begin
;	 R2326	              DAP_PTR = ch$ptr (CONFIG_MSG,,8);
;	 R2327	              DAP_LEN = CONFIG_LEN;
;	 R2328	              FLAGS [SEND] =
;	 R2329	              FLAGS [RECEIVE] =
;	 R2330	              FLAGS [ALLOCATE] = $TRUE;
;	 R2331	              end;
;	 R2332	          [1] :                         ! Configuration received
;	 R2333	              begin
;	 R2334	
;	 R2335	              !
;	 R2336	              ! Get operating system type of remote node.
;	 R2337	              ! If it's TOPS-10 or TOPS-20 then set the
;	 R2338	              ! MACY11 format flag in the RAT field of the
;	 R2339	              ! attribute message.
;	 R2340	              !
;	 R2341	
;	 R2342	              OSTYPE = ch$rchar (ch$ptr (.DAP_BFR,4,8));
;	 R2343	
;	 R2344	              if .OSTYPE eql 7 or .OSTYPE eql 8
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  79
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2345	              then ch$wchar (%O'001',ch$ptr (ATTRIB_MSG,6,8))
;	 R2346	              else ch$wchar (%O'000',ch$ptr (ATTRIB_MSG,6,8));
;	 R2347	
;	 R2348	              DAP_PTR = ch$ptr (ATTRIB_MSG,,8);
;	 R2349	              DAP_LEN = ATTRIB_LEN;
;	 R2350	              FLAGS [SEND] = $TRUE;
;	 R2351	              FLAGS [RECEIVE] = $FALSE;
;	 R2352	              FILE [FD_DAP_STATE] = -2;
;	 R2353	              end;
;	 R2354	          [-2] :                        ! Attributes sent
;	 R2355	              begin
;	 R2356	
;	 R2357	              !
;	 R2358	              ! Set up pointer to DAP buffer for access message.
;	 R2359	              !
;	 R2360	
;	 R2361	              DAP_PTR = ch$ptr (.DAP_BFR,,8);
;	 R2362	
;	 R2363	              !
;	 R2364	              ! Build access message.
;	 R2365	              ! ACCESS --> 003,000,ACCFUNC(1)B,000,FILESPEC(I-255)A,FAC(EX-3)BM
;	 R2366	              !
;	 R2367	
;	 R2368	              PUTB (%O'003',DAP_PTR);   ! OPERATOR TYPE = 3 (ACCESS)
;	 R2369	              PUTB (%O'000',DAP_PTR);   ! OPERATOR FLAGS
;	 R2370	              if .FILE [FD_ACCESS] neq FILE_ACCESS_WRITE_ONLY
;	 R2371	              then PUTB (%O'001',DAP_PTR) ! $OPEN an existing file
;	 R2372	              else PUTB (%O'002',DAP_PTR); ! $CREATE a new file
;	 R2373	              PUTB (%O'000',DAP_PTR);   ! ACCOPT field
;	 R2374	              LEN = min (.LEN, 255);    ! Not more than 255 maximum
;	 R2375	              PUTB (.LEN,DAP_PTR);      ! I-field length
;	 R2376	              DAP_PTR = ch$move (.LEN,
;	 R2377	                                 .PTR,
;	 R2378	                                 .DAP_PTR);
;	 R2379	
;	 R2380	              !
;	 R2381	              ! Set bits in FAC based on file access requested.
;	 R2382	              !
;	 R2383	
;	 R2384	              FAC = 0;                  ! Clear initial FAC
;	 R2385	
;	 R2386	              selectone .FILE [FD_ACCESS] of
;	 R2387	                  set
;	 R2388	                  [FILE_ACCESS_WRITE_ONLY] :
;	 R2389	                      FAC = .FAC or %B'0000001'; ! Set FB$PUT
;	 R2390	                  [FILE_ACCESS_READ_ONLY] :
;	 R2391	                      FAC = .FAC or %B'0000010'; ! Set FB$GET
;	 R2392	                  [FILE_ACCESS_RANDOM] :
;	 R2393	                      FAC = .FAC or %B'0001000'; ! set FB$UPD
;	 R2394	                  tes;
;	 R2395	
;	 R2396	              PUTB (.FAC,DAP_PTR);      ! Store FAC in message
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  80
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2397	              DAP_LEN = 6 + .LEN;
;	 R2398	              DAP_PTR = ch$ptr (.DAP_BFR,,8);
;	 R2399	              FLAGS [SEND] =
;	 R2400	              FLAGS [RECEIVE] = $TRUE;
;	 R2401	              end;
;	 R2402	          [2] :                         ! Attributes received
;	 R2403	              begin
;	 R2404	              selectone .OP of
;	 R2405	                  set
;	 R2406	                  [DAP_OPEN] :          ! Open complete
;	 R2407	                      begin
;	 R2408	                      BUFFER [BD_BIAS] = 4;
;	 R2409	                      FLAGS [RECEIVE] = $TRUE;
;	 R2410	                      FLAGS [DEALLOCATE] =
;	 R2411	                      FLAGS [DONE] =
;	 R2412	                      FLAGS [SEND] = $FALSE;
;	 R2413	                      end;
;	 R2414	                  [DAP_CLOSE] :         ! Send access complete message
;	 R2415	                      begin
;	 R2416	                      DAP_PTR = ch$ptr (ACCOMP_MSG,,8);
;	 R2417	                      DAP_LEN = ACCOMP_LEN;
;	 R2418	                      FLAGS [SEND] =
;	 R2419	                      FLAGS [RECEIVE] =
;	 R2420	                      FLAGS [ALLOCATE] = $TRUE;
;	 R2421	                      FLAGS [DONE] = $FALSE;
;	 R2422	                      end;
;	 R2423	                  tes;
;	 R2424	              end;
;	 R2425	          [6] :                         ! Acknowledge received
;	 R2426	              begin
;	 R2427	              selectone .OP of
;	 R2428	                  set
;	 R2429	                  [DAP_GET] :           ! Read a data message
;	 R2430	                      begin
;	 R2431	                      DAP_BFR = .BUFFER [BD_ADDRESS];
;	 R2432	                      DAP_LEN = .BUFFER [BD_LENGTH];
;	 R2433	                      FLAGS [SEND] = $FALSE;
;	 R2434	                      FLAGS [RECEIVE] = $TRUE;
;	 R2435	                      end;
;	 R2436	                  [DAP_PUT] :           ! Send a data message
;	 R2437	                      begin
;	 R2438	                      TEMP =
;	 R2439	                      DAP_PTR = ch$ptr (.BUFFER [BD_ADDRESS],,8);
;	 R2440	                      ch$wchar_a (8,TEMP); ! Write data message header
;	 R2441	                      ch$wchar_a (0,TEMP);
;	 R2442	                      ch$wchar_a (1,TEMP);
;	 R2443	                      ch$wchar_a (0,TEMP);
;	 R2444	                      DAP_LEN = .BUFFER [BD_DATA_COUNT] + .BUFFER [BD_BIAS];
;	 R2445	                      FLAGS [RECEIVE] =
;	 R2446	                      FLAGS [DEALLOCATE] = $FALSE;
;	 R2447	                      FLAGS [SEND] =
;	 R2448	                      FLAGS [DONE] = $TRUE;
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  81
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2449	                      end;
;	 R2450	                  [DAP_OPEN] :
;	 R2451	                      begin
;	 R2452	                      selectone .FILE[FD_ACCESS] of
;	 R2453	                          set
;	 R2454	                          [FILE_ACCESS_READ_ONLY]:
;	 R2455	                              begin
;	 R2456	                              DAP_PTR = ch$ptr (CONTROL_GET_MSG,,8);
;	 R2457	                              DAP_LEN = CONTROL_GET_LEN;
;	 R2458	                              FLAGS [SEND] =
;	 R2459	                              FLAGS [DEALLOCATE] =
;	 R2460	                              FLAGS [DONE] = $TRUE;
;	 R2461	                              FLAGS [RECEIVE] = $FALSE;
;	 R2462	                              end;
;	 R2463	                          [FILE_ACCESS_WRITE_ONLY]:
;	 R2464	                              begin
;	 R2465	                              DAP_PTR = ch$ptr (CONTROL_PUT_MSG,,8);
;	 R2466	                              DAP_LEN = CONTROL_PUT_LEN;
;	 R2467	                              FLAGS [SEND] =
;	 R2468	                              FLAGS [DEALLOCATE] =
;	 R2469	                              FLAGS [DONE] = $TRUE;
;	 R2470	                              FLAGS [RECEIVE] = $FALSE;
;	 R2471	                              end;
;	 R2472	                          tes;
;	 R2473	                      end;
;	 R2474	                  [DAP_CLOSE] :         ! Send access complete message
;	 R2475	                      begin
;	 R2476	                      DAP_PTR = ch$ptr (ACCOMP_MSG,,8);
;	 R2477	                      DAP_LEN = ACCOMP_LEN;
;	 R2478	                      FLAGS [SEND] =
;	 R2479	                      FLAGS [ALLOCATE] =
;	 R2480	                      FLAGS [RECEIVE] = $TRUE;
;	 R2481	                      end;
;	 R2482	                  tes;
;	 R2483	              end;
;	 R2484	          [7] :                         ! Access Complete received
;	 R2485	              begin
;	 R2486	              FLAGS [SEND] =
;	 R2487	              FLAGS [RECEIVE] = $FALSE;
;	 R2488	              FLAGS [DEALLOCATE] =
;	 R2489	              FLAGS [DONE] = $TRUE;
;	 R2490	              end;
;	 R2491	          [8] :                         ! Data message received
;	 R2492	              begin
;	 R2493	              selectone .OP of
;	 R2494	                  set
;	 R2495	                  [DAP_GET] :           ! Process header
;	 R2496	                      begin
;	 R2497	
;	 R2498	                      !
;	 R2499	                      ! Get length of header portion of DAP data message
;	 R2500	                      ! and save as bias into buffer.
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  82
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2501	                      ! Save number of data bytes read.
;	 R2502	                      !
;	 R2503	
;	 R2504	                      BUFFER [BD_BIAS] = 3 + ch$rchar (ch$ptr (.BUFFER [BD_ADDRESS],2,8));
;	 R2505	                      BUFFER [BD_DATA_COUNT] = .DAP_LEN - .BUFFER [BD_BIAS];
;	 R2506	
;	 R2507	                      FLAGS [SEND] =
;	 R2508	                      FLAGS [RECEIVE] = $FALSE;
;	 R2509	                      FILE [FD_DAP_STATE] = 6; ! Make this work next time
;	 R2510	                      FLAGS [DONE] = $TRUE;
;	 R2511	                      end;
;	 R2512	                  [DAP_PUT] :           ! Illegal
;	 R2513	                      begin
;	 R2514	                      FLAGS [SUCCESS] = $FALSE;
;	 R2515	                      if .FLAGS [BUFFER_ALLOCATED]
;	 R2516	                      then
;	 R2517	                          FLAGS [DEALLOCATE] = $TRUE;
;	 R2518	                      FLAGS [DONE] = $TRUE;
;	 R2519	                      end;
;	 R2520	                  [DAP_OPEN] :          ! Illegal
;	 R2521	                      begin
;	 R2522	                      FLAGS [SUCCESS] = $FALSE;
;	 R2523	                      if .FLAGS [BUFFER_ALLOCATED]
;	 R2524	                      then
;	 R2525	                          FLAGS [DEALLOCATE] = $TRUE;
;	 R2526	                      FLAGS [DONE] = $TRUE;
;	 R2527	                      end;
;	 R2528	                  [DAP_CLOSE] :         ! Send access complete message
;	 R2529	                      begin
;	 R2530	                      DAP_PTR = ch$ptr (ACCOMP_MSG,,8);
;	 R2531	                      DAP_LEN = ACCOMP_LEN;
;	 R2532	                      FLAGS [SEND] =
;	 R2533	                      FLAGS [DEALLOCATE] =
;	 R2534	                      FLAGS [DONE] = $TRUE;
;	 R2535	                      end;
;	 R2536	                  tes;
;	 R2537	              end;
;	 R2538	          [9] :                         ! Status message received
;	 R2539	              begin
;	 R2540	
;	PR2541	              %debug (ALWAYS,
;	PR2542	                      (DAP_PTR = ch$ptr (.DAP_BFR,2,8); ! Point to STSCODE
;	PR2543	                       TEMP = GETW (DAP_PTR); ! Get STSCODE
;	PR2544	                       TRACE_INFO ('DAP Status Received: MACCODE = %O, MICCODE = %O',
;	PR2545	                                   .TEMP<12,4>,
;	 R2546	                                   .TEMP<0,12>)));
;	 R2547	
;	PR2548	              $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FIO, .FILE [FD_TYPE],
;	 R2549	                  'Received error Status message from remote FAL', 212);
;	 R2550	              FLAGS [SUCCESS] = $FALSE;
;	 R2551	              if .FLAGS [BUFFER_ALLOCATED]
;	 R2552	              then
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  83
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2553	                  FLAGS [DEALLOCATE] = $TRUE;
;	 R2554	              FLAGS [DONE] = $TRUE;
;	 R2555	              end;
;	 R2556	          [inrange,
;	 R2557	           outrange] :                  ! Unexpected DAP message received
;	 R2558	              begin
;	 R2559	              FLAGS [SUCCESS] = $FALSE;
;	 R2560	              if .FLAGS [BUFFER_ALLOCATED]
;	 R2561	              then
;	 R2562	                  FLAGS [DEALLOCATE] = $TRUE;
;	 R2563	              FLAGS [DONE] = $TRUE;
;	 R2564	              end;
;	 R2565	          tes;
;	 R2566	
;	 R2567	      if .FLAGS [SEND]
;	 R2568	      then
;	 R2569	          begin
;	 R2570	          if not NMU$NETWORK_WRITE (.FILE [FD_JFN], $TRUE, .DAP_LEN, .DAP_PTR)
;	 R2571	          then begin
;	PR2572	               $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FIO, .FILE [FD_TYPE],
;	 R2573	                            'Could not send DAP message to remote FAL', 210);
;	 R2574	               FILE [FD_DAP_STATE] = -1;
;	 R2575	               FLAGS [SUCCESS] = $FALSE;
;	 R2576	               FLAGS [DONE] = $TRUE;
;	 R2577	               end;
;	 R2578	
;	 R2579	          FLAGS [SEND] = $FALSE;
;	 R2580	
;	PR2581	          %debug ((FILE_TRACE and DAP_MESSAGE_TRACE),
;	PR2582	                  (FORMAT_BUFFER ('DAP message sent',,
;	 R2583	                                  0, .DAP_PTR, .DAP_LEN)));
;	 R2584	          end;
;	 R2585	
;	 R2586	      if .FLAGS [ALLOCATE]
;	 R2587	      then
;	 R2588	          begin
;	 R2589	          DAP_BFR = NMU$MEMORY_GET (DAP_BFR_ALLOCATION);
;	 R2590	          DAP_LEN = DAP_BFR_ALLOCATION;
;	 R2591	          FLAGS [ALLOCATE] = $FALSE;
;	 R2592	          FLAGS [BUFFER_ALLOCATED] = $TRUE;
;	 R2593	          end;
;	 R2594	
;	 R2595	      if .FLAGS [RECEIVE]
;	 R2596	      then
;	 R2597	          begin
;	 R2598	
;	 R2599	          DAP_PTR = ch$ptr (.DAP_BFR,,8);
;	 R2600	
;	CR2601	%( N.B. - The action to be taken when a network error occurs, i.e., we get
;	CR2602	   a zero return value, needs to be evaluated. Maybe a way needs to be
;	CR2603	   devised to return the network failure information back to the requestor
;	 R2604	   in the response message. )%
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  84
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

;	 R2605	
;	 R2606	          if (DAP_LEN = NMU$NETWORK_READ (.FILE [FD_JFN], .DAP_LEN,
;	 R2607	                                          .DAP_PTR)) leq 0
;	 R2608	          then begin
;	PR2609	               $RESPONSE_X (.FILE [FD_RESPONSE], NICE$_FIO, .FILE [FD_TYPE],
;	 R2610	                            'Could not receive DAP message from remote FAL', 211);
;	 R2611	               FILE [FD_DAP_STATE] = -1;
;	 R2612	               FLAGS [SUCCESS] = $FALSE;
;	 R2613	               FLAGS [DEALLOCATE] =
;	 R2614	               FLAGS [DONE] = $TRUE;
;	 R2615	               end;
;	 R2616	
;	 R2617	          FLAGS [RECEIVE] = $FALSE;
;	 R2618	
;	 R2619	          !
;	 R2620	          ! Set state based on DAP message type received.
;	 R2621	          !
;	 R2622	
;	 R2623	          if .DAP_LEN geq 1
;	 R2624	          then
;	 R2625	              FILE [FD_DAP_STATE] = ch$rchar (ch$ptr (.DAP_BFR,0,8))
;	 R2626	          else
;	 R2627	              FILE [FD_DAP_STATE] = -1;
;	 R2628	
;	PR2629	          %debug ((FILE_TRACE and DAP_MESSAGE_TRACE),
;	PR2630	                  (FORMAT_BUFFER ('DAP message received, %D bytes: %/%+%16B',
;	PR2631	                                  (.DAP_LEN),
;	 R2632	                                  0, .DAP_PTR, .DAP_LEN)));
;	 R2633	          end;
;	 R2634	
;	 R2635	      if .FLAGS [DEALLOCATE]
;	 R2636	      then
;	 R2637	          begin
;	 R2638	          NMU$MEMORY_RELEASE (.DAP_BFR, DAP_BFR_ALLOCATION);
;	 R2639	          DAP_BFR = 0;
;	 R2640	          FLAGS [DEALLOCATE] = $FALSE;
;	 R2641	          FLAGS [BUFFER_ALLOCATED] = $FALSE;
;	 R2642	          end;
;	 R2643	
;	 R2644	      end
;	 R2645	    until .FLAGS [DONE];
;	 R2646	
;	PR2647	    %debug (FILE_TRACE,
;	PR2648	            ((if .FLAGS [SUCCESS]
;	PR2649	              then TRACE_INFO ('FAL operation complete')
;	 R2650	              else TRACE_INFO ('FAL operation failed'))));
;	 R2651	
;	 R2652	    return .FLAGS [SUCCESS]
;	 R2653	
;	 R2654	    end;				!End of FAL_ACCESS
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  85
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)


000014						.PSECT	$PLIT$,  RO ,  D  
000014	000001 				P.AAG:	.WORD	1
000016	001000 					.WORD	1000
000020	003010 					.WORD	3010
000022	003005 					.WORD	3005
000024	001400 					.WORD	1400
000026	021000 					.WORD	21000
000030	000002 				P.AAH:	.WORD	2
000032	001013 					.WORD	1013
000034	100000 					.WORD	-100000
000036	000001 					.WORD	1
000040	000004 				P.AAI:	.WORD	4
000042	000401 					.WORD	401
000044	000003 					.WORD	3
000046	000004 				P.AAJ:	.WORD	4
000050	000404 					.WORD	404
000052	000003 					.WORD	3
000054	000007 				P.AAK:	.WORD	7
000056	000001 					.WORD	1


	000014'				CONFIG.MSG=	    P.AAG
	000014 				CONFIG.LEN=	    14
	000030'				ATTRIB.MSG=	    P.AAH
	000007 				ATTRIB.LEN=	    7
	000040'				CONTROL.GET.MSG=    P.AAI
	000005 				CONTROL.GET.LEN=    5
	000046'				CONTROL.PUT.MSG=    P.AAJ
	000005 				CONTROL.PUT.LEN=    5
	000054'				ACCOMP.MSG=	    P.AAK
	000003 				ACCOMP.LEN=	    3


						.SBTTL	FAL.ACCESS FAL_ACCESS
006366						.PSECT	$CODE$,  RO 

000000	004167  000000G			FAL.ACCESS:
						JSR	R1,$SAVE5			;					2237
000004	162706  000010 				SUB	#10,SP
000010	016646  000034 				MOV	34(SP),-(SP)			; FILE,*				2263
000014	012700  000026 				MOV	#26,R0				;					2261
000020	061600 					ADD	(SP),R0
000022	010066  000010 				MOV	R0,10(SP)
000026	005003 					CLR	R3				; FLAGS					2304
000030	152703  000040 				BISB	#40,R3				; *,FLAGS				2305
000034	005066  000002 				CLR	2(SP)				; DAP.BFR				2306
000040	012700  000030 				MOV	#30,R0				;					2314
000044	061600 					ADD	(SP),R0
000046	010066  000006 				MOV	R0,6(SP)
000052	117600  000006 			1$:	MOVB	@6(SP),R0
000056	062700  000002 				ADD	#2,R0
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  86
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

000062	020027  000013 				CMP	R0,#13
000066	101003 					BHI	2$
000070	006300 					ASL	R0
000072	066007  000060'				ADD	P.AAL(R0),PC			; Case dispatch
000076	142703  000040 			2$:	BICB	#40,R3				; *,FLAGS				2559
000102	032703  000020 				BIT	#20,R3				; *,FLAGS				2560
000106	001002 					BNE	3$
000110	000167  001250 				JMP	38$
000114	000167  001240 			3$:	JMP	37$				;					2562
000120	142703  000040 			4$:	BICB	#40,R3				; *,FLAGS				2318
000124	152703  000100 				BISB	#100,R3				; *,FLAGS				2319
000130	032703  000020 				BIT	#20,R3				; *,FLAGS				2320
000134	001573 					BEQ	17$
000136	000167  000734 				JMP	29$				;					2322
000142	012766  000014' 000004 		5$:	MOV	#CONFIG.MSG,4(SP)		; *,DAP.PTR				2326
000150	012704  000014 				MOV	#14,R4				; *,DAP.LEN				2327
000154	000167  000700 				JMP	27$				;					2329
000160	005005 				6$:	CLR	R5				; OSTYPE				2342
000162	016600  000002 				MOV	2(SP),R0			; DAP.BFR,*
000166	156005  000004 				BISB	4(R0),R5			; *(DAP.BFR),OSTYPE
000172	020527  000007 				CMP	R5,#7				; OSTYPE,*				2344
000176	001403 					BEQ	7$
000200	020527  000010 				CMP	R5,#10				; OSTYPE,*
000204	001004 					BNE	8$
000206	112767  000001  000036'		7$:	MOVB	#1,ATTRIB.MSG+6			;					2345
000214	000402 					BR	9$				;					2344
000216	105067  000036'			8$:	CLRB	ATTRIB.MSG+6			;					2346
000222	012766  000030' 000004 		9$:	MOV	#ATTRIB.MSG,4(SP)		; *,DAP.PTR				2348
000230	012704  000007 				MOV	#7,R4				; *,DAP.LEN				2349
000234	152703  000001 				BISB	#1,R3				; *,FLAGS				2350
000240	142703  000002 				BICB	#2,R3				; *,FLAGS				2351
000244	112776  000376  000006 			MOVB	#376,@6(SP)			;					2352
000252	000560 					BR	20$				;					2314
000254	016666  000002  000004 		10$:	MOV	2(SP),4(SP)			; DAP.BFR,DAP.PTR			2361
000262	112776  000003  000004 			MOVB	#3,@4(SP)			; *,DAP.PTR				2368
000270	005266  000004 				INC	4(SP)				; DAP.PTR
000274	105076  000004 				CLRB	@4(SP)				; DAP.PTR				2369
000300	005266  000004 				INC	4(SP)				; DAP.PTR
000304	011600 					MOV	(SP),R0				;					2370
000306	116001  000005 				MOVB	5(R0),R1
000312	020127  000002 				CMP	R1,#2
000316	001404 					BEQ	11$
000320	112776  000001  000004 			MOVB	#1,@4(SP)			; *,DAP.PTR				2371
000326	000403 					BR	12$				;					2370
000330	112776  000002  000004 		11$:	MOVB	#2,@4(SP)			; *,DAP.PTR				2372
000336	005266  000004 			12$:	INC	4(SP)				; DAP.PTR				2371
000342	105076  000004 				CLRB	@4(SP)				; DAP.PTR				2373
000346	005266  000004 				INC	4(SP)				; DAP.PTR
000352	016600  000030 				MOV	30(SP),R0			; LEN,*					2374
000356	020027  000377 				CMP	R0,#377
000362	003402 					BLE	13$
000364	012700  000377 				MOV	#377,R0
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  87
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

000370	010066  000030 			13$:	MOV	R0,30(SP)			; *,LEN
000374	010002 					MOV	R0,R2				; LEN,*					2375
000376	110276  000004 				MOVB	R2,@4(SP)			; *,DAP.PTR
000402	005266  000004 				INC	4(SP)				; DAP.PTR
000406	010246 					MOV	R2,-(SP)			;					2378
000410	016646  000034 				MOV	34(SP),-(SP)			; PTR,*
000414	016646  000010 				MOV	10(SP),-(SP)			; DAP.PTR,*
000420	004767  000000G				JSR	PC,BL$MOV
000424	010066  000012 				MOV	R0,12(SP)			; *,DAP.PTR				2376
000430	005005 					CLR	R5				; FAC					2384
000432	020127  000002 				CMP	R1,#2				;					2386
000436	001003 					BNE	14$
000440	052705  000001 				BIS	#1,R5				; *,FAC					2389
000444	000413 					BR	16$				;					2386
000446	020127  000001 			14$:	CMP	R1,#1
000452	001003 					BNE	15$
000454	052705  000002 				BIS	#2,R5				; *,FAC					2391
000460	000405 					BR	16$				;					2386
000462	020127  000003 			15$:	CMP	R1,#3
000466	001002 					BNE	16$
000470	052705  000010 				BIS	#10,R5				; *,FAC					2393
000474	110576  000012 			16$:	MOVB	R5,@12(SP)			; FAC,DAP.PTR				2396
000500	010204 					MOV	R2,R4				; *,DAP.LEN				2397
000502	062704  000006 				ADD	#6,R4				; *,DAP.LEN
000506	016666  000010  000012 			MOV	10(SP),12(SP)			; DAP.BFR,DAP.PTR			2398
000514	152703  000003 				BISB	#3,R3				; *,FLAGS				2399
000520	062706  000006 				ADD	#6,SP				;					2355
000524	000566 				17$:	BR	30$				;					2314
000526	016600  000034 			18$:	MOV	34(SP),R0			; OP,*					2404
000532	020027  000001 				CMP	R0,#1
000536	001012 					BNE	19$
000540	017600  000010 				MOV	@10(SP),R0			;					2408
000544	012760  000004  000020 			MOV	#4,20(R0)
000552	152703  000002 				BISB	#2,R3				; *,FLAGS				2409
000556	142703  000111 				BICB	#111,R3				; *,FLAGS				2410
000562	000547 					BR	30$				;					2404
000564	020027  000004 			19$:	CMP	R0,#4
000570	001144 					BNE	30$
000572	012766  000054' 000004 			MOV	#ACCOMP.MSG,4(SP)		; *,DAP.PTR				2416
000600	012704  000003 				MOV	#3,R4				; *,DAP.LEN				2417
000604	152703  000007 				BISB	#7,R3				; *,FLAGS				2418
000610	142703  000100 				BICB	#100,R3				; *,FLAGS				2421
000614	000532 				20$:	BR	30$				;					2314
000616	016601  000034 			21$:	MOV	34(SP),R1			; OP,*					2427
000622	020127  000003 				CMP	R1,#3
000626	001016 					BNE	22$
000630	017600  000010 				MOV	@10(SP),R0			;					2431
000634	016066  000002  000002 			MOV	2(R0),2(SP)			; *,DAP.BFR
000642	017600  000010 				MOV	@10(SP),R0			;					2432
000646	016004  000004 				MOV	4(R0),R4			; *,DAP.LEN
000652	142703  000001 				BICB	#1,R3				; *,FLAGS				2433
000656	152703  000002 				BISB	#2,R3				; *,FLAGS				2434
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  88
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

000662	000507 					BR	30$				;					2427
000664	020127  000002 			22$:	CMP	R1,#2
000670	001031 					BNE	23$
000672	017600  000010 				MOV	@10(SP),R0			;					2439
000676	016066  000002  000004 			MOV	2(R0),4(SP)			; *,DAP.PTR
000704	016605  000004 				MOV	4(SP),R5			; DAP.PTR,TEMP				2438
000710	112725  000010 				MOVB	#10,(R5)+			; *,TEMP				2440
000714	105025 					CLRB	(R5)+				; TEMP					2441
000716	112725  000001 				MOVB	#1,(R5)+			; *,TEMP				2442
000722	105025 					CLRB	(R5)+				; TEMP					2443
000724	017601  000010 				MOV	@10(SP),R1			;					2444
000730	010100 					MOV	R1,R0
000732	016104  000026 				MOV	26(R1),R4			; *,DAP.LEN
000736	066004  000020 				ADD	20(R0),R4			; *,DAP.LEN
000742	142703  000012 				BICB	#12,R3				; *,FLAGS				2445
000746	152703  000100 				BISB	#100,R3				; *,FLAGS				2448
000752	000545 					BR	35$				;					2447
000754	020127  000001 			23$:	CMP	R1,#1				;					2427
000760	001027 					BNE	26$
000762	011601 					MOV	(SP),R1				;					2452
000764	116100  000005 				MOVB	5(R1),R0
000770	020027  000001 				CMP	R0,#1
000774	001004 					BNE	24$
000776	012766  000040' 000004 			MOV	#CONTROL.GET.MSG,4(SP)		; *,DAP.PTR				2456
001004	000406 					BR	25$				;					2457
001006	020027  000002 			24$:	CMP	R0,#2				;					2452
001012	001166 					BNE	39$
001014	012766  000046' 000004 			MOV	#CONTROL.PUT.MSG,4(SP)		; *,DAP.PTR				2465
001022	012704  000005 			25$:	MOV	#5,R4				; *,DAP.LEN				2466
001026	152703  000111 				BISB	#111,R3				; *,FLAGS				2467
001032	142703  000002 				BICB	#2,R3				; *,FLAGS				2470
001036	000554 					BR	39$				;					2427
001040	020127  000004 			26$:	CMP	R1,#4
001044	001151 					BNE	39$
001046	012766  000054' 000004 			MOV	#ACCOMP.MSG,4(SP)		; *,DAP.PTR				2476
001054	012704  000003 				MOV	#3,R4				; *,DAP.LEN				2477
001060	152703  000006 			27$:	BISB	#6,R3				; *,FLAGS				2479
001064	000500 					BR	35$				;					2478
001066	142703  000003 			28$:	BICB	#3,R3				; *,FLAGS				2486
001072	152703  000100 				BISB	#100,R3				; *,FLAGS				2489
001076	152703  000010 			29$:	BISB	#10,R3				; *,FLAGS				2488
001102	000532 				30$:	BR	39$				;					2314
001104	016600  000034 			31$:	MOV	34(SP),R0			; OP,*					2493
001110	020027  000003 				CMP	R0,#3
001114	001030 					BNE	32$
001116	017601  000010 				MOV	@10(SP),R1			;					2504
001122	010100 					MOV	R1,R0
001124	016000  000002 				MOV	2(R0),R0
001130	116061  000002  000020 			MOVB	2(R0),20(R1)
001136	105061  000021 				CLRB	21(R1)
001142	062761  000003  000020 			ADD	#3,20(R1)
001150	010100 					MOV	R1,R0				;					2505
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  89
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

001152	010402 					MOV	R4,R2				; DAP.LEN,*
001154	166102  000020 				SUB	20(R1),R2
001160	010260  000026 				MOV	R2,26(R0)
001164	142703  000003 				BICB	#3,R3				; *,FLAGS				2507
001170	111776  000006 				MOVB	(PC),@6(SP)			;					2509
001174	000473 					BR	38$				;					2510
001176	020027  000002 			32$:	CMP	R0,#2				;					2493
001202	001006 					BNE	33$
001204	142703  000040 				BICB	#40,R3				; *,FLAGS				2514
001210	032703  000020 				BIT	#20,R3				; *,FLAGS				2515
001214	001463 					BEQ	38$
001216	000460 					BR	37$				;					2517
001220	020027  000001 			33$:	CMP	R0,#1				;					2493
001224	001006 					BNE	34$
001226	142703  000040 				BICB	#40,R3				; *,FLAGS				2522
001232	032703  000020 				BIT	#20,R3				; *,FLAGS				2523
001236	001452 					BEQ	38$
001240	000447 					BR	37$				;					2525
001242	020027  000004 			34$:	CMP	R0,#4				;					2493
001246	001050 					BNE	39$
001250	012766  000054' 000004 			MOV	#ACCOMP.MSG,4(SP)		; *,DAP.PTR				2530
001256	012704  000003 				MOV	#3,R4				; *,DAP.LEN				2531
001262	152703  000110 				BISB	#110,R3				; *,FLAGS				2533
001266	152703  000001 			35$:	BISB	#1,R3				; *,FLAGS				2532
001272	000436 					BR	39$				;					2314
001274	011601 				36$:	MOV	(SP),R1				;					2549
001276	016100  000010 				MOV	10(R1),R0			; *,STRPTR
001302	112720  000356 				MOVB	#356,(R0)+			; *,STRPTR
001306	005001 					CLR	R1				; DETAIL
001310	011602 					MOV	(SP),R2
001312	156201  000004 				BISB	4(R2),R1			; *,DETAIL
001316	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
001320	010102 					MOV	R1,R2				; DETAIL,*
001322	000302 					SWAB	R2
001324	110220 					MOVB	R2,(R0)+			; *,STRPTR
001326	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
001332	012701  000324 				MOV	#324,R1
001336	012702  000001 				MOV	#1,R2
001342	004767  000000G				JSR	PC,$CBDSG
001346	142703  000040 				BICB	#40,R3				; *,FLAGS				2550
001352	032703  000020 				BIT	#20,R3				; *,FLAGS				2551
001356	001402 					BEQ	38$
001360	152703  000010 			37$:	BISB	#10,R3				; *,FLAGS				2553
001364	152703  000100 			38$:	BISB	#100,R3				; *,FLAGS				2554
001370	032703  000001 			39$:	BIT	#1,R3				; *,FLAGS				2567
001374	001453 					BEQ	41$
001376	017646  000000 				MOV	@0(SP),-(SP)			;					2570
001402	012746  000001 				MOV	#1,-(SP)
001406	010446 					MOV	R4,-(SP)			; DAP.LEN,*
001410	016646  000012 				MOV	12(SP),-(SP)			; DAP.PTR,*
001414	004767  000000G				JSR	PC,UN.WRITE
001420	062706  000010 				ADD	#10,SP
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  90
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

001424	006000 					ROR	R0
001426	103434 					BLO	40$
001430	011601 					MOV	(SP),R1				;					2573
001432	016100  000010 				MOV	10(R1),R0			; *,STRPTR
001436	112720  000356 				MOVB	#356,(R0)+			; *,STRPTR
001442	005001 					CLR	R1				; DETAIL
001444	011602 					MOV	(SP),R2
001446	156201  000004 				BISB	4(R2),R1			; *,DETAIL
001452	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
001454	010102 					MOV	R1,R2				; DETAIL,*
001456	000302 					SWAB	R2
001460	110220 					MOVB	R2,(R0)+			; *,STRPTR
001462	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
001466	012701  000322 				MOV	#322,R1
001472	012702  000001 				MOV	#1,R2
001476	004767  000000G				JSR	PC,$CBDSG
001502	112776  000377  000006 			MOVB	#377,@6(SP)			;					2574
001510	142703  000040 				BICB	#40,R3				; *,FLAGS				2575
001514	152703  000100 				BISB	#100,R3				; *,FLAGS				2576
001520	142703  000001 			40$:	BICB	#1,R3				; *,FLAGS				2579
001524	032703  000004 			41$:	BIT	#4,R3				; *,FLAGS				2586
001530	001415 					BEQ	42$
001532	012746  001000 				MOV	#1000,-(SP)			;					2589
001536	004767  000000G				JSR	PC,UM.GET
001542	010066  000004 				MOV	R0,4(SP)			; *,DAP.BFR
001546	012704  001000 				MOV	#1000,R4			; *,DAP.LEN				2590
001552	142703  000004 				BICB	#4,R3				; *,FLAGS				2591
001556	152703  000020 				BISB	#20,R3				; *,FLAGS				2592
001562	005726 					TST	(SP)+				;					2588
001564	032703  000002 			42$:	BIT	#2,R3				; *,FLAGS				2595
001570	001465 					BEQ	45$
001572	016666  000002  000004 			MOV	2(SP),4(SP)			; DAP.BFR,DAP.PTR			2599
001600	017646  000000 				MOV	@0(SP),-(SP)			;					2606
001604	010446 					MOV	R4,-(SP)			; DAP.LEN,*
001606	016646  000010 				MOV	10(SP),-(SP)			; DAP.PTR,*
001612	004767  000000G				JSR	PC,UN.READ
001616	062706  000006 				ADD	#6,SP
001622	010004 					MOV	R0,R4				; *,DAP.LEN
001624	003034 					BGT	43$				;					2607
001626	011601 					MOV	(SP),R1				;					2610
001630	016100  000010 				MOV	10(R1),R0			; *,STRPTR
001634	112720  000356 				MOVB	#356,(R0)+			; *,STRPTR
001640	005001 					CLR	R1				; DETAIL
001642	011602 					MOV	(SP),R2
001644	156201  000004 				BISB	4(R2),R1			; *,DETAIL
001650	110120 					MOVB	R1,(R0)+			; DETAIL,STRPTR
001652	010102 					MOV	R1,R2				; DETAIL,*
001654	000302 					SWAB	R2
001656	110220 					MOVB	R2,(R0)+			; *,STRPTR
001660	112720  000005 				MOVB	#5,(R0)+			; *,STRPTR
001664	012701  000323 				MOV	#323,R1
001670	012702  000001 				MOV	#1,R2
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  91
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (1)

001674	004767  000000G				JSR	PC,$CBDSG
001700	112776  000377  000006 			MOVB	#377,@6(SP)			;					2611
001706	142703  000040 				BICB	#40,R3				; *,FLAGS				2612
001712	152703  000110 				BISB	#110,R3				; *,FLAGS				2613
001716	142703  000002 			43$:	BICB	#2,R3				; *,FLAGS				2617
001722	005704 					TST	R4				; DAP.LEN				2623
001724	003404 					BLE	44$
001726	117676  000002  000006 			MOVB	@2(SP),@6(SP)			; DAP.BFR,*				2625
001734	000403 					BR	45$				;					2623
001736	112776  000377  000006 		44$:	MOVB	#377,@6(SP)			;					2627
001744	032703  000010 			45$:	BIT	#10,R3				; *,FLAGS				2635
001750	001413 					BEQ	46$
001752	016646  000002 				MOV	2(SP),-(SP)			; DAP.BFR,*				2638
001756	012746  001000 				MOV	#1000,-(SP)
001762	004767  000000G				JSR	PC,UM.RELEASE
001766	005066  000006 				CLR	6(SP)				; DAP.BFR				2639
001772	142703  000030 				BICB	#30,R3				; *,FLAGS				2641
001776	022626 					CMP	(SP)+,(SP)+			;					2637
002000	032703  000100 			46$:	BIT	#100,R3				; *,FLAGS				2645
002004	001002 					BNE	47$
002006	000167  176040 				JMP	1$
002012	005000 				47$:	CLR	R0				;					2261
002014	032703  000040 				BIT	#40,R3				; *,FLAGS
002020	001401 					BEQ	48$
002022	005200 					INC	R0
002024	062706  000012 			48$:	ADD	#12,SP				;					2237
002030	000207 					RTS	PC
; Routine Size:  525 words,	Routine Base:  $CODE$ + 6366
; Maximum stack depth per invocation:  16 words


000060						.PSECT	$PLIT$,  RO ,  D  

					P.AAL:						; CASE Table for FAL.ACCESS+0072	2314
000060	000156 					.WORD	156				; [10$]
000062	000022 					.WORD	22				; [4$]
000064	000044 					.WORD	44				; [5$]
000066	000062 					.WORD	62				; [6$]
000070	000430 					.WORD	430				; [18$]
000072	000000 					.WORD	0				; [2$]
000074	000000 					.WORD	0				; [2$]
000076	000000 					.WORD	0				; [2$]
000100	000520 					.WORD	520				; [21$]
000102	000770 					.WORD	770				; [28$]
000104	001006 					.WORD	1006				; [31$]
000106	001176 					.WORD	1176				; [36$]
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  92
X03.09		FAL_ACCESS					14-Nov-1984 14:22:19	DNET61:<MCB.NML>FALACC.BLI.1 (2)

;	 R2655	
;	 R2656	! Local Modes:
;	 R2657	! Mode:BLISS
;	 R2658	! Auto Save Mode:2
;	 R2659	! Comment Column:40
;	 R2660	! Comment Rounding:+1
;	 R2661	! End:
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  93
X03.09		FAL_ACCESS					14-Nov-1984 14:23:02	DNET61:<MCB.NML>FILMCB.B16.1 (8)

;	 R2662	
;	 R2663	! Local Modes:
;	 R2664	! Mode:BLISS
;	 R2665	! Auto Save Mode:2
;	 R2666	! Comment Column:40
;	 R2667	! Comment Rounding:+1
;	 R2668	! End:
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  94
X03.09		FAL_ACCESS					12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (18)

;	  2669	
;	  2670	end				! End of Module NMUFIL
;	  2671	eludom



;					OTS external references
						.GLOBL	$SAVE5, $SAVE4, $SAVE3, $SAVE2
						.GLOBL	BL$FSB, BL$MOV


;					PSECT SUMMARY
;
;	Psect Name			Words	  Attributes
;	 $OWN$				    1	    RW ,  D  ,  LCL,  REL,  CON
;	 $CODE$				 2184	    RO ,  I  ,  LCL,  REL,  CON
;	 $PLIT$				   36	    RO ,  D  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  DNET61:<MCB.NML>NMULIB.L16.1		      2716       166         6         0
NMUFIL								24-May-1985 13:27:15	TOPS-20 Bliss-16 2A(530)	    Page  95
X03.09		FAL_ACCESS					12-Nov-1984 13:10:28	DNET61:<MCB.NML>NMUFIL.BLI.1 (19)

;	  2672	
;	  2673	! Local Modes:
;	  2674	! Mode:BLISS
;	  2675	! Auto Save Mode:2
;	  2676	! Comment Column:40
;	  2677	! Comment Rounding:+1
;	  2678	! End:
; Size:		2184 code + 37 data words
; Run Time:	00:47.4
; Elapsed Time:	01:00.2
; Memory Used:	119 pages
; Compilation Complete
ACCOMP_LEN			2270+#	2414+	2474+	2528+
ACCOMP_MSG			2269+#	2413+	2473+	2527+
ALL				2275+#	2276+	2301+
ALLOCATE			2279+#	2327+	2417+	2476+	2583+	2588+
ALLOC_BUFFER			 164	 615
ATTRIB_LEN			2264+#	2346+
ATTRIB_MSG			2263+#	2342+	2343+	2345+
B1				 236	 237	 250	 251
B2				 236	 238	 240	 250	 252	 254
B3				 236	 241	 243
B4				 236	 244	 246
BD_ADDRESS			 369#	1280	1711+	1783+	1787+	1978+	2003+	2030+	2120+	2428+	2436+	2501+
BD_ALLOCATION			 371#	1717+	1783+	1789+
BD_BIAS				 374#	1255	1279	1281	1980+	2032+	2405+	2441+	2501+	2502+
BD_CHANGED_COUNT		 380#	1194	1289
BD_CHANGED			 381#	 985	1195	1291	1506
BD_CURRENT_POSITION		 375#	1020	1032	1178	1190	1276	1281	1971+	1976+	1979+	2025+	2029+
				2031+
BD_DATA_COUNT			 377#	1192	1271	1276	1278	1975+	2010+	2013+	2028+	2122+	2125+	2441+
				2502+
BD_END_OF_FILE			 383#	 993	1292
BD_FILE_POSITION		 372#	1123	1253	1254	1269	1960+	1970+	2000+	2009+	2012+	2019+	2024+
				2124+
BD_LENGTH			 370#	1255	1277	1718+	1788+	2002+	2119+	2429+
BD_MAX_POSITION			 373#	1125	1254	1255	1962+	2012+	2013+	2021+
BD_NEXT				 368#	1730+	1734+	1735+	1791+	1793+
BD_POINTER			 376#	1024	1027	1031	1184	1186	1280	1978+	2030+
BD_REMAINING_COUNT		 378#	 982	1016	1030	1038	1174	1193	1199	1208	1277	1975+	2028+
BD_VALID			 382#	 959	1111	1290	1506	1701+	2043+	2121+
BEG_PTR				 692	 700#	 708	 718	 719	 726	 747	 805
BIN				 300
BOUT				 300
BUFFER				 951#	 959	 982	 985	 993	1005#	1016	1020	1024	1027	1030#	1031#
				1032#	1038	1109#	1111	1123	1125	1163#	1174	1178	1184#	1186	1190#
				1192#	1193#	1194#	1195#	1199	1208	1246#	1253	1254	1255	1269	1271
				1276#	1277#	1278	1279	1280#	1281	1289#	1290#	1291#	1292#	1500#	1506
				1697+	1699+#	1701+#	1711+#	1717+#	1718+#	1729+	1730+#	1734+#	1735+	1771+	1773+#
				1783+	1787+#	1788+#	1789+#	1791+	1793+	1795+	1939+#	1960+	1962+	1970+	1971+
				1975+#	1976+	1978+#	1979+	1980+	2000+	2002+	2003+	2009+	2010+	2012+	2013+
				2019+	2021+	2024+	2025+	2028+#	2029+	2030+#	2031+	2032+	2043+#	2104+#	2119+
				2120+	2121+#	2122+	2124+	2125+	2260+#	2405+#	2428+	2429+	2436+	2441+	2501+#
				2502+#
BUFFER_ALLOCATED		2281+#	2317+	2512+	2520+	2548+	2557+	2589+	2638+
BUFFER_DATA_BLOCK		 273#	 951	1005	1109	1163	1246	1500	1694+	1697+	1768+	1771+	1939+
				2104+	2260+
BUFFER_DATA_BLOCK_ALLOCATION	 388#	1699+	1795+
BUFFER_DATA_BLOCK_SIZE		 273	 277	 387#
BUFFER_DATA_FIELDS		 274	 278	 366#
BUFFER_PAGE			1944+	2108+
BUFFER_RING			1768+#	1773+	1792+#	1793+#
BYTE_COUNT			1381	1412	1432
BYTE_POSITION			1299	1331	1354	1366
BYTE_SIZE			1247#	1282	1940+#	1981+	2033+
CB_ACCOUNT_LENGTH		1874+
CB_ACCOUNT			1875+
CB_DATA_LENGTH			1878+
CB_DESCRIPTOR_LENGTH		1851+
CB_HOST				1870+
CB_HOST_LENGTH			1871+
CB_OBJECT			1850+
CB_PASSWORD			1877+
CB_PASSWORD_LENGTH		1876+
CB_TASK_LENGTH			1852+
CB_USERID			1873+
CB_USERID_LENGTH		1872+
CH$ASCII			 708	 726	 757	 868	 869	 870
CH$BYTE				 236#	 250#	2261+	2263+	2265+	2267+	2269+
CH$WCHAR			2342+	2343+
CHR				 854	 856#	 857	 861#
CLOSE_FILE			 169	1518	1903+
CLOSF				 300
CONFIG_LEN			2262+#	2324+
CONFIG_MSG			2261+#	2323+
CONNECT_BLOCK			1840+
CONN_BLK			1840+	1850+#	1851+#	1852+#	1870+#	1871+#	1872+#	1873+#	1874+#	1875+#	1876+#	1877+#
				1878+#	1880+
CONTROL_GET_LEN			2266+#	2454+
CONTROL_GET_MSG			2265+#	2453+
CONTROL_PUT_LEN			2268+#	2463+
CONTROL_PUT_MSG			2267+#	2462+
CP				1371	1372	1374	1437	1438	1440
DAP_BFR				2289+	2303+#	2339+	2358+	2395+	2428+#	2539+	2586+#	2596+	2622+	2635+	2636+#
DAP_BFR_ALLOCATION		 423#	2586+	2587+	2635+
DAP_BFR_LENGTH			 421#	 422
DAP_BFR_SIZE			 422#	 423
DAP_CLOSE			 315#	2170+	2411+	2471+	2525+
DAP_GET				 314#	2002+	2426+	2492+
DAP_LEN				2291+	2324+#	2346+#	2394+#	2414+#	2429+#	2441+#	2454+#	2463+#	2474+#	2502+	2528+#
				2567+	2580+	2587+#	2603+#	2620+	2628+	2629+
DAP_MESSAGE_TRACE		2578+	2626+
DAP_OPEN			 312#	1894+	2403+	2447+	2517+
DAP_PTR				2290+	2323+#	2345+#	2358+#	2365+	2366+	2368+	2369+	2370+	2372+	2373+#	2375+
				2393+	2395+#	2413+#	2436+#	2453+#	2462+#	2473+#	2527+#	2539+#	2540+	2567+	2580+
				2596+#	2604+	2629+
DAP_PUT				 313#	2119+	2433+	2509+
DEALLOCATE			2280+#	2319+	2407+	2443+	2456+	2465+	2485+	2514+	2522+	2530+	2550+	2559+
				2610+	2632+	2637+
DEALLOC_BUFFER			 165	 627	1527
DECLARE_JSYS			 300
DEST_COUNT			 885	 922	 928	1050
DEST_PTR			 885	1026#	1028
DONE				2283+#	2316+	2408+	2418+	2445+	2457+	2466+	2486+	2507+	2515+	2523+	2531+
				2551+	2560+	2573+	2611+	2642+
FAC				2295+#	2381+#	2386+#	2388+#	2390+#	2393+
FAL_ACCESS			 170	1894+	2002+	2119+	2170+
FAL_OBJECT			 420#	1850+
FD_ACCESS			 329#	 561	 568	 574	2367+	2383+	2449+
FD_BYTE_SIZE			 331#	 563	 570	 576	1247	1940+
FD_CURRENT_BUFFER		 337#	 614	 951	1005	1109	1163	1246	1500	1694+	1768+	1939+	2104+
				2260+
FD_CURRENT_POSITION		 333#	 639	1033	1123	1125	1201	1270	1354	1366	1372	1432	1438
				1960+	1962+	1969+	2019+	2021+	2023+
FD_DAP_STATE			 341#	 607	2309+	2311+	2349+	2506+	2571+	2608+	2622+	2624+
FD_FILE_POSITION		 335#	 640	1253	2000+	2009+	2010+	2124+	2125+
FD_FORMAT			 330#	 562	 569	 575
FD_JFN				 260#	1535	1880+	2176+	2567+	2603+
FD_LENGTH			 336#	 622	2122+
FD_LOCAL			 342#	 603	 606	1352	1703+	1775+	1831+	1986+	2111+	2160+
FD_NAME				 263#	 584
FD_PAGE_COUNT			 265#
FD_RESPONSE			 332#	 549	 759	 785	 811	 817	 942	1105	1345	1357	1426	1491
				1881+	1883+	2545+	2569+	2606+
FD_SEEK_DONE			 343#	 641	 959	1117	1120	1367	1433	1954+	1958+
FD_TYPE				 328#	 548	 759	 785	 811	 817	1357	1883+	2545+	2569+	2606+
FILE				 509	 547#	 548#	 549#	 561#	 562#	 563#	 568#	 569#	 570#	 574#	 575#
				 576#	 584	 593	 596	 603#	 606#	 607#	 614#	 615	 622	 624	 627
				 628	 639	 640	 641#	 648	 653	 660	 759	 785	 811	 817	 916
				 934#	 942#	 951	 959	 962	 988	 997	1005	1033	1083	1096#	1105#
				1109	1117	1120#	1123	1125	1130	1151	1163	1201	1211	1214	1224
				1246	1247	1253	1270	1326	1337#	1345#	1352	1354	1357	1366	1367#
				1372	1407	1418#	1426#	1432	1433#	1438	1473	1483#	1491#	1500	1509
				1518	1527	1531	1535	1600	1606	1623	1668+	1694+	1703+	1742+	1768+
				1775+	1801+	1831+	1880+#	1881+	1883+	1894+	1903+	1913+	1939+	1940+	1954+
				1958+#	1960+	1962+	1969+	1986+	2000+	2002+	2009+	2010+	2019+	2021+	2023+
				2049+	2104+	2111+	2119+	2122+	2124+	2125+	2134+	2160+	2170+	2176+	2234+
				2260+	2309+	2311+	2349+#	2367+	2383+	2449+	2506+#	2545+	2567+	2569+	2571+#
				2603+	2606+	2608+#	2622+#	2624+#
FILE_ACCESS_RANDOM		 353#	 568	2389+
FILE_ACCESS_READ_ONLY		 351#	 561	2387+	2451+
FILE_ACCESS_WRITE_ONLY		 352#	 574	2367+	2385+	2460+
FILE_BUFFER_BLOCK		 277#
FILE_DATA_BLOCK_ALLOCATION	 348#	 547	 596	 628	1531
FILE_DATA_BLOCK_SIZE		 269	 277	 347#
FILE_DATA_BLOCK			 269#	 509	 660	 916	1083	1224	1326	1407	1473	1668+	1742+	1801+
				1913+	2049+	2134+	2234+
FILE_DATA_FIELDS		 270	 278	 325#
FILE_DATA_TRACE			1022	1180
FILE_DUMP_IMAGE			 572
FILE_ERROR			 159
FILE_FORMAT_18_FOR_16		 357#	 562	 575
FILE_FORMAT_BYTE_STREAM		 356#
FILE_FORMAT_SWAPPED_BYTES	 358#	 569
FILE_FORMAT_WORD		 359#
FILE_ID				 510	 526#	 527	 539#	 540	 597#	 598	 629#	 630	 648#	 652	 655
				 885	 921	 934	1055	1089	1096	1299	1330	1337	1381	1411	1418
				1447	1477	1483	1529	1543	1573	1606	1616
FILE_NAME			 473	 514	 515	 521	 534	 551
FILE_NAME_BLOCK			 281#	 508	 661	1801+
FILE_NAME_FIELDS		 282	 395#
FILE_NAME_FIELDS_ALLOCATION	 413#
FILE_NAME_FIELDS_SIZE		 281	 412#
FILE_PAGE			1943+	2107+
FILE_PERMANENT_DATA_BASE	 566
FILE_SECONDARY_DUMPER		 559
FILE_SECONDARY_LOADER		 557
FILE_SYSTEM_IMAGE		 556
FILE_SYS_SPEC_FIELDS		 259#	 327
FILE_TABLE			 431	 466	 648	1529	1606
FILE_TERTIARY_LOADER		 558
FILE_TRACE			 468	 512	 650	 919	1018	1022	1036	1087	1114	1128	1135	1145
				1176	1180	1197	1294	1328	1369	1409	1435	1475	1533	1614	2297+
				2308+	2578+	2626+	2644+
FILE_TYPE			 473	 524	 537	 548	 554
FIND_FILE_DATA_BLOCK		 160	 934	1096	1337	1418	1483
FIRST_BUFFER			1694+#	1726+	1729+#	1734+	1735+#
FLAGS				2288+	2301+#	2302+#	2315+#	2316+#	2317+	2319+#	2325+#	2326+#	2327+#	2347+#	2348+#
				2396+#	2397+#	2406+#	2407+#	2408+#	2409+#	2415+#	2416+#	2417+#	2418+#	2430+#	2431+#
				2442+#	2443+#	2444+#	2445+#	2455+#	2456+#	2457+#	2458+#	2464+#	2465+#	2466+#	2467+#
				2475+#	2476+#	2477+#	2483+#	2484+#	2485+#	2486+#	2504+#	2505+#	2507+#	2511+#	2512+
				2514+#	2515+#	2519+#	2520+	2522+#	2523+#	2529+#	2530+#	2531+#	2547+#	2548+	2550+#
				2551+#	2556+#	2557+	2559+#	2560+#	2564+	2572+#	2573+#	2576+#	2583+	2588+#	2589+#
				2592+	2609+#	2610+#	2611+#	2614+#	2632+	2637+#	2638+#	2642+	2645+	2649+
FLAG_COUNT			1945+	2109+
FLAG_FIELDS			2273+#	2288+
FLD				 229#
FN				 508	 551#	 552#	 582	 583	 593	 601	 624	 661	 700	 701	 718#
				 720#	 734#	 735#	 736#	 737#	 747#	 749	 765	 766	 769	 770	 773
				 774	 783	 794#	 804#	 805#	 806#	 809	 815	1801+	1861+	1862+	1872+
				1873+	1874+	1875+	1876+	1877+	1895+	1896+
FN_ACCOUNT_LENGTH		 400#	 736	 774	1874+
FN_ACCOUNT_POINTER		 406#	 773	1875+
FN_HOST_LENGTH			 398#	 601	 734	 747	 749	 783	 804	1861+	1862+
FN_HOST_POINTER			 404#	 718	1862+
FN_LENGTH			 397#	 552	 582	 583	 701	 720
FN_NAME_LENGTH			 402#	 720	 806	 809	 815	1896+
FN_NAME_POINTER			 408#	 794	 805	1895+
FN_PASSWORD_LENGTH		 401#	 737	 770	1876+
FN_PASSWORD_POINTER		 407#	 769	1877+
FN_POINTER			 403#	 551	 552	 582	 700
FN_USER_LENGTH			 399#	 735	 766	1872+
FN_USER_POINTER			 405#	 765	1873+
FORMAT_BUFFER			1023	1181	2579+	2627+
GETW				2540+
GTJFN				 300
HOST				 473
ILEN				 826	 857	 860#	 867	 868	 869	 870	 879#
IPTR				 826	 856	 859#	 861	 868	 869	 870	 876	 877	 878#
LEN				2234+	2371+#	2372+	2373+	2394+
MASK				 196	 197	 209	 210	 223	 224	 229	 230
MAX_FILE_NAME_LENGTH		 263	 318#	 534	 583
MOVE_COUNT			1008	1016#	1020	1024	1026	1030	1031	1032	1033	1034	1166	1174#
				1178	1182	1184	1187	1188	1190	1192	1193	1194	1201
NICE$_FIO			1357	1618	2545+	2569+	2606+
NICE$_FOE			 524	 537	 759	 785	 811	 817	1883+
NICE$_LCF			1881+
NMU$FILE_CLOSE			 158
NMU$FILE_INITIALIZE		 149
NMU$FILE_OPEN			 150
NMU$FILE_READ			 153
NMU$FILE_SEEK			 156
NMU$FILE_SKIP			 157
NMU$FILE_WRITE			 154
NMU$MEMORY_GET			 547	1699+	1711+	2586+
NMU$MEMORY_MANAGER		 444
NMU$MEMORY_RELEASE		 596	 628	1531	1783+	1795+	2635+
NMU$NETWORK_CLOSE		2176+
NMU$NETWORK_OPEN		1880+
NMU$NETWORK_READ		2603+
NMU$NETWORK_UTILITIES		 443
NMU$NETWORK_WRITE		2567+
NMU$TABLE_CLEAR			 466
NMU$TABLE_DELETE		1529
NMU$TABLE_FETCH			1606
NMU$TABLE_INSERT		 648
NMU$TABLE_ROUTINES		 442
NMU$TEXT			 441
NMUFIL				  97#
NODE_BFR			1841+	1858+	1870+
NODE_ID_BUFFER_LENGTH		1863+
NODE_ID_BUFFER_SIZE		1841+
NODE_PTR			1842+	1858+#	1859+	1860+	1861+	1862+
OLEN				 826	 872#	 876#	 879
OP				2234+	2299+	2401+	2424+	2490+
OPENF				 300
OPEN_FILE			 166	 624
OPTR				 826	 877#
OSTYPE				2294+#	2339+#	2341+
PAGE_SIZE			 303#
PARSE_ACCESS_CONTROL		 152	 764	 768	 772
PARSE_FILE_SPECIFICATION	 151	 593
PTR				 853	 868#	 869#	 870#	 876	 878	2234+	2374+
PUTB				1859+	1860+	1861+#	2365+	2366+	2368+	2369+	2370+	2372+	2393+
READ_FILE			 167	 962	 997
RECEIVE				2278+#	2326+	2348+	2397+	2406+	2416+	2431+	2442+	2458+	2467+	2477+	2484+
				2505+	2592+	2614+
REMOTE_BUFFER_ALLOCATION	 292#	1711+	1717+
REMOTE_BUFFER_LENGTH		 291#	 292	1718+
RFPTR				 300
RSP_PTR				 473	 524	 537	 549	 885	 934	 942	1055	1096	1105	1299	1337
				1345	1381	1418	1426	1447	1483	1491	1543	1573	1618
RTN_COD				2117+	2119+#	2129+
SEND				2277+#	2325+	2347+	2396+	2409+	2415+	2430+	2444+	2455+	2464+	2475+	2483+
				2504+	2529+	2564+	2576+
SETUP_NEEDED			1085	1121#	1141#	1147#	1150
SETUP_WRITE_BUFFER		 155	1151	1214
SFPTR				 300
SOURCE_LINK			1880+
SOURCE_PTR			1055	1182	1185	1187#
SUCCESS				2282+#	2302+	2315+	2511+	2519+	2547+	2556+	2572+	2609+	2645+	2649+
TEMP				1844+	1966+	2287+	2294+	2295+	2435+#	2437+	2438+	2439+	2440+	2540+#	2542+
				2543+
TEMP32				1243	1269	1270	1271	1967+	1969+	1970+	1971+	1995+	2023+	2024+	2025+
THIRTY_TWO_BIT			1243	1967+	1995+
TMP_LTH				 694	 701#	 708	 719#	 720	 726	 734	 749#	 757	 764	 768	 772
				 806
TMP_PTR				 693	 700#	 708#	 719	 726#	 747	 748#	 757	 764	 768	 772	 794
TRACE_INFO			 469	 513	 651	 920	1019	1037	1088	1115	1129	1136	1146	1177
				1198	1295	1329	1373	1410	1439	1476	1534	1615	2298+	2309+	2541+
				2646+	2647+
VAL				 229	 230
WRITE_COUNT			1055	1090	1104
WRITE_FILE			 168	 988	1130	1211	1509
XFR_COUNT			 917	 928#	 971	1016	1034#	1050	1084	1104#	1159	1174	1188#
$32BIT_INTEGER			 181#	 333	 335	 336	 372	 373
$ADDRESS			 337	 368	 369
$BIT				 342	 343	 381	 382	 383	2277+	2278+	2279+	2280+	2281+	2282+	2283+
$BITS				2275+
$BYTE				 328
$FALSE				 606	 641	 761	 787	 813	 819	 873	1097	1120	1131	1141	1212
				1291	1339	1359	1420	1485	1511	1520	1701+	1707+	1709+	1714+	1779+
				1781+	1835+	1885+	1904+	1958+	1990+	1992+	2006+	2113+	2121+	2162+	2315+
				2348+	2409+	2418+	2430+	2443+	2458+	2467+	2484+	2505+	2511+	2519+	2547+
				2556+	2572+	2576+	2588+	2609+	2614+	2637+	2638+
$FIELD				 324	 365	 394	2272+
$FIELD_SET_SIZE			 347	 387	 412
$FIELD_SET_UNITS		 348	 388	 413
$INTEGER			 184	 260	 265	 370	 371	 374	 375	 377	 378	 380	 397	 398
				 399	 400	 401	 402
$MCB				 182	 233	 261	 308	 441	1247	1630	1940+
$OVERLAY			2276+
$P				 196#	 224
$P$S				 223#
$POINTER			 332	 376	 403	 404	 405	 406	 407	 408
$RESPONSE_X			 524	 537	 759	 785	 811	 817	1357	1618	1883+	2545+	2569+	2606+
$S				 209#	 224
$STRING				 263
$SUB_BLOCK			 183
$TINY_INTEGER			 329	 330	 331	 341
$TOPS10				 227	 306	2666
$TOPS20				 298	 580	1628
$TRUE				 603	 822	 880	1121	1147	1195	1219	1290	1292	1367	1376	1433
				1442	1539	1569	1705+	1738+	1777+	1797+	1909+	1982+	1988+	2043+	2045+
				2180+	2302+	2316+	2319+	2327+	2347+	2397+	2406+	2417+	2431+	2445+	2457+
				2466+	2477+	2486+	2507+	2514+	2515+	2522+	2523+	2531+	2550+	2551+	2559+
				2560+	2567+	2573+	2589+	2611+
%ADDI32				1033	1201	1255	1432	2010+	2013+	2122+	2125+
%CMP32				1123	1125	1960+	1962+	2019+	2021+
%CMPI32				1354
%DEBUG				 468	 512	 650	 919	1018	1022	1036	1087	1114	1128	1135	1145
				1176	1180	1197	1294	1328	1369	1409	1435	1475	1533	1614	2297+
				2308+	2538+	2578+	2626+	2644+
%DEBUG_DATA_BASE		 438
%GLOBAL_ROUTINE			 447#	 473#	 885#	1055#	1299#	1381#	1447#
%MODULE_NAME			 288
%MOV32				1253	1254	1269	1969+	2000+	2009+	2012+	2023+	2124+
%MOVF32				1271	1372	1438	1971+	2025+
%MOVI32				 622	 639	 640	1366
%ROUTINE			 660#	 826#	1224#	1543#	1573#	1668+#	1742+#	1801+#	1913+#	2049+#	2134+#	2234+#
%SUB32				1270	1970+	2024+