Google
 

Trailing-Edge - PDP-10 Archives - BB-P363B-SM_1985 - mcb/nml/nmuskd.lst
There are no other files named nmuskd.lst in the archive.
								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   1
								 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (1)

;	  0001	! <BRANDT.DEVELOPMENT>NMUSKD.BLI.1 22-Jun-82 15:50:31, Edit by BRANDT
;	  0002	!
;	  0003	!   Ident 19.
;	  0004	!     Clean up some problems introduced in last edit.
;	  0005	!     1) Have SCHED_FLAG unlock the semaphore when the event
;	  0006	!        occurs only if no tasks are moved to run queue
;	  0007	!     2) Don't have SCHED_WAIT lock the semaphore when a task
;	  0008	!	 resumes.
;	  0009	!     3) Make sure TABLE_INDEX has a value when TABLE_DELETE is
;	  0010	!        called.
;	  0011	!     4) When a task resumes after sleeping, use the table
;	  0012	!	 entry for the tasks queued to this event to determine
;	  0013	!	 if the event has happened or if the sleep time has expired.
;	  0014	!
;	  0015	! <BRANDT.DEVELOPMENT>NMUSKD.BLI.1 25-May-82 12:05:13, Edit by BRANDT
;	  0016	!
;	  0017	!   Ident 18.
;	  0018	!   Make network function timeouts work.
;	  0019	!     1) In NMU$SCHED_WAIT make calls to SCHED_SLEEP if a wait time
;	  0020	!        is specified.
;	  0021	!     2) Remove routine NMU$TIMEOUT_CHECK.
;	  0022	!     3) Always have SCHED_FLAG unlock the semaphore when the event
;	  0023	!        occurs
;	  0024	
;	  0025	! NET:<PECKHAM.DEVELOPMENT>NMUSKD.BLI.2 22-Apr-82 09:50:31, Edit by PECKHAM
;	  0026	!
;	  0027	! Ident 17.
;	  0028	! Make stack sizes larger for TOPS10/20 in NMU$SCHED_CREATE.
;	  0029	!
;	  0030	! NET:<GROSSMAN.NML-SOURCES>NMUSKD.BLI.3 24-Feb-82 10:24:00, Edit by GROSSMAN
;	  0031	!
;	  0032	! Make NMU$SCHED_DESCHEDULE put NML to sleep forever if it has nothing to do.
;	  0033	! This is for Tops-10 only.
;	  0034	!
;	  0035	! NET:<GROSSMAN>NMUSKD.BLI.2 16-Feb-82 15:16:52, Edit by GROSSMAN
;	  0036	!
;	  0037	! Make NMU$SCHED_FLAG call the table deallocator after it is done reading
;	  0038	! all the tasks from the event block. This should prevent some free space
;	  0039	! lossage problems.
;	  0040	!
;	  0041	! NET:<GROSSMAN.NML-SOURCES>NMUSKD.BLI.4 13-Feb-82 22:54:00, Edit by GROSSMAN
;	  0042	!
;	  0043	! Remove EXTERNAL ROUTINE of DETACH from this file. Put it into the macro
;	  0044	! INIT_GLOBALS in NMINI.REQ. Also change the name of the second formal
;	  0045	! parameter (WAIT) for the routine NMU$TIMEOUT_CHECK to WAIT_FLAG. This is
;	  0046	! to avoid conflict with a Tops-10 monitor call of the same name. (Oddly
;	  0047	! enough, the parameter is never used!?!).
;	  0048	!
;	  0049	! NET:<PECKHAM.DEVELOPMENT>NMUSKD.BLI.2  7-Feb-82 18:21:00, Edit by PECKHAM
;	  0050	!
;	  0051	! Ident 16.
;	  0052	! Fix code in NMU$SCHED_WAIT to avoid generating INFO message.
								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   2
								 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (1)

;	  0053	!
;	  0054	! NET:<PECKHAM.DEVELOPMENT>NMUSKD.BLI.2  5-Feb-82 09:11:11, Edit by GROSSMAN
;	  0055	!								for PECKHAM
;	  0056	! Ident 15.
;	  0057	! Initialize RUN_QUEUE (its really just a table now). And, fix ..._EVENT so
;	  0058	! that the resetting of an EVENT_QUEUE (which is really a table) calls
;	  0059	! NMU$TABLE_CLEAR which will collect its own garbage thus alleviating some
;	  0060	! memory problems.
;	  0061	!
;	  0062	! NET:<GROSSMAN>NMUSKD.BLI.11 26-Jan-82 06:42:16, Edit by GROSSMAN
;	  0063	!
;	  0064	! Ident 14.
;	  0065	! Install many changes so that counter timers work. Some of them are:
;	  0066	! 1) Make all events not use a queued data structure. They now use a list
;	  0067	! in order to pointer to all waiting tasks.
;	  0068	! 2) Turn the RUN_QUEUE into a run_list. It is now a list of all runnable
;	  0069	! tasks. This keep it from interfering with the TIME_QUEUE.
;	  0070	! 3) Make NMU$SCHED_SLEEP accept the same task multiple times. (It actually
;	  0071	! just does nothing if the task is already scheduled to be woken up later).
;	  0072	! I hope thats all...
;	  0073	!
;	  0074	! NET:<PECKHAM.DEVELOPMENT>NMUSKD.BLI.2 23-Jan-82 23:48:34, Edit by PECKHAM
;	  0075	!
;	  0076	! Ident 13.
;	  0077	! Fix ref bug in NMU$TIMEOUT_CHECK.
;	  0078	! Comment out call to NMU$TIMEOUT_CHECK in NMU$SCHED_DESCHEDULE.
;	  0079	!
;	  0080	! NET:<DECNET20-V3P1.NMLLIB>NMUSKD.BLI 02-Dec-81 09:49:20, Edit by THIGPEN
;	  0081	!
;	  0082	! Ident 12.
;	  0083	! Merge changes made by Stu Grossman (see below) with changes in ident 11.
;	  0084	!
;	  0085	! NET:<DECNET20-V3P1.NMLLIB>NMUSKD.BLI 02-Dec-81 09:49:20, Edit by THIGPEN
;	  0086	!
;	  0087	! Ident 11.
;	  0088	! Changes to allow timing out calls to NMU$SCHED_WAIT:
;	  0089	!   Add routine NMU$TIMEOUT_CHECK
;	  0090	!   Change NMU$SCHED_WAIT and NMU$SCHED_DESCHEDULE
;	  0091	!   Change calls to NMU$SCHED_WAIT in NMU$SQUEUE_REMOVE, NMU$QQUEUE_INSERT,
;	  0092	!                             and SCHEDULER_TASK.
;	  0093	!
;	  0094	! NET:<GROSSMAN>NMUSKD.BLI.2  8-Dec-81 17:17:47, Edit by GROSSMAN
;	  0095	!
;	  0096	! Install a call to DETACH if we're running under Tops-10. This should be the
;	  0097	! first thing done in the program, because there are probably several things
;	  0098	! waiting to for us to get off the Force Line.
;	  0099	!
;	  0100	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUSKD.BLI.44  2-Oct-81 15:06:29, Edit by GUNN
;	  0101	!
;	  0102	! Ident 10.
;	  0103	! Change NML version number to 3.0.0 from 2.1.0.
;	  0104	!
								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   3
								 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (1)

;	  0105	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUSKD.BLI.42 12-Aug-81 10:43:40, Edit by JENNESS
;	  0106	!
;	  0107	!    Ident 09.
;	  0108	!    Add NMU$QQUEUE_EXTRACT routine.  Needed to handle REMOTE/LOCAL NML
;	  0109	!    request queues.
;	  0110	!
;	  0111	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUSKD.BLI.41  6-Aug-81 13:46:31, Edit by JENNESS
;	  0112	!
;	  0113	!    Add routine NMU$SCHED_ERROR.  Change NMU$SCHED_COMPLETE to look at
;	  0114	!    the error message stored in the task block only.  NMU$SCHED_ERROR
;	  0115	!    puts the supplied error message in the task block error buffer and
;	  0116	!    then calls NMU$SCHED_COMPLETE.  (Makes panic interrupts easier).
;	  0117	!
;	  0118	! NET:<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUSKD.BLI.40  5-Aug-81 15:26:20, Edit by JENNESS
;	  0119	!
;	  0120	!    Fix ch$movasciz call in NMU$SCHED_COMPLETE so that it has the
;	  0121	!    correct arguments (addresses instead of immediate pointers).
;	  0122	!
;	  0123	! NET:<DECNET20-V3P1.NMU.LIBRARY>NMUSKD.BLI.2 30-Jun-81 10:36:28, Edit by JENNESS
;	  0124	!    Make TIMEOUT_SIGNAL clear TIME_OUT.  This solves multiple tasks
;	  0125	!    waiting for timeout race problem.
;	  0126	!
;	  0127	!NET:<DECNET20-V3P1.NMU>NMUSKD.BLI.2 16-Jun-81 13:21:51, Edit by JENNESS
;	  0128	!
;	  0129	!    Readability improvements.  Add TB_ERROR_PC to task block for recording
;	  0130	!    PC of exception failures.
;	  0131	!
;	  0132	! NET:<DECNET20-V3P1.BASELEVEL-2.MCB>NMUSKD.BLI.1 10-Jun-81 09:37:45, Edit by SROBINSON
;	  0133	!
;	  0134	!    Add Quota Queue Support
;	  0135	!
;	  0136	!<DECNET20-V3P1.BASELEVEL-2.SOURCES>NMUSKD.BLI.31 23-Mar-81 11:17:02, Edit by SROBINSON
;	  0137	!
;	  0138	!    Fix NMU$SCHED_EVENT to set event block EB_NOINT flags correctly
;	  0139	!
;	  0140	!NET:<DECNET20-V3P1.NMU>NMUSKD.BLI.42 14-Mar-81 15:15:38, Edit by JENNESS
;	  0141	!
;	  0142	!    Add trace code for debugging.
;	  0143	!
;	  0144	!<DECNET20-V3P1.BASELEVEL-2.MCB>NMUSKD.BLI.2 13-Mar-81 14:32:46, Edit by SROBINSON
;	  0145	!    Fix NMU$SCHED_FLAG to clear out the queue on any EVENT
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   4
								 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (2)

;	  0146	module NMUSKD (					! Scheduler
;	  0147			ident = 'X00.19',
;	  0148			main = TOPMOST
;	  0149			) =
;	  0150	begin
;	  0151	!
;	  0152	!                    COPYRIGHT (c) 1980, 1981, 1982
;	  0153	!                    DIGITAL EQUIPMENT CORPORATION
;	  0154	!                        Maynard, Massachusetts
;	  0155	!
;	  0156	!     This software is furnished under a license and may  be  used
;	  0157	!     and copied only in accordance with the terms of such license
;	  0158	!     and with the inclusion of the above copyright notice.   This
;	  0159	!     software  or any other copies thereof may not be provided or
;	  0160	!     otherwise made available to any other person.  No  title  to
;	  0161	!     and ownership of the software is hereby transferred.
;	  0162	!
;	  0163	!     The information  in  this  software  is  subject  to  change
;	  0164	!     without  notice  and should not be construed as a commitment
;	  0165	!     by DIGITAL EQUIPMENT CORPORATION.
;	  0166	!
;	  0167	!     DIGITAL assumes no responsibility for the use or reliability
;	  0168	!     of  its  software  on  equipment  which  is  not supplied by
;	  0169	!     DIGITAL.
;	  0170	!
;	  0171	
;	  0172	!++
;	  0173	! Facility: LSG DECnet Network Management
;	  0174	!
;	  0175	! Abstract:
;	  0176	!
;	  0177	!       This module provides the scheduling code for multi-tasking.
;	  0178	!	The main routine (start) for any program using this scheduler
;	  0179	!	is contained here also.
;	  0180	!
;	  0181	!       Scheduling is done on two entities:
;	  0182	!
;	  0183	!       (1)  Queues   when a queue becomes non-empty all
;	  0184	!                     tasks waiting are scheduled.
;	  0185	!
;	  0186	!       (2)  Events   when an event occurs the first task waiting for
;	  0187	!                     the event is scheduled.
;	  0188	!
;	  0189	!
;	  0190	! Environment: TOPS10 and TOPS20 user mode, MCB RSX task mode
;	  0191	!
;	  0192	! Author: Steven M. Jenness, Creation date: 20 August 1980
;	  0193	!
;	  0194	!--
;	  0195	
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   5
X00.19								 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (3)

;	  0196	
;	  0197	!
;	  0198	! Include files
;	  0199	!
;	  0200	
;	  0201	library 'NMULIB';				! All needed definitions
;	  0202	
;	  0203	!
;	  0204	! Global routines
;	  0205	!
;	  0206	
;	  0207	forward routine
;	  0208	    NMU$SCHED_MANAGER;				! Global entry definitions
;	  0209	
;	  0210	!
;	  0211	! Local routines
;	  0212	!
;	  0213	
;	  0214	forward routine
;	  0215	    TOPMOST : novalue,				! Starting routine
;	  0216	    SCHEDULER_TASK : novalue,			! Scheduler task co-routine
;	  0217	    TIMEOUT_SIGNAL : TIMER_INTERRUPT_LINKAGE novalue,	! Signal SKD_EVENT
;	  0218	    TT_SCAN;					! Scan TIME_QUEUE
;	  0219	
;	  0220	!
;	  0221	! Global literals
;	  0222	!
;	  0223	
;	  0224	global literal
;	  0225	    %name ('TB.SKD') = %fieldexpand (TB_SCHED_QUEUE, 0) * %UPVAL,
;	  0226	    %name ('TB.QUE') = %fieldexpand (TB_TASK_QUEUE, 0) * %UPVAL,
;	  0227	    %name ('TB.STR') = %fieldexpand (TB_START, 0) * %UPVAL,
;	  0228	    %name ('TB.ABT') = %fieldexpand (TB_ABORT, 0) * %UPVAL,
;	  0229	    %name ('TB.RSC') = %fieldexpand (TB_RESOURCE, 0) * %UPVAL,
;	  0230	    %name ('TB.ERR') = %fieldexpand (TB_ERROR_PC, 0) * %UPVAL,
;	  0231	    %name ('TB.NAM') = %fieldexpand (TB_NAME, 0) * %UPVAL,
;	L 0232	%if $TOPS10 or $TOPS20
;	U 0233	%then
;	U 0234	    %name ('TB.BUF') = %fieldexpand (TB_ERROR_BUFFER, 0) * %UPVAL,
;	  0235	%fi
;	  0236	    %name ('TB.EVW') = %fieldexpand (TB_EVENT_WAIT, 0) * %UPVAL,
;	  0237	    %name ('TB.SEM') = %fieldexpand (TB_SEMAPHORE, 0) * %UPVAL,
;	  0238	    %name ('TB.TIM') = %fieldexpand (TB_TIME, 0) * %UPVAL,
;	  0239	    %name ('TB.CTX') = %fieldexpand (TB_CONTEXT, 0) * %UPVAL,
;	  0240	    %name ('TB.STK') = %fieldexpand (TB_STACK, 0) * %UPVAL;
;	  0241	
;	  0242	!
;	  0243	! Own storage
;	  0244	!
;	  0245	
;	  0246	!
;	  0247	! Make something have an initial value so $OWN$ PSECT for NMUSKD
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   6
X00.19								 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (3)

