Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/nml/nmumcb.lst
There are no other files named nmumcb.lst in the archive.
								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   1
								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (1)

;	  0001	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.2  2-Jul-82 21:41:12, Edit by PECKHAM
;	  0002	!
;	  0003	! Ident 09.
;	  0004	! Fix parameter order in NMU$NMX_IO routine
;	  0005	!
;	  0006	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.2 29-Jun-82 09:55:42, Edit by PECKHAM
;	  0007	!
;	  0008	! Ident 08.
;	  0009	! Change SS$EVR routine into more general NMU$NMX_IO routine.
;	  0010	!
;	  0011	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.6 26-May-82 10:19:07, Edit by PECKHAM
;	  0012	!
;	  0013	! Ident 07.
;	  0014	! Correct SS$GTM and SS$TDF time arithmetic -
;	  0015	! SECONDS_PER_HALFDAY is 16 bits, and therefore is a negative number!
;	  0016	!
;	  0017	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.5 26-Mar-82 09:03:39, Edit by PECKHAM
;	  0018	!
;	  0019	! Ident 06.
;	  0020	! Use new MCB TIME_BLOCK structure to optimize code.
;	  0021	!
;	  0022	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.3 23-Mar-82 17:17:14, Edit by PECKHAM
;	  0023	!
;	  0024	! Ident 05.
;	  0025	! Fix SS$GTM to set uptime in TIME_BLOCK if detected.
;	  0026	!
;	  0027	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.2 19-Feb-82 16:08:01, Edit by PECKHAM
;	  0028	!
;	  0029	! Ident 04.
;	  0030	! Change INTERRUPT_ROUTINE reference to IO_INTERRUPT_ROUTINE in SS$EVR.
;	  0031	!
;	  0032	!NET:<PECKHAM.DEVELOPMENT>NMUMCB.B16.5  5-Feb-82 18:34:32, Edit by PECKHAM
;	  0033	!
;	  0034	! Ident 03.
;	  0035	! Initialize event blocks in SS$EVR.
;	  0036	! Correct julian half-day calculation in SS$GTM to account for bliss feature
;	  0037	! of evaluating (+-) from right to left!
;	  0038	!
;	  0039	!NET:<DECNET20-V3P1.NMLLIB>NMUMCB.B16 4-Dec-81 16:15:19, Edit by THIGPEN
;	  0040	!
;	  0041	! Ident 02.
;	  0042	! Add timeout arg to NMU$SCHED_WAIT call
;	  0043	!
;	  0044	module NMUMCB (					! MCB Specific BLISS Routines
;	  0045			ident = 'X00.09'
;	  0046			) =
;	  0047	begin
;	  0048	!
;	  0049	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0050	!                    DIGITAL EQUIPMENT CORPORATION
;	  0051	!                        Maynard, Massachusetts
;	  0052	!
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   2
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (1)

;	  0053	!     This software is furnished under a license and may  be  used
;	  0054	!     and copied only in accordance with the terms of such license
;	  0055	!     and with the inclusion of the above copyright notice.   This
;	  0056	!     software  or any other copies thereof may not be provided or
;	  0057	!     otherwise made available to any other person.  No  title  to
;	  0058	!     and ownership of the software is hereby transferred.
;	  0059	!
;	  0060	!     The information  in  this  software  is  subject  to  change
;	  0061	!     without  notice  and should not be construed as a commitment
;	  0062	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0063	!
;	  0064	!     DIGITAL assumes no responsibility for the use or reliability
;	  0065	!     of  its  software  on  equipment  which  is  not supplied by
;	  0066	!     DIGITAL.
;	  0067	!
;	  0068	
;	  0069	!++
;	  0070	! Facility: LSG DECnet Network Management
;	  0071	!
;	  0072	! Abstract:
;	  0073	!
;	  0074	!	This set of routines offer system specific routines written in
;	  0075	!	BLISS-16 for the MCB Environment.
;	  0076	!
;	  0077	! Environment: MCB RSX task level
;	  0078	!
;	  0079	! Author: Scott G. Robinson, Creation Date: 21-Jan-81
;	  0080	!
;	  0081	!--
;	  0082	
;	  0083	!<BLF/SYNONYM %UNQUOTE =>
;	  0084	!<BLF/SYNONYM $FIELD=FIELD>
;	  0085	!<BLF/PAGE>
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   3
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (2)

;	  0086	!
;	  0087	! Include files
;	  0088	!
;	  0089	
;	  0090	library 'NMULIB';
;	  0091	
;	  0092	!
;	  0093	! Table of contents
;	  0094	!
;	  0095	
;	  0096	forward routine
;	  0097	    SS$GTM : novalue,                   ! Get TIME_BLOCK with OFFSET from now
;	  0098	    SS$STI : novalue,                   ! Set Timer Interrupt for future
;	  0099	    SS$TDF,                             ! Return Time Differential
;	  0100	    SS_MESSAGE : novalue,               ! Send message to Console
;	  0101	    NMU$NMX_IO;                         ! Do NMX QIO
;	  0102	
;	  0103	!
;	  0104	! Own Variables
;	  0105	!
;	  0106	
;	  0107	own
;	  0108	    TIME_BUF : BLOCK [8],
;	  0109	    TIME : GTIM$ (TIME_BUF);
;	  0110	
;	  0111	external routine
;	  0112	    NMU$SCHED_MANAGER;
;	  0113	
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   4
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (3)