;	  0248	! shows up in TKB36 map.
;	  0249	!
;	  0250	
;	  0251	own
;	  0252	    RUN_QUEUE : initial (0),            ! Queue of runnable tasks
;	  0253	    TASK_QUEUE : Q_HEADER,              ! Queue of all tasks
;	  0254	    SKD_EVENT : EVENT_BLOCK,            ! Event for scheduler wakeup
;	  0255	    SKD_TASK : ref TASK_BLOCK,          ! Task block for scheduler
;	  0256	    TIME_OUT : TIME_BLOCK;
;	  0257	
;	  0258	global
;	  0259	    TIME_QUEUE : Q_HEADER,              ! Queue of tasks waiting for timeouts
;	  0260	    NMLVER : initial (3),
;	  0261	    DECECO : initial (0),
;	  0262	    USRECO : initial (0);
;	  0263	
;	  0264	%master_debug_data_base;                ! Debugging data base
;	  0265	
;	  0266	!
;	  0267	! Structures
;	  0268	!
;	  0269	! Timer queue scanning data block
;	  0270	!
;	  0271	
;	  0272	    $field
;	  0273	    TQUEUE_SCAN_FIELDS =
;	  0274		set
;	  0275		TT_NOW = [$sub_block (TIME_BLOCK_SIZE)], ! Current time
;	  0276		TT_TIME = [$sub_block (TIME_BLOCK_SIZE)] ! Least of wakeup times found
;	  0277		tes;
;	  0278	
;	  0279	literal
;	  0280	    TQUEUE_SCAN_SIZE = $field_set_size;
;	  0281	
;	  0282	macro
;	  0283	    TIMER_SCAN_BLOCK = block [TQUEUE_SCAN_SIZE] field (TQUEUE_SCAN_FIELDS) %;
;	  0284	
;	  0285	!
;	  0286	! External references
;	  0287	!
;	  0288	
;	  0289	external
;	  0290	    CURTSK;					! Current task pointer
;	  0291	
;	  0292	external routine
;	  0293	    NMU$TABLE_ROUTINES,				! Table manipulation routines
;	  0294	    NMU$QUEUE_MANAGER,				! Queue manager routines
;	  0295	    NMU$MEMORY_MANAGER,				! Memory management routines
;	  0296	    INIT_GLOBALS;				! Other global routines for initialization
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   7
X00.19		TOPMOST						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (4)

;	  0297	%routine ('TOPMOST') : novalue =
;	  0298	
;	  0299	!++
;	  0300	! Functional description:
;	  0301	!
;	  0302	!       This is the "main" routine for the program using this
;	  0303	!	scheduler.
;	  0304	!
;	  0305	!	It initializes the memory management system, scheduler and
;	  0306	!	any other system that requires initialization (defined in
;	  0307	!	NMINI.REQ).
;	  0308	!
;	  0309	!
;	  0310	! Note that interlocks need to be developed to allow multi-streaming
;	  0311	! of initialization code.
;	  0312	!
;	  0313	!--
;	  0314	
;	  0315	    begin
;	  0316	
;	  0317	!
;	  0318	! Detach the job from the Force Line if necessary. (Tops-10 only)
;	  0319	!
;	  0320	    %if $TOPS10 %then DETACH (); %fi
;	  0321	
;	  0322	!
;	  0323	! Setup the debugging data base (if needed)
;	  0324	!
;	  0325	    %debug_setup;
;	  0326	
;	  0327	!
;	  0328	! Reset memory manager
;	  0329	!
;	  0330	    NMU$MEMORY_RESET ();
;	  0331	    NMU$MEMORY_INITIALIZE (BASIC_MEMORY);
;	  0332	!
;	  0333	! Reset the scheduler.
;	  0334	!
;	  0335	! Reset master task queue and queue of runnable tasks.
;	  0336	!
;	  0337	    NMU$QUEUE_RESET (TASK_QUEUE);
;	  0338	    RUN_QUEUE = 0;
;	  0339	!
;	  0340	! Create null task using the current stack.
;	  0341	!
;	  0342	    NMU$QUEUE_RESET (TIME_QUEUE);    
;	  0343	    NMU$SCHED_EVENT (SKD_EVENT, $true);
;	  0344	
;	  0345	    SKD_TASK = NMU$MEMORY_GET (TASK_BLOCK_ALLOCATION);
;	  0346	    CURTSK = .SKD_TASK;
;	  0347	
;	  0348	    begin
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   8
X00.19		TOPMOST						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (4)

;	  0349	
;	  0350	    local
;	  0351		TASK_NAME_POINTER, NAME_LITERAL;
;	  0352	
;	  0353	    TASK_NAME_POINTER = ch$ptr (SKD_TASK [TB_NAME]);
;	  0354	    NAME_LITERAL = ch$asciz ('SCHEDULER');
;	  0355	    ch$movasciz (TASK_NAME_POINTER, .NAME_LITERAL);
;	  0356	    end;
;	  0357	
;	  0358	!
;	  0359	! Initialize all other systems.
;	  0360	!
;	  0361	    MASTER_INITIALIZATION;
;	  0362	!
;	  0363	! Start scheduling by calling scheduler co-routine
;	  0364	!
;	  0365	    SCHEDULER_TASK ();
;	  0366	!
;	  0367	! If return here ... NML has crashed.
;	  0368	!
;	  0369	    end;					! End of TOPMOST


						.TITLE	NMUSKD
						.IDENT	/X00.19/


000000						.PSECT	$PLIT$,  RO ,  D  
000000	   123     103     110 		P.AAA:	.ASCII	/SCH/
000003	   105     104     125 			.ASCII	/EDU/
000006	   114     105     122 			.ASCII	/LER/
000011	   000 					.ASCII	<00>
000012	   116     115     114 		P.AAB:	.ASCII	/NML/
000015	   055     120     122 			.ASCII	/-PR/
000020	   117     103     105 			.ASCII	/OCE/
000023	   123     123     117 			.ASCII	/SSO/
000026	   122     000 				.ASCII	/R/<00>
000030	   114     117     117 		P.AAC:	.ASCII	/LOO/
000033	   120     102     101 			.ASCII	/PBA/
000036	   103     113     055 			.ASCII	/CK-/
000041	   115     111     122 			.ASCII	/MIR/
000044	   122     117     122 			.ASCII	/ROR/
000047	   000 					.ASCII	<00>
000050	   116     111     103 		P.AAD:	.ASCII	/NIC/
000053	   105     055     114 			.ASCII	/E-L/
000056	   111     123     124 			.ASCII	/IST/
000061	   105     116     105 			.ASCII	/ENE/
000064	   122     055     061 			.ASCII	/R-1/
000067	   000 					.ASCII	<00>
000070	   116     111     103 		P.AAE:	.ASCII	/NIC/
000073	   105     055     114 			.ASCII	/E-L/
000076	   111     123     124 			.ASCII	/IST/
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page   9
X00.19		TOPMOST						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (4)

000101	   105     116     105 			.ASCII	/ENE/
000104	   122     055     062 			.ASCII	/R-2/
000107	   000 					.ASCII	<00>
000110	   103     117     125 		P.AAF:	.ASCII	/COU/
000113	   116     124     105 			.ASCII	/NTE/
000116	   122     055     124 			.ASCII	/R-T/
000121	   111     115     105 			.ASCII	/IME/
000124	   122     000 				.ASCII	/R/<00>



000000						.PSECT	$OWN$,  D  
000000	000000 				RUN.QUEUE:
						.WORD	0
000002					TASK.QUEUE:
						.BLKW	3
000010					SKD.EVENT:
						.BLKW	3
000016					SKD.TASK:
						.BLKW	1
000020					TIME.OUT:
						.BLKW	3



000000						.PSECT	$GLOB$,  D  
000000					TIME.QUEUE::
						.BLKW	3
000006	000003 				NMLVER::.WORD	3
000010	000000 				DECECO::.WORD	0
000012	000000 				USRECO::.WORD	0
000014					DEBUG:: .BLKW	2
000020					TRACE.BUFFER::
						.BLKW	144


						.GLOBL	CURTSK, UT.CLEAR, UT.INSERT, UT.FETCH
						.GLOBL	UT.DELETE, UT.CHANGE, UT.MAX, UQ.RESET
						.GLOBL	UQ.INSERT, UQ.REMOVE, UQ.EXTRACT
						.GLOBL	UQ.LENGTH, UQ.SCAN, UQ.SEXTRACT
						.GLOBL	UM.RESET, UM.INITIALIZE, UM.GET
						.GLOBL	UM.RELEASE, UN.INIT, UN.LOCAL
						.GLOBL	UN.OPEN, UN.ACCEPT, UN.REJECT
						.GLOBL	UN.READ, UN.WRITE, UN.ABORT, UN.CLOSE
						.GLOBL	UN.STATUS, UN.VALIDATE, NX.MIRROR
						.GLOBL	NL.INIT, NW.INI, EV.INI, NL.VDI
						.GLOBL	NL.DQR, NL.RCV, NL.CTT


	000000 				TB.SKD==	    0
	000006 				TB.QUE==	    6
	000014 				TB.STR==	    14
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  10
X00.19		TOPMOST						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (4)

	000016 				TB.ABT==	    16
	000020 				TB.RSC==	    20
	000022 				TB.ERR==	    22
	000024 				TB.NAM==	    24
	000044 				TB.EVW==	    44
	000046 				TB.SEM==	    46
	000050 				TB.TIM==	    50
	000056 				TB.CTX==	    56
	000060 				TB.STK==	    60
	000001 				DB.TRA==	    1
	000002 				DB.RTN==	    2
	000004 				DB.GLX==	    4
	000010 				DB.MEM==	    10
	000020 				DB.MCS==	    20
	000040 				DB.SKD==	    40
	000100 				DB.EVT==	    100
	000200 				DB.NET==	    200
	000400 				DB.NTT==	    400
	001000 				DB.DES==	    1000
	002000 				DB.NCP==	    2000
	004000 				DB.IPC==	    4000
	010000 				DB.FIL==	    10000
	020000 				DB.PAG==	    20000
	040000 				DB.DLW==	    40000
	100000 				DB.FDT==	    -100000
	000001 				DB.DAP==	    1
	000002 				DB.CTT==	    2


						.SBTTL	TOPMOST TOPMOST
000000						.PSECT	$CODE$,  RO 

000000	004167  000000G			TOPMOST:JSR	R1,$SAVE2			;					0297
000004	004767  000000G				JSR	PC,UM.RESET			;					0330
000010	012746  011610 				MOV	#11610,-(SP)			;					0331
000014	004767  000000G				JSR	PC,UM.INITIALIZE
000020	012716  000002'				MOV	#TASK.QUEUE,(SP)		;					0337
000024	004767  000000G				JSR	PC,UQ.RESET
000030	005067  000000'				CLR	RUN.QUEUE			;					0338
000034	012716  000000'				MOV	#TIME.QUEUE,(SP)		;					0342
000040	004767  000000G				JSR	PC,UQ.RESET
000044	012716  000010'				MOV	#SKD.EVENT,(SP)			;					0343
000050	012746  000001 				MOV	#1,-(SP)
000054	004767  000000V				JSR	PC,US.EVENT
000060	012716  000060 				MOV	#60,(SP)			;					0345
000064	004767  000000G				JSR	PC,UM.GET
000070	010067  000016'				MOV	R0,SKD.TASK
000074	010067  000000G				MOV	R0,CURTSK			; SKD.TASK,*				0346
000100	010002 					MOV	R0,R2				; SKD.TASK,TASK.NAME.POINT		0353
000102	062702  000024 				ADD	#24,R2				; *,TASK.NAME.POINT
000106	012701  000000'				MOV	#P.AAA,R1			; *,NAME.LITERAL			0354
000112	012716  000310 				MOV	#310,(SP)			;					0355
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  11
X00.19		TOPMOST						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (4)

000116	010146 					MOV	R1,-(SP)			; NAME.LITERAL,*
000120	005046 					CLR	-(SP)
000122	004767  000000G				JSR	PC,BL$FCH
000126	022626 					CMP	(SP)+,(SP)+
000130	005700 					TST	R0
000132	001003 					BNE	1$
000134	012716  000310 				MOV	#310,(SP)
000140	000411 					BR	2$
000142	012716  000310 			1$:	MOV	#310,(SP)
000146	010146 					MOV	R1,-(SP)			; NAME.LITERAL,*
000150	005046 					CLR	-(SP)
000152	004767  000000G				JSR	PC,BL$FCH
000156	160100 					SUB	R1,R0				; NAME.LITERAL,*
000160	022626 					CMP	(SP)+,(SP)+
000162	010016 					MOV	R0,(SP)
000164	010146 				2$:	MOV	R1,-(SP)			; NAME.LITERAL,*
000166	010246 					MOV	R2,-(SP)			; TASK.NAME.POINT,*
000170	004767  000000G				JSR	PC,BL$MOV
000174	010002 					MOV	R0,R2				; *,TASK.NAME.POINT
000176	004767  000000G				JSR	PC,NW.INI			;					0356
000202	004767  000000G				JSR	PC,UN.INIT
000206	004767  000000G				JSR	PC,NL.VDI
000212	004767  000000G				JSR	PC,NL.INIT
000216	004767  000000G				JSR	PC,EV.INI
000222	012716  000000G				MOV	#NL.DQR,(SP)
000226	012746  000454 				MOV	#454,-(SP)
000232	005046 					CLR	-(SP)
000234	012746  000012'				MOV	#P.AAB,-(SP)
000240	004767  000000V				JSR	PC,US.CREATE
000244	012716  000000G				MOV	#NX.MIRROR,(SP)
000250	012746  001000 				MOV	#1000,-(SP)
000254	005046 					CLR	-(SP)
000256	012746  000030'				MOV	#P.AAC,-(SP)
000262	004767  000000V				JSR	PC,US.CREATE
000266	012716  000000G				MOV	#NL.RCV,(SP)
000272	012746  000372 				MOV	#372,-(SP)
000276	005046 					CLR	-(SP)
000300	012746  000050'				MOV	#P.AAD,-(SP)
000304	004767  000000V				JSR	PC,US.CREATE
000310	012716  000000G				MOV	#NL.RCV,(SP)
000314	012746  000372 				MOV	#372,-(SP)
000320	005046 					CLR	-(SP)
000322	012746  000070'				MOV	#P.AAE,-(SP)
000326	004767  000000V				JSR	PC,US.CREATE
000332	012716  000000G				MOV	#NL.CTT,(SP)
000336	012746  000372 				MOV	#372,-(SP)
000342	005046 					CLR	-(SP)
000344	012746  000110'				MOV	#P.AAF,-(SP)
000350	004767  000000V				JSR	PC,US.CREATE
000354	004767  000000V				JSR	PC,SCHEDULER.TASK		;					0365
000360	062706  000046 				ADD	#46,SP				;					0315
000364	000207 					RTS	PC				;					0297
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  12
X00.19		TOPMOST						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (4)

; Routine Size:  123 words,	Routine Base:  $CODE$ + 0000
; Maximum stack depth per invocation:  23 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  13
X00.19		NMU$SCHED_CREATE as US_CREATE			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (5)

;	  0370	%global_routine ('NMU$SCHED_CREATE', CODE, STACK_SIZE, ABORT_RTN, NAME_PTR) =
;	  0371	
;	  0372	!++
;	  0373	! Functional description:
;	  0374	!
;	  0375	!       This routine allocates a task state block and sets the task
;	  0376	!       up for execution.  The code specified is started when the
;	  0377	!       task comes up in the runnable task queue.
;	  0378	!
;	  0379	! Formal parameters:
;	  0380	!
;	  0381	!       .CODE         Address of routine to execute as the task
;	  0382	!       .STACK_SIZE   Number of fullwords to allocate for stack
;	  0383	!	.ABORT_RTN    Address of a routine to call when the task
;	  0384	!		       is aborted
;	  0385	!	.NAME_PTR     Byte pointer to a ASCIZ task name string
;	  0386	!
;	  0387	! Routine value:
;	  0388	!
;	  0389	!       The returned value is the address of the task's state
;	  0390	!       block.  This value is used whenever the task is to
;	  0391	!       be affected by such routines as NMU$SCHED_ABORT.
;	  0392	!
;	  0393	! Side effects:
;	  0394	!
;	  0395	!       The runnable task queue gets another task.
;	  0396	!
;	  0397	!--
;	  0398	
;	  0399	    begin
;	  0400	
;	  0401	    local
;	  0402		TASK : ref TASK_BLOCK,
;	  0403		TASK_NAME;
;	  0404	
;	  0405	    %debug (SCHEDULER_TRACE, (TRACE_INFO ('Creating %A (%O)', .NAME_PTR, .CODE)));
;	  0406	
;	L 0407	%if $TOPS10 or $TOPS20
;	U 0408	%then
;	U 0409	    STACK_SIZE = .STACK_SIZE*2;
;	  0410	%fi
;	  0411	
;	  0412	!
;	  0413	! Get memory for a task block
;	  0414	!
;	  0415	    TASK = NMU$MEMORY_GET (TASK_BLOCK_ALLOCATION + (.STACK_SIZE*%upval));
;	  0416	!
;	  0417	! Initialize start address, error routine, task name and
;	  0418	! stack.
;	  0419	!
;	  0420	    TASK [TB_START] = .CODE;
;	  0421	    TASK_INITIALIZE (.TASK, .STACK_SIZE);
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  14
X00.19		NMU$SCHED_CREATE as US_CREATE			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (5)

;	  0422	    TASK [TB_ABORT] = .ABORT_RTN;
;	  0423	    TASK_NAME = ch$ptr (TASK [TB_NAME]);
;	  0424	    ch$movasciz (TASK_NAME, .NAME_PTR);
;	  0425	!
;	  0426	! Insert entry into master task queue and
;	  0427	! runnable task queue.
;	  0428	!
;	  0429	    NMU$QUEUE_INSERT (TASK_QUEUE, TASK [TB_TASK_QUEUE]);
;	  0430	    NMU$TABLE_INSERT (RUN_QUEUE, TASK [TB_SCHED_QUEUE]);
;	  0431	!
;	  0432	! Return address of the task block.
;	  0433	!
;	  0434	    .TASK
;	  0435	    end;					! End of NMU$SCHED_CREATE


						.GLOBL	SS$TNI


						.SBTTL	US.CREATE NMU$SCHED_CREATE as US_CREATE
000000	004167  000000G			US.CREATE::
						JSR	R1,$SAVE3			;					0370
000004	016600  000016 				MOV	16(SP),R0			; STACK.SIZE,*				0415
000010	006300 					ASL	R0
000012	010046 					MOV	R0,-(SP)
000014	062716  000060 				ADD	#60,(SP)
000020	004767  000000G				JSR	PC,UM.GET
000024	010002 					MOV	R0,R2				; *,TASK
000026	016662  000022  000014 			MOV	22(SP),14(R2)			; CODE,*(TASK)				0420
000034	010216 					MOV	R2,(SP)				; TASK,*				0421
000036	016646  000020 				MOV	20(SP),-(SP)			; STACK.SIZE,*
000042	004767  000000G				JSR	PC,SS$TNI
000046	016662  000020  000016 			MOV	20(SP),16(R2)			; ABORT.RTN,*(TASK)			0422
000054	010203 					MOV	R2,R3				; TASK,TASK.NAME			0423
000056	062703  000024 				ADD	#24,R3				; *,TASK.NAME
000062	012716  000310 				MOV	#310,(SP)			;					0424
000066	016601  000016 				MOV	16(SP),R1			; NAME.PTR,*
000072	010146 					MOV	R1,-(SP)
000074	005046 					CLR	-(SP)
000076	004767  000000G				JSR	PC,BL$FCH
000102	022626 					CMP	(SP)+,(SP)+
000104	005700 					TST	R0
000106	001003 					BNE	1$
000110	012716  000310 				MOV	#310,(SP)
000114	000411 					BR	2$
000116	012716  000310 			1$:	MOV	#310,(SP)
000122	010146 					MOV	R1,-(SP)
000124	005046 					CLR	-(SP)
000126	004767  000000G				JSR	PC,BL$FCH
000132	160100 					SUB	R1,R0
000134	022626 					CMP	(SP)+,(SP)+
000136	010016 					MOV	R0,(SP)
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  15
X00.19		NMU$SCHED_CREATE as US_CREATE			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (5)

000140	010146 				2$:	MOV	R1,-(SP)
000142	010346 					MOV	R3,-(SP)			; TASK.NAME,*
000144	004767  000000G				JSR	PC,BL$MOV
000150	010003 					MOV	R0,R3				; *,TASK.NAME
000152	012716  000002'				MOV	#TASK.QUEUE,(SP)		;					0429
000156	010246 					MOV	R2,-(SP)			; TASK,*
000160	062716  000006 				ADD	#6,(SP)
000164	004767  000000G				JSR	PC,UQ.INSERT
000170	012716  000000'				MOV	#RUN.QUEUE,(SP)			;					0430
000174	010246 					MOV	R2,-(SP)			; TASK,*
000176	004767  000000G				JSR	PC,UT.INSERT
000202	062706  000014 				ADD	#14,SP				;					0399
000206	010200 					MOV	R2,R0				; TASK,*				0370
000210	000207 					RTS	PC
; Routine Size:  69 words,	Routine Base:  $CODE$ + 0366
; Maximum stack depth per invocation:  11 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  16
X00.19		NMU$SCHED_ABORT as US_ABORT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (6)

;	  0436	%global_routine ('NMU$SCHED_ABORT', TASK : ref TASK_BLOCK) : novalue =
;	  0437	
;	  0438	!++
;	  0439	! Functional description:
;	  0440	!
;	  0441	!       This routine aborts a task and calls it's clean up routine.
;	  0442	!
;	  0443	! Formal parameters:
;	  0444	!
;	  0445	!       .TASK   Address of task block for task to abort.
;	  0446	!
;	  0447	! Routine value: none
;	  0448	! Side effects:
;	  0449	!
;	  0450	!       The specified task will be aborted, it's cleanup routine
;	  0451	!       will be called (if it exists) and all traces of the task
;	  0452	!       will disappear.
;	  0453	!
;	  0454	!--
;	  0455	
;	  0456	    begin
;	  0457	
;	  0458	    bind routine
;	  0459		A_ROUTINE = .TASK [TB_ABORT];		! Abort routine address
;	  0460	
;	P 0461	    %debug (SCHEDULER_TRACE, (TRACE_INFO ('Aborting task %A (%O)',
;	  0462						   ch$ptr (TASK [TB_NAME]), .TASK)));
;	  0463	
;	  0464	    if A_ROUTINE neq 0 then A_ROUTINE (.TASK);
;	  0465	
;	  0466	!*****
;	  0467	! If task is completely aborted ... delete the task and resources
;	  0468	!*****
;	  0469	
;	  0470	    end;					! End of NMU$SCHED_ABORT


						.SBTTL	US.ABORT NMU$SCHED_ABORT as US_ABORT
000000	016600  000002 			US.ABORT::
						MOV	2(SP),R0			; TASK,*				0459
000004	005760  000016 				TST	16(R0)				;					0464
000010	001404 					BEQ	1$
000012	010046 					MOV	R0,-(SP)			; TASK,*
000014	004770  000016 				JSR	PC,@16(R0)
000020	005726 					TST	(SP)+
000022	000207 				1$:	RTS	PC				;					0436
; Routine Size:  10 words,	Routine Base:  $CODE$ + 0600
; Maximum stack depth per invocation:  2 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  17
X00.19		NMU$SCHED_FINI as US_FINI			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (7)

;	  0471	%global_routine ('NMU$SCHED_FINI') : novalue =
;	  0472	
;	  0473	!++
;	  0474	! Functional description:
;	  0475	!
;	  0476	!	This routine is called whenever a task "exits".  This means
;	  0477	!	that the routine comprising the main routine of the task
;	  0478	!	attempts to return.
;	  0479	!
;	  0480	! Formal parameters: none
;	  0481	!
;	  0482	! Routine value: none
;	  0483	! Side effects:
;	  0484	!
;	  0485	!--
;	  0486	
;	  0487	    begin
;	  0488	
;	  0489	    TASK_INFO ('Task has exited');
;	  0490	
;	  0491	    NMU$SCHED_DESCHEDULE ();
;	  0492	    end;					! End of NMU$SCHED_FINI


						.SBTTL	US.FINI NMU$SCHED_FINI as US_FINI
000000	004767  000000V			US.FINI::
						JSR	PC,US.DESCHEDULE		;					0491
000004	000207 					RTS	PC				;					0471
; Routine Size:  3 words,	Routine Base:  $CODE$ + 0624
; Maximum stack depth per invocation:  1 word
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  18
X00.19		NMU$SCHED_ERROR as US_ERROR			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (8)

;	  0493	%global_routine ('NMU$SCHED_ERROR', ERROR_PTR) : novalue =
;	  0494	
;	  0495	!++
;	  0496	! Functional description:
;	  0497	!
;	  0498	!        This routine is called in a task's context to abnormally
;	  0499	!        complete it's execution.  It puts the supplied error message
;	  0500	!        into the task's task block error buffer and then calls
;	  0501	!        NMU$SCHED_COMPLETE to abort the task.
;	  0502	!
;	  0503	! Formal parameters:
;	  0504	!
;	  0505	!    .ERROR_PTR    Pointer to ASCIZ string to be put into the
;	  0506	!                   task block error buffer.
;	  0507	!
;	  0508	! Routine value: none
;	  0509	! Side effects: none
;	  0510	!
;	  0511	!--
;	  0512	
;	  0513	    begin
;	  0514	
;	L 0515	%if not $MCB
;	U 0516	%then
;	U 0517	    local
;	U 0518	         TASK : ref TASK_BLOCK,
;	U 0519	         TB_POINTER;
;	U 0520	
;	U 0521	    TASK = CURRENT_TASK;
;	U 0522	
;	U 0523	    TB_POINTER = ch$ptr (TASK [TB_ERROR_BUFFER]);
;	U 0524	
;	U 0525	    if .ERROR_PTR neq 0
;	U 0526	    then ch$movasciz (TB_POINTER, .ERROR_PTR);
;	  0527	%fi
;	  0528	
;	  0529	    NMU$SCHED_COMPLETE ();
;	  0530	    end;                                ! End of NMU$SCHED_ERROR


						.SBTTL	US.ERROR NMU$SCHED_ERROR as US_ERROR
000000	004767  000000V			US.ERROR::
						JSR	PC,US.COMPLETE			;					0529
000004	000207 					RTS	PC				;					0493
; Routine Size:  3 words,	Routine Base:  $CODE$ + 0632
; Maximum stack depth per invocation:  1 word
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  19
X00.19		NMU$SCHED_COMPLETE as US_COMPLETE		 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (9)

;	  0531	%global_routine ('NMU$SCHED_COMPLETE') : novalue =
;	  0532	
;	  0533	!++
;	  0534	! Functional description:
;	  0535	!
;	  0536	!        This routine is called in a task's context to abnormally
;	  0537	!        complete it's execution.  It outputs the message that is
;	  0538	!        stored in the task block's error buffer, aborts the task
;	  0539	!        and deschedules it forever.
;	  0540	!
;	  0541	! Formal parameters: none
;	  0542	!
;	  0543	! Routine value: none
;	  0544	! Side effects: none
;	  0545	!
;	  0546	!--
;	  0547	
;	  0548	    begin
;	  0549	    local
;	  0550	         TASK : ref TASK_BLOCK;
;	  0551	
;	  0552	    TASK = CURRENT_TASK;
;	  0553	
;	L 0554	%if not $MCB
;	U 0555	%then
;	U 0556	    TASK_INFO (ch$ptr (TASK [TB_ERROR_BUFFER]));
;	  0557	%fi
;	  0558	
;	  0559	    NMU$SCHED_ABORT (.TASK);
;	  0560	    NMU$SCHED_DESCHEDULE ();
;	  0561	    end;                                ! End of NMU$SCHED_COMPLETE


						.SBTTL	US.COMPLETE NMU$SCHED_COMPLETE as US_COMPLETE
000000	016700  000000G			US.COMPLETE::
						MOV	CURTSK,R0			; *,TASK				0552