;	  0114	global routine SS$GTM (OFFSET, TIM_BLK) : novalue =
;	  0115	
;	  0116	!++
;	  0117	! Functional description:
;	  0118	!
;	  0119	!	SS$GTM updates TIM_BLK to reflect the current time + OFFSET (in
;	  0120	!	seconds.
;	  0121	!
;	  0122	! Formal parameters:
;	  0123	!
;	  0124	!	OFFSET - the number of seconds in the future to set TIM_BLK to
;	  0125	!	TIM_BLK - a TIME_BLOCK
;	  0126	!
;	  0127	! Routine value: none
;	  0128	! Side effects:
;	  0129	!	None
;	  0130	!--
;	  0131	
;	  0132	    begin
;	  0133	
;	  0134	    map
;	  0135		TIM_BLK : ref TIME_BLOCK;
;	  0136	
;	  0137	    builtin
;	  0138	        rot;
;	  0139	
;	  0140	    local
;	  0141		JULIAN,
;	  0142	        SECOND;
;	  0143	
;	  0144	!
;	  0145	! Start by getting current TIME.
;	  0146	!
;	  0147	    dir$ (TIME);
;	  0148	!
;	  0149	! Fixup year for Algorithm
;	  0150	!
;	  0151	    JULIAN = .TIME_BUF [G$TIYR];
;	  0152	
;	  0153	    if .JULIAN geq 77
;	  0154	    then
;	  0155		begin
;	  0156		!
;	  0157		! Calculate Julian Half-Day
;	  0158		!
;	  0159		JULIAN = .JULIAN + 1900;
;	  0160		JULIAN = (3055*(.TIME_BUF [G$TIMO] + 2)/100 -
;	  0161		    (.TIME_BUF [G$TIMO] + 10)/13*2) - 91 +
;	  0162		    (1 - (.JULIAN - (.JULIAN/4*4 + 3))/4)*
;	  0163		    ((.TIME_BUF [G$TIMO] + 10)/13 + .TIME_BUF [G$TIDA]) - 1 +
;	  0164		    (.JULIAN - 1977)*365 + (.JULIAN - 1977)/4;
;	  0165		end
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   5
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (3)

;	  0166	    else
;	  0167		begin
;	  0168	        bind
;	  0169	            MONTH = uplit (0,31,59,90,120,151,181,212,243,273,304,334) : vector;
;	  0170		!
;	  0171		! Calculate the uptime
;	  0172		!
;	  0173		JULIAN = .JULIAN*365;
;	  0174		JULIAN = .JULIAN + .MONTH [.TIME_BUF [G$TIMO]] + .TIME_BUF [G$TIDA];
;	  0175		end;
;	  0176	
;	  0177	!
;	  0178	! Formulate rest of time
;	  0179	!
;	  0180	
;	  0181	    JULIAN = .JULIAN*2 + (.TIME_BUF [G$TIHR]/12);
;	  0182	    SECOND = ((.TIME_BUF [G$TIHR] mod 12)*60 +
;	  0183	              .TIME_BUF [G$TIMI])*60 +
;	  0184	             .TIME_BUF [G$TISC];
;	  0185	
;	  0186	    if .OFFSET nequ 0
;	  0187	    then
;	  0188	        begin
;	  0189	
;	  0190	        literal
;	  0191	            SECONDS_PER_HALFDAY = 12*60*60;
;	  0192	
;	  0193	        if .OFFSET gequ SECONDS_PER_HALFDAY
;	  0194	        then
;	  0195	            begin
;	  0196	            OFFSET = .OFFSET - SECONDS_PER_HALFDAY;
;	  0197	            JULIAN = .JULIAN + 1;
;	  0198	            end;
;	  0199	
;	  0200	        if rot (SECOND = .SECOND + .OFFSET, 1)
;	  0201	        then
;	  0202	            begin
;	  0203	            SECOND = .SECOND - SECONDS_PER_HALFDAY;
;	  0204	            JULIAN = .JULIAN + 1;
;	  0205	            end
;	  0206	        else
;	  0207	            if .SECOND gequ SECONDS_PER_HALFDAY
;	  0208	            then
;	  0209	                begin
;	  0210	                SECOND = .SECOND - SECONDS_PER_HALFDAY;
;	  0211	                JULIAN = .JULIAN + 1;
;	  0212	                end;
;	  0213	
;	  0214	        end;
;	  0215	
;	  0216	!
;	  0217	! Return the updated time block
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   6
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (3)

;	  0218	!
;	  0219	    TIM_BLK [TIME_JULIAN] = .JULIAN;
;	  0220	    TIM_BLK [TIME_SECOND] = .SECOND;
;	  0221	    TIM_BLK [TIME_MILLISECOND] = %o'100000';
;	  0222	!
;	  0223	    end;					! End of SS$GTM


						.TITLE	NMUMCB
						.IDENT	/X00.09/


000000						.PSECT	$PLIT$,  RO ,  D  
000000	000000 				P.AAA:	.WORD	0
000002	000037 					.WORD	37
000004	000073 					.WORD	73
000006	000132 					.WORD	132
000010	000170 					.WORD	170
000012	000227 					.WORD	227
000014	000265 					.WORD	265
000016	000324 					.WORD	324
000020	000363 					.WORD	363
000022	000421 					.WORD	421
000024	000460 					.WORD	460
000026	000516 					.WORD	516



000000						.PSECT	$OWN$,  D  
000000					TIME.BUF:
						.BLKW	10
000020	001075 				TIME:	.WORD	1075
000022	000000'					.WORD	TIME.BUF


						.GLOBL	US.CREATE, US.ABORT, US.FINI, US.COMPLETE
						.GLOBL	US.ERROR, US.INSERT, US.REMOVE
						.GLOBL	US.QRESET, US.QQINS, US.QQREM
						.GLOBL	US.QQSET, US.QQEXT, US.EVENT, US.WAIT
						.GLOBL	US.FLAG, US.SLEEP, US.CURRENT
						.GLOBL	US.DESCHEDULE


	000000'				MONTH=		    P.AAA


						.SBTTL	SS$GTM
000000						.PSECT	$CODE$,  RO 

000000	004167  000000G			SS$GTM::JSR	R1,$SAVE4			;					0114
000004	012746  000020'				MOV	#TIME,-(SP)			;					0147
000010	104377 					EMT	377
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   7
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (3)

000012	016703  000000'				MOV	TIME.BUF,R3			; *,JULIAN				0151
000016	016704  000002'				MOV	TIME.BUF+2,R4			;					0160
000022	020327  000115 				CMP	R3,#115				; JULIAN,*				0153
000026	002474 					BLT	1$
000030	062703  003554 				ADD	#3554,R3			; *,JULIAN				0159
000034	010401 					MOV	R4,R1				;					0160
000036	070127  005757 				MUL	#5757,R1
000042	010100 					MOV	R1,R0
000044	010002 					MOV	R0,R2
000046	062702  013736 				ADD	#13736,R2
000052	010201 					MOV	R2,R1
000054	006700 					SXT	R0
000056	071027  000144 				DIV	#144,R0
000062	010002 					MOV	R0,R2
000064	062704  000012 				ADD	#12,R4				;					0161
000070	010401 					MOV	R4,R1
000072	006700 					SXT	R0
000074	071027  000015 				DIV	#15,R0
000100	010004 					MOV	R0,R4
000102	010401 					MOV	R4,R1
000104	006301 					ASL	R1
000106	160102 					SUB	R1,R2				;					0160
000110	010301 					MOV	R3,R1				; JULIAN,*				0162
000112	006700 					SXT	R0
000114	071027  000004 				DIV	#4,R0
000120	006300 					ASL	R0
000122	006300 					ASL	R0
000124	160300 					SUB	R3,R0				; JULIAN,*
000126	062700  000003 				ADD	#3,R0
000132	010001 					MOV	R0,R1
000134	006700 					SXT	R0
000136	071027  177774 				DIV	#-4,R0
000142	005300 					DEC	R0
000144	010401 					MOV	R4,R1				;					0163
000146	066701  000004'				ADD	TIME.BUF+4,R1
000152	070100 					MUL	R0,R1				;					0162
000154	160102 					SUB	R1,R2				;					0161
000156	010301 					MOV	R3,R1				; JULIAN,*				0164
000160	070127  000555 				MUL	#555,R1
000164	010100 					MOV	R1,R0
000166	060002 					ADD	R0,R2				;					0163
000170	010300 					MOV	R3,R0				; JULIAN,*				0164
000172	162700  003671 				SUB	#3671,R0
000176	010001 					MOV	R0,R1
000200	006700 					SXT	R0
000202	071027  000004 				DIV	#4,R0
000206	060002 					ADD	R0,R2
000210	010203 					MOV	R2,R3				; *,JULIAN
000212	162703  001441 				SUB	#1441,R3			; *,JULIAN
000216	000414 					BR	2$				;					0153
000220	010301 				1$:	MOV	R3,R1				; JULIAN,*				0173
000222	070127  000555 				MUL	#555,R1
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   8
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (3)

000226	010103 					MOV	R1,R3				; *,JULIAN
000230	010401 					MOV	R4,R1				;					0174
000232	006301 					ASL	R1
000234	010300 					MOV	R3,R0				; JULIAN,*
000236	066100  000000'				ADD	MONTH(R1),R0
000242	066700  000004'				ADD	TIME.BUF+4,R0
000246	010003 					MOV	R0,R3				; *,JULIAN
000250	010302 				2$:	MOV	R3,R2				; JULIAN,*				0181
000252	006302 					ASL	R2
000254	016701  000006'				MOV	TIME.BUF+6,R1
000260	006700 					SXT	R0
000262	071027  000014 				DIV	#14,R0
000266	060002 					ADD	R0,R2
000270	010203 					MOV	R2,R3				; *,JULIAN
000272	016701  000006'				MOV	TIME.BUF+6,R1			;					0182
000276	006700 					SXT	R0
000300	071027  000014 				DIV	#14,R0
000304	070127  000074 				MUL	#74,R1
000310	066701  000010'				ADD	TIME.BUF+10,R1
000314	070127  000074 				MUL	#74,R1				;					0183
000320	066701  000012'				ADD	TIME.BUF+12,R1
000324	016600  000016 				MOV	16(SP),R0			; OFFSET,*				0186
000330	001421 					BEQ	5$
000332	020027  124300 				CMP	R0,#124300			;					0193
000336	103404 					BLO	3$
000340	062766  053500  000016 			ADD	#53500,16(SP)			; *,OFFSET				0196
000346	005203 					INC	R3				; JULIAN				0197
000350	066601  000016 			3$:	ADD	16(SP),R1			; OFFSET,SECOND				0200
000354	010100 					MOV	R1,R0				; SECOND,*
000356	103403 					BLO	4$				;					0203
000360	020127  124300 				CMP	R1,#124300			; SECOND,*				0207
000364	103403 					BLO	5$
000366	062701  053500 			4$:	ADD	#53500,R1			; *,SECOND				0210
000372	005203 					INC	R3				; JULIAN				0211
000374	016600  000014 			5$:	MOV	14(SP),R0			; TIM.BLK,*				0219
000400	010310 					MOV	R3,(R0)				; JULIAN,*
000402	010160  000002 				MOV	R1,2(R0)			; SECOND,*				0220
000406	012760  100000  000004 			MOV	#-100000,4(R0)			;					0221
000414	000207 					RTS	PC				;					0114
; Routine Size:  135 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  8 words


;	  0224	
;	  0225	!
;	  0226	
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page   9
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (4)

;	  0227	global routine SS$STI (TIM_BLK, TIMER_ROUTINE) : novalue =
;	  0228	
;	  0229	!++
;	  0230	! Functional description:
;	  0231	!
;	  0232	!	SS$STI sets a timer interrupt for sometime in the future as
;	  0233	!	indicated by TIM_BLK. TIMER_ROUTINE is invoked for the interrupt.
;	  0234	!
;	  0235	!
;	  0236	! Formal parameters:
;	  0237	!
;	  0238	!	TIM_BLK - a TIME_BLOCK
;	  0239	!	TIMER_ROUTINE - the address of the routine for the AST
;	  0240	!
;	  0241	! Routine value: none
;	  0242	! Side effects:
;	  0243	!	None
;	  0244	!--
;	  0245	
;	  0246	    begin
;	  0247	
;	  0248	    map
;	  0249		TIM_BLK : ref TIME_BLOCK;
;	  0250	
;	  0251	    own
;	  0252		MARK_TIME : MRKT$ (, 0, 2, 0);
;	  0253	
;	  0254	    local
;	  0255		CUR_TIM : TIME_BLOCK;
;	  0256	
;	  0257	    bind
;	  0258		HOW_MUCH = MARK_TIME [M$KTMG],
;	  0259		AST_ROUTINE = MARK_TIME [M$KTAE];
;	  0260	
;	  0261	!
;	  0262	! Get current time
;	  0263	!
;	  0264	    SS$GTM (0, CUR_TIM);
;	  0265	!
;	  0266	! Calculate time difference thus determining seconds in future
;	  0267	!
;	  0268	
;	  0269	    if (SS$TDF (.TIM_BLK, CUR_TIM, HOW_MUCH) leq 0) then HOW_MUCH = 1;
;	  0270	
;	  0271	!
;	  0272	! Generate Time Request to Exec
;	  0273	!
;	  0274	    AST_ROUTINE = .TIMER_ROUTINE;
;	  0275	    dir$ (MARK_TIME);
;	  0276	!
;	  0277	    end;					! End of SS$STI
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  10
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (4)



000024						.PSECT	$OWN$,  D  
000024	002427 				MARK.TIME:
						.WORD	2427
000026	000000 					.WORD	0
000030	000000 					.WORD	0
000032	000002 					.WORD	2
000034	000000 					.WORD	0


	000030'				HOW.MUCH=	    MARK.TIME+4
	000034'				AST.ROUTINE=	    MARK.TIME+10


						.SBTTL	SS$STI
000416						.PSECT	$CODE$,  RO 

000000	162706  000006 			SS$STI::SUB	#6,SP				;					0227
000004	005046 					CLR	-(SP)				;					0264
000006	012746  000004 				MOV	#4,-(SP)
000012	060616 					ADD	SP,(SP)				; CUR.TIM,*
000014	004767  177342 				JSR	PC,SS$GTM
000020	016616  000016 				MOV	16(SP),(SP)			; TIM.BLK,*				0269
000024	012746  000006 				MOV	#6,-(SP)
000030	060616 					ADD	SP,(SP)				; CUR.TIM,*
000032	012746  000030'				MOV	#HOW.MUCH,-(SP)
000036	004767  000000V				JSR	PC,SS$TDF
000042	022626 					CMP	(SP)+,(SP)+
000044	005700 					TST	R0
000046	003003 					BGT	1$
000050	012767  000001  000030'			MOV	#1,HOW.MUCH
000056	016667  000014  000034'		1$:	MOV	14(SP),AST.ROUTINE		; TIMER.ROUTINE,*			0274
000064	012746  000024'				MOV	#MARK.TIME,-(SP)		;					0275
000070	104377 					EMT	377
000072	062706  000012 				ADD	#12,SP				;					0227
000076	000207 					RTS	PC
; Routine Size:  32 words,	Routine Base:  $CODE$ + 0416
; Maximum stack depth per invocation:  8 words


;	  0278	
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  11
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (5)

;	  0279	global routine SS$TDF (TIM_BLK_1, TIM_BLK_2, ABTIME) =
;	  0280	
;	  0281	!++
;	  0282	! Functional description:
;	  0283	!
;	  0284	!	SS$TDF subtracts TIM_BLK_2 from TIM_BLK_1 returning the absolute
;	  0285	!	difference in ABTIME and +1,0,-1 to indicate interpretation of
;	  0286	!	the result.
;	  0287	!
;	  0288	! Formal parameters:
;	  0289	!
;	  0290	!	TIM_BLK_1 - a TIME_BLOCK
;	  0291	!	TIM_BLK_2 - a TIME_BLOCK
;	  0292	!	ABTIME - where to store the absolute difference
;	  0293	!
;	  0294	! Routine value: +1 if TIM_BLK_1 > TIM_BLK_2
;	  0295	!		  0 if TIM_BLK_1 = TIM_BLK_2
;	  0296	!		 -1 if TIM_BLK_1 < TIM_BLK_2
;	  0297	!
;	  0298	! Side effects:
;	  0299	!	None
;	  0300	!--
;	  0301	
;	  0302	    begin
;	  0303	
;	  0304	    map
;	  0305		TIM_BLK_1 : ref TIME_BLOCK,
;	  0306		TIM_BLK_2 : ref TIME_BLOCK;
;	  0307	
;	  0308	    builtin
;	  0309	        rot;
;	  0310	
;	  0311	    literal
;	  0312	        SECONDS_PER_HALFDAY = 12*60*60;
;	  0313	
;	  0314	    local
;	  0315		TEMP_JULIAN,
;	  0316		TEMP_SECOND;
;	  0317	
;	  0318	!
;	  0319	! Calculate Differences
;	  0320	!
;	  0321	    TEMP_SECOND = .TIM_BLK_1 [TIME_SECOND];
;	  0322	    TEMP_JULIAN = .TIM_BLK_1 [TIME_JULIAN];
;	  0323	
;	  0324	    if rot (TEMP_SECOND = .TEMP_SECOND - .TIM_BLK_2 [TIME_SECOND], 1)
;	  0325	    then
;	  0326	        begin
;	  0327	        TEMP_JULIAN = .TEMP_JULIAN - 1;
;	  0328	        TEMP_SECOND = .TEMP_SECOND + SECONDS_PER_HALFDAY;
;	  0329	        end;
;	  0330	
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  12
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (5)

;	  0331	    TEMP_JULIAN = .TEMP_JULIAN - .TIM_BLK_2 [TIME_JULIAN];
;	  0332	
;	  0333	!
;	  0334	! Calculate some representation of Absolute Time
;	  0335	!
;	  0336	    .ABTIME = .TEMP_SECOND;
;	  0337	
;	  0338	     if .TEMP_JULIAN eql 1
;	  0339	     then
;	  0340	         .ABTIME = ..ABTIME + SECONDS_PER_HALFDAY;
;	  0341	
;	  0342	!
;	  0343	! Return sign indication
;	  0344	!
;	  0345	
;	  0346	    if .TEMP_JULIAN lss 0
;	  0347	    then
;	  0348		return -1
;	  0349	    else
;	  0350	
;	  0351		if (.TEMP_SECOND eql 0) and (.TEMP_JULIAN eql 0)
;	  0352	        then
;	  0353	            return 0
;	  0354	        else
;	  0355	            return 1
;	  0356	
;	  0357	    end;					! End of SS$TDF


						.SBTTL	SS$TDF
000000	004167  000000G			SS$TDF::JSR	R1,$SAVE2			;					0279
000004	016600  000014 				MOV	14(SP),R0			; TIM.BLK.1,*				0321
000010	016001  000002 				MOV	2(R0),R1			; *,TEMP.SECOND
000014	011002 					MOV	(R0),R2				; TIM.BLK.1,TEMP.JULIAN			0322
000016	016600  000012 				MOV	12(SP),R0			; TIM.BLK.2,*				0324
000022	166001  000002 				SUB	2(R0),R1			; *,TEMP.SECOND
000026	010100 					MOV	R1,R0				; TEMP.SECOND,*
000030	103003 					BCC	1$
000032	005302 					DEC	R2				; TEMP.JULIAN				0327
000034	162701  053500 				SUB	#53500,R1			; *,TEMP.SECOND				0328
000040	167602  000012 			1$:	SUB	@12(SP),R2			; TIM.BLK.2,TEMP.JULIAN			0331
000044	010176  000010 				MOV	R1,@10(SP)			; TEMP.SECOND,ABTIME			0336
000050	020227  000001 				CMP	R2,#1				; TEMP.JULIAN,*				0338
000054	001003 					BNE	2$
000056	162776  053500  000010 			SUB	#53500,@10(SP)			; *,ABTIME				0340
000064	005702 				2$:	TST	R2				; TEMP.JULIAN				0346
000066	002003 					BGE	3$
000070	012700  177777 				MOV	#-1,R0
000074	000207 					RTS	PC
000076	005701 				3$:	TST	R1				; TEMP.SECOND				0351
000100	001004 					BNE	4$
000102	005702 					TST	R2				; TEMP.JULIAN
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  13
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (5)

000104	001002 					BNE	4$
000106	005000 					CLR	R0
000110	000207 					RTS	PC
000112	012700  000001 			4$:	MOV	#1,R0
000116	000207 					RTS	PC				;					0279
; Routine Size:  40 words,	Routine Base:  $CODE$ + 0516
; Maximum stack depth per invocation:  4 words


;	  0358	
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  14
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (6)

;	  0359	global routine SS_MESSAGE (MESSAGE) : novalue =
;	  0360	
;	  0361	!++
;	  0362	! Functional description:
;	  0363	!
;	  0364	!
;	  0365	! Formal parameters:
;	  0366	!
;	  0367	!	SS$MSG issues a message to the controlling terminal. It also
;	  0368	!	handles initialization of that terminal.
;	  0369	!
;	  0370	! FORMAL PARAMETERS:
;	  0371	!
;	  0372	!	MESSAGE - the pointer to the ASCIZ string to output
;	  0373	!
;	  0374	! IMPLICIT INPUTS:
;	  0375	!
;	  0376	!	LUNCO - the console output LUN
;	  0377	!
;	  0378	! IMPLICIT OUTPUTS:
;	  0379	!
;	  0380	!	LUNCO - is set to the LUN if not already setup
;	  0381	!
;	  0382	! Routine Value:
;	  0383	!
;	  0384	!	None
;	  0385	!
;	  0386	! SIDE EFFECTS:
;	  0387	!
;	  0388	!	Message may be issued to the CO: device
;	  0389	!
;	  0390	!--
;	  0391	
;	  0392	    begin
;	  0393	
;	  0394	    own
;	  0395		LUNCO;
;	  0396	
;	  0397	    local
;	  0398		LENGTH;
;	  0399	
;	  0400	!
;	  0401	! Find length of string
;	  0402	!
;	  0403	    LENGTH = ch$len (.MESSAGE, 255);
;	  0404	!
;	  0405	! Assign the LUN if not already initialized
;	  0406	!
;	  0407	
;	  0408	    if .LUNCO eql 0
;	  0409	    then
;	  0410		begin
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  15
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (6)

;	  0411		LUNCO = NMU$_CONSOLE_LUN;
;	  0412		ALUN$S (.LUNCO, %ascii'TI', 0);
;	  0413		end;
;	  0414	
;	  0415	!
;	  0416	! Now Output the string
;	  0417	!
;	  0418	    QIOW$S (IO$WLB, .LUNCO, NMU$_CONSOLE_FLAG,,,, <.MESSAGE, .LENGTH, 0>);
;	  0419	    end;					! End of SS_MESSAGE



000036						.PSECT	$OWN$,  D  
000036					LUNCO:	.BLKW	1


						.SBTTL	SS.MESSAGE
000636						.PSECT	$CODE$,  RO 

000000	004167  000000G			SS.MESSAGE::
						JSR	R1,$SAVE2			;					0359
000004	012746  000377 				MOV	#377,-(SP)			;					0403
000010	016601  000012 				MOV	12(SP),R1			; MESSAGE,*
000014	010146 					MOV	R1,-(SP)
000016	005046 					CLR	-(SP)
000020	004767  000000G				JSR	PC,BL$FCH
000024	062706  000006 				ADD	#6,SP
000030	005700 					TST	R0
000032	001003 					BNE	1$
000034	012702  000377 				MOV	#377,R2				; *,LENGTH
000040	000412 					BR	2$
000042	012746  000377 			1$:	MOV	#377,-(SP)
000046	010146 					MOV	R1,-(SP)
000050	005046 					CLR	-(SP)
000052	004767  000000G				JSR	PC,BL$FCH
000056	160100 					SUB	R1,R0
000060	062706  000006 				ADD	#6,SP
000064	010002 					MOV	R0,R2				; *,LENGTH
000066	005767  000036'			2$:	TST	LUNCO				;					0408
000072	001013 					BNE	3$
000074	012767  000001  000036'			MOV	#1,LUNCO			;					0411
000102	005046 					CLR	-(SP)				;					0412
000104	012746  044524 				MOV	#44524,-(SP)
000110	012746  000001 				MOV	#1,-(SP)
000114	012746  002007 				MOV	#2007,-(SP)
000120	104377 					EMT	377
000122	005046 				3$:	CLR	-(SP)				;					0418
000124	005046 					CLR	-(SP)
000126	005046 					CLR	-(SP)
000130	005046 					CLR	-(SP)
000132	010246 					MOV	R2,-(SP)			; LENGTH,*
000134	010146 					MOV	R1,-(SP)
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  16
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (6)

000136	005046 					CLR	-(SP)
000140	005046 					CLR	-(SP)
000142	012746  000001 				MOV	#1,-(SP)
000146	016746  000036'				MOV	LUNCO,-(SP)
000152	012746  000400 				MOV	#400,-(SP)
000156	012746  006003 				MOV	#6003,-(SP)
000162	104377 					EMT	377
000164	000207 					RTS	PC				;					0359
; Routine Size:  59 words,	Routine Base:  $CODE$ + 0636
; Maximum stack depth per invocation:  17 words


;	  0420	
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  17
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (7)

;	  0421	global routine NMU$NMX_IO (FCN_MOD, BUFFER, LENGTH) =
;	  0422	
;	  0423	!++
;	  0424	! FUNCTIONAL DESCRIPTION:
;	  0425	!
;	  0426	!
;	  0427	! FORMAL PARAMETERS
;	  0428	!
;	  0429	!	NONE.
;	  0430	!
;	  0431	! IMPLICIT INPUTS
;	  0432	!
;	  0433	!
;	  0434	! ROUTINE VALUE:
;	  0435	!
;	  0436	!	NONE.
;	  0437	!
;	  0438	! SIDE EFFECTS:
;	  0439	!
;	  0440	!	None
;	  0441	!
;	  0442	!--
;	  0443	
;	  0444	    begin
;	  0445	!<BLF/NOFORMAT>
;	  0446	!<BLF/NOERROR>
;	  0447	
;	  0448	      $field
;	  0449		MCB$IOSB$fields =		!  QIO Status Block
;	  0450		  set
;	  0451		  IOSB$ERROR	= [$integer],	! Composite error code:
;	  0452			$overlay(IOSB$ERROR)
;	  0453		  	IOSB$ERR = [$tiny_integer],     ! error code
;	  0454		  	IOSB$ERR1= [$tiny_integer],     ! 0 = I/O error, -1 = directive error
;	  0455			$continue
;	  0456		  IOSB$_COUNT= [$integer],	! I/O count (bytes)
;	  0457		  IOSB$_EVENT = [$sub_block(EVENT_BLOCK_SIZE)]  ! IO Event Block
;	  0458		  tes;
;	  0459	
;	  0460	!<BLF/ERROR>
;	  0461	!<BLF/FORMAT>
;	  0462	
;	  0463	    literal
;	  0464		MCB$_IOSB_SIZE = $field_set_size,
;	  0465		MCB$_IOSB_ALLOCATION = $field_set_units;
;	  0466	
;	  0467	    macro
;	M 0468		$IO_STATUS_BLOCK =
;	  0469		    BLOCK[MCB$_IOSB_SIZE]  FIELD( MCB$IOSB$fields ) %;
;	  0470	
;	  0471	    local
;	  0472		IO_STATUS_BLOCK : $IO_STATUS_BLOCK;
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  18
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (7)

;	  0473	
;	  0474	!
;	  0475	! Interrupt Service Routine for Read of Event Queue
;	  0476	!
;	  0477	    routine RLB_AST IO_INTERRUPT_ROUTINE =
;	  0478		begin
;	  0479	
;	  0480		map
;	  0481		    IO_STATUS_BLOCK : ref $IO_STATUS_BLOCK;
;	  0482	
;	  0483		NMU$SCHED_FLAG (IO_STATUS_BLOCK [IOSB$_EVENT]);
;	  0484		PROCESS_WAKE;
;	  0485		end;					! of RLB_AST


						.SBTTL	RLB.AST
000000	010046 				RLB.AST:MOV	R0,-(SP)			;					0477
000002	016646  000002 				MOV	2(SP),-(SP)			; IO.STATUS.BLOCK,*			0483
000006	062716  000004 				ADD	#4,(SP)
000012	004767  000000G				JSR	PC,US.FLAG
000016	012746  000040 				MOV	#40,-(SP)
000022	012746  001041 				MOV	#1041,-(SP)
000026	104377 					EMT	377
000030	005726 					TST	(SP)+
000032	012600 					MOV	(SP)+,R0			;					0477

					;+
					;	RSX AST Service Routine Exit
					;-

000034	012716  000563 				MOV	#563,(SP)
000040	104377 					EMT	377
; Routine Size:  17 words,	Routine Base:  $CODE$ + 1024
; Maximum stack depth per invocation:  6 words


;	  0486	!
;	  0487	! Main Read Processing
;	  0488	!
;	  0489	
;	  0490	    begin			! Initialize I/O status block
;	  0491	
;	  0492	    local
;	  0493		ADR : ref vector;
;	  0494	
;	  0495	    ADR = IO_STATUS_BLOCK;
;	  0496	
;	  0497	    decru INDEX from MCB$_IOSB_SIZE to 1 do
;	  0498		begin
;	  0499		ADR [0] = 0;
;	  0500		ADR = ADR [1];	%(force auto-increment)%
;	  0501		end;
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  19
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (7)

;	  0502	
;	  0503	    end;
;	  0504	
;	  0505	    NMU$SCHED_EVENT (IO_STATUS_BLOCK [IOSB$_EVENT], $true);
;	  0506	
;	  0507	    while $true do
;	  0508		begin
;	  0509		QIO$S (.FCN_MOD, NMU$_NM_DEVICE_LUN,,, IO_STATUS_BLOCK, RLB_AST, <.BUFFER, .LENGTH>);
;	  0510	!
;	  0511	! Wait for data buffer to be received
;	  0512	!
;	  0513	
;	  0514		while .IO_STATUS_BLOCK [IOSB$ERROR] eql 0 do
;	  0515		    NMU$SCHED_WAIT (IO_STATUS_BLOCK [IOSB$_EVENT],0);
;	  0516	
;	  0517		if .IO_STATUS_BLOCK [IOSB$ERR] eql IS$SUC then exitloop;
;	  0518		end;
;	  0519	
;	  0520	!
;	  0521	    .IO_STATUS_BLOCK [IOSB$_COUNT]
;	  0522	    end;					! End of routine NMU$NMX_IO


						.SBTTL	SS$NMX
000000	010146 				SS$NMX::MOV	R1,-(SP)			;					0421
000002	162706  000012 				SUB	#12,SP
000006	010601 					MOV	SP,R1				; IO.STATUS.BLOCK,ADR			0495
000010	012700  000005 				MOV	#5,R0				; *,INDEX				0497
000014	005021 				1$:	CLR	(R1)+				; ADR					0499
000016	077002 					SOB	R0,1$				; INDEX,*				0000
000020	012746  000006 				MOV	#6,-(SP)			;					0505
000024	060616 					ADD	SP,(SP)				; IO.STATUS.BLOCK+4,*
000026	012746  000001 				MOV	#1,-(SP)
000032	004767  000000G				JSR	PC,US.EVENT
000036	005046 				2$:	CLR	-(SP)				;					0509
000040	005046 					CLR	-(SP)
000042	005046 					CLR	-(SP)
000044	005046 					CLR	-(SP)
000046	016646  000032 				MOV	32(SP),-(SP)			; LENGTH,*
000052	016646  000036 				MOV	36(SP),-(SP)			; BUFFER,*
000056	012746  001024'				MOV	#RLB.AST,-(SP)
000062	012746  000024 				MOV	#24,-(SP)
000066	060616 					ADD	SP,(SP)				; IO.STATUS.BLOCK,*
000070	005046 					CLR	-(SP)
000072	012746  000002 				MOV	#2,-(SP)
000076	016646  000052 				MOV	52(SP),-(SP)			; FCN.MOD,*
000102	012746  006001 				MOV	#6001,-(SP)
000106	104377 					EMT	377
000110	022626 				3$:	CMP	(SP)+,(SP)+
000112	005716 					TST	(SP)				; IO.STATUS.BLOCK			0514
000114	001007 					BNE	4$
000116	012746  000006 				MOV	#6,-(SP)			;					0515
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  20
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (7)

000122	060616 					ADD	SP,(SP)				; IO.STATUS.BLOCK+4,*
000124	005046 					CLR	-(SP)
000126	004767  000000G				JSR	PC,US.WAIT
000132	000766 					BR	3$
000134	121627  000001 			4$:	CMPB	(SP),#1				; IO.STATUS.BLOCK,*			0517
000140	001002 					BNE	5$
000142	024646 					CMP	-(SP),-(SP)
000144	000402 					BR	6$
000146	024646 				5$:	CMP	-(SP),-(SP)			;					0508
000150	000732 					BR	2$				;					0507
000152	016600  000006 			6$:	MOV	6(SP),R0			; IO.STATUS.BLOCK+2,*			0521
000156	062706  000016 				ADD	#16,SP				;					0421
000162	012601 					MOV	(SP)+,R1
000164	000207 					RTS	PC
; Routine Size:  59 words,	Routine Base:  $CODE$ + 1066
; Maximum stack depth per invocation:  22 words


;	  0523	
;	  0524	end						! End of module NMUMCB
;	  0525	
;	  0526	eludom



;					OTS external references
						.GLOBL	$SAVE4, $SAVE2, BL$FCH


;					PSECT SUMMARY
;
;	Psect Name			Words	  Attributes
;	 $OWN$				   16	    RW ,  D  ,  LCL,  REL,  CON
;	 $PLIT$				   12	    RO ,  D  ,  LCL,  REL,  CON
;	 $CODE$				  342	    RO ,  I  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  DNET61:<MCB.NML>NMULIB.L16.1		      2716        94         3         0





;	  0527	! Local Modes:
;	  0528	! Mode:Bliss
NMUMCB								24-May-1985 13:29:34	TOPS-20 Bliss-16 2A(530)	    Page  21
X00.09								 3-Jan-1983 17:07:45	DNET61:<MCB.NML>NMUMCB.B16.1 (7)

;	  0529	! Comment Start:!
;	  0530	! Comment Column:40
;	  0531	! Comment Rounding:+1
;	  0532	! Auto Save Mode:2
;	  0533	! End:
; Size:		342 code + 28 data words
; Run Time:	00:06.6
; Elapsed Time:	00:10.5
; Memory Used:	39 pages
; Compilation Complete
ABTIME				 279	 336#	 340#
ADR				 493	 495#	 499#	 500#
ALUN$S				 412
AST_ROUTINE			 259#	 274#
BUFFER				 421	 509
CH$LEN				 403
CUR_TIM				 255	 264	 269
DIR$				 147	 275
EVENT_BLOCK_SIZE		 457
FCN_MOD				 421	 509
G$TIDA				 163	 174
G$TIHR				 181	 182
G$TIMI				 183
G$TIMO				 160	 161	 163	 174
G$TISC				 184
G$TIYR				 151
GTIM$				 109
HOW_MUCH			 258#	 269#
INDEX				 497
IO$WLB				 418
IOSB$ERR			 453#	 517
IOSB$ERR1			 454#
IOSB$ERROR			 451#	 452	 514
IOSB$_COUNT			 456#	 521
IOSB$_EVENT			 457#	 483	 505	 515
IO_INTERRUPT_ROUTINE		 477#
IO_STATUS_BLOCK			 472	 481	 483	 495	 505	 509	 514	 515	 517	 521
IS$SUC				 517
JULIAN				 141	 151#	 153	 159#	 160#	 162	 164	 173#	 174#	 181#	 197#	 204#
				 211#	 219
LUNCO				 395#	 408	 411#	 412	 418
M$KTAE				 259
M$KTMG				 258
MARK_TIME			 252	 258	 259	 275
MCB$IOSB$FIELDS			 449#	 469
MCB$_IOSB_ALLOCATION		 465#
MCB$_IOSB_SIZE			 464#	 469	 497
MESSAGE				 359	 403	 418
MONTH				 169#	 174
MRKT$				 252
NMU$NMX_IO			 101	 421*
NMU$SCHED_EVENT			 505
NMU$SCHED_FLAG			 483
NMU$SCHED_MANAGER		 112*
NMU$SCHED_WAIT			 515
NMU$_CONSOLE_FLAG		 418
NMU$_CONSOLE_LUN		 411
NMU$_NM_DEVICE_LUN		 509
NMUMCB				  44#
OFFSET				 114	 186	 193	 196#	 200
PROCESS_WAKE			 484
QIO$S				 509
QIOW$S				 418
RLB_AST				 477*	 509
ROT				 138	 200	 309	 324
SECOND				 142	 182#	 200#	 203#	 207	 210#	 220
SECONDS_PER_HALFDAY		 191#	 193	 196	 203	 207	 210	 312#	 328	 340
SS$GTM				  97	 114*	 264
SS$STI				  98	 227*
SS$TDF				  99	 269	 279*
SS_MESSAGE			 100	 359*
TEMP_JULIAN			 315	 322#	 327#	 331#	 338	 346	 351
TEMP_SECOND			 316	 321#	 324#	 328#	 336	 351
TIME				 109	 147
TIMER_ROUTINE			 227	 274
TIME_BLOCK			 135	 249	 255	 305	 306
TIME_BUF			 108	 109	 151	 160	 161	 163	 174	 181	 182	 183	 184
TIME_JULIAN			 219	 322	 331
TIME_MILLISECOND		 221
TIME_SECOND			 220	 321	 324
TIM_BLK				 114	 135	 219#	 220#	 221#	 227	 249	 269
TIM_BLK_1			 279	 305	 321	 322
TIM_BLK_2			 279	 306	 324	 331
$CONTINUE			 455
$FIELD				 448
$FIELD_SET_SIZE			 464
$FIELD_SET_UNITS		 465
$INTEGER			 451	 456
$IO_STATUS_BLOCK		 468#	 472	 481
$OVERLAY			 452
$SUB_BLOCK			 457
$TINY_INTEGER			 453	 454
$TRUE				 505	 507