000004	010046 					MOV	R0,-(SP)			; TASK,*				0559
000006	004767  177726 				JSR	PC,US.ABORT
000012	004767  000000V				JSR	PC,US.DESCHEDULE		;					0560
000016	005726 					TST	(SP)+				;					0548
000020	000207 					RTS	PC				;					0531
; Routine Size:  9 words,	Routine Base:  $CODE$ + 0640
; Maximum stack depth per invocation:  2 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  20
X00.19		NMU$SQUEUE_RESET as US_QRESET			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (10)

;	  0562	%global_routine ('NMU$SQUEUE_RESET', QUEUE : ref SQ_HEADER) : novalue =
;	  0563	
;	  0564	!++
;	  0565	! Functional description:
;	  0566	!
;	  0567	!       This routine resets a "scheduling" type queue.  Any queue
;	  0568	!       that can have scheduling done on it contains extra information
;	  0569	!       in the queue header that should be reset any time the queue
;	  0570	!       is reset.
;	  0571	!
;	  0572	! Formal parameters:
;	  0573	!
;	  0574	!       .QUEUE   Address of queue header
;	  0575	!
;	  0576	! Routine value: none
;	  0577	! Side effects:
;	  0578	!
;	  0579	!      Any entries on the queue are lost
;	  0580	!      Any tasks that are waiting on this queue have
;	  0581	!       their entries on the task wait list deleted.
;	  0582	!
;	  0583	!--
;	  0584	
;	  0585	    begin
;	  0586	
;	  0587	!
;	  0588	! Reset data queue.
;	  0589	!
;	  0590	    NMU$QUEUE_RESET (QUEUE [Q_QUEUE]);
;	  0591	!
;	  0592	! Reset queue non-empty event.
;	  0593	! Don't allow SQUEUE operations at interrupt level.
;	  0594	!
;	  0595	    NMU$SCHED_EVENT (QUEUE [Q_EVENT], $false);
;	  0596	    end;					! End of NMU$SQUEUE_RESET


						.SBTTL	US.QRESET NMU$SQUEUE_RESET as US_QRESET
000000	016646  000002 			US.QRESET::
						MOV	2(SP),-(SP)			; QUEUE,*				0590
000004	004767  000000G				JSR	PC,UQ.RESET
000010	016616  000004 				MOV	4(SP),(SP)			; QUEUE,*				0595
000014	062716  000006 				ADD	#6,(SP)
000020	005046 					CLR	-(SP)
000022	004767  000000V				JSR	PC,US.EVENT
000026	022626 					CMP	(SP)+,(SP)+			;					0585
000030	000207 					RTS	PC				;					0562
; Routine Size:  13 words,	Routine Base:  $CODE$ + 0662
; Maximum stack depth per invocation:  3 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  21
X00.19		NMU$SQUEUE_INSERT as US_INSERT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (11)

;	  0597	%global_routine ('NMU$SQUEUE_INSERT', QUEUE : ref SQ_HEADER, ENTRY) : novalue =
;	  0598	
;	  0599	!++
;	  0600	! Functional description:
;	  0601	!
;	  0602	!       This routine inserts an entry into a queue.  If a task is
;	  0603	!       waiting for this queue to become non-empty, it is scheduled
;	  0604	!       for execution.
;	  0605	!
;	  0606	! Formal parameters:
;	  0607	!
;	  0608	!       .QUEUE   Address of a queue header block
;	  0609	!       .ENTRY   Address of a entry to be inserted to queue
;	  0610	!
;	  0611	! Routine value: none
;	  0612	! Side effects:
;	  0613	!
;	  0614	!       If the queue becomes non-empty the queue of tasks waiting
;	  0615	!       for this to happen is checked.  If a task is waiting, it
;	  0616	!       is put onto the queue of runnable tasks.
;	  0617	!
;	  0618	!--
;	  0619	
;	  0620	    begin
;	  0621	
;	  0622	    NMU$QUEUE_INSERT (QUEUE [Q_QUEUE], .ENTRY);
;	  0623	    NMU$SCHED_FLAG (QUEUE [Q_EVENT]);
;	  0624	    end;					! End of NMU$SQUEUE_INSERT


						.SBTTL	US.INSERT NMU$SQUEUE_INSERT as US_INSERT
000000	016646  000004 			US.INSERT::
						MOV	4(SP),-(SP)			; QUEUE,*				0622
000004	016646  000004 				MOV	4(SP),-(SP)			; ENTRY,*
000010	004767  000000G				JSR	PC,UQ.INSERT
000014	016616  000010 				MOV	10(SP),(SP)			; QUEUE,*				0623
000020	062716  000006 				ADD	#6,(SP)
000024	004767  000000V				JSR	PC,US.FLAG
000030	022626 					CMP	(SP)+,(SP)+			;					0620
000032	000207 					RTS	PC				;					0597
; Routine Size:  14 words,	Routine Base:  $CODE$ + 0714
; Maximum stack depth per invocation:  3 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  22
X00.19		NMU$SQUEUE_REMOVE as US_REMOVE			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (12)

;	  0625	%global_routine ('NMU$SQUEUE_REMOVE', QUEUE : ref SQ_HEADER) =
;	  0626	
;	  0627	!++
;	  0628	! Functional description:
;	  0629	!
;	  0630	!       This routine removes an entry from a queue.  If the queue
;	  0631	!       is empty, the calling task is descheduled and a new task
;	  0632	!       is selected for running.  If no task is runnable, the null
;	  0633	!       task is executed.
;	  0634	!
;	  0635	! Formal parameters:
;	  0636	!
;	  0637	!       .QUEUE   Address of a queue header block
;	  0638	!
;	  0639	! Routine value:
;	  0640	!
;	  0641	!       Address of entry from queue
;	  0642	!
;	  0643	! Side effects: none
;	  0644	!
;	  0645	!--
;	  0646	
;	  0647	    begin
;	  0648	
;	  0649	    local
;	  0650		ENTRY;
;	  0651	
;	  0652	    while (ENTRY = NMU$QUEUE_REMOVE (QUEUE [Q_QUEUE])) eql 0 do
;	  0653		NMU$SCHED_WAIT (QUEUE [Q_EVENT],0);
;	  0654	
;	  0655	    .ENTRY
;	  0656	    end;					! End of NMU$SQUEUE_REMOVE


						.SBTTL	US.REMOVE NMU$SQUEUE_REMOVE as US_REMOVE
000000	004167  000000G			US.REMOVE::
						JSR	R1,$SAVE2			;					0625
000004	016602  000010 				MOV	10(SP),R2			; QUEUE,*				0653
000010	062702  000006 				ADD	#6,R2
000014	016646  000010 			1$:	MOV	10(SP),-(SP)			; QUEUE,*				0652
000020	004767  000000G				JSR	PC,UQ.REMOVE
000024	005726 					TST	(SP)+
000026	010001 					MOV	R0,R1				; *,ENTRY
000030	001006 					BNE	2$
000032	010246 					MOV	R2,-(SP)			;					0653
000034	005046 					CLR	-(SP)
000036	004767  000000V				JSR	PC,US.WAIT
000042	022626 					CMP	(SP)+,(SP)+
000044	000763 					BR	1$				;					0652
000046	010100 				2$:	MOV	R1,R0				; ENTRY,*				0625
000050	000207 					RTS	PC
; Routine Size:  21 words,	Routine Base:  $CODE$ + 0750
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  23
X00.19		NMU$SQUEUE_REMOVE as US_REMOVE			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (12)

; Maximum stack depth per invocation:  6 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  24
X00.19		NMU$QQUEUE_RESET as US_QQSET			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (13)

;	  0657	%global_routine ('NMU$QQUEUE_RESET', QUEUE : ref QQ_HEADER, QUOTA) : novalue =
;	  0658	
;	  0659	!++
;	  0660	! Functional description:
;	  0661	!
;	  0662	!       This routine resets a "quota scheduling" type queue.  Any queue
;	  0663	!       that can have scheduling done on it contains extra information
;	  0664	!       in the queue header that should be reset any time the queue
;	  0665	!       is reset.
;	  0666	!
;	  0667	! Formal parameters:
;	  0668	!
;	  0669	!       .QUEUE   Address of queue header
;	  0670	!       .QUOTA   Number of Entries in queue before insert waits
;	  0671	!
;	  0672	! Routine value: none
;	  0673	! Side effects:
;	  0674	!
;	  0675	!      Any entries on the queue are lost
;	  0676	!      Any tasks that are waiting on this queue have
;	  0677	!       their entries on the task wait list deleted.
;	  0678	!
;	  0679	!--
;	  0680	
;	  0681	    begin
;	  0682	
;	  0683	!
;	  0684	! Reset the scheduler queue portion of this entry.
;	  0685	!
;	  0686	    NMU$SQUEUE_RESET (QUEUE [QQ_SQUEUE]);
;	  0687	!
;	  0688	! Reset insert queue resume event.
;	  0689	! Don't allow SQUEUE operations at interrupt level.
;	  0690	!
;	  0691	    NMU$SCHED_EVENT (QUEUE [QQ_IEVENT], $false);
;	  0692	    QUEUE [QQ_QUOTA] = .QUOTA;
;	  0693	    QUEUE [QQ_CURRENT] = 0;
;	  0694	    end;					! End of NMU$QQUEUE_RESET


						.SBTTL	US.QQSET NMU$QQUEUE_RESET as US_QQSET
000000	010146 				US.QQSET::
						MOV	R1,-(SP)			;					0657
000002	016601  000006 				MOV	6(SP),R1			; QUEUE,*				0686
000006	010146 					MOV	R1,-(SP)
000010	004767  177624 				JSR	PC,US.QRESET
000014	010116 					MOV	R1,(SP)				;					0691
000016	062716  000014 				ADD	#14,(SP)
000022	005046 					CLR	-(SP)
000024	004767  000000V				JSR	PC,US.EVENT
000030	016661  000010  000022 			MOV	10(SP),22(R1)			; QUOTA,*				0692
000036	005061  000024 				CLR	24(R1)				;					0693
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  25
X00.19		NMU$QQUEUE_RESET as US_QQSET			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (13)

000042	022626 					CMP	(SP)+,(SP)+			;					0681
000044	012601 					MOV	(SP)+,R1			;					0657
000046	000207 					RTS	PC
; Routine Size:  20 words,	Routine Base:  $CODE$ + 1022
; Maximum stack depth per invocation:  4 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  26
X00.19		NMU$QQUEUE_INSERT as US_QQINS			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (14)

;	  0695	%global_routine ('NMU$QQUEUE_INSERT', QUEUE : ref QQ_HEADER, ENTRY) : novalue =
;	  0696	
;	  0697	!++
;	  0698	! Functional description:
;	  0699	!
;	  0700	!       This routine inserts an entry into a queue.  If a task is
;	  0701	!       waiting for this queue to become non-empty, it is scheduled
;	  0702	!       for execution. If this insert would exceed the insert quota
;	  0703	!       the current task is suspended.
;	  0704	!
;	  0705	! Formal parameters:
;	  0706	!
;	  0707	!       .QUEUE   Address of a queue header block
;	  0708	!       .ENTRY   Address of a entry to be inserted to queue
;	  0709	!
;	  0710	! Routine value: none
;	  0711	! Side effects:
;	  0712	!
;	  0713	!       If the queue becomes non-empty the queue of tasks waiting
;	  0714	!       for this to happen is checked.  If a task is waiting, it
;	  0715	!       is put onto the queue of runnable tasks.
;	  0716	!
;	  0717	!--
;	  0718	
;	  0719	    begin
;	  0720	
;	  0721	    while .QUEUE [QQ_CURRENT] geq .QUEUE [QQ_QUOTA]
;	  0722	    do NMU$SCHED_WAIT (QUEUE [QQ_IEVENT],0);
;	  0723	
;	  0724	    QUEUE [QQ_CURRENT] = .QUEUE [QQ_CURRENT] + 1;
;	  0725	    NMU$SQUEUE_INSERT (QUEUE [QQ_SQUEUE], .ENTRY);
;	  0726	    end;					! End of NMU$QQUEUE_INSERT


						.SBTTL	US.QQINS NMU$QQUEUE_INSERT as US_QQINS
000000	004167  000000G			US.QQINS::
						JSR	R1,$SAVE3			;					0695
000004	016601  000014 				MOV	14(SP),R1			; QUEUE,*				0721
000010	012702  000024 				MOV	#24,R2
000014	060102 					ADD	R1,R2
000016	010103 					MOV	R1,R3				;					0722
000020	062703  000014 				ADD	#14,R3
000024	021261  000022 			1$:	CMP	(R2),22(R1)			;					0721
000030	002406 					BLT	2$
000032	010346 					MOV	R3,-(SP)			;					0722
000034	005046 					CLR	-(SP)
000036	004767  000000V				JSR	PC,US.WAIT
000042	022626 					CMP	(SP)+,(SP)+
000044	000767 					BR	1$				;					0721
000046	005212 				2$:	INC	(R2)				;					0724
000050	010146 					MOV	R1,-(SP)			;					0725
000052	016646  000014 				MOV	14(SP),-(SP)			; ENTRY,*
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  27
X00.19		NMU$QQUEUE_INSERT as US_QQINS			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (14)

000056	004767  177540 				JSR	PC,US.INSERT
000062	022626 					CMP	(SP)+,(SP)+			;					0719
000064	000207 					RTS	PC				;					0695
; Routine Size:  27 words,	Routine Base:  $CODE$ + 1072
; Maximum stack depth per invocation:  7 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  28
X00.19		NMU$QQUEUE_REMOVE as US_QQREM			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (15)

;	  0727	%global_routine ('NMU$QQUEUE_REMOVE', QUEUE : ref QQ_HEADER) =
;	  0728	
;	  0729	!++
;	  0730	! Functional description:
;	  0731	!
;	  0732	!       This routine removes an entry from a queue.  If the queue
;	  0733	!       is empty, the calling task is descheduled and a new task
;	  0734	!       is selected for running.  If no task is runnable, the null
;	  0735	!       task is executed. When a remove has dropped the number of
;	  0736	!       queue entries to less than the quota the queue inserter is
;	  0737	!       resumed.
;	  0738	!
;	  0739	! Formal parameters:
;	  0740	!
;	  0741	!       .QUEUE   Address of a queue header block
;	  0742	!
;	  0743	! Routine value:
;	  0744	!
;	  0745	!       Address of entry from queue
;	  0746	!
;	  0747	! Side effects: none
;	  0748	!
;	  0749	!--
;	  0750	
;	  0751	    begin
;	  0752	
;	  0753	    local
;	  0754	        ENTRY;
;	  0755	
;	  0756	    ENTRY = NMU$SQUEUE_REMOVE (QUEUE [QQ_SQUEUE]);
;	  0757	    QUEUE [QQ_CURRENT] = .QUEUE [QQ_CURRENT] - 1;
;	  0758	
;	  0759	    if .QUEUE [QQ_CURRENT] lss .QUEUE [QQ_QUOTA]
;	  0760	    then NMU$SCHED_FLAG ( QUEUE [QQ_IEVENT]);
;	  0761	
;	  0762	    .ENTRY
;	  0763	    end;					! End of NMU$QQUEUE_REMOVE


						.SBTTL	US.QQREM NMU$QQUEUE_REMOVE as US_QQREM
000000	004167  000000G			US.QQREM::
						JSR	R1,$SAVE2			;					0727
000004	016601  000010 				MOV	10(SP),R1			; QUEUE,*				0756
000010	010146 					MOV	R1,-(SP)
000012	004767  177552 				JSR	PC,US.REMOVE
000016	010002 					MOV	R0,R2				; *,ENTRY
000020	005361  000024 				DEC	24(R1)				;					0757
000024	026161  000024  000022 			CMP	24(R1),22(R1)			;					0759
000032	002005 					BGE	1$
000034	010116 					MOV	R1,(SP)				;					0760
000036	062716  000014 				ADD	#14,(SP)
000042	004767  000000V				JSR	PC,US.FLAG
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  29
X00.19		NMU$QQUEUE_REMOVE as US_QQREM			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (15)

000046	005726 				1$:	TST	(SP)+				;					0751
000050	010200 					MOV	R2,R0				; ENTRY,*				0727
000052	000207 					RTS	PC
; Routine Size:  22 words,	Routine Base:  $CODE$ + 1160
; Maximum stack depth per invocation:  5 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  30
X00.19		NMU$QQUEUE_EXTRACT as US_QQEXT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (16)

;	  0764	%global_routine ('NMU$QQUEUE_EXTRACT', QUEUE : ref QQ_HEADER, ENTRY) =
;	  0765	
;	  0766	!++
;	  0767	! Functional description:
;	  0768	!
;	  0769	!       This routine removes an explicit entry from a queue.  The
;	  0770	!       quota for the queue is adjusted to reflect the entry's
;	  0771	!       extraction.
;	  0772	!
;	  0773	! Formal parameters:
;	  0774	!
;	  0775	!       .QUEUE   Address of a queue header block
;	  0776	!       .ENTRY   Address of entry on queue
;	  0777	!
;	  0778	! Routine value:
;	  0779	!
;	  0780	!	$true	Entry was found on the queue and extracted
;	  0781	!	$false	Entry was not found on the queue
;	  0782	!
;	  0783	! Side effects: none
;	  0784	!
;	  0785	!--
;	  0786	
;	  0787	    begin
;	  0788	
;	  0789	    if NMU$QUEUE_EXTRACT (QUEUE [QQ_SQUEUE], .ENTRY)
;	  0790	    then
;	  0791	        begin
;	  0792	        QUEUE [QQ_CURRENT] = .QUEUE [QQ_CURRENT] - 1;
;	  0793	        $true
;	  0794	        end
;	  0795	    else
;	  0796	        $false
;	  0797	
;	  0798	    end;					! End of NMU$QQUEUE_EXTRACT


						.SBTTL	US.QQEXT NMU$QQUEUE_EXTRACT as US_QQEXT
000000	016646  000004 			US.QQEXT::
						MOV	4(SP),-(SP)			; QUEUE,*				0789
000004	016646  000004 				MOV	4(SP),-(SP)			; ENTRY,*
000010	004767  000000G				JSR	PC,UQ.EXTRACT
000014	022626 					CMP	(SP)+,(SP)+
000016	006000 					ROR	R0
000020	103007 					BCC	1$
000022	016600  000004 				MOV	4(SP),R0			; QUEUE,*				0792
000026	005360  000024 				DEC	24(R0)
000032	012700  000001 				MOV	#1,R0				;					0787
000036	000207 					RTS	PC
000040	005000 				1$:	CLR	R0
000042	000207 					RTS	PC				;					0764
; Routine Size:  18 words,	Routine Base:  $CODE$ + 1234
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  31
X00.19		NMU$QQUEUE_EXTRACT as US_QQEXT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (16)

; Maximum stack depth per invocation:  3 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  32
X00.19		NMU$SCHED_EVENT as US_EVENT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (17)

;	  0799	%global_routine ('NMU$SCHED_EVENT', EVENT : ref EVENT_BLOCK, INT_OFF) : novalue =
;	  0800	
;	  0801	!++
;	  0802	! Functional description:
;	  0803	!
;	  0804	!       This routine resets the data base associated with a
;	  0805	!       particular event.
;	  0806	!
;	  0807	! Formal parameters:
;	  0808	!
;	  0809	!       .EVENT		Address of event block (EVENT_BLOCK)
;	  0810	!	.INT_OFF	Boolean flag indicating if interrupts
;	  0811	!			are to be turned off when this event
;	  0812	!			is being signalled. (i.e. this flag is
;	  0813	!			$true if the event can be signalled from
;	  0814	!			interrupt level.)
;	  0815	!
;	  0816	! Routine value: none
;	  0817	! Side effects:
;	  0818	!
;	  0819	!       The queue of tasks waiting for the event is cleared.
;	  0820	!       The count of event occurances is cleared.
;	  0821	!
;	  0822	!--
;	  0823	
;	  0824	    begin
;	  0825	
;	  0826	    %debug (EVENT_TRACE, (TRACE_INFO ('Event reset (%O)', .EVENT)));
;	  0827	
;	  0828	!
;	  0829	! Reset queue of tasks waiting for this event.
;	  0830	!
;	  0831	    NMU$TABLE_CLEAR (EVENT [EB_TASKS]);
;	  0832	!    EVENT [EB_TASKS] = 0;
;	  0833	!
;	  0834	! Lock the event semaphore, indicating is hasn't
;	  0835	! happened yet.
;	  0836	!
;	  0837	    LOCK (EVENT [EB_SEMAPHORE]);
;	  0838	!
;	  0839	! Set the interrupt suppression flag (if event
;	  0840	! can be signalled from interrupt level.
;	  0841	!
;	  0842	    EVENT [EB_NOINT] = .INT_OFF;
;	  0843	    end;					! End of NMU$SCHED_EVENT


						.SBTTL	US.EVENT NMU$SCHED_EVENT as US_EVENT
000000	010146 				US.EVENT::
						MOV	R1,-(SP)			;					0799
000002	016601  000006 				MOV	6(SP),R1			; EVENT,*				0831
000006	010146 					MOV	R1,-(SP)
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  33
X00.19		NMU$SCHED_EVENT as US_EVENT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (17)

000010	004767  000000G				JSR	PC,UT.CLEAR
000014	005761  000002 				TST	2(R1)				;					0837
000020	001003 					BNE	1$
000022	012761  000001  000002 			MOV	#1,2(R1)
000030	016600  000006 			1$:	MOV	6(SP),R0			; INT.OFF,*				0842
000034	142761  000001  000004 			BICB	#1,4(R1)
000042	006000 					ROR	R0
000044	105561  000004 				ADCB	4(R1)
000050	005726 					TST	(SP)+				;					0824
000052	012601 					MOV	(SP)+,R1			;					0799
000054	000207 					RTS	PC
; Routine Size:  23 words,	Routine Base:  $CODE$ + 1300
; Maximum stack depth per invocation:  3 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  34
X00.19		NMU$SCHED_FLAG as US_FLAG			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (18)

;	  0844	%global_routine ('NMU$SCHED_FLAG', EVENT : ref EVENT_BLOCK) : novalue =
;	  0845	
;	  0846	!++
;	  0847	! Functional description:
;	  0848	!
;	  0849	!       This routine flags an "event" occurance.  Any task that
;	  0850	!       is waiting for the event will be put onto the RUNNABLE
;	  0851	!       task queue.
;	  0852	!
;	  0853	! Formal parameters:
;	  0854	!
;	  0855	!       .EVENT    Address of selected event queue header
;	  0856	!
;	  0857	! Routine value: none
;	  0858	! Side effects:
;	  0859	!
;	  0860	!       Tasks may be put onto the runnable queue.
;	  0861	!       The queue associated with the EVENT will be emptied.
;	  0862	!
;	  0863	!--
;	  0864	
;	  0865	    begin
;	  0866	
;	  0867	    local
;	  0868		TASK : ref TASK_BLOCK;
;	  0869	
;	  0870	    %debug (EVENT_TRACE, (TRACE_INFO ('Event flagged (%O)', .EVENT)));
;	  0871	
;	  0872	!
;	  0873	! If can be flagged from interrupt level .. turn
;	  0874	! interrupts off for a moment.
;	  0875	!
;	  0876	
;	  0877	    if .EVENT [EB_NOINT] then INTERRUPT_OFF;
;	  0878	
;	  0879	!
;	  0880	! Signal that the event has happened by  scheduling  all  the
;	  0881	! tasks  queued  to the event.  If no tasks are queued to the
;	  0882	! event, unlock the semaphore to indicate the event has occurred.
;	  0883	!
;	  0884	
;	  0885	    TASK = 0;
;	  0886	    incr INDEX from 1 to NMU$TABLE_MAX (EVENT [EB_TASKS]) do
;	  0887		if NMU$TABLE_FETCH (EVENT [EB_TASKS], .INDEX, TASK) then
;	  0888		begin
;	  0889		NMU$TABLE_INSERT (RUN_QUEUE, TASK [TB_SCHED_QUEUE]);
;	  0890		NMU$TABLE_DELETE (EVENT [EB_TASKS], .INDEX);
;	  0891		end;
;	  0892	
;	  0893	    if .TASK eql 0 then UNLOCK (EVENT [EB_SEMAPHORE]);
;	  0894	
;	  0895	!
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  35
X00.19		NMU$SCHED_FLAG as US_FLAG			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (18)

;	  0896	! Now  we  clear  the table pointed to by the event block, so
;	  0897	! that people who just deallocate the block  without  calling
;	  0898	! NMU$SCHED_EVENT,  won't make us lose the memory taken up by
;	  0899	! the table.  (At this point all of the useful  info  in  the
;	  0900	! table has been extracted.)
;	  0901	!
;	  0902	
;	  0903	    NMU$TABLE_CLEAR (EVENT [EB_TASKS]);
;	  0904	
;	  0905	!
;	  0906	! Turn interrupts back on it they were turned off.
;	  0907	!
;	  0908	
;	  0909	    if .EVENT [EB_NOINT] then INTERRUPT_ON;
;	  0910	
;	  0911	    end;					! End of NMU$SCHED_FLAG


						.GLOBL	INTNST


						.SBTTL	US.FLAG NMU$SCHED_FLAG as US_FLAG
000000	004167  000000G			US.FLAG::
						JSR	R1,$SAVE3			;					0844
000004	005746 					TST	-(SP)
000006	016602  000014 				MOV	14(SP),R2			; EVENT,*				0877
000012	132762  000001  000004 			BITB	#1,4(R2)
000020	001405 					BEQ	1$
000022	012746  000543 				MOV	#543,-(SP)
000026	104377 					EMT	377
000030	005267  000000G				INC	INTNST
000034	005016 				1$:	CLR	(SP)				; TASK					0885
000036	010246 					MOV	R2,-(SP)			;					0886
000040	004767  000000G				JSR	PC,UT.MAX
000044	010003 					MOV	R0,R3
000046	005001 					CLR	R1				; INDEX
000050	000425 					BR	3$
000052	010216 				2$:	MOV	R2,(SP)				;					0887
000054	010146 					MOV	R1,-(SP)			; INDEX,*
000056	012746  000006 				MOV	#6,-(SP)
000062	060616 					ADD	SP,(SP)				; TASK,*
000064	004767  000000G				JSR	PC,UT.FETCH
000070	022626 					CMP	(SP)+,(SP)+
000072	006000 					ROR	R0
000074	103013 					BCC	3$
000076	012716  000000'				MOV	#RUN.QUEUE,(SP)			;					0889
000102	016646  000002 				MOV	2(SP),-(SP)			; TASK,*
000106	004767  000000G				JSR	PC,UT.INSERT
000112	010216 					MOV	R2,(SP)				;					0890
000114	010146 					MOV	R1,-(SP)			; INDEX,*
000116	004767  000000G				JSR	PC,UT.DELETE
000122	022626 					CMP	(SP)+,(SP)+			;					0888
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  36
X00.19		NMU$SCHED_FLAG as US_FLAG			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (18)

000124	005201 				3$:	INC	R1				; INDEX					0886
000126	020103 					CMP	R1,R3				; INDEX,*
000130	003750 					BLE	2$
000132	005766  000002 				TST	2(SP)				; TASK					0893
000136	001002 					BNE	4$
000140	005062  000002 				CLR	2(R2)
000144	010216 				4$:	MOV	R2,(SP)				;					0903
000146	004767  000000G				JSR	PC,UT.CLEAR
000152	132762  000001  000004 			BITB	#1,4(R2)			;					0909
000160	001416 					BEQ	5$
000162	012746  000543 				MOV	#543,-(SP)
000166	104377 					EMT	377
000170	005726 					TST	(SP)+
000172	005367  000000G				DEC	INTNST
000176	000243 					.WORD CLV!CLC
							
000200	003007 					BGT	6$
000202	005067  000000G				CLR	INTNST
000206	012746  000545 				MOV	#545,-(SP)
000212	104377 					EMT	377
000214	000401 					BR	6$
000216	005726 				5$:	TST	(SP)+				;					0844
000220	005726 				6$:	TST	(SP)+
000222	000207 					RTS	PC
; Routine Size:  74 words,	Routine Base:  $CODE$ + 1356
; Maximum stack depth per invocation:  9 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  37
X00.19		NMU$SCHED_WAIT as US_WAIT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (19)

;	  0912	%global_routine ('NMU$SCHED_WAIT', EVENT: ref EVENT_BLOCK, SECONDS) :  =
;	  0913	
;	  0914	!++
;	  0915	! Functional description:
;	  0916	!
;	  0917	!       This routine blocks a process until it is woken up on
;	  0918	!       any event (or queue non-empty) that it is waiting for,
;	  0919	!       or until the timeout interval (if specified) passes.
;	  0920	!
;	  0921	! Formal parameters:
;	  0922	!
;	  0923	!	.EVENT	Address of event block on which to wait
;	  0924	!	SECONDS	Number of seconds to wait before timing out
;	  0925	!		0 means no timeout
;	  0926	!
;	  0927	! Routine value:
;	  0928	!
;	  0929	!	 $TRUE if the awaited event happened or if no timeout requested
;	  0930	!        $FALSE if it timed out
;	  0931	!
;	  0932	! Side effects: none
;	  0933	!
;	  0934	!--
;	  0935	
;	  0936	    begin
;	  0937	
;	  0938	    local
;	  0939		TASK : ref TASK_BLOCK,
;	  0940		EVENT_OCCURRED;
;	  0941	
;	  0942	    stacklocal
;	  0943	        TABLE_INDEX;			! Ensure our own private copy
;	  0944	
;	  0945	    %debug (EVENT_TRACE, (TRACE_INFO ('Event wait (%O)', .EVENT)));
;	  0946	
;	  0947	!
;	  0948	! Turn the interrupts off if this event can be signaled from
;	  0949	! interrupt level.
;	  0950	!
;	  0951	
;	  0952	    if .EVENT [EB_NOINT] then INTERRUPT_OFF;
;	  0953	
;	  0954	    EVENT_OCCURRED = LOCK (EVENT [EB_SEMAPHORE]);
;	  0955	
;	  0956	    if not .EVENT_OCCURRED		! If event has not yet occurred,
;	  0957	    then				! add current task to task list
;	  0958		begin				! for this event.
;	  0959		TABLE_INDEX = NMU$TABLE_INSERT (EVENT [EB_TASKS], CURRENT_TASK);
;	  0960		if .EVENT [EB_NOINT] then INTERRUPT_ON; ! Enable interrupts
;	  0961	        if .SECONDS eql 0		! If no time specified,
;	  0962		then				!  just suspend task.
;	  0963		    begin
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  38
X00.19		NMU$SCHED_WAIT as US_WAIT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (19)

;	  0964		    NMU$SCHED_DESCHEDULE ();	! When task resumes...
;	  0965		    return $TRUE;	 	!  Return
;	  0966		    end
;	  0967	        else				! If a wait time was specified,
;	  0968		    NMU$SCHED_SLEEP (.SECONDS);	!  suspend task by sleeping.
;	  0969	
;	  0970		!
;	  0971		! Task will resume here if sleep time expires or event occurs.
;	  0972		! If it timed out, task needs to be removed from event task
;	  0973		! list; if event occurred, task needs to be removed from
;	  0974		! TIME_QUEUE.  We try to do both -- no ill side effects.
;	  0975		!
;	  0976	
;	  0977		if .EVENT [EB_NOINT] then INTERRUPT_OFF; ! Interrupts off again
;	  0978	
;	  0979		EVENT_OCCURRED = (.EVENT [EB_TASKS] eql 0);
;	  0980	
;	  0981		NMU$TABLE_DELETE (EVENT [EB_TASKS], .TABLE_INDEX);
;	  0982	
;	  0983		TASK = CURRENT_TASK;
;	  0984	        NMU$QUEUE_EXTRACT(TIME_QUEUE, TASK [TB_SCHED_QUEUE]);
;	  0985	
;	  0986		if .EVENT [EB_NOINT] then INTERRUPT_ON;
;	  0987	
;	  0988		return .EVENT_OCCURRED;
;	  0989		end
;	  0990	    else				! If event has already occurred,
;	  0991	        begin				!  do not even suspend task.
;	  0992		if .EVENT [EB_NOINT] then INTERRUPT_ON;
;	  0993	        return $TRUE;
;	  0994	        end;
;	  0995	    end;					! End of NMU$SCHED_WAIT


						.SBTTL	US.WAIT NMU$SCHED_WAIT as US_WAIT
000000	004167  000000G			US.WAIT::
						JSR	R1,$SAVE3			;					0912
000004	005746 					TST	-(SP)
000006	016601  000016 				MOV	16(SP),R1			; EVENT,*				0952
000012	012703  000004 				MOV	#4,R3
000016	060103 					ADD	R1,R3
000020	132713  000001 				BITB	#1,(R3)
000024	001405 					BEQ	1$
000026	012746  000543 				MOV	#543,-(SP)
000032	104377 					EMT	377
000034	005267  000000G				INC	INTNST
000040	005761  000002 			1$:	TST	2(R1)				;					0954
000044	001402 					BEQ	2$
000046	005002 					CLR	R2				; EVENT.OCCURRED
000050	000405 					BR	3$
000052	012700  000001 			2$:	MOV	#1,R0
000056	010061  000002 				MOV	R0,2(R1)
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  39
X00.19		NMU$SCHED_WAIT as US_WAIT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (19)

000062	010002 					MOV	R0,R2				; *,EVENT.OCCURRED
000064	032702  000001 			3$:	BIT	#1,R2				; *,EVENT.OCCURRED			0956
000070	001122 					BNE	11$
000072	010146 					MOV	R1,-(SP)			;					0959
000074	016746  000000G				MOV	CURTSK,-(SP)
000100	004767  000000G				JSR	PC,UT.INSERT
000104	010066  000004 				MOV	R0,4(SP)			; *,TABLE.INDEX
000110	132713  000001 				BITB	#1,(R3)				;					0960
000114	001416 					BEQ	4$
000116	012746  000543 				MOV	#543,-(SP)
000122	104377 					EMT	377
000124	022626 					CMP	(SP)+,(SP)+
000126	005367  000000G				DEC	INTNST
000132	000243 					.WORD CLV!CLC
							
000134	003007 					BGT	5$
000136	005067  000000G				CLR	INTNST
000142	012746  000545 				MOV	#545,-(SP)
000146	104377 					EMT	377
000150	000401 					BR	5$
000152	022626 				4$:	CMP	(SP)+,(SP)+			;					0912
000154	016600  000014 			5$:	MOV	14(SP),R0			; SECONDS,*				0961
000160	001003 					BNE	6$
000162	004767  000000V				JSR	PC,US.DESCHEDULE		;					0964
000166	000502 					BR	12$				;					0963
000170	010046 				6$:	MOV	R0,-(SP)			;					0968
000172	004767  000000V				JSR	PC,US.SLEEP
000176	005726 					TST	(SP)+
000200	132713  000001 				BITB	#1,(R3)				;					0977
000204	001405 					BEQ	7$
000206	012746  000543 				MOV	#543,-(SP)
000212	104377 					EMT	377
000214	005267  000000G				INC	INTNST
000220	005000 				7$:	CLR	R0				;					0979
000222	005711 					TST	(R1)
000224	001001 					BNE	8$
000226	005200 					INC	R0
000230	010002 				8$:	MOV	R0,R2				; *,EVENT.OCCURRED
000232	010146 					MOV	R1,-(SP)			;					0981
000234	016646  000002 				MOV	2(SP),-(SP)			; TABLE.INDEX,*
000240	004767  000000G				JSR	PC,UT.DELETE
000244	016700  000000G				MOV	CURTSK,R0			; *,TASK				0983
000250	012716  000000'				MOV	#TIME.QUEUE,(SP)		;					0984
000254	010046 					MOV	R0,-(SP)			; TASK,*
000256	004767  000000G				JSR	PC,UQ.EXTRACT
000262	132713  000001 				BITB	#1,(R3)				;					0986
000266	001417 					BEQ	9$
000270	012746  000543 				MOV	#543,-(SP)
000274	104377 					EMT	377
000276	062706  000006 				ADD	#6,SP
000302	005367  000000G				DEC	INTNST
000306	000243 					.WORD CLV!CLC
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  40
X00.19		NMU$SCHED_WAIT as US_WAIT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (19)

							
000310	003010 					BGT	10$
000312	005067  000000G				CLR	INTNST
000316	012746  000545 				MOV	#545,-(SP)
000322	104377 					EMT	377
000324	000402 					BR	10$
000326	062706  000006 			9$:	ADD	#6,SP				;					0912
000332	010200 				10$:	MOV	R2,R0				; EVENT.OCCURRED,*			0956
000334	000421 					BR	13$
000336	132713  000001 			11$:	BITB	#1,(R3)				;					0992
000342	001414 					BEQ	12$
000344	012746  000543 				MOV	#543,-(SP)
000350	104377 					EMT	377
000352	005367  000000G				DEC	INTNST
000356	000243 					.WORD CLV!CLC
							
000360	003005 					BGT	12$
000362	005067  000000G				CLR	INTNST
000366	012746  000545 				MOV	#545,-(SP)
000372	104377 					EMT	377
000374	012700  000001 			12$:	MOV	#1,R0				;					0956
000400	005726 				13$:	TST	(SP)+				;					0912
000402	000207 					RTS	PC
; Routine Size:  130 words,	Routine Base:  $CODE$ + 1602
; Maximum stack depth per invocation:  11 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  41
X00.19		NMU$SCHED_DESCHEDULE as US_DESCHEDULE		 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (20)

;	  0996	%global_routine ('NMU$SCHED_DESCHEDULE') : novalue =
;	  0997	
;	  0998	!++
;	  0999	! Functional description:
;	  1000	!
;	  1001	!	This routine deschedules the currently running task.
;	  1002	!	If no other task wants to run, the null task is run.
;	  1003	!
;	  1004	! Formal parameters: none
;	  1005	!
;	  1006	! Routine value: none
;	  1007	! Side effects: none
;	  1008	!
;	  1009	!--
;	  1010	
;	  1011	    begin
;	  1012	
;	  1013	    local
;	  1014		TASK : ref TASK_BLOCK;
;	  1015	
;	  1016	    TASK = 0;
;	  1017	
;	  1018	!
;	  1019	! Wait until a task is found and scheduled
;	  1020	!
;	  1021	    while .TASK eql 0
;	  1022	    do
;	  1023		begin
;	  1024	
;	  1025	!
;	  1026	! Turn interrupts off so that the scheduler is not
;	  1027	! interrupted while working on the run queue.
;	  1028	!
;	  1029		INTERRUPT_OFF;
;	  1030	!
;	  1031	! Get the next entry from the run queue.
;	  1032	!
;	  1033		incr INDEX from 1 to NMU$TABLE_MAX (RUN_QUEUE) do
;	  1034		    if NMU$TABLE_FETCH (RUN_QUEUE, .INDEX, TASK) then
;	  1035		    begin
;	  1036			NMU$TABLE_DELETE (RUN_QUEUE, .INDEX);
;	  1037			exitloop;
;	  1038		    end;
;	  1039	
;	  1040	
;	  1041	!	TASK = NMU$QUEUE_REMOVE (RUN_QUEUE);
;	  1042	!
;	  1043	! Turn the interrupts back on now.
;	  1044	!
;	  1045		INTERRUPT_ON;
;	  1046	!
;	  1047	! Switch context to either the new task (if
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  42
X00.19		NMU$SCHED_DESCHEDULE as US_DESCHEDULE		 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (20)

;	  1048	! one was removed from the queue or the the
;	  1049	! null task.
;	  1050	!
;	  1051	
;	  1052		if .TASK neq 0
;	  1053		then
;	  1054		    if .TASK neq CURRENT_TASK
;	  1055		    then
;	  1056			begin
;	P 1057			%debug (SCHEDULER_TRACE,
;	P 1058				(TRACE_INFO ('Switch to (%O) %A',
;	  1059					 .TASK, ch$ptr (TASK [TB_NAME]))));
;	  1060	
;	  1061			CONTEXT_SWITCH (.TASK);
;	  1062		        end
;	  1063		    else
;	  1064			begin
;	P 1065			%debug (SCHEDULER_TRACE,
;	  1066				(TRACE_INFO ('Continuing current task')));
;	  1067			1;
;	  1068			end
;	  1069		else
;	  1070		    begin
;	P 1071		    %debug (SCHEDULER_TRACE,
;	  1072			    (TRACE_INFO ('No runnable task .. sleeping')));
;	  1073	
;	  1074		    %if not $TOPS10 %then PROCESS_SLEEP (60);
;	  1075	                            %else PROCESS_SLEEP (0); %fi
;	  1076	
;	P 1077		    %debug (SCHEDULER_TRACE,
;	  1078			    (TRACE_INFO ('Program woken up')));
;	  1079		    end;
;	  1080		end;
;	  1081	!
;	  1082	! When context switched back to this task...
;	  1083	! this routine will return.
;	  1084	!
;	  1085	    end;					! End of NMU$SCHED_DESCHEDULE


						.GLOBL	SS$CTX


						.SBTTL	US.DESCHEDULE NMU$SCHED_DESCHEDULE as US_DESCHEDULE
000000	004167  000000G			US.DESCHEDULE::
						JSR	R1,$SAVE3			;					0996
000004	005046 					CLR	-(SP)				; TASK					1016
000006	005002 					CLR	R2				;					1021
000010	005702 				1$:	TST	R2
000012	001103 					BNE	7$
000014	012746  000543 				MOV	#543,-(SP)			;					1023
000020	104377 					EMT	377
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  43
X00.19		NMU$SCHED_DESCHEDULE as US_DESCHEDULE		 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (20)

000022	005267  000000G				INC	INTNST
000026	012746  000000'				MOV	#RUN.QUEUE,-(SP)		;					1033
000032	004767  000000G				JSR	PC,UT.MAX
000036	010003 					MOV	R0,R3
000040	005001 					CLR	R1				; INDEX
000042	000422 					BR	3$
000044	012716  000000'			2$:	MOV	#RUN.QUEUE,(SP)			;					1034
000050	010146 					MOV	R1,-(SP)			; INDEX,*
000052	012746  000006 				MOV	#6,-(SP)
000056	060616 					ADD	SP,(SP)				; TASK,*
000060	004767  000000G				JSR	PC,UT.FETCH
000064	022626 					CMP	(SP)+,(SP)+
000066	006000 					ROR	R0
000070	103007 					BCC	3$
000072	012716  000000'				MOV	#RUN.QUEUE,(SP)			;					1036
000076	010146 					MOV	R1,-(SP)			; INDEX,*
000100	004767  000000G				JSR	PC,UT.DELETE
000104	005726 					TST	(SP)+				;					1037
000106	000403 					BR	4$
000110	005201 				3$:	INC	R1				; INDEX					1033
000112	020103 					CMP	R1,R3				; INDEX,*
000114	003753 					BLE	2$
000116	012746  000543 			4$:	MOV	#543,-(SP)			;					1038
000122	104377 					EMT	377
000124	005726 					TST	(SP)+
000126	005367  000000G				DEC	INTNST
000132	000243 					.WORD CLV!CLC
							
000134	003005 					BGT	5$
000136	005067  000000G				CLR	INTNST
000142	012746  000545 				MOV	#545,-(SP)
000146	104377 					EMT	377
000150	011602 				5$:	MOV	(SP),R2				; TASK,*				1052
000152	001410 					BEQ	6$
000154	020267  000000G				CMP	R2,CURTSK			;					1054
000160	001713 					BEQ	1$
000162	010246 					MOV	R2,-(SP)			;					1061
000164	004767  000000G				JSR	PC,SS$CTX
000170	005726 					TST	(SP)+				;					1056
000172	000706 					BR	1$				;					1052
000174	012746  000040 			6$:	MOV	#40,-(SP)			;					1074
000200	012746  001051 				MOV	#1051,-(SP)
000204	104377 					EMT	377
000206	012746  000040 				MOV	#40,-(SP)
000212	012746  001037 				MOV	#1037,-(SP)
000216	104377 					EMT	377
000220	000673 					BR	1$				;					1021
000222	005726 				7$:	TST	(SP)+				;					0996
000224	000207 					RTS	PC
; Routine Size:  75 words,	Routine Base:  $CODE$ + 2206
; Maximum stack depth per invocation:  9 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  44
X00.19		NMU$SCHED_SLEEP as US_SLEEP			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (21)

;	  1086	%global_routine ('NMU$SCHED_SLEEP', TIME) : novalue =
;	  1087	
;	  1088	!++
;	  1089	! Functional description:
;	  1090	!
;	  1091	!	This routine is called by any task that wishes to go
;	  1092	!	to sleep for a short while.  The task will block until
;	  1093	!	the specified number of seconds elapses.
;	  1094	!
;	  1095	! Formal parameters:
;	  1096	!
;	  1097	!	.TIME	Number of seconds to wait.
;	  1098	!
;	  1099	! Routine value: none
;	  1100	! Side effects: none
;	  1101	!
;	  1102	!--
;	  1103	
;	  1104	    begin
;	  1105	
;	  1106	    local
;	  1107		TASK : ref TASK_BLOCK;
;	  1108	
;	  1109	    %debug (SCHEDULER_TRACE, (TRACE_INFO ('Task sleeping for %D seconds', .TIME)));
;	  1110	
;	  1111	!
;	  1112	! Get address of currently running task's task block.
;	  1113	!
;	  1114	    TASK = CURRENT_TASK;
;	  1115	!
;	  1116	! Set the time to wake this task up, clear the wakeup
;	  1117	! event and queue it to the time wakeup queue.
;	  1118	!
;	  1119	    TIME_CURRENT (.TIME, TASK [TB_TIME]);
;	  1120	!First extract the item from the queu if it was in there already. This will
;	  1121	!insure that an item never get in there twice.
;	  1122	    NMU$QUEUE_EXTRACT(TIME_QUEUE, TASK [TB_SCHED_QUEUE]);
;	  1123	    NMU$QUEUE_INSERT (TIME_QUEUE, TASK [TB_SCHED_QUEUE]);
;	  1124	!
;	  1125	! Signal to the TIMER TASK that someone has modified it's
;	  1126	! data base.  Then wait for the TIMER TASK to put this task
;	  1127	! back onto the run queue.
;	  1128	!
;	  1129	    NMU$SCHED_FLAG (SKD_EVENT);
;	  1130	    NMU$SCHED_DESCHEDULE ();
;	  1131	
;	P 1132	    %debug (SCHEDULER_TRACE,
;	  1133		    (TRACE_INFO ('Task woken up')));
;	  1134	    end;					! End of NMU$SCHED_SLEEP


						.GLOBL	SS$GTM
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  45
X00.19		NMU$SCHED_SLEEP as US_SLEEP			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (21)



						.SBTTL	US.SLEEP NMU$SCHED_SLEEP as US_SLEEP
000000	010146 				US.SLEEP::
						MOV	R1,-(SP)			;					1086
000002	016701  000000G				MOV	CURTSK,R1			; *,TASK				1114
000006	016646  000004 				MOV	4(SP),-(SP)			; TIME,*				1119
000012	010146 					MOV	R1,-(SP)			; TASK,*
000014	062716  000050 				ADD	#50,(SP)
000020	004767  000000G				JSR	PC,SS$GTM
000024	012716  000000'				MOV	#TIME.QUEUE,(SP)		;					1122
000030	010146 					MOV	R1,-(SP)			; TASK,*
000032	004767  000000G				JSR	PC,UQ.EXTRACT
000036	012716  000000'				MOV	#TIME.QUEUE,(SP)		;					1123
000042	010146 					MOV	R1,-(SP)			; TASK,*
000044	004767  000000G				JSR	PC,UQ.INSERT
000050	012716  000010'				MOV	#SKD.EVENT,(SP)			;					1129
000054	004767  176642 				JSR	PC,US.FLAG
000060	004767  177466 				JSR	PC,US.DESCHEDULE		;					1130
000064	062706  000010 				ADD	#10,SP				;					1104
000070	012601 					MOV	(SP)+,R1			;					1086
000072	000207 					RTS	PC
; Routine Size:  30 words,	Routine Base:  $CODE$ + 2434
; Maximum stack depth per invocation:  6 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  46
X00.19		SCHEDULER_TASK					 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (22)

;	  1135	%routine ('SCHEDULER_TASK') : novalue =
;	  1136	
;	  1137	!++
;	  1138	! Functional description:
;	  1139	!
;	  1140	!	This task handles timeouts for other tasks.  Other
;	  1141	!	tasks queue themselves to this task to be woken up
;	  1142	!	after the time specified in the TIME_OUT block in
;	  1143	!	their respective task blocks.
;	  1144	!
;	  1145	! Formal parameters: none
;	  1146	!
;	  1147	! Routine value: none
;	  1148	! Side effects: none
;	  1149	!
;	  1150	!--
;	  1151	
;	  1152	    begin
;	  1153	
;	  1154	    local
;	  1155		TT_SBLK : TIMER_SCAN_BLOCK;
;	  1156	
;	  1157	!
;	  1158	! Flag that no time out interrupt is currently defined.
;	  1159	!
;	  1160	    TIME_SET_NULL (TIME_OUT);
;	  1161	!
;	  1162	! Loop doing this task's work forever.
;	  1163	!
;	  1164	
;	  1165	    while $true do
;	  1166		begin
;	  1167	!
;	  1168	! Get current time.
;	  1169	!
;	  1170		TIME_CURRENT (0, TT_SBLK [TT_NOW]);
;	  1171		TIME_SET_NULL (TT_SBLK [TT_TIME]);
;	  1172	!
;	  1173	! Scan timer queue, scheduling any task that needs
;	  1174	! to be scheduled.  Also find the next time to have
;	  1175	! a time out interrupt generated.
;	  1176	!
;	  1177		NMU$QUEUE_SCAN (TIME_QUEUE, TT_SBLK, TT_SCAN);
;	  1178	!
;	  1179	! The time returned in TT_TIME is the time of the closest
;	  1180	! task wakeup.  If it is greater than zero, a task is
;	  1181	! waiting for wakeup.  If no task is waiting, then clear
;	  1182	! any pending interrupts.
;	  1183	!
;	  1184	! Set a new time out interrupt if needed.
;	  1185	!
;	  1186	
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  47
X00.19		SCHEDULER_TASK					 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (22)

;	  1187		if TIME_NULL (TT_SBLK [TT_TIME])
;	  1188		then
;	  1189		    begin
;	  1190		    TIME_INTERRUPT_CLEAR;
;	  1191		    TIME_SET_NULL (TIME_OUT);
;	  1192		    end
;	  1193		else
;	  1194	
;	  1195		    if TIME_TEST (TT_SBLK [TT_TIME], lss, TIME_OUT)
;	  1196		       or TIME_NULL (TIME_OUT)
;	  1197		    then
;	  1198			begin
;	  1199			TIME_COPY (TIME_OUT, TT_SBLK [TT_TIME]);
;	  1200			TIME_INTERRUPT_CLEAR;
;	  1201			TIME_INTERRUPT_SET (TIME_OUT, TIMEOUT_SIGNAL);
;	  1202			end;
;	  1203	
;	  1204	!
;	  1205	! Wait until the next scheduler event occurs.  The scheduler
;	  1206	! event includes both time interrupts and another task
;	  1207	! queueing itself to be woken up in the future.
;	  1208	!
;	  1209		NMU$SCHED_WAIT (SKD_EVENT,0);
;	  1210		end;
;	  1211	
;	  1212	    end;					! End of SCHEDULER_TASK


						.GLOBL	SS$TDF, SS$STI


	000020'				TBLK=		    TIME.OUT
	000020'				TBLK=		    TIME.OUT
	000020'				TIMBLK2=	    TIME.OUT
	000020'				TBLK=		    TIME.OUT
	000020'				TOBLK=		    TIME.OUT


						.SBTTL	SCHEDULER.TASK SCHEDULER_TASK
000000	162706  000016 			SCHEDULER.TASK:
						SUB	#16,SP				;					1135
000004	012767  177777  000020'			MOV	#-1,TBLK			;					1160
000012	005046 				1$:	CLR	-(SP)				;					1170
000014	012746  000006 				MOV	#6,-(SP)
000020	060616 					ADD	SP,(SP)				; TT.SBLK,*
000022	004767  000000G				JSR	PC,SS$GTM
000026	012766  177777  000014 			MOV	#-1,14(SP)			; *,TBLK				1171
000034	012716  000000'				MOV	#TIME.QUEUE,(SP)		;					1177
000040	012746  000010 				MOV	#10,-(SP)
000044	060616 					ADD	SP,(SP)				; TT.SBLK,*
000046	012746  000000V				MOV	#TT.SCAN,-(SP)
000052	004767  000000G				JSR	PC,UQ.SCAN
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  48
X00.19		SCHEDULER_TASK					 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (22)

000056	026627  000020  177777 			CMP	20(SP),#-1			; TBLK,*				1187
000064	001011 					BNE	2$
000066	012746  000433 				MOV	#433,-(SP)			;					1189
000072	104377 					EMT	377
000074	062706  000010 				ADD	#10,SP
000100	012767  177777  000020'			MOV	#-1,TBLK			;					1191
000106	000450 					BR	6$				;					1187
000110	012716  000020 			2$:	MOV	#20,(SP)			;					1195
000114	060616 					ADD	SP,(SP)				; TIMBLK1,*
000116	012746  000020'				MOV	#TIMBLK2,-(SP)
000122	012746  000014 				MOV	#14,-(SP)
000126	060616 					ADD	SP,(SP)				; ABTIME,*
000130	004767  000000G				JSR	PC,SS$TDF
000134	022626 					CMP	(SP)+,(SP)+
000136	005700 					TST	R0
000140	002404 					BLT	3$
000142	026727  000020' 177777 			CMP	TBLK,#-1			;					1196
000150	001025 					BNE	4$
000152	016667  000020  000020'		3$:	MOV	20(SP),TOBLK			; FRMBLK,*				1199
000160	016667  000022  000022'			MOV	22(SP),TOBLK+2			; FRMBLK+2,*
000166	016667  000024  000024'			MOV	24(SP),TOBLK+4			; FRMBLK+4,*
000174	012746  000433 				MOV	#433,-(SP)
000200	104377 					EMT	377
000202	062706  000006 				ADD	#6,SP
000206	012716  000020'				MOV	#TIME.OUT,(SP)			;					1201
000212	012746  000000V				MOV	#TIMEOUT.SIGNAL,-(SP)
000216	004767  000000G				JSR	PC,SS$STI
000222	000401 					BR	5$				;					1195
000224	022626 				4$:	CMP	(SP)+,(SP)+			;					1135
000226	022626 				5$:	CMP	(SP)+,(SP)+			;					1195
000230	012746  000010'			6$:	MOV	#SKD.EVENT,-(SP)		;					1209
000234	005046 					CLR	-(SP)
000236	004767  176610 				JSR	PC,US.WAIT
000242	022626 					CMP	(SP)+,(SP)+			;					1166
000244	000662 					BR	1$				;					1165
; Routine Size:  83 words,	Routine Base:  $CODE$ + 2530
; Maximum stack depth per invocation:  14 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  49
X00.19		TIMEOUT_SIGNAL					 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (23)

;	  1213	%routine ('TIMEOUT_SIGNAL') TIMER_INTERRUPT_ROUTINE novalue =
;	  1214	
;	  1215	!++
;	  1216	! Functional description:
;	  1217	!
;	  1218	!	This routine is called at interrupt level when
;	  1219	!	a timer interrupt occurs.  It signals the SKD_EVENT
;	  1220	!	so that the scheduler task will start again.
;	  1221	!
;	  1222	! Formal parameters: none
;	  1223	!
;	  1224	! Routine value: none
;	  1225	! Side effects: none
;	  1226	!
;	  1227	!--
;	  1228	
;	  1229	    begin
;	  1230	        TIME_SET_NULL (TIME_OUT);
;	  1231		NMU$SCHED_FLAG (SKD_EVENT);
;	  1232		PROCESS_WAKE;
;	  1233	    end;					! End of TIMEOUT_SIGNAL


	000020'				TBLK=		    TIME.OUT


						.SBTTL	TIMEOUT.SIGNAL TIMEOUT_SIGNAL
000000	010046 				TIMEOUT.SIGNAL:
						MOV	R0,-(SP)			;					1213
000002	012767  177777  000020'			MOV	#-1,TBLK			;					1230
000010	012746  000010'				MOV	#SKD.EVENT,-(SP)		;					1231
000014	004767  176340 				JSR	PC,US.FLAG
000020	012746  000040 				MOV	#40,-(SP)
000024	012746  001041 				MOV	#1041,-(SP)
000030	104377 					EMT	377
000032	005726 					TST	(SP)+
000034	012600 					MOV	(SP)+,R0			;					1213

					;+
					;	RSX AST Service Routine Exit
					;-

000036	012716  000563 				MOV	#563,(SP)
000042	104377 					EMT	377
; Routine Size:  18 words,	Routine Base:  $CODE$ + 2776
; Maximum stack depth per invocation:  6 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  50
X00.19		TT_SCAN						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (24)

;	  1234	%routine ('TT_SCAN', TASK : ref TASK_BLOCK, DATA : ref TIMER_SCAN_BLOCK) =
;	  1235	
;	  1236	!++
;	  1237	! Functional description:
;	  1238	!
;	  1239	!	This routine performs the timer queue scaning for the
;	  1240	!	scheduler task.
;	  1241	!
;	  1242	!	When a task is found that has a wakeup time less than
;	  1243	!	the current time, a wakeup event is generated for it.
;	  1244	!
;	  1245	!	The closest wakeup time to the current time is kept
;	  1246	!	so that a wake up interrupt can be set.
;	  1247	!
;	  1248	! Formal parameters:
;	  1249	!
;	  1250	!	.TASK	Address of task from time queue
;	  1251	!	.DATA	Address of timer queue scanning data block
;	  1252	!
;	  1253	! Routine value: none
;	  1254	! Side effects: none
;	  1255	!
;	  1256	!--
;	  1257	
;	  1258	    begin
;	  1259	!
;	  1260	! Check to see if the task needs to be woken up.
;	  1261	!
;	  1262	
;	  1263	    if TIME_TEST (TASK [TB_TIME], leq, DATA [TT_NOW])
;	  1264	    then
;	  1265		begin
;	  1266		NMU$QUEUE_SCAN_EXTRACT (TASK [TB_SCHED_QUEUE]);
;	  1267		NMU$TABLE_INSERT (RUN_QUEUE, TASK [TB_SCHED_QUEUE]);
;	P 1268		%debug (SCHEDULER_TRACE,
;	P 1269			(TRACE_INFO ('Task (%O) %A scheduled for wakeup',
;	  1270				 .TASK, ch$ptr (TASK [TB_NAME]))));
;	  1271		end
;	  1272	    else
;	  1273	!
;	  1274	! Check if wakeup time of task is the closest future
;	  1275	! time.
;	  1276	!
;	  1277	
;	  1278		if TIME_TEST (DATA [TT_TIME], gtr, TASK [TB_TIME])
;	  1279		   or TIME_NULL (DATA [TT_TIME])
;	  1280		then TIME_COPY (DATA [TT_TIME], TASK [TB_TIME]);
;	  1281	
;	  1282	!
;	  1283	! Return value indicating that queue scan should continue to
;	  1284	! the end of the queue.
;	  1285	!
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  51
X00.19		TT_SCAN						 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (24)

;	  1286	    0
;	  1287	    end;					! End of TT_SCAN


						.SBTTL	TT.SCAN TT_SCAN
000000	004167  000000G			TT.SCAN:JSR	R1,$SAVE2			;					1234
000004	024646 					CMP	-(SP),-(SP)
000006	016601  000016 				MOV	16(SP),R1			; TASK,*				1263
000012	012702  000050 				MOV	#50,R2
000016	060102 					ADD	R1,R2
000020	010246 					MOV	R2,-(SP)
000022	016646  000016 				MOV	16(SP),-(SP)			; DATA,*
000026	012746  000010 				MOV	#10,-(SP)
000032	060616 					ADD	SP,(SP)				; ABTIME,*
000034	004767  000000G				JSR	PC,SS$TDF
000040	062706  000006 				ADD	#6,SP
000044	005700 					TST	R0
000046	003012 					BGT	1$
000050	010146 					MOV	R1,-(SP)			;					1266
000052	004767  000000G				JSR	PC,UQ.SEXTRACT
000056	012716  000000'				MOV	#RUN.QUEUE,(SP)			;					1267
000062	010146 					MOV	R1,-(SP)
000064	004767  000000G				JSR	PC,UT.INSERT
000070	022626 					CMP	(SP)+,(SP)+			;					1265
000072	000431 					BR	3$				;					1263
000074	016601  000014 			1$:	MOV	14(SP),R1			; DATA,*				1278
000100	062701  000006 				ADD	#6,R1
000104	010146 					MOV	R1,-(SP)
000106	010246 					MOV	R2,-(SP)
000110	012746  000006 				MOV	#6,-(SP)
000114	060616 					ADD	SP,(SP)				; ABTIME,*
000116	004767  000000G				JSR	PC,SS$TDF
000122	062706  000006 				ADD	#6,SP
000126	005700 					TST	R0
000130	003003 					BGT	2$
000132	021127  177777 				CMP	(R1),#-1			;					1279
000136	001007 					BNE	3$
000140	011211 				2$:	MOV	(R2),(R1)			;					1280
000142	016261  000002  000002 			MOV	2(R2),2(R1)
000150	016261  000004  000004 			MOV	4(R2),4(R1)
000156	005000 				3$:	CLR	R0				;					1234
000160	022626 					CMP	(SP)+,(SP)+
000162	000207 					RTS	PC
; Routine Size:  58 words,	Routine Base:  $CODE$ + 3042
; Maximum stack depth per invocation:  9 words
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  52
X00.19		NMU$SCHED_CURRENT as US_CURRENT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (25)

;	  1288	%global_routine ('NMU$SCHED_CURRENT') =
;	  1289	
;	  1290	!++
;	  1291	! Functional description:
;	  1292	!
;	  1293	!	This routine returns the current task block address.
;	  1294	!
;	  1295	! Formal parameters: none
;	  1296	!
;	  1297	! Routine value:
;	  1298	!
;	  1299	!	A task block address
;	  1300	!
;	  1301	! Side effects: none
;	  1302	!
;	  1303	!--
;	  1304	
;	  1305	    begin
;	  1306	    CURRENT_TASK
;	  1307	    end;					! End of NMU$SCHED_CURRENT


						.SBTTL	US.CURRENT NMU$SCHED_CURRENT as US_CURRENT
000000	016700  000000G			US.CURRENT::
						MOV	CURTSK,R0			;					1288
000004	000207 					RTS	PC
; Routine Size:  3 words,	Routine Base:  $CODE$ + 3226
; Maximum stack depth per invocation:  0 words


;	  1308	
;	  1309	end						! End of module SCHED
;	  1310	
;	  1311	eludom


						.SBTTL	.MAIN. NMU$SCHED_CURRENT as US_CURRENT
						;+
						; Interface to Main Routine
						;-

000000	004767  174540 			.MAIN.::JSR	PC,TOPMOST
000004	000167  000000G				JMP	BL$XIT
; Routine Size:  4 words,	Routine Base:  $CODE$ + 3234
; Maximum stack depth per invocation:  0 words

;					OTS external references
						.GLOBL	BL$XIT, $SAVE3, $SAVE2, BL$FCH
						.GLOBL	BL$MOV


;					PSECT SUMMARY
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  53
X00.19		NMU$SCHED_CURRENT as US_CURRENT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (25)

;
;	Psect Name			Words	  Attributes
;	 $OWN$				   11	    RW ,  D  ,  LCL,  REL,  CON
;	 $GLOB$				  108	    RW ,  D  ,  LCL,  REL,  CON
;	 $PLIT$				   43	    RO ,  D  ,  LCL,  REL,  CON
;	 $CODE$				  850	    RO ,  I  ,  LCL,  REL,  CON




;				LIBRARY STATISTICS
;
;					     -------- Symbols --------    Blocks
;	File				     Total    Loaded   Percent      Read
;
;  DNET61:<MCB.NML>NMULIB.L16.1		      2716       228         8         0
NMUSKD								24-May-1985 13:28:56	TOPS-20 Bliss-16 2A(530)	    Page  54
X00.19		NMU$SCHED_CURRENT as US_CURRENT			 3-Jan-1983 17:16:55	DNET61:<MCB.NML>NMUSKD.BLI.1 (26)

;	  1312	! Local Modes:
;	  1313	! Mode:BLISS
;	  1314	! Auto Save Mode:2
;	  1315	! Comment Column:40
;	  1316	! Comment Rounding:+1
;	  1317	! End:
; Size:		850 code + 162 data words
; Run Time:	00:16.3
; Elapsed Time:	00:21.9
; Memory Used:	56 pages
; Compilation Complete
ABORT_RTN			 370	 422
A_ROUTINE			 459*	 464
BASIC_MEMORY			 331
CH$ASCIZ			 354
CH$MOVASCIZ			 355	 424	 526
CONTEXT_SWITCH			1061
CURRENT_TASK			 521	 552	 959	 983	1054	1114	1306
CURTSK				 290	 346#
DATA				1234	1263	1278	1279	1280
DECECO				 261
DETACH				 320
EB_NOINT			 842	 877	 909	 952	 960	 977	 986	 992
EB_SEMAPHORE			 837	 893	 954
EB_TASKS			 831	 886	 887	 890	 903	 959	 979	 981
ERROR_PTR			 493	 525	 526
EVENT_BLOCK			 254	 799	 844	 912
EVENT_OCCURRED			 940	 954#	 956	 979#	 988
EVENT_TRACE			 826	 870	 945
EVENT				 799	 826	 831	 837	 842#	 844	 870	 877	 886	 887	 890	 893
				 903	 909	 912	 945	 952	 954	 959	 960	 977	 979	 981	 986
				 992
INDEX				 886	 887	 890	1033	1034	1036
INIT_GLOBALS			 296
INTERRUPT_OFF			 877	 952	 977	1029
INTERRUPT_ON			 909	 960	 986	 992	1045
INT_OFF				 799	 842
LOCK				 837	 954
MASTER_INITIALIZATION		 361
NAME_LITERAL			 351	 354#	 355
NAME_PTR			 370	 405	 424
NMLVER				 260
NMU$MEMORY_GET			 345	 415
NMU$MEMORY_INITIALIZE		 331
NMU$MEMORY_MANAGER		 295
NMU$MEMORY_RESET		 330
NMU$QUEUE_EXTRACT		 789	 984	1122
NMU$QUEUE_INSERT		 429	 622	1123
NMU$QUEUE_MANAGER		 294
NMU$QUEUE_REMOVE		 652
NMU$QUEUE_RESET			 337	 342	 590
NMU$QUEUE_SCAN			1177
NMU$QUEUE_SCAN_EXTRACT		1266
NMU$SCHED_ABORT			 559
NMU$SCHED_COMPLETE		 529
NMU$SCHED_DESCHEDULE		 491	 560	 964	1130
NMU$SCHED_EVENT			 343	 595	 691
NMU$SCHED_FLAG			 623	 760	1129	1231
NMU$SCHED_MANAGER		 208
NMU$SCHED_SLEEP			 968
NMU$SCHED_WAIT			 653	 722	1209
NMU$SQUEUE_INSERT		 725
NMU$SQUEUE_REMOVE		 756
NMU$SQUEUE_RESET		 686
NMU$TABLE_CLEAR			 831	 903
NMU$TABLE_DELETE		 890	 981	1036
NMU$TABLE_FETCH			 887	1034
NMU$TABLE_INSERT		 430	 889	 959	1267
NMU$TABLE_MAX			 886	1033
NMU$TABLE_ROUTINES		 293*
NMUSKD				 146#
PROCESS_SLEEP			1074	1075
PROCESS_WAKE			1232
QQ_CURRENT			 693	 721	 724	 757	 759	 792
QQ_HEADER			 657	 695	 727	 764
QQ_IEVENT			 691	 722	 760
QQ_QUOTA			 692	 721	 759
QQ_SQUEUE			 686	 725	 756	 789
QUEUE				 562	 590	 595	 597	 622	 623	 625	 652	 653	 657	 686	 691
				 692#	 693#	 695	 721	 722	 724#	 725	 727	 756	 757#	 759	 760
				 764	 789	 792#
QUOTA				 657	 692
Q_EVENT				 595	 623	 653
Q_HEADER			 253	 259
Q_QUEUE				 590	 622	 652
RUN_QUEUE			 252	 338#	 430	 889	1033	1034	1036	1267
SCHEDULER_TASK			 216	 365
SCHEDULER_TRACE			 405	 461	1057	1065	1071	1077	1109	1132	1268
SECONDS				 912	 961	 968
SKD_EVENT			 254	 343	1129	1209	1231
SKD_TASK			 255	 345#	 346	 353
SQ_HEADER			 562	 597	 625
STACK_SIZE			 370	 409#	 415	 421
TABLE_INDEX			 943	 959#	 981
TASK				 402	 415#	 420#	 421	 422#	 423	 429	 430	 434	 436	 459	 462
				 464	 518	 521#	 523	 550	 552#	 556	 559	 868	 885#	 887	 889
				 893	 939	 983#	 984	1014	1016#	1021	1034	1052	1054	1059	1061
				1107	1114#	1119	1122	1123	1234	1263	1266	1267	1270	1278	1280
TASK_BLOCK_ALLOCATION		 345	 415
TASK_BLOCK			 255	 402	 436	 518	 550	 868	 939	1014	1107	1234
TASK_INFO			 489	 556
TASK_INITIALIZE			 421
TASK_NAME			 403	 423#	 424
TASK_NAME_POINTER		 351	 353#	 355
TASK_QUEUE			 253	 337	 429
TB_ABORT			 228	 422	 459
TB_CONTEXT			 239
TB_ERROR_BUFFER			 234	 523	 556
TB_ERROR_PC			 230
TB_EVENT_WAIT			 236
TB_NAME				 231	 353	 423	 462	1059	1270
TB_POINTER			 519	 523#	 526
TB_RESOURCE			 229
TB_SCHED_QUEUE			 225	 430	 889	 984	1122	1123	1266	1267
TB_SEMAPHORE			 237
TB_STACK			 240
TB_START			 227	 420
TB_TASK_QUEUE			 226	 429
TB_TIME				 238	1119	1263	1278	1280
TIME				1086	1109	1119
TIMEOUT_SIGNAL			 217	1201
TIMER_INTERRUPT_LINKAGE		 217
TIMER_INTERRUPT_ROUTINE		1213#
TIMER_SCAN_BLOCK		 283#	1155	1234
TIME_BLOCK_SIZE			 275	 276
TIME_BLOCK			 256
TIME_COPY			1199	1280
TIME_CURRENT			1119	1170
TIME_INTERRUPT_CLEAR		1190	1200
TIME_INTERRUPT_SET		1201
TIME_NULL			1187	1196	1279
TIME_OUT			 256	1160	1191	1195	1196	1199	1201	1230
TIME_QUEUE			 259	 342	 984	1122	1123	1177
TIME_SET_NULL			1160	1171	1191	1230
TIME_TEST			1195	1263	1278
TOPMOST				 148	 215
TQUEUE_SCAN_FIELDS		 273#	 283
TQUEUE_SCAN_SIZE		 280#	 283
TRACE_INFO			 405	 461	 826	 870	 945	1058	1066	1072	1078	1109	1133	1269
TT_NOW				 275#	1170	1263
TT_SBLK				1155	1170	1171	1177	1187	1195	1199
TT_SCAN				 218#	1177
TT_TIME				 276#	1171	1187	1195	1199	1278	1279	1280
UNLOCK				 893
USRECO				 262
$FALSE				 595	 691	 796
$FIELD				 272
$FIELD_SET_SIZE			 280
$MCB				 515	 554
$SUB_BLOCK			 275	 276
$TOPS10				 232	 320	 407	1074
$TOPS20				 232#	 407
$TRUE				 343	 793	 965	 993	1165
%DEBUG				 405	 461	 826	 870	 945	1057	1065	1071	1077	1109	1132	1268
%DEBUG_SETUP			 325
%GLOBAL_ROUTINE			 370#	 436#	 471#	 493#	 531#	 562#	 597#	 625#	 657#	 695#	 727#	 764#
				 799#	 844#	 912#	 996#	1086#	1288#
%MASTER_DEBUG_DATA_BASE		 264
%ROUTINE			 297#	1135#	1213	1234#