Google
 

Trailing-Edge - PDP-10 Archives - BB-H348C-RM_1982 - swskit-v21/listings/tkb-vnp/pcor0.bpt
There are no other files named pcor0.bpt in the archive.
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

   1	!<SAUTER.TKB20>PCOR0.BLI.22, 14-Feb-79 07:27:36, Edit by SROBINSON
   2	!<SAUTER.TKB20>PCOR0.BLI.20, 14-Feb-79 07:05:05, Edit by SROBINSON
   3	!<SAUTER.TKB20>PCOR0.BLI.14, 13-Feb-79 10:40:20, Edit by SROBINSON
   4	!<SAUTER.TKB20>PCOR0.BLI.9, 13-Feb-79 08:14:24, Edit by SROBINSON
   5	!<SAUTER.TKB20>PCOR0.BLI.6, 30-Dec-78 13:00:43, Edit by SROBINSON
   6	!<SAUTER.TKB20>PCOR0.BLI.3, 16-Nov-78 14:32:41, Edit by SROBINSON
   7	!<SAUTER.VNP20>PCOR0.BLI.2, 23-Sep-78 08:47:28, Edit by SROBINSON
   8	!<SROBINSON>PCOR0.BLI.2, 23-Sep-78 07:31:04, Edit by SROBINSON
   9	MODULE PCOR0 (					!PROCESS CORE IMAGE
  10			IDENT = 'X0.1-4'
  11			) =
  12	BEGIN
  13	!
  14	!
  15	!
  16	! COPYRIGHT (C) 1978, 1979 BY
  17	! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
  18	!
  19	!
  20	! THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
  21	! ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
  22	! INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
  23	! COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
  24	! OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
  25	! TRANSFERRED.
  26	!
  27	!
  28	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
  29	! AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
  30	! CORPORATION.
  31	!
  32	! DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
  33	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
  34	!
  35	
  36	!++
  37	! FACILITY: VNP-20
  38	!
  39	! ABSTRACT:
  40	!
  41	!
  42	! THIS MODULE PROCESSES CORE IMAGES (KERNEL AND TASK) FOR VNP20
  43	!
  44	!
  45	! ENVIRONMENT: TOPS-20 USER MODE
  46	!
  47	! AUTHOR: J. SAUTER, CREATION DATE: 30-MAY-78
  48	!
  49	! MODIFIED BY:
  50	!
  51	!	Scott G. Robinson, 16-SEP-78 : VERSION X0.1-2A
  52	!	- Finish Development of D_DCP
  53	!	- Finish Development of D_DUP
  54	!	- Develop support for NSP, DLX, AUX LLCs
  55	!	- Correct minor bugs in various routines
  56	!
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

  57	!	Scott G. Robinson, 23-SEP-78 : VERSION X0.1-3A
  58	!	- Split the original PCOR into 3 modules (PCOR0,PCOR1,PCOR2)
  59	!
  60	!	Scott G. Robinson, 13-FEB-79 : VERSION X0.1-4
  61	!	- Fix LOADD so that interrupt vectors are initialized correctly
  62	!
  63	!	, : VERSION
  64	! 01	-
  65	!--
  66	
  67	!<BLF/PAGE>
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

  68	!
  69	! TABLE OF CONTENTS:
  70	!
  71	
  72	FORWARD ROUTINE
  73	    GETBYT,					!GET A PDP-11 BYTE
  74	    GETWRD,					!GET A WORD
  75	    PUTBYT : NOVALUE,				!STORE A BYTE
  76	    PUTWRD : NOVALUE,				!STORE A WORD
  77	    ALOCB,					!ALLOCATE PDP-11 CORE
  78	    DEACB : NOVALUE,				!DEALLOCATE PDP-11 CORE
  79	    M_PCB,					!MAKE A PCB
  80	    MCEX : NOVALUE,				!MERGE COMM EXEC INTO KERNEL
  81	    INSTAL : NOVALUE,				!INSTALL A TASK
  82	    LOADD : NOVALUE,				!LOAD A DRIVER
  83	    LNKDCB : NOVALUE;				!LINK A DCB INTO KERNEL
  84	
  85	!
  86	! INCLUDE FILES:
  87	!
  88	
  89	LIBRARY 'VNP-LIB.L36';
  90	
  91	!REQUIRE 'BLOCKH.REQ';				!PREPARE TO DEFINE STORAGE BLOCKS
  92	!REQUIRE 'FILE.REQ';				!DEFINE FILE BLOCK
  93	!REQUIRE 'VNPVAL.REQ';				!VALUE BLOCK FOR VNP20
  94	!REQUIRE 'BLOCKT.REQ';				!END OF DEFINING STORAGE BLOCKS
  95	!REQUIRE 'TSKDEF.REQ';				!DEFINE TASK OFFSETS
  96	!
  97	! MACROS:
  98	!
  99	!	NONE
 100	!
 101	! EQUATED SYMBOLS:
 102	!
 103	
 104	LITERAL
 105	    DEBUG = 0;
 106	
 107	!
 108	! OWN STORAGE:
 109	!
 110	!	NONE
 111	!
 112	! EXTERNAL REFERENCES:
 113	!
 114	
 115	EXTERNAL ROUTINE
 116	    ATOR50 : NOVALUE,				!CONVERT ASCII TO RADIX50_11
 117	    OUTPUT : NOVALUE,				!WRITE ON A FILE
 118	    PCRLF : NOVALUE,				!PRINT CR THEN LF
 119	    OUTSTR : NOVALUE,				!PRINT A STRING
 120	    OUTNUM : NOVALUE,				!PRINT A NUMBER
 121	    ERROR : NOVALUE,				!SIGNAL PROGRAMMING ERROR
 122	    ERRMSG : NOVALUE,				!ERROR MESSAGE
 123	    VRBL_SYM,					!GET A SYMBOL FROM A FILE
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 124	    SYM_VAL;					!GET A SYMBOL FROM A FILE
 125	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 126	GLOBAL ROUTINE GETBYT (FILE_PTR, LOCN) = 	!GET A BYTE FROM A CORE OR TASK IMAGE
 127	
 128	!++
 129	! FUNCTIONAL DESCRIPTION:
 130	!
 131	!	FETCH A SPECIFIED BYTE FROM A CORE IMAGE OR TASK IMAGE.
 132	!
 133	! FORMAL PARAMETERS:
 134	!
 135	!	FILE_PTR - FILE BLOCK WHICH CONTAINS POINTERS TO THE IMAGE
 136	!	LOCN - ADDRESS OF LOCATION TO FETCH
 137	!
 138	! IMPLICIT INPUTS:
 139	!
 140	!	NONE
 141	!
 142	! IMPLICIT OUTPUTS:
 143	!
 144	!	NONE
 145	!
 146	! ROUTINE VALUE:
 147	!
 148	!	THE 8-BIT BYTE AT THE LOCATION, OR -1 IF ERROR.
 149	!
 150	! SIDE EFFECTS
 151	!
 152	!	NONE
 153	!
 154	!--
 155	
 156	    BEGIN
 157	
 158	    BIND
 159		ROUTINE_NAME = UPLIT (%ASCIZ'GETBYT');
 160	
 161	    MAP
 162		FILE_PTR : REF FILE_BLOCK;
 163	
 164	    LOCAL
 165		CORE_IMAGE : REF VECTOR,
 166		LABEL_IMAGE : REF VECTOR,
 167		CORE_LEN,
 168		CORE_WORD,
 169		RESULT,
 170		BASE_ADDRESS;
 171	
 172	    IF (DEBUG GEQ 3)
 173	    THEN
 174		BEGIN					!DEBUG
 175		PCRLF (1);
 176		OUTPUT (1, %O'11');
 177		OUTPUT (1, %O'11');
 178		OUTSTR (1, UPLIT (%ASCIZ'GETBYT: '));
 179		OUTNUM (1, .LOCN, 8, 6);
 180		END;					!DEBUG
 181	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 182	!
 183	! GET POINTERS TO THE MEMORY INFORMATION
 184	!
 185	    CORE_IMAGE = .FILE_PTR [FILE_CORE];
 186	    CORE_LEN = .FILE_PTR [FILE_CORE_LEN];
 187	    LABEL_IMAGE = .FILE_PTR [FILE_LABEL];
 188	!
 189	! VALIDATE THE ADDRESS
 190	!
 191	    BASE_ADDRESS = .LABEL_IMAGE [L$BSA] + (.LABEL_IMAGE [L$BSA + 1]*256);
 192	
 193	    IF (((.LOCN - .BASE_ADDRESS) GEQ .CORE_LEN) OR (.LOCN LSS .BASE_ADDRESS))
 194	    THEN
 195		BEGIN
 196		ERRMSG (0, 25, ROUTINE_NAME, .LOCN, FILE_PTR [FILE_NAME], 0, 0);
 197		RESULT = -1;
 198		END
 199	    ELSE
 200		BEGIN
 201	!
 202	! FETCH THE DATA
 203	!
 204		CORE_WORD = .CORE_IMAGE [(.LOCN - .BASE_ADDRESS)/4];
 205		RESULT = .CORE_WORD<(CASE ((.LOCN - .BASE_ADDRESS) AND 3) FROM 0 TO 3 OF
 206			SET
 207			[0] : 18;
 208			[1] : 26;
 209			[2] : 0;
 210			[3] : 8;
 211			TES), 8>
 212		END;
 213	
 214	    IF (DEBUG GEQ 3)
 215	    THEN
 216		BEGIN					!DEBUG
 217		OUTSTR (1, UPLIT (%ASCIZ', '));
 218		OUTNUM (1, .RESULT, 8, 6);
 219		END;					!DEBUG
 220	
 221	    .RESULT
 222	    END;					!OF GETBYT
 223	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 224	GLOBAL ROUTINE GETWRD (FILE_PTR, LOCN) = 	!GET A WORD FROM A CORE OR TASK IMAGE
 225	
 226	!++
 227	! FUNCTIONAL DESCRIPTION:
 228	!
 229	!	FETCH A SPECIFIED WORD FROM A CORE IMAGE OR TASK IMAGE.
 230	!
 231	! FORMAL PARAMETERS:
 232	!
 233	!	FILE_PTR - FILE BLOCK WHICH CONTAINS POINTERS TO THE IMAGE
 234	!	LOCN - ADDRESS OF LOCATION TO FETCH
 235	!
 236	! IMPLICIT INPUTS:
 237	!
 238	!	NONE
 239	!
 240	! IMPLICIT OUTPUTS:
 241	!
 242	!	NONE
 243	!
 244	! ROUTINE VALUE:
 245	!
 246	!	THE 16-BIT WORD AT THE LOCATION, OR -1 IF ERROR.
 247	!
 248	! SIDE EFFECTS
 249	!
 250	!	NONE
 251	!
 252	!--
 253	
 254	    BEGIN
 255	
 256	    BIND
 257		ROUTINE_NAME = UPLIT (%ASCIZ'GETWRD');
 258	
 259	    MAP
 260		FILE_PTR : REF FILE_BLOCK;
 261	
 262	    LOCAL
 263		CORE_IMAGE : REF VECTOR,
 264		LABEL_IMAGE : REF VECTOR,
 265		CORE_LEN,
 266		CORE_WORD,
 267		RESULT,
 268		BASE_ADDRESS;
 269	
 270	    IF (DEBUG GEQ 3)
 271	    THEN
 272		BEGIN					!DEBUG
 273		PCRLF (1);
 274		OUTPUT (1, %O'11');
 275		OUTPUT (1, %O'11');
 276		OUTSTR (1, UPLIT (%ASCIZ'GETWRD: '));
 277		OUTNUM (1, .LOCN, 8, 6);
 278		END;					!DEBUG
 279	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 280	!
 281	! GET POINTERS TO THE MEMORY INFORMATION
 282	!
 283	    CORE_IMAGE = .FILE_PTR [FILE_CORE];
 284	    CORE_LEN = .FILE_PTR [FILE_CORE_LEN];
 285	    LABEL_IMAGE = .FILE_PTR [FILE_LABEL];
 286	!
 287	! VALIDATE THE ADDRESS
 288	!
 289	    BASE_ADDRESS = .LABEL_IMAGE [L$BSA] + (.LABEL_IMAGE [L$BSA + 1]*256);
 290	
 291	    IF (((.LOCN - .BASE_ADDRESS) GEQ .CORE_LEN) OR (.LOCN LSS .BASE_ADDRESS)) OR ((.LOCN AND %O'1') NEQ 0)
 292	    THEN
 293		BEGIN
 294		ERRMSG (0, 25, ROUTINE_NAME, .LOCN, FILE_PTR [FILE_NAME], 0, 0);
 295		RESULT = -1;
 296		END
 297	    ELSE
 298		BEGIN
 299	!
 300	! FETCH THE DATA
 301	!
 302		CORE_WORD = .CORE_IMAGE [(.LOCN - .BASE_ADDRESS)/4];
 303		RESULT = .CORE_WORD<(CASE ((.LOCN - .BASE_ADDRESS) AND 3) FROM 0 TO 2 OF
 304			SET
 305			[0] : 18;
 306			[1] : -1;
 307			[2] : 0;
 308			TES), 8> + 			!
 309		(.CORE_WORD<(CASE ((.LOCN + 1 - .BASE_ADDRESS) AND 3) FROM 1 TO 3 OF
 310			SET
 311			[1] : 26;
 312			[2] : -1;
 313			[3] : 8;
 314			TES), 8>*256);
 315		END;
 316	
 317	    IF (DEBUG GEQ 3)
 318	    THEN
 319		BEGIN					!DEBUG
 320		OUTSTR (1, UPLIT (%ASCIZ', '));
 321		OUTNUM (1, .RESULT, 8, 6);
 322		END;					!DEBUG
 323	
 324	    .RESULT
 325	    END;					!OF GETWRD
 326	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 327	GLOBAL ROUTINE PUTBYT (FILE_PTR, LOCN, VAL) : NOVALUE = 	!PUT A BYTE IN A CORE IMAGE
 328	
 329	!++
 330	! FUNCTIONAL DESCRIPTION:
 331	!
 332	!	STORE A SPECIFIED BYTE IN A CORE IMAGE.
 333	!
 334	! FORMAL PARAMETERS:
 335	!
 336	!	FILE_PTR - FILE BLOCK WHICH CONTAINS POINTERS TO THE IMAGE
 337	!	 (WILL ALWAYS BE THE KERNEL)
 338	!	LOCN - ADDRESS OF LOCATION TO STORE
 339	!	VAL - VALUE TO BE STORED; ONLY THE LOW-ORDER 8 BITS ARE STORED
 340	!
 341	! IMPLICIT INPUTS:
 342	!
 343	!	NONE
 344	!
 345	! IMPLICIT OUTPUTS:
 346	!
 347	!	NONE
 348	!
 349	! ROUTINE VALUE:
 350	!
 351	!	NONE
 352	!
 353	! SIDE EFFECTS
 354	!
 355	!	CHANGES THE CORE IMAGE
 356	!
 357	!--
 358	
 359	    BEGIN
 360	
 361	    BIND
 362		ROUTINE_NAME = UPLIT (%ASCIZ'PUTBYT');
 363	
 364	    MAP
 365		FILE_PTR : REF FILE_BLOCK;
 366	
 367	    LOCAL
 368		CORE_IMAGE : REF VECTOR,
 369		LABEL_IMAGE : REF VECTOR,
 370		CORE_LEN,
 371		CORE_WORD,
 372		BASE_ADDRESS;
 373	
 374	    IF (DEBUG GEQ 3)
 375	    THEN
 376		BEGIN					!DEBUG
 377		PCRLF (1);
 378		OUTPUT (1, %O'11');
 379		OUTPUT (1, %O'11');
 380		OUTSTR (1, UPLIT (%ASCIZ'PUTBYT: '));
 381		OUTNUM (1, .LOCN, 8, 6);
 382		OUTSTR (1, UPLIT (%ASCIZ', '));
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 383		OUTNUM (1, .VAL, 8, 6);
 384		END;					!DEBUG
 385	
 386	!
 387	! GET POINTERS TO THE MEMORY INFORMATION
 388	!
 389	    CORE_IMAGE = .FILE_PTR [FILE_CORE];
 390	    CORE_LEN = .FILE_PTR [FILE_CORE_LEN];
 391	    LABEL_IMAGE = .FILE_PTR [FILE_LABEL];
 392	!
 393	! VALIDATE THE ADDRESS
 394	!
 395	    BASE_ADDRESS = .LABEL_IMAGE [L$BSA] + (.LABEL_IMAGE [L$BSA + 1]*256);
 396	
 397	    IF (((.LOCN - .BASE_ADDRESS) GEQ .CORE_LEN) OR (.LOCN LSS .BASE_ADDRESS))
 398	    THEN
 399		ERRMSG (0, 25,
 400		    ROUTINE_NAME, .LOCN, FILE_PTR [FILE_NAME], 0, 0)
 401	    ELSE
 402		BEGIN
 403	!
 404	! STORE THE DATA
 405	!
 406		CORE_WORD = .CORE_IMAGE [(.LOCN - .BASE_ADDRESS)/4];
 407		CORE_WORD<(CASE ((.LOCN - .BASE_ADDRESS) AND 3) FROM 0 TO 3 OF
 408			SET
 409			[0] : 18;
 410			[1] : 26;
 411			[2] : 0;
 412			[3] : 8;
 413			TES), 8> = .VAL;
 414		CORE_IMAGE [(.LOCN - .BASE_ADDRESS)/4] = .CORE_WORD;
 415		END;
 416	
 417	    END;					!OF PUTBYT
 418	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 419	GLOBAL ROUTINE PUTWRD (FILE_PTR, LOCN, VAL) : NOVALUE = 	!PUT A WORD IN A CORE IMAGE
 420	
 421	!++
 422	! FUNCTIONAL DESCRIPTION:
 423	!
 424	!	STORE A 16-BIT WORD IN A CORE IMAGE
 425	!
 426	! FORMAL PARAMETERS:
 427	!
 428	!	FILE_PTR - FILE BLOCK WHICH CONTAINS POINTERS TO THE IMAGE
 429	!	 (WILL ALWAYS BE KERNEL)
 430	!	LOCN - ADDRESS OF LOCATION TO STORE
 431	!	VAL - VALUE TO STORE; ONLY THE LOW-ORDER 16 BITS ARE STORED
 432	!
 433	! IMPLICIT INPUTS:
 434	!
 435	!	NONE
 436	!
 437	! IMPLICIT OUTPUTS:
 438	!
 439	!	NONE
 440	!
 441	! ROUTINE VALUE:
 442	!
 443	!	NONE
 444	!
 445	! SIDE EFFECTS
 446	!
 447	!	CHANGES THE CORE IMAGE
 448	!
 449	!--
 450	
 451	    BEGIN
 452	
 453	    BIND
 454		ROUTINE_NAME = UPLIT (%ASCIZ'PUTWRD');
 455	
 456	    MAP
 457		FILE_PTR : REF FILE_BLOCK;
 458	
 459	    LOCAL
 460		CORE_IMAGE : REF VECTOR,
 461		LABEL_IMAGE : REF VECTOR,
 462		CORE_LEN,
 463		CORE_WORD,
 464		BASE_ADDRESS;
 465	
 466	    IF (DEBUG GEQ 3)
 467	    THEN
 468		BEGIN					!DEBUG
 469		PCRLF (1);
 470		OUTPUT (1, %O'11');
 471		OUTPUT (1, %O'11');
 472		OUTSTR (1, UPLIT (%ASCIZ'PUTWRD: '));
 473		OUTNUM (1, .LOCN, 8, 6);
 474		OUTSTR (1, UPLIT (%ASCIZ', '));
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 475		OUTNUM (1, .VAL, 8, 6);
 476		END;					!DEBUG
 477	
 478	!
 479	! GET POINTERS TO THE MEMORY INFORMATION
 480	!
 481	    CORE_IMAGE = .FILE_PTR [FILE_CORE];
 482	    CORE_LEN = .FILE_PTR [FILE_CORE_LEN];
 483	    LABEL_IMAGE = .FILE_PTR [FILE_LABEL];
 484	!
 485	! VALIDATE THE ADDRESS
 486	!
 487	    BASE_ADDRESS = .LABEL_IMAGE [L$BSA] + (.LABEL_IMAGE [L$BSA + 1]*256);
 488	
 489	    IF (((.LOCN - .BASE_ADDRESS) GEQ .CORE_LEN) OR (.LOCN LSS .BASE_ADDRESS) OR ((.LOCN AND %O'1') NEQ 0))
 490	    THEN
 491		ERRMSG (0, 25, ROUTINE_NAME, .LOCN, FILE_PTR [FILE_NAME], 0, 0)
 492	    ELSE
 493		BEGIN
 494	!
 495	! STORE THE DATA
 496	!
 497		CORE_WORD = .CORE_IMAGE [(.LOCN - .BASE_ADDRESS)/4];
 498		CORE_WORD<(CASE ((.LOCN - .BASE_ADDRESS) AND 3) FROM 0 TO 2 OF
 499			SET
 500			[0] : 18;
 501			[1] : -1;
 502			[2] : 0;
 503			TES), 8> = .VAL<0, 8>;
 504		CORE_WORD<(CASE ((.LOCN + 1 - .BASE_ADDRESS) AND 3) FROM 1 TO 3 OF
 505			SET
 506			[1] : 26;
 507			[2] : -1;
 508			[3] : 8;
 509			TES), 8> = .VAL<8, 8>;
 510		CORE_IMAGE [(.LOCN - .BASE_ADDRESS)/4] = .CORE_WORD;
 511		END;
 512	
 513	    END;					!OF PUTWRD
 514	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 515	GLOBAL ROUTINE ALOCB (FILE_PTR, AMOUNT, WHERE, VALUES) = 	!ALLOCATE PDP-11 CORE
 516	
 517	!++
 518	! FUNCTIONAL DESCRIPTION:
 519	!
 520	!	ALLOCATE SPACE FROM THE PDP-11'S SYSTEM POOL
 521	!	 OR COMM EXEC PARTITION
 522	!	 (TRANSLATED FROM RSX-11M VERSION 3.1, MODULE CORAL)
 523	!	 (MODIFIED BASED ON VMR TO ALLOCATE TOP-DOWN.)
 524	!
 525	! FORMAL PARAMETERS:
 526	!
 527	!	FILE_PTR - FILE BLOCK WHICH CONTAINS POINTERS TO THE IMAGE
 528	!	 AND SYMBOL TABLE
 529	!	AMOUNT - THE NUMBER OF BYTES TO GET
 530	!	WHERE - 1 = COMM EXEC PARTITION OR SYSTEM POOL,
 531	!		0 = SYSTEM POOL ONLY
 532	!	VALUES - BLOCK WHICH HOLDS SYMBOL VALUES
 533	!
 534	! IMPLICIT INPUTS:
 535	!
 536	!	NONE
 537	!
 538	! IMPLICIT OUTPUTS:
 539	!
 540	!	MODIFIES THE CORE IMAGE TO ALLOCATE THE SPACE
 541	!
 542	! ROUTINE VALUE:
 543	!
 544	!	PDP-11 ADDRESS OF WHERE CORE HAS BEEN ALLOCATED, OR 0
 545	!
 546	! SIDE EFFECTS
 547	!
 548	!	PRINTS AN ERROR MESSAGE IF PDP-11 SYSTEM POOL IS EXHAUSTED
 549	!
 550	!--
 551	
 552	    BEGIN
 553	
 554	    BIND
 555		ROUTINE_NAME = UPLIT (%ASCIZ'ALOCB');
 556	
 557	    MAP
 558		FILE_PTR : REF FILE_BLOCK,
 559		VALUES : REF VNPVAL_BLOCK;
 560	
 561	    LOCAL
 562		R0,
 563		R1,
 564		R2,
 565		SCAN_DONE,
 566		TEMP,
 567		PLACE,
 568		RESULT;
 569	
 570	    IF (DEBUG GEQ 2)
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 571	    THEN
 572		BEGIN					!DEBUG
 573		PCRLF (1);
 574		OUTPUT (1, %O'11');
 575		OUTSTR (1, UPLIT (%ASCIZ'ALOCB: '));
 576		OUTNUM (1, .AMOUNT, 8, 6);
 577		OUTSTR (1, UPLIT (%ASCIZ', '));
 578		OUTNUM (1, .WHERE, 10, 0);
 579		END;					!DEBUG
 580	
 581	    RESULT = -1;
 582	    PLACE = .WHERE;
 583	
 584	    WHILE ((.RESULT LSS 0) AND (.PLACE GEQ 0)) DO
 585		BEGIN					!TRY EACH STORAGE CLASS, WORKING DOWN.
 586		R1 = .AMOUNT;				!SIZE OF CORE BUFFER TO ALLOCATE IN BYTES
 587		R0 = 					!POINT TO ALLOCATION MASK WORD
 588		(CASE (.PLACE) FROM 0 TO 1 OF
 589		    SET
 590		    [0] : .VALUES [CRAVL];
 591		    [1] : .VALUES [CEAVL];
 592		    TES) - 2;
 593		R1 = .R1 + GETWRD (.FILE_PTR, .R0);	!ROUND TO NEXT BOUNDRY
 594		R1 = .R1 AND ( NOT (GETWRD (.FILE_PTR, .R0)));	!CLEAR EXCESS
 595		R0 = .R0 + 2;
 596	
 597		IF (.R1 NEQ 0) THEN 			!ASSUME ZERO LENGTH BLOCK; IF EQ ZERO LENGTH REQUEST
 598		    BEGIN
 599		    SCAN_DONE = 0;
 600	
 601		    WHILE (.SCAN_DONE EQL 0) DO
 602			BEGIN
 603			R2 = .R0;			!SAVE ADDRESS OF CURRENT BLOCK
 604			R0 = GETWRD (.FILE_PTR, .R2);	!GET ADDRESS OF NEXT BLOCK
 605	
 606			IF (.R0 EQL 0)
 607			THEN
 608			    SCAN_DONE = -1		!IF EQ END OF CHAIN
 609			ELSE
 610			    BEGIN
 611			    TEMP = GETWRD (.FILE_PTR, .R0 + 2);
 612	
 613			    IF (.TEMP GEQ .R1) THEN 	!BLOCK BIG ENOUGH?  IF LO NO
 614				BEGIN
 615	
 616				IF (.TEMP GTR .R1) THEN 	!IF EQ, BLOCK IS EXACT SIZE
 617				    BEGIN
 618				    PUTWRD (.FILE_PTR, .R0 + 2, .TEMP - .R1);	!REDUCE SIZE OF FREE BLOCK
 619				    R0 = .R0 + .TEMP - .R1;	!CALCULATE ADDRESS OF ALLOCATED BLOCK
 620				    END			!.TEMP GTR .R1
 621				ELSE
 622				    PUTWRD (.FILE_PTR, .R2, GETWRD (.FILE_PTR, .R0));	!LINK AROUND ALLOCATED BLOCK
 623	
 624				SCAN_DONE = 1;
 625				END;			!.TEMP GEQ .R1
 626	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 627			    END;			!.R0 EQL 0
 628	
 629			END;				!.SCAN_DONE EQL 0
 630	
 631		    END					!.R1 NEQ 0
 632		ELSE
 633		    SCAN_DONE = -1;
 634	
 635		IF (.SCAN_DONE GTR 0) THEN RESULT = .R0 ELSE PLACE = .PLACE - 1;
 636	
 637		END;
 638	
 639	    IF (.RESULT LSS 0) THEN ERRMSG (0, 26, ROUTINE_NAME, FILE_PTR [FILE_NAME], .AMOUNT, 0, 0);
 640	
 641	    IF (DEBUG GEQ 2)
 642	    THEN
 643		BEGIN					!DEBUG
 644		OUTSTR (1, UPLIT (%ASCIZ', '));
 645		OUTNUM (1, .RESULT, 8, 6);
 646		END;					!DEBUG
 647	
 648	    .RESULT
 649	    END;					!OF ALOCB
 650	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 651	GLOBAL ROUTINE DEACB (FILE_PTR, LOCN, AMOUNT, VALUES) : NOVALUE = 	!DEALLOCATE PDP-11 CORE
 652	
 653	!++
 654	! FUNCTIONAL DESCRIPTION:
 655	!
 656	!	DEALLOCATE SPACE FROM THE PDP-11'S SYSTEM POOL
 657	!
 658	! FORMAL PARAMETERS:
 659	!
 660	!	FILE_PTR - FILE BLOCK WHICH CONTAINS POINTERS TO THE IMAGE
 661	!	 AND SYMBOL TABLE
 662	!	LOCN - THE STARTING ADDRESS OF THE SPACE TO BE DEALLOCATED
 663	!	AMOUNT - THE NUMBER OF BYTES TO FREE
 664	!	VALUES - BLOCK WHICH HOLDS SYMBOL VALUES
 665	!
 666	! IMPLICIT INPUTS:
 667	!
 668	!	NONE
 669	!
 670	! IMPLICIT OUTPUTS:
 671	!
 672	!	MODIFIES THE CORE IMAGE TO DEALLOCATE THE SPACE
 673	!
 674	! ROUTINE VALUE:
 675	!
 676	!	NONE
 677	!
 678	! SIDE EFFECTS
 679	!
 680	!	NONE
 681	!
 682	!--
 683	
 684	    BEGIN
 685	
 686	    BIND
 687		ROUTINE_NAME = UPLIT (%ASCIZ'DEACB');
 688	
 689	    MAP
 690		FILE_PTR : REF FILE_BLOCK,
 691		VALUES : REF VNPVAL_BLOCK;
 692	
 693	    LOCAL
 694		R0,
 695		R1,
 696		R2,
 697		R3,
 698		SAVE,
 699		SCAN_DONE,
 700		TEMP;
 701	
 702	    IF (DEBUG GEQ 2)
 703	    THEN
 704		BEGIN					!DEBUG
 705		PCRLF (1);
 706		OUTPUT (1, %O'11');
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 707		OUTSTR (1, UPLIT (%ASCIZ'DEACB: '));
 708		OUTNUM (1, .LOCN, 8, 6);
 709		OUTSTR (1, UPLIT (%ASCIZ', '));
 710		OUTNUM (1, .AMOUNT, 8, 6);
 711		END;					!DEBUG
 712	
 713	    R0 = .LOCN;					!ADDRESS OF STORAGE TO FREE
 714	    R1 = .AMOUNT;				!NUMBER OF BYTES TO FREE
 715	    R3 = .VALUES [CRAVL] - 2;			!POINT TO ALLOCATION MASK WORD
 716	    TEMP = GETWRD (.FILE_PTR, .R3);		!ROUND TO NEXT BOUNDRY
 717	    R1 = .R1 + .TEMP;
 718	    R1 = .R1 AND ( NOT .TEMP);
 719	    R3 = .R3 + 2;
 720	
 721	    IF (.R1 NEQ 0)				!IF EQ NO BLOCK TO RELEASE
 722	    THEN
 723		BEGIN
 724		SCAN_DONE = 0;
 725	
 726		WHILE (.SCAN_DONE EQL 0) DO
 727		    BEGIN
 728		    R2 = .R3;				!SAVE ADDRESS OF CURRENT BLOCK
 729		    R3 = GETWRD (.FILE_PTR, .R3);	!GET ADDRESS OF NEXT BLOCK
 730	
 731		    IF (.R3 EQL 0)			!IF EQ END OF CHAIN
 732		    THEN
 733			SCAN_DONE = 1
 734		    ELSE
 735	
 736			IF (.R0 LSS .R3)		!BLOCK GO HERE?
 737			THEN
 738			    SCAN_DONE = 1;		!IF HIS NO
 739	
 740		    END;				!OF WHILE SCAN_DONE
 741	
 742		PUTWRD (.FILE_PTR, .R0, .R3);		!ASSUME NO AGLOMERATION
 743		SAVE = .R0;				!CALCULATE ADDRESS OF NEW BLOCK
 744		SAVE = .SAVE + .R1;
 745	
 746		IF (.SAVE GEQ %O'200000')		!IF CS ILLEGAL DEALLOCATION
 747		THEN
 748		    ERRMSG (0, 27, ROUTINE_NAME, FILE_PTR [FILE_NAME], .AMOUNT, .LOCN, 1)
 749		ELSE
 750		    BEGIN
 751	
 752		    IF (.R0 LSS .VALUES [POOL])		! DEALLOCATION BEFORE FRONT OF LIST?
 753		    THEN 				!IF LO, YES
 754			ERRMSG (0, 27, ROUTINE_NAME, FILE_PTR [FILE_NAME], .AMOUNT, .LOCN, 2)
 755		    ELSE
 756			BEGIN
 757			TEMP = GETWRD (.FILE_PTR, .VALUES [EXSIZ]);
 758	
 759			IF (.SAVE GTR .TEMP)		!DEALLOCATION PAST END OF POOL?
 760			THEN 				!IF HI YES
 761			    ERRMSG (0, 27, ROUTINE_NAME, FILE_PTR [FILE_NAME], .AMOUNT, .LOCN, 3)
 762			ELSE
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 763			    BEGIN
 764	
 765			    IF ((.R3 LSS .SAVE)		!EQUAL TO NEXT IN CHAIN?
 766				AND (.R3 NEQ 0))	!INSERT AT END OF LIST?
 767			    THEN 			!IF EQ YES, OK
 768				ERRMSG (0, 27, ROUTINE_NAME, FILE_PTR [FILE_NAME], .AMOUNT, .LOCN, 4)
 769			    ELSE
 770				BEGIN
 771	
 772				IF (.R3 EQL .SAVE) THEN 	!IF NE NO
 773				    BEGIN
 774				    TEMP = GETWRD (.FILE_PTR, .R3);	!MOVE LINK WORD TO BLOCK RELEASED
 775				    R3 = .R3 + 2;
 776				    PUTWRD (.FILE_PTR, .R0, .TEMP);
 777				    TEMP = GETWRD (.FILE_PTR, .R3);	!MERGE TWO BLOCKS
 778				    R1 = .R1 + .TEMP;
 779				    END;
 780	
 781				SAVE = .R2;		!SAVE ADDRESS OF PREVIOUS BLOCK
 782				PUTWRD (.FILE_PTR, .R2, .R0);	!ASSUME NO AGLOMERATION
 783				R2 = .R2 + 2;
 784				TEMP = GETWRD (.FILE_PTR, .R2);	!CALCULATE ADDRESS OF NEXT BLOCK
 785				SAVE = .SAVE + .TEMP;
 786	
 787				IF (.R0 LSS .SAVE)	!EQUAL TO BLOCK BEING RELEASED?
 788				THEN 			!IF HIS, NO OVERLAP
 789				    ERRMSG (0, 27, ROUTINE_NAME, FILE_PTR [FILE_NAME], .AMOUNT, .LOCN, 5)
 790				ELSE
 791				    BEGIN
 792	
 793				    IF (.R0 EQL .SAVE)	!IF NE NO
 794				    THEN
 795					BEGIN
 796					R1 = .R1 + GETWRD (.FILE_PTR, .R2);	!MERGE TWO BLOCKS
 797					TEMP = GETWRD (.FILE_PTR, .R0);	!MOVE LINK WORD TO PREVIOUS BLOCK
 798					R2 = .R2 - 2;
 799					PUTWRD (.FILE_PTR, .R2, .TEMP);
 800					R0 = .R2;	!SET NEW ADDRESS OF BLOCK
 801					END;
 802	
 803				    PUTWRD (.FILE_PTR, .R0 + 2, .R1);	!SET SIZE OF BLOCK RELEASED
 804				    END;
 805	
 806				END;
 807	
 808			    END;
 809	
 810			END;
 811	
 812		    END;
 813	
 814		END;
 815	
 816	    END;					!OF DEACB
 817	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 818	GLOBAL ROUTINE M_PCB (KERNEL_FILE, PAR_NAME, PAR_MAIN, PAR_BASE, PAR_TOP, BUSY_FLAGS, STAT_FLAGS,
 819		MIN_PCB_LEN, VALUES) = 			!CREATE A PCB
 820	
 821	!++
 822	! FUNCTIONAL DESCRIPTION:
 823	!
 824	!	CREATE A PARTITION CONTROL BLOCK (PCB).  FILL IN ITS FIELDS
 825	!	 AND PUT IT ON THE KERNEL'S LIST OF PCBS.  THIS ROUTINE WILL
 826	!	 CREATE EITHER A MAIN PARTITION OR A SUB PARTITION.
 827	!
 828	! FORMAL PARAMETERS:
 829	!
 830	!	KERNEL_FILE - FILE BLOCK FOR THE KERNEL
 831	!	PAR_NAME - PARTITION NAME, SIX ASCII CHARACTERS
 832	!	PAR_MAIN - MAIN PCB FOR SUB-PARTITION, OR 0 FOR MAIN PARTITION
 833	!	PAR_BASE - BASE ADDRESS OF THIS PARTITION
 834	!	PAR_TOP - HIGHEST ADDRESS OF THIS PARTITION, OR 0
 835	!	BUSY_FLAGS - FLAGS FOR THE P.BUSY WORD
 836	!	STAT_FLAGS - FLAGS FOR THE P.STAT WORD
 837	!	MIN_PCB_LEN - MINIMUM LENGTH PCB TO CREATE
 838	!	VALUES - VALUES READ FROM CETAB.MAC AND THE SYMBOL TABLES
 839	!
 840	! IMPLICIT INPUTS:
 841	!
 842	!	NONE
 843	!
 844	! IMPLICIT OUTPUTS:
 845	!
 846	!	MAY STORE TOP OF PARTITION IN .KERNEL_FILE[FILE_HWM] FOR THE
 847	!	 SAKE OF THE NEXT CALL TO M_PCB.
 848	!
 849	! ROUTINE VALUE:
 850	!
 851	!	PDP-11 ADDRESS OF THE PCB CREATED
 852	!
 853	! SIDE EFFECTS
 854	!
 855	!	CHANGES THE CORE IMAGE
 856	!
 857	!--
 858	
 859	    BEGIN
 860	
 861	    BIND
 862		ROUTINE_NAME = UPLIT (%ASCIZ'M_PCB');
 863	
 864	    MAP
 865		KERNEL_FILE : REF FILE_BLOCK,
 866		VALUES : REF VNPVAL_BLOCK;
 867	
 868	    LOCAL
 869		PCB_ADDR,
 870		HIGH_EXEC_ADDR,
 871		FLAGS,
 872		TEMP1,
 873		TEMP2,
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 874		DYNAMIC_PAR,
 875		R50VAL : VECTOR [4];
 876	
 877	    IF (DEBUG GEQ 1)
 878	    THEN
 879		BEGIN					!DEBUG
 880		PCRLF (1);
 881		OUTSTR (1, UPLIT (%ASCIZ'MAKE PCB: '));
 882		OUTSTR (1, .PAR_NAME);
 883		OUTSTR (1, UPLIT (%ASCIZ', '));
 884		OUTNUM (1, .PAR_BASE, 8, 6);
 885		OUTSTR (1, UPLIT (%ASCIZ', '));
 886		OUTNUM (1, .PAR_TOP, 8, 6);
 887		END;					!DEBUG
 888	
 889	!
 890	! STORE TOP OF PARTITION IN THE HIGH-WATER-MARK (HWM) CELL.
 891	!  IT CAN BE USED AS THE BASE FOR THE NEXT CALL TO M_PCB
 892	!  OR AS THE LIMIT FOR WHAT TO WRITE OUT OF THE CORE IMAGE.
 893	! NOTE THAT THE HWM IS ONLY STORED IF THE NEW VALUE IS LARGER THAN
 894	!  THE VALUE ALREADY IN THE CELL.  THIS IS BECAUSE OF SUB-PARTITIONS
 895	!  AND SYSTEM-CONTROLLED PARTITIONS.
 896	!
 897	
 898	    IF (.KERNEL_FILE [FILE_HWM] LSS (.PAR_TOP OR 63)) THEN KERNEL_FILE [FILE_HWM] = .PAR_TOP OR 63;
 899	
 900	!
 901	! FIND THE FLAGS FROM THIS CORE IMAGE.
 902	!  WE NEED THEM TO SUPPORT PLAS.
 903	!
 904	    FLAGS = GETWRD (.KERNEL_FILE, .VALUES [FMASK]);
 905	!
 906	! DETERMINE IF THIS IS A DYNAMIC PARTITION
 907	!  (THAT IS, IF IT IS A SUB-PARTITION OF A SYSTEM-CONTROLLED PARTITION)
 908	!
 909	
 910	    IF (.PAR_MAIN EQL 0)
 911	    THEN
 912		DYNAMIC_PAR = 0
 913	    ELSE
 914		BEGIN					!SUB-PARTITION
 915		DYNAMIC_PAR = 0;
 916	
 917		IF ((GETWRD (.KERNEL_FILE, .PAR_MAIN + .VALUES [P_STAT]) AND .VALUES [PS_SYS]) NEQ 0)
 918		THEN
 919		    DYNAMIC_PAR = 1;
 920	
 921		END;
 922	
 923	!
 924	! NOW ALLOCATE A PARTITION CONTROL BLOCK.
 925	!
 926	    PCB_ADDR = ALOCB (.KERNEL_FILE, MAX (.VALUES [P_LGTH], .MIN_PCB_LEN), 0, .VALUES);
 927	!
 928	! NEXT, STORE APPROPRIATE VALUES IN IT
 929	!
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 930	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_LNK], 0);
 931	    PUTBYT (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_PRI], 0);
 932	    PUTBYT (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_IOC], 0);
 933	    ATOR50 (.PAR_NAME, R50VAL);
 934	
 935	    INCR COUNTER FROM 0 TO 3 DO
 936		PUTBYT (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_NAM] + .COUNTER, .R50VAL [.COUNTER]);
 937	
 938	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_SUB], 0);
 939	
 940	    IF (.PAR_MAIN NEQ 0)
 941	    THEN
 942		BEGIN					!LINK SUB-PARTITION TO PARTITION'S LIST
 943		TEMP1 = .PAR_MAIN;
 944	
 945		WHILE (.TEMP1 NEQ 0) DO
 946		    BEGIN
 947		    TEMP2 = .TEMP1;
 948		    TEMP1 = GETWRD (.KERNEL_FILE, .TEMP2 + .VALUES [P_SUB]);
 949		    END;
 950	
 951		PUTWRD (.KERNEL_FILE, .TEMP2 + .VALUES [P_SUB], .PCB_ADDR);
 952		END;
 953	
 954	    IF (.PAR_MAIN EQL 0)
 955	    THEN
 956		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_MAIN], .PCB_ADDR)
 957	    ELSE
 958		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_MAIN], .PAR_MAIN);
 959	
 960	    TEMP1 = .PAR_BASE/64;
 961	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_REL], .TEMP1);
 962	
 963	    IF (.PAR_TOP NEQ 0)
 964	    THEN
 965		BEGIN
 966		TEMP1 = (.PAR_TOP - .PAR_BASE + 64)/64;
 967		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_SIZE], .TEMP1);
 968		END;
 969	
 970	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_WAIT], 0);
 971	
 972	    IF (.DYNAMIC_PAR EQL 0)
 973	    THEN
 974		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_WAIT] + 2,
 975		    .PCB_ADDR + .VALUES [P_WAIT])
 976	    ELSE
 977		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_WAIT] + 2, 0);
 978	
 979	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_BUSY], .BUSY_FLAGS);
 980	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_TCB], 0);
 981	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_STAT], .STAT_FLAGS);
 982	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_HDR], 0);
 983	
 984	    IF (.FLAGS AND .VALUES [FE_PLA])
 985	    THEN
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

 986		BEGIN					! PLAS SUPPORT
 987		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_PRO], 0);
 988		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_ATT], 0);
 989		PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_ATT] + 2, .PCB_ADDR + .VALUES [P_ATT]);
 990		END;					!OF PLAS SUPPORT
 991	
 992	!
 993	! UNLESS THIS IS A SUB-PARTITION OF A SYSTEM-CONTROLLED PARTITION,
 994	!  LINK IT INTO THE KERNEL'S LIST OF PARTITIONS.
 995	!
 996	
 997	    IF (.DYNAMIC_PAR EQL 0)
 998	    THEN
 999		BEGIN					!LINK IT IN
1000		TEMP1 = .VALUES [PARHD];		!HEADER OF PARTITION LIST
1001	
1002		WHILE (.TEMP1 NEQ 0) DO
1003		    BEGIN
1004		    TEMP2 = .TEMP1;
1005		    TEMP1 = GETWRD (.KERNEL_FILE, .TEMP2 + .VALUES [P_LNK]);
1006		    END;
1007	
1008		PUTWRD (.KERNEL_FILE, .TEMP2 + .VALUES [P_LNK], .PCB_ADDR);
1009		END;
1010	
1011	!
1012	! WE ARE DONE, RETURN THE PCB ADDRESS
1013	!
1014	    .PCB_ADDR
1015	    END;					!OF M_PCB
1016	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1017	GLOBAL ROUTINE MCEX (KERNEL_FILE, CEX_FILE, VALUES) : NOVALUE = 	!MERGE THE COMM EXEC
1018	
1019	!++
1020	! FUNCTIONAL DESCRIPTION:
1021	!
1022	!	MERGE THE COMM EXEC INTO THE KERNEL.  THIS REQUIRES SETTING
1023	!	 UP A COMMON PARTITION.  INFORMATION ON THE PARTITION IS
1024	!	 TAKEN FROM THE COMM EXEC'S LABEL AND HEADER BLOCKS,
1025	!	 AND FROM CETAB.MAC.
1026	!
1027	! FORMAL PARAMETERS:
1028	!
1029	!	KERNEL_FILE - FILE BLOCK FOR THE KERNEL
1030	!	CEX_FILE - FILE BLOCK FOR THE COMM EXEC
1031	!	VALUES - VALUES READ FROM CETAB.MAC AND THE SYMBOL TABLES
1032	!
1033	! IMPLICIT INPUTS:
1034	!
1035	!	NONE
1036	!
1037	! IMPLICIT OUTPUTS:
1038	!
1039	!	NONE
1040	!
1041	! ROUTINE VALUE:
1042	!
1043	!	NONE
1044	!
1045	! SIDE EFFECTS
1046	!
1047	!	CHANGES THE CORE IMAGE
1048	!
1049	!--
1050	
1051	    BEGIN
1052	
1053	    BIND
1054		ROUTINE_NAME = UPLIT (%ASCIZ'MCEX');
1055	
1056	    MAP
1057		KERNEL_FILE : REF FILE_BLOCK,
1058		CEX_FILE : REF FILE_BLOCK,
1059		VALUES : REF VNPVAL_BLOCK;
1060	
1061	    LOCAL
1062		PCB_ADDR,
1063		CEX_LABEL : REF VECTOR [1024],
1064		KERNEL_LABEL : REF VECTOR [1024],
1065		HIGH_EXEC_ADDR,
1066		FLAGS,
1067		CEX_BASE,
1068		CEX_TOP,
1069		TEMP1,
1070		TEMP2,
1071		TEMP3,
1072		TEMP4,
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1073		TEMP5,
1074		R50VAL : VECTOR [4];
1075	
1076	    CEX_LABEL = .CEX_FILE [FILE_LABEL];
1077	    KERNEL_LABEL = .KERNEL_FILE [FILE_LABEL];
1078	!
1079	! FIND THE FLAGS FROM THIS CORE IMAGE, AND CHECK THAT ALL NECESSARY
1080	!  OPTIONS AND NO BAD OPTIONS ARE SELECTED.
1081	!
1082	    FLAGS = GETWRD (.KERNEL_FILE, .VALUES [FMASK]);
1083	!
1084	! VERIFY THAT FE_EXT (22-BIT ADDRESSING) IS CLEAR.
1085	!  ALSO, FE_CEX (COMM EXEC LOADED) SHOULD BE CLEAR.
1086	!
1087	
1088	    IF ((.FLAGS AND .VALUES [FE_EXT]) NEQ 0)
1089	    THEN
1090		ERRMSG (0, 28, ROUTINE_NAME, KERNEL_FILE [FILE_NAME], 0, 0,
1091		    0);
1092	
1093	    IF ((.FLAGS AND .VALUES [FE_CEX]) NEQ 0)
1094	    THEN
1095		ERRMSG (0, 30, ROUTINE_NAME, KERNEL_FILE [FILE_NAME], 0, 0,
1096		    0);
1097	
1098	!
1099	! SINCE WE HAVE NOT REALLY CHECKED OUT PLAS SUPPORT, DONT ALLOW IT.
1100	!
1101	
1102	    IF ((.FLAGS AND .VALUES [FE_PLA]) NEQ 0)
1103	    THEN
1104		ERRMSG (0, 33, ROUTINE_NAME, KERNEL_FILE [FILE_NAME], 0, 0,
1105		    0);
1106	
1107	!
1108	! EXTEND THE EXECUTIVE POOL TO THE BOTTOM OF THE COMM EXEC PARTITION
1109	!
1110	    CEX_BASE = .CEX_LABEL [L$BSA] + (256*.CEX_LABEL [L$BSA + 1]);
1111	    CEX_TOP = .CEX_LABEL [L$BHGV] + (256*.CEX_LABEL [L$BHGV + 1]);
1112	
1113	    IF ((.FLAGS AND .VALUES [FE_EXV]) EQL 0) THEN HIGH_EXEC_ADDR = 16*2048 ELSE HIGH_EXEC_ADDR = 20*2048;
1114	
1115	    IF (.CEX_TOP GTR .HIGH_EXEC_ADDR)
1116	    THEN
1117		ERRMSG (0, 31, ROUTINE_NAME, CEX_FILE [FILE_NAME], .CEX_TOP,
1118		    .HIGH_EXEC_ADDR, 0);
1119	
1120	!
1121	! ROUND THE BASE OF THE EXEC STORAGE POOL UP TO A MULTIPLE OF 4 BYTES
1122	!
1123	    TEMP1 = GETWRD (.KERNEL_FILE, .VALUES [CRAVL]);	!BASE OF POOL
1124	    TEMP2 = GETWRD (.KERNEL_FILE, .TEMP1 + 2);	!CURRENT LENGTH OF POOL
1125	    PUTWRD (.KERNEL_FILE, .TEMP1 + 2, 0);	!CLEAR OLD LENGTH WORD
1126	    TEMP3 = ((.TEMP1 + 3) AND ( NOT 3));	!ROUND UP BASE TO MULT. OF 4
1127	    TEMP2 = .TEMP2 - (.TEMP3 - .TEMP1);		!ADJUST LENGTH WORD
1128	    PUTWRD (.KERNEL_FILE, .VALUES [CRAVL], .TEMP3);	!STORE NEW BASE
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1129	    PUTWRD (.KERNEL_FILE, .TEMP3, 0);		!CLEAR NEW POINTER WORD
1130	    PUTWRD (.KERNEL_FILE, .TEMP3 + 2, .TEMP2);	!STORE NEW LENGTH
1131	!
1132	! INCREASE THE SIZE OF THE EXEC
1133	!
1134	    TEMP1 = GETWRD (.KERNEL_FILE, .VALUES [EXSIZ]);	!REMEMBER OLD SIZE
1135	    PUTWRD (.KERNEL_FILE, .VALUES [EXSIZ], .CEX_BASE);	!STORE NEW SIZE
1136	!
1137	! FREE THE NEW SPACE, THUS PLACING IT IN THE EXEC STORAGE POOL
1138	!
1139	    DEACB (.KERNEL_FILE, .TEMP1,
1140		(.CEX_BASE - .TEMP1) AND ( NOT (GETWRD (.KERNEL_FILE, .VALUES [CRAVL] - 2))), .VALUES);
1141	! CREATE A PARTITION CONTROL BLOCK
1142	!
1143	    PCB_ADDR = M_PCB (.KERNEL_FILE, UPLIT (%ASCIZ'CEXPAR'), 0, .CEX_BASE, .CEX_TOP, %O'100200',
1144		.VALUES [PS_COM], 0, .VALUES);
1145	    VALUES [CEX_PCB_ADDR] = .PCB_ADDR;
1146	!
1147	! NOW COPY THE COMM EXEC INTO THE KERNEL IMAGE
1148	!
1149	
1150	    INCR ADDRESS FROM .CEX_BASE TO .CEX_TOP DO
1151		PUTBYT (.KERNEL_FILE, .ADDRESS, GETBYT (.CEX_FILE, .ADDRESS));
1152	
1153	!
1154	! SET UP ALLOCATION POINTER FOR DOING ALLOCATION IN THE
1155	!  COMM EXEC'S PARTITION.  THIS CODE WAS TRANSLATED FROM
1156	!  SUBROUTINE CEPTR IN MODULE VCEX IN DECNET-11M.
1157	!
1158	    TEMP1 = .VALUES [CEAVL] - 2;		!GET ADDRESS OF ROUNDING FACTOR
1159	    TEMP4 = .TEMP1;				!REMEMBER ADDRESS OF ROUNDING FACTOR
1160	    TEMP2 = .TEMP4 + 6;				!POINT TO TWO WORDS PAST ALLOCATION LIST HEAD
1161	    TEMP5 = GETWRD (.KERNEL_FILE, .TEMP1);
1162	    TEMP2 = .TEMP2 + .TEMP5;			!ROUND UP <POINTER ADDRESS+4>
1163	    TEMP2 = .TEMP2 AND ( NOT .TEMP5);
1164	    TEMP1 = .TEMP1 + 2;
1165	    TEMP3 = .CEX_TOP + 1 - .TEMP2;		!COMPUTE POOL LENGTH
1166	
1167	    IF (.TEMP3 EQL 0)
1168	    THEN
1169		BEGIN
1170		PUTWRD (.KERNEL_FILE, .TEMP1, 0);	!DENOTE NO CEX POOL
1171		PUTWRD (.KERNEL_FILE, .TEMP1 + 2, 0);	!CLEAR NEXT ADDR SEGMENT, TOO
1172		END
1173	    ELSE
1174		BEGIN
1175		PUTWRD (.KERNEL_FILE, .TEMP1, .TEMP2);	!SET ADDRESS OF FIRST SEGMENT
1176		PUTWRD (.KERNEL_FILE, .TEMP1 + 2, 0);	!THIS SEGMENT IS ZERO LENGTH
1177		TEMP2 = .TEMP2 - .TEMP4;		!COMPUTE ADDRESS OF NEXT SEGMENT
1178		TEMP1 = .TEMP1 + .TEMP2;		! DESCRIPTOR + 2
1179		PUTWRD (.KERNEL_FILE, .TEMP1 - 2, 0);	!NO NEXT DESCRIPTOR
1180		END;
1181	
1182	    PUTWRD (.KERNEL_FILE, .TEMP1, .TEMP3);	!SET THIS SEGMENT LENGTH
1183	!
1184	! MAKE SURE THE NODE IDENTIFICATION FIELD ENDS WITH BLANKS RATHER
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1185	!  THAN ZEROS.
1186	!
1187	
1188	    INCR COUNTER FROM 2 TO 34 DO
1189	
1190		IF (GETBYT (.KERNEL_FILE, .VALUES [NODID] + .COUNTER) EQL 0)
1191		THEN
1192		    PUTBYT (.KERNEL_FILE,
1193			.VALUES [NODID] + .COUNTER, %C' ');
1194	
1195	!
1196	! NOW SET THE BIT IN THE FLAGS WORD WHICH MEANS THAT WE HAVE
1197	!  LOADED THE COMM EXEC.
1198	!
1199	    FLAGS = .FLAGS OR .VALUES [FE_CEX];
1200	    PUTWRD (.KERNEL_FILE, .VALUES [FMASK], .FLAGS);
1201	!
1202	    END;					!OF MCEX
1203	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1204	GLOBAL ROUTINE INSTAL (KERNEL_FILE, TASK_FILE, TASK_NAME, PCB_ARG, VALUES) : NOVALUE = 	!INSTALL A TASK
1205	
1206	!++
1207	! FUNCTIONAL DESCRIPTION:
1208	!
1209	!	INSTALL A TASK IN A GIVEN PARTITION, OR IN THE
1210	!	 SYSTEM-CONTROLLED PARTITION.  FIX THE TASK IN CORE.
1211	!
1212	! FORMAL PARAMETERS:
1213	!
1214	!	KERNEL_FILE - POINTER TO THE FILE BLOCK WHICH DESCRIBES THE
1215	!	 RSX-11S KERNEL
1216	!	TASK_FILE - POINTER TO A SIMILAR FILE BLOCK WHICH DESCRIBES
1217	!	 THE TASK TO BE INSTALLED
1218	!	TASK_NAME - POINTER TO THE TASK NAME, IN ASCII
1219	!	PCB_ARG - THE PDP-11 ADDRESS OF THE PARTITION INTO WHICH
1220	!	 THE TASK IS TO BE INSTALLED.  IF 0, THE TASK IS TO BE
1221	!	 INSTALLED IN THE SYSTEM-CONTROLLED PARTITION.
1222	!	VALUES - POINTER TO THE VALUES BLOCK
1223	!
1224	! IMPLICIT INPUTS:
1225	!
1226	!	NONE
1227	!
1228	! IMPLICIT OUTPUTS:
1229	!
1230	!	NONE
1231	!
1232	! ROUTINE VALUE:
1233	!
1234	!	NONE
1235	!
1236	! SIDE EFFECTS
1237	!
1238	!	MODIFIES THE KERNEL'S DATA STRUCTURES
1239	!
1240	!--
1241	
1242	    BEGIN
1243	
1244	    BIND
1245		ROUTINE_NAME = UPLIT (%ASCIZ'INSTALL');
1246	
1247	    MAP
1248		KERNEL_FILE : REF FILE_BLOCK,
1249		TASK_FILE : REF FILE_BLOCK,
1250		VALUES : REF VNPVAL_BLOCK;
1251	
1252	    LOCAL
1253		TCB_ADDR,
1254		PCB_ADDR,
1255		HDR_ADDR,
1256		HDR_SIZE,
1257		TASK_LABEL : REF VECTOR [1024],
1258		TEMP1,
1259		TEMP2,
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1260		TEMP3,
1261		TASK_BASE,
1262		TASK_TOP,
1263		TASK_SIZE,
1264		ASCVAL : VECTOR [4],
1265		TASK_FLAGS,
1266		PARTITION_BASE,
1267		NLUN,
1268		PRIORITY,
1269		SEARCH_DONE;
1270	
1271	    IF (DEBUG GEQ 1)
1272	    THEN
1273		BEGIN					!DEBUG
1274		PCRLF (1);
1275		OUTSTR (1, UPLIT (%ASCIZ'INSTALL: '));
1276		OUTSTR (1, TASK_FILE [FILE_NAME]);
1277		END;					!DEBUG
1278	
1279	!
1280	! COMPUTE THE SIZE OF THE TASK, AND ITS FLAGS
1281	!
1282	    TASK_LABEL = .TASK_FILE [FILE_LABEL];
1283	    TASK_BASE = .TASK_LABEL [L$BSA] + (.TASK_LABEL [L$BSA + 1]*256);
1284	    TASK_TOP = .TASK_LABEL [L$BHGV] + (.TASK_LABEL [L$BHGV + 1]*256);
1285	    TASK_SIZE = .TASK_TOP - .TASK_BASE + 1;
1286	    TASK_FLAGS = .TASK_LABEL [L$BFLG] + (.TASK_LABEL [L$BFLG + 1]*256);
1287	!
1288	! ALLOCATE A TCB
1289	!
1290	    TCB_ADDR = ALOCB (.KERNEL_FILE, .VALUES [T_LGTH], 0, .VALUES);
1291	!
1292	! COMPUTE THE LENGTH OF THE HEADER, AND ALLOCATE IT.
1293	!
1294	    HDR_SIZE = GETWRD (.TASK_FILE, .TASK_BASE + .VALUES [H_HDLN]) + 2;
1295	    HDR_ADDR = ALOCB (.KERNEL_FILE, .HDR_SIZE, 0, .VALUES);
1296	!
1297	! FETCH THE NAME OF THE TASK, AND ITS PRIORITY
1298	!
1299	    ATOR50 (.TASK_NAME, ASCVAL);
1300	    PRIORITY = .TASK_LABEL [L$BPRI];
1301	!
1302	!  IF THE TASK'S PRIORITY FIELD IS 0, DEFAULT IT TO 50.
1303	!
1304	
1305	    IF (.PRIORITY EQL 0) THEN PRIORITY = 50;
1306	
1307	!
1308	! IF WE NEED A PCB, ALLOCATE ONE.  OTHERWISE USE THE ONE SPECIFIED.
1309	!
1310	
1311	    IF (.PCB_ARG NEQ 0)
1312	    THEN
1313		PCB_ADDR = .PCB_ARG
1314	    ELSE
1315		BEGIN					!ALLOCATE A PCB
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1316	!
1317	! FIND THE SYSTEM-CONTROLLED PARTITION
1318	!
1319		TEMP1 = .VALUES [PARHD];
1320		SEARCH_DONE = 0;
1321	
1322		WHILE (.SEARCH_DONE EQL 0) DO
1323		    BEGIN
1324		    TEMP2 = GETWRD (.KERNEL_FILE, .TEMP1);
1325	
1326		    IF (.TEMP2 EQL 0)
1327		    THEN
1328			SEARCH_DONE = -1
1329		    ELSE
1330			BEGIN
1331			TEMP3 = GETWRD (.KERNEL_FILE, .TEMP2 + .VALUES [P_STAT]);
1332	
1333			IF ((.TEMP3 AND .VALUES [PS_SYS]) NEQ 0)
1334			THEN
1335			    SEARCH_DONE = 1
1336			ELSE
1337			    TEMP1 = .TEMP2 + .VALUES [P_LNK];
1338	
1339			END;
1340	
1341		    END;
1342	
1343		IF (.SEARCH_DONE LEQ 0) THEN ERROR (UPLIT (%ASCIZ'NO GEN PARTITION - INSTALL'));
1344	
1345	!
1346	! NOW ALLOCATE A SUB-PARTITION OF THE SYSTEM-CONTROLLED PARTITION
1347	!
1348		PCB_ADDR = M_PCB (.KERNEL_FILE, TASK_FILE [FILE_NAME], .TEMP2, .KERNEL_FILE [FILE_HWM],
1349		    .KERNEL_FILE [FILE_HWM] + .TASK_SIZE, %O'000000', .VALUES [PS_SYS], 0, .VALUES);
1350		END;
1351	
1352	!
1353	! BE SURE THE TCB IS ALL ZERO, SO WE WON'T HAVE TO EXPLICITLY
1354	!  CLEAR ZERO FIELDS BELOW.
1355	!
1356	
1357	    INCR COUNTER FROM 0 TO .VALUES [T_LGTH] DO
1358		PUTBYT (.KERNEL_FILE, .TCB_ADDR + .COUNTER, 0);
1359	
1360	!
1361	! FILL IN THE TCB
1362	!
1363	    PUTBYT (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_PRI], .PRIORITY);
1364	
1365	    INCR COUNTER FROM 0 TO 3 DO
1366		PUTBYT (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_NAM] + .COUNTER, .ASCVAL [.COUNTER]);
1367	
1368	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_RCVL] + 2, .TCB_ADDR + .VALUES [T_RCVL]);
1369	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_ASTL] + 2, .TCB_ADDR + .VALUES [T_ASTL]);
1370	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_STAT], .VALUES [TS_EXE]);
1371	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_ST2], .VALUES [T2_CHK] OR .VALUES [T2_FXD]);
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1372	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_ST3], .VALUES [T3_PMD] OR 	!
1373		(IF ((.TASK_FLAGS AND TS$PRV) NEQ 0) THEN .VALUES [T3_PRV] ELSE 0) OR 	!
1374		(IF ((.TASK_FLAGS AND TS$ACP) NEQ 0) THEN .VALUES [T3_ACP] ELSE 0) OR 	!
1375		(IF ((.TASK_FLAGS AND (TS$NSD OR TS$ACP)) NEQ 0) THEN .VALUES [T3_NSD] ELSE 0));
1376	    PUTBYT (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_DPRI], .PRIORITY);
1377	!
1378	! SET THE 3-BYTE FIELD WHICH SPECIFIES WHERE ON ITS LOAD DEVICE
1379	!  THIS TASK CAME FROM TO 0.
1380	!
1381	
1382	    INCR COUNTER FROM 0 TO 3 DO
1383		PUTBYT (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_LBN] + .COUNTER, 0);
1384	
1385	!
1386	! PRETEND THAT THIS TASK CAME FROM DEVICE LB:
1387	!  FIND THE UCB ADDRESS FOR LB, AND STORE IT IN THE TCB.
1388	!
1389	    SEARCH_DONE = 0;
1390	    TEMP1 = GETWRD (.KERNEL_FILE, .VALUES [DEVHD]);
1391	
1392	    WHILE (.SEARCH_DONE EQL 0) DO
1393		BEGIN
1394	
1395		IF (GETWRD (.KERNEL_FILE, .TEMP1 + .VALUES [D_NAM]) EQL (%C'L' + (256*%C'B')))
1396		THEN
1397		    BEGIN
1398		    TEMP1 = GETWRD (.KERNEL_FILE, .TEMP1 + .VALUES [D_UCB]);
1399		    SEARCH_DONE = 1;
1400		    END
1401		ELSE
1402		    BEGIN
1403		    TEMP1 = GETWRD (.KERNEL_FILE, .TEMP1 + .VALUES [D_LNK]);
1404	
1405		    IF (.TEMP1 EQL 0) THEN SEARCH_DONE = -1;
1406	
1407		    END;
1408	
1409		END;
1410	
1411	    IF (.SEARCH_DONE LEQ 0) THEN ERROR (UPLIT (%ASCIZ'NO DEVICE LB - INSTALL'));
1412	
1413	!
1414	! WE HAVE THE UCB ADDRESS OF LB IN TEMP1.
1415	!
1416	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_LDV], .TEMP1);
1417	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_PCB], .PCB_ADDR);
1418	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_MXSZ], .TASK_SIZE/64);
1419	!
1420	! THE HEADER IS MOSTLY A COPY OF THE FIRST FEW BYTES OF THE TASK
1421	!  IMAGE.
1422	!
1423	
1424	    INCR COUNTER FROM 0 TO .HDR_SIZE - 1 DO
1425		PUTBYT (.KERNEL_FILE, .HDR_ADDR + .COUNTER, GETBYT (.TASK_FILE, .TASK_BASE + .COUNTER));
1426	
1427	!
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1428	! SOME FIELDS OF THE HEADER HAVE TO BE RELOCATED
1429	!
1430	    PUTWRD (.KERNEL_FILE, .HDR_ADDR + .VALUES [H_WND],
1431		GETWRD (.KERNEL_FILE, .HDR_ADDR + .VALUES [H_WND]) + .HDR_ADDR);
1432	    PUTWRD (.KERNEL_FILE, .HDR_ADDR + .VALUES [H_GARD],
1433		GETWRD (.KERNEL_FILE, .HDR_ADDR + .VALUES [H_GARD]) + .HDR_ADDR);
1434	    NLUN = GETWRD (.KERNEL_FILE, .HDR_ADDR + .VALUES [H_NLUN]);
1435	    PUTWRD (.KERNEL_FILE, .HDR_ADDR + .VALUES [H_LUN] + (.NLUN*4) + 2, .PCB_ADDR);
1436	!
1437	! LINK THE PCB WITH THE TCB AND HDR
1438	!
1439	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_TCB], .TCB_ADDR);
1440	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_HDR], .HDR_ADDR);
1441	!
1442	! NOW COPY THE TASK INTO ITS PARTITION
1443	!
1444	    PARTITION_BASE = GETWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_REL])*64;
1445	
1446	    IF (DEBUG GEQ 1)
1447	    THEN
1448		BEGIN					!DEBUG
1449		OUTSTR (1, UPLIT (%ASCIZ', '));
1450		OUTNUM (1, .PARTITION_BASE, 8, 6);
1451		OUTSTR (1, UPLIT (%ASCIZ', '));
1452		OUTNUM (1, .PARTITION_BASE + .TASK_SIZE - 1, 8, 6);
1453		END;					!DEBUG
1454	
1455	    INCR COUNTER FROM 0 TO .TASK_SIZE - 1 DO
1456		PUTBYT (.KERNEL_FILE, .PARTITION_BASE + .COUNTER, GETBYT (.TASK_FILE, .COUNTER + .TASK_BASE));
1457	
1458	!
1459	! LINK THE TCB INTO THE SYSTEM'S LIST OF TCBS
1460	!
1461	    TEMP1 = GETWRD (.KERNEL_FILE, .VALUES [TSKHD]);
1462	    TEMP3 = 0;
1463	    SEARCH_DONE = 0;
1464	
1465	    WHILE (.SEARCH_DONE EQL 0) DO
1466		BEGIN
1467		TEMP2 = GETBYT (.KERNEL_FILE, .TEMP1 + .VALUES [T_PRI]);
1468	
1469		IF (.TEMP2 LSS .PRIORITY)
1470		THEN
1471		    SEARCH_DONE = 1
1472		ELSE
1473		    BEGIN
1474		    TEMP3 = .TEMP1;
1475		    TEMP1 = GETWRD (.KERNEL_FILE, .TEMP1 + .VALUES [T_TCBL]);
1476	
1477		    IF (.TEMP1 EQL 0) THEN SEARCH_DONE = -1;
1478	
1479		    END;
1480	
1481		END;
1482	
1483	    IF (.SEARCH_DONE LSS 0) THEN ERROR (UPLIT (%ASCIZ'TCB LINKS BAD - INSTALL'));
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1484	
1485	!
1486	! NOW, TEMP3 POINTS TO THE PREVIOUS TCB AND TEMP1 TO THE NEXT TCB.
1487	!  IF TEMP3 IS ZERO, THIS TCB IS TO BE FIRST.
1488	!
1489	
1490	    IF (.TEMP3 EQL 0)
1491	    THEN
1492		PUTWRD (.KERNEL_FILE, .VALUES [TSKHD], .TCB_ADDR)
1493	    ELSE
1494		PUTWRD (.KERNEL_FILE,
1495		    .TEMP3 + .VALUES [T_TCBL], .TCB_ADDR);
1496	
1497	    PUTWRD (.KERNEL_FILE, .TCB_ADDR + .VALUES [T_TCBL], .TEMP1);
1498	    END;					!OF INSTALL
1499	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1500	GLOBAL ROUTINE LOADD (KERNEL_FILE, TASK_FILE, TASK_NAME, GEN_PCB, VALUES) : NOVALUE = 	!INSTALL A DRIVER
1501	
1502	!++
1503	! FUNCTIONAL DESCRIPTION:
1504	!
1505	!	INSTALL A LOADABLE DRIVER, WITH DATA BASE.  IT IS ALWAYS
1506	!	 INSTALLED IN THE SYSTEM-CONTROLLED PARTITION.
1507	!
1508	! FORMAL PARAMETERS:
1509	!
1510	!	KERNEL_FILE - POINTER TO THE FILE BLOCK WHICH DESCRIBES THE
1511	!	 RSX-11S KERNEL
1512	!	TASK_FILE - POINTER TO A SIMILAR FILE BLOCK WHICH DESCRIBES
1513	!	 THE TASK (DRIVER) TO BE INSTALLED
1514	!	TASK_NAME - POINTER TO THE TASK NAME, IN ASCII.
1515	!	 THIS IS ALWAYS OF THE FORM XXDRV, WHERE XX IS THE DEVICE NAME.
1516	!	GEN_PCB - PDP-11 ADDRESS OF THE SYSTEM-CONTROLLED PARTITION
1517	!	VALUES - POINTER TO THE VALUES BLOCK
1518	!
1519	! IMPLICIT INPUTS:
1520	!
1521	!	NONE
1522	!
1523	! IMPLICIT OUTPUTS:
1524	!
1525	!	NONE
1526	!
1527	! ROUTINE VALUE:
1528	!
1529	!	NONE
1530	!
1531	! SIDE EFFECTS
1532	!
1533	!	MODIFIES THE KERNEL'S DATA STRUCTURES
1534	!
1535	!--
1536	
1537	    BEGIN
1538	
1539	    BIND
1540		ROUTINE_NAME = UPLIT (%ASCIZ'LOADD');
1541	
1542	    MAP
1543		KERNEL_FILE : REF FILE_BLOCK,
1544		TASK_FILE : REF FILE_BLOCK,
1545		VALUES : REF VNPVAL_BLOCK;
1546	
1547	    LOCAL
1548		PCB_ADDR,
1549		PAR_BASE,
1550		TASK_LABEL : REF VECTOR [1024],
1551		TASK_BASE,
1552		TASK_TOP,
1553		TASK_SIZE,
1554		TASK_FLAGS,
1555		PCB_BASE,
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1556		FIRST_DCB_ADDR,
1557		LAST_DCB_ADDR,
1558		DCB_ADDR,
1559		LAST_SCB_ADDR,
1560		SCB_ADDR,
1561		FIRST_UCB_ADDR,
1562		UCB_ADDR,
1563		UCB_LENGTH,
1564		XXEND,
1565		XXDAT,
1566		INPINT,
1567		OUTINT,
1568		VECTOR,
1569		LOC,
1570		NUNITS;
1571	
1572	    IF (DEBUG GEQ 1)
1573	    THEN
1574		BEGIN					!DEBUG
1575		PCRLF (1);
1576		OUTSTR (1, UPLIT (%ASCIZ'LOAD DRIVER: '));
1577		OUTSTR (1, TASK_FILE [FILE_NAME]);
1578		END;					!DEBUG
1579	
1580	!
1581	! COMPUTE THE SIZE OF THE TASK, AND ITS FLAGS
1582	!
1583	    TASK_LABEL = .TASK_FILE [FILE_LABEL];
1584	    TASK_BASE = .TASK_LABEL [L$BSA] + (.TASK_LABEL [L$BSA + 1]*256);
1585	    TASK_TOP = .TASK_LABEL [L$BHGV] + (.TASK_LABEL [L$BHGV + 1]*256);
1586	    TASK_SIZE = .TASK_TOP - .TASK_BASE + 1;
1587	    TASK_FLAGS = .TASK_LABEL [L$BFLG] + (.TASK_LABEL [L$BFLG + 1]*256);
1588	!
1589	! COMPUTE THE LENGTH OF THE DRIVER'S DATA BASE
1590	!  AND ALLOCATE SPACE FOR IT.
1591	!
1592	    XXEND = VRBL_SYM (.TASK_FILE, 2, UPLIT (%ASCIZ'$\\END'), 0);
1593	    XXDAT = VRBL_SYM (.TASK_FILE, 2, UPLIT (%ASCIZ'$\\DAT'), 0);
1594	    FIRST_DCB_ADDR = ALOCB (.KERNEL_FILE, .XXEND - .XXDAT, 0, .VALUES);
1595	!
1596	! COPY THE DATA BASE TO THE KERNEL POOL
1597	!
1598	
1599	    INCR COUNTER FROM .XXDAT TO .XXEND - 1 DO
1600		PUTBYT (.KERNEL_FILE, .FIRST_DCB_ADDR + .COUNTER - .XXDAT, GETBYT (.TASK_FILE, .COUNTER));
1601	
1602	!
1603	! ALLOCATE A PCB IN THE SYSTEM-CONTROLLED AREA TO POINT TO THE
1604	!  DRIVER MEMORY.
1605	!
1606	    PAR_BASE = .KERNEL_FILE [FILE_HWM] + 1;
1607	    PCB_ADDR = M_PCB (.KERNEL_FILE, UPLIT (%ASCIZ'GEN   '), .GEN_PCB, .PAR_BASE,
1608		.PAR_BASE + .TASK_SIZE - (.XXEND - .XXDAT), %O'000000', .VALUES [PS_SYS] OR .VALUES [PS_DRV], 0,
1609		.VALUES);
1610	!
1611	! PROCESS EACH DCB, WITH ITS UCBS AND SCBS.
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1612	!
1613	    SCB_ADDR = 0;
1614	    DCB_ADDR = .FIRST_DCB_ADDR;
1615	
1616	    WHILE (.DCB_ADDR NEQ 0) DO
1617		BEGIN
1618		LAST_DCB_ADDR = .DCB_ADDR;
1619	!
1620	! COMPUTE THE NUMBER OF UNITS AND THE LENGTH OF EACH UCB
1621	!
1622		NUNITS = GETBYT (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_UNIT] + 1) - GETBYT (.KERNEL_FILE,
1623		    .DCB_ADDR + .VALUES [D_UNIT]) + 1;
1624		UCB_LENGTH = GETWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_UCBL]);
1625	!
1626	! RELOCATE THE DCB, UCB AND SCB.
1627	!
1628		FIRST_UCB_ADDR = GETWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_UCB]) - .XXDAT + .DCB_ADDR;
1629		PUTWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_UCB], .FIRST_UCB_ADDR);
1630		PUTWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_DSP],
1631		    VRBL_SYM (.TASK_FILE, 2, UPLIT (%ASCIZ'$\\TBL'), 0));
1632		PUTWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_PCB], .PCB_ADDR);
1633	
1634		INCR COUNTER FROM 0 TO .NUNITS - 1 DO
1635		    BEGIN				!EACH UCB
1636		    UCB_ADDR = .FIRST_UCB_ADDR + (.UCB_LENGTH*.COUNTER);
1637		    PUTWRD (.KERNEL_FILE, .UCB_ADDR + .VALUES [U_DCB],
1638			GETWRD (.KERNEL_FILE,
1639			    .UCB_ADDR + .VALUES [U_DCB]) - .XXDAT + .DCB_ADDR);
1640		    PUTWRD (.KERNEL_FILE, .UCB_ADDR + .VALUES [U_RED],
1641			GETWRD (.KERNEL_FILE,
1642			    .UCB_ADDR + .VALUES [U_RED]) - .XXDAT + .DCB_ADDR);
1643		    LAST_SCB_ADDR = .SCB_ADDR;
1644		    SCB_ADDR = GETWRD (.KERNEL_FILE, .UCB_ADDR + .VALUES [U_SCB]) - .XXDAT + .DCB_ADDR;
1645		    PUTWRD (.KERNEL_FILE, .UCB_ADDR + .VALUES [U_SCB], .SCB_ADDR);
1646	
1647		    IF (.SCB_ADDR NEQ .LAST_SCB_ADDR)
1648		    THEN
1649			BEGIN
1650			PUTWRD (.KERNEL_FILE, .SCB_ADDR + .VALUES [S_LHD] + 2,
1651			    GETWRD (.KERNEL_FILE,
1652				.SCB_ADDR + .VALUES [S_LHD] + 2) - .XXDAT + .DCB_ADDR);
1653			PUTWRD (.KERNEL_FILE, .SCB_ADDR + .VALUES [S_FRK] + 8, .PAR_BASE/64);
1654	
1655			IF ((VECTOR = GETBYT (.KERNEL_FILE, .SCB_ADDR + .VALUES [S_VCT])^2) NEQ 0)
1656			THEN
1657			    BEGIN
1658			    OUTINT = -1;
1659	
1660			    IF ((INPINT = VRBL_SYM (.TASK_FILE, 2, UPLIT (%ASCIZ'$\\INT'), 1)) LEQ 0)
1661			    THEN
1662				BEGIN
1663				OUTINT = VRBL_SYM (.TASK_FILE, 2, UPLIT (%ASCIZ'$\\OUT'), 0);
1664				INPINT = VRBL_SYM (.TASK_FILE, 2, UPLIT (%ASCIZ'$\\INP'), 0);
1665				END;
1666	
1667			    IF (INPINT GTR 0)
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1668			    THEN
1669				BEGIN
1670				LOC = ALOCB (.KERNEL_FILE, 28, 0, .VALUES);
1671	!
1672	! INPUT INTERRUPT VECTOR SETUP
1673	!
1674				PUTWRD (.KERNEL_FILE, .VECTOR, .LOC);
1675				PUTWRD (.KERNEL_FILE, .VECTOR + 2, 7*32);
1676	!
1677	! NOW COMPILE INSTRUCTIONS, AS FOLLOWS:
1678	!
1679	!	JSR R5,$INTSV
1680	!	.WORD PRIORITY
1681	!	MOV @#KIASR5,-(SP)
1682	!	MOV #BIAS,@#KIASR5
1683	!	JSR PC,@#$??INP 	OR	JSR PC,@#$??INT
1684	!	MOV (SP)+,@#KIASR5
1685	!	RETURN
1686	!
1687				PUTWRD (.KERNEL_FILE, .LOC, %O'4537');
1688				PUTWRD (.KERNEL_FILE, .LOC + 2, SYM_VAL (.KERNEL_FILE, UPLIT (%ASCIZ'$INTSV'), 0));
1689				LOC = .LOC + 4;
1690				PUTWRD (.KERNEL_FILE, .LOC,
1691				    (GETBYT (.KERNEL_FILE, .SCB_ADDR + .VALUES [S_VCT] - 1) XOR %O'340'));
1692				LOC = .LOC + 2;
1693				PUTWRD (.KERNEL_FILE, .LOC, %O'13746');
1694				PUTWRD (.KERNEL_FILE, .LOC + 2, %O'172352');
1695				LOC = .LOC + 4;
1696				PUTWRD (.KERNEL_FILE, .LOC, %O'12737');
1697				PUTWRD (.KERNEL_FILE, .LOC + 2, GETWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_REL]));
1698				PUTWRD (.KERNEL_FILE, .LOC + 4, %O'172352');
1699				LOC = .LOC + 6;
1700				PUTWRD (.KERNEL_FILE, .LOC, %O'4737');
1701				PUTWRD (.KERNEL_FILE, .LOC + 2, .INPINT);
1702				LOC = .LOC + 4;
1703				PUTWRD (.KERNEL_FILE, .LOC, %O'12637');
1704				PUTWRD (.KERNEL_FILE, .LOC + 2, %O'172352');
1705				LOC = .LOC + 4;
1706				PUTWRD (.KERNEL_FILE, .LOC, %O'207');
1707				END;
1708	
1709			    IF (OUTINT GTR 0)
1710			    THEN
1711				BEGIN
1712				LOC = ALOCB (.KERNEL_FILE, 28, 0, .VALUES);
1713	!
1714	!  OUTPUT INTERRUPT VECTOR SETUP
1715	!
1716				PUTWRD (.KERNEL_FILE, .VECTOR + 4, .LOC);
1717				PUTWRD (.KERNEL_FILE, .VECTOR + 6, 7*32);
1718	!
1719	! NOW COMPILE INSTRUCTIONS, AS FOLLOWS:
1720	!
1721	!	JSR R5,@#$INTSV
1722	!	.WORD PRIORITY
1723	!	MOV @#KIASR5,-(SP)
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1724	!	MOV #BIAS,@#KIASR5
1725	!	JSR PC,@#$??OUT
1726	!	MOV (SP)+,@#KIASR5
1727	!	RETURN
1728	!
1729				PUTWRD (.KERNEL_FILE, .LOC, %O'4537');
1730				PUTWRD (.KERNEL_FILE, .LOC + 2, SYM_VAL (.KERNEL_FILE, UPLIT (%ASCIZ'$INTSV'), 0));
1731				LOC = .LOC + 4;
1732				PUTWRD (.KERNEL_FILE, .LOC,
1733				    (GETBYT (.KERNEL_FILE, .SCB_ADDR + .VALUES [S_VCT] - 1) XOR %O'340'));
1734				LOC = .LOC + 2;
1735				PUTWRD (.KERNEL_FILE, .LOC, %O'13746');
1736				PUTWRD (.KERNEL_FILE, .LOC + 2, %O'172352');
1737				LOC = .LOC + 4;
1738				PUTWRD (.KERNEL_FILE, .LOC, %O'12737');
1739				PUTWRD (.KERNEL_FILE, .LOC + 2, GETWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_REL]));
1740				PUTWRD (.KERNEL_FILE, .LOC + 4, %O'172352');
1741				LOC = .LOC + 6;
1742				PUTWRD (.KERNEL_FILE, .LOC, %O'4737');
1743				PUTWRD (.KERNEL_FILE, .LOC + 2, .OUTINT);
1744				LOC = .LOC + 4;
1745				PUTWRD (.KERNEL_FILE, .LOC, %O'12637');
1746				PUTWRD (.KERNEL_FILE, .LOC + 2, %O'172352');
1747				LOC = .LOC + 4;
1748				PUTWRD (.KERNEL_FILE, .LOC, %O'207');
1749				END;
1750	
1751			    IF ((.INPINT LEQ 0) AND (.OUTINT LEQ 0))
1752			    THEN
1753				ERRMSG (0, 40, ROUTINE_NAME,
1754				    UPLIT (%ASCIZ'Interrupt Setup'), UPLIT (%ASCIZ'for driver in file'),
1755				    TASK_FILE [FILE_NAME], 0);
1756	
1757			    END;
1758	
1759			END;
1760	
1761		    END;
1762	
1763		DCB_ADDR = GETWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_LNK]);
1764		END;
1765	
1766	!
1767	! STORE IN THE TCB POINTER FIELD OF THE PCB, A POINTER TO
1768	!  THE FIRST DCB.
1769	!
1770	    PUTWRD (.KERNEL_FILE, .PCB_ADDR + .VALUES [P_TCB], .FIRST_DCB_ADDR);
1771	!
1772	! COPY THE DRIVER CODE INTO THE PARTITION CREATED FOR IT
1773	!
1774	
1775	    INCR COUNTER FROM 0 TO .TASK_SIZE - 1 DO
1776		PUTBYT (.KERNEL_FILE, .PAR_BASE + .COUNTER, GETBYT (.TASK_FILE, .TASK_BASE + .COUNTER));
1777	
1778	!
1779	! LINK THE DCB INTO THE SYSTEM'S LIST OF DCBS
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1780	!
1781	    LNKDCB (.KERNEL_FILE, .FIRST_DCB_ADDR, .VALUES);
1782	    END;					!OF LOADD
1783	
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1784	GLOBAL ROUTINE LNKDCB (KERNEL_FILE, DCB_ADDR, VALUES) : NOVALUE = 	!LINK DCB INTO KERNEL
1785	
1786	!++
1787	! FUNCTIONAL DESCRIPTION:
1788	!
1789	!	LINK A DCB INTO THE KERNEL'S LIST OF DCBS.  IT IS PLACED
1790	!	 IN ALPHABETICAL ORDER.
1791	!
1792	! FORMAL PARAMETERS:
1793	!
1794	!	KERNEL_FILE - POINTER TO THE FILE BLOCK WHICH DESCRIBES THE
1795	!	 RSX-11S KERNEL
1796	!	DCB_ADDR - PDP-11 ADDRESS OF THE DCB TO BE LINKED
1797	!	VALUES - POINTER TO THE VALUES BLOCK
1798	!
1799	! IMPLICIT INPUTS:
1800	!
1801	!	NONE
1802	!
1803	! IMPLICIT OUTPUTS:
1804	!
1805	!	NONE
1806	!
1807	! ROUTINE VALUE:
1808	!
1809	!	NONE
1810	!
1811	! SIDE EFFECTS
1812	!
1813	!	MODIFIES THE KERNEL'S DATA STRUCTURES
1814	!
1815	!--
1816	
1817	    BEGIN
1818	
1819	    BIND
1820		ROUTINE_NAME = UPLIT (%ASCIZ'LNKDCB');
1821	
1822	    MAP
1823		KERNEL_FILE : REF FILE_BLOCK,
1824		VALUES : REF VNPVAL_BLOCK;
1825	
1826	    LOCAL
1827		PREV_DCB,
1828		NEXT_DCB,
1829		SEARCH_DONE;
1830	
1831	!
1832	! FIND THE TWO EXISTING DCBS WHICH THIS ONE MUST GO BETWEEN
1833	!
1834	    NEXT_DCB = GETWRD (.KERNEL_FILE, .VALUES [DEVHD]);
1835	    PREV_DCB = 0;
1836	    SEARCH_DONE = 0;
1837	
1838	    WHILE (.SEARCH_DONE EQL 0) DO
1839		BEGIN
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

1840	
1841		IF (.NEXT_DCB EQL 0)
1842		THEN
1843		    SEARCH_DONE = 1
1844		ELSE
1845		    BEGIN
1846	
1847		    IF (GETWRD (.KERNEL_FILE, .NEXT_DCB + .VALUES [D_NAM]) GTRU GETWRD (.KERNEL_FILE,
1848			    .DCB_ADDR + .VALUES [D_NAM]))
1849		    THEN
1850			SEARCH_DONE = 1
1851		    ELSE
1852			BEGIN
1853			PREV_DCB = .NEXT_DCB;
1854			NEXT_DCB = GETWRD (.KERNEL_FILE, .PREV_DCB + .VALUES [D_LNK]);
1855			END;
1856	
1857		    END;
1858	
1859		END;
1860	
1861	!
1862	! WE NOW HAVE THE TWO DCBS.  IF PREV_DCB IS ZERO THIS DCB IS TO BE FIRST
1863	!
1864	    PUTWRD (.KERNEL_FILE, .DCB_ADDR + .VALUES [D_LNK], .NEXT_DCB);
1865	
1866	    IF (.PREV_DCB EQL 0)
1867	    THEN
1868		PUTWRD (.KERNEL_FILE, .VALUES [DEVHD], .DCB_ADDR)
1869	    ELSE
1870		PUTWRD (.KERNEL_FILE,
1871		    .PREV_DCB + .VALUES [D_LNK], .DCB_ADDR);
1872	
1873	    END;					!OF LNKDCB
1874	
1875	END
1876	
1877	ELUDOM
1878	! Local Modes:
1879	! Comment Column:36
1880	! Comment Start:!
1881	! Mode:Fundamental
1882	! Auto Save Mode:2
1883	! End:
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

ADDRESS		1150	1151
ALOCB		  77	 515*	 926	1290	1295	1594	1670
		1712
AMOUNT		 515	 576	 586#	 639	 651	 710	 714#
		 748	 754	 761	 768	 789
ASCVAL		1264	1299	1366
ATOR50		 116*	 933	1299
BASE_ADDRESS	 170	 191#	 193	 204	 205	 268	 289#
		 291	 302	 303	 309	 372	 395#	 397
		 406	 407	 414	 464	 487#	 489	 497
		 498	 504	 510
BUSY_FLAGS	 818	 979
CEAVL		 591	1158
CEX_BASE	1067	1110#	1135	1140	1143	1150
CEX_FILE	1017	1058	1076	1117	1151
CEX_LABEL	1063	1076#	1110	1111
CEX_PCB_ADDR	1145
CEX_TOP		1068	1111#	1115	1117	1143	1150	1165
CORE_IMAGE	 165	 185#	 204	 263	 283#	 302	 368
		 389#	 406	 414#	 460	 481#	 497	 510#
CORE_LEN	 167	 186#	 193	 265	 284#	 291	 370
		 390#	 397	 462	 482#	 489
CORE_WORD	 168	 204#	 205	 266	 302#	 303	 309
		 371	 406#	 407#	 414	 463	 497#	 498#
		 504#	 510
COUNTER		 935	 936	1188	1190	1193	1357	1358
		1365	1366	1382	1383	1424	1425	1455
		1456	1599	1600	1634	1636	1775	1776
CRAVL		 590	 715	1123	1128	1140
DCB_ADDR	1558	1614#	1616	1618	1622	1623	1624
		1628	1629	1630	1632	1639	1642	1644
		1652	1763#	1784	1848	1864	1868	1871
DEACB		  78	 651*	1139
DEVHD		1390	1834	1868
DYNAMIC_PAR	 874	 912#	 915#	 919#	 972	 997
D_DSP		1630
D_LNK		1403	1763	1854	1864	1871
D_NAM		1395	1847	1848
D_PCB		1632
D_UCBL		1624
D_UCB		1398	1628	1629
D_UNIT		1622	1623
ERRMSG		 122	 196	 294	 399	 491	 639	 748
		 754	 761	 768	 789#	1090	1095	1104
		1117	1753
ERROR		 121	1343	1411	1483
EXSIZ		 757	1134	1135
FE_CEX		1093	1199
FE_EXT		1088
FE_EXV		1113
FE_PLA		 984	1102
FILE_BLOCK	 162	 260	 365	 457	 558	 690	 865
		1057	1058	1248	1249	1543	1544	1823
FILE_CORE	 185	 283	 389	 481
FILE_CORE_LEN	 186	 284	 390	 482
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

FILE_HWM	 898	1348	1349	1606
FILE_LABEL	 187	 285	 391	 483	1076	1077	1282
		1583
FILE_NAME	 196	 294	 400	 491	 639	 748	 754
		 761	 768	 789	1090	1095	1104	1117
		1276	1348	1577	1755
FILE_PTR	 126	 162	 185	 186	 187	 196	 224
		 260	 283	 284	 285	 294	 327	 365
		 389	 390	 391	 400	 419	 457	 481
		 482	 483	 491	 515	 558	 593	 594
		 604	 611	 618	 622	 639	 651	 690
		 716	 729	 742	 748	 754	 757	 761
		 768	 774	 776	 777	 782	 784	 789
		 796	 797	 799	 803
FIRST_DCB_ADDR	1556	1594#	1600	1614	1770	1781
FIRST_UCB_ADDR	1561	1628#	1629	1636
FLAGS		 871	 904#	 984	1066	1082#	1088	1093
		1102	1113	1199#	1200
FMASK		 904	1082	1200
GEN_PCB		1500	1607
GETBYT		  73	 126*	1151	1190	1425	1456	1467
		1600	1622	1655	1691	1733	1776
GETWRD		  74	 224*	 593#	 594	 604	 611	 622
		 716#	 729	 757	 774#	 777#	 784	 796
		 797#	 904	 917	 948	1005	1082	1123
		1124	1134	1140	1161	1294	1324	1331
		1390	1395	1398	1403	1431	1433	1434
		1444	1461	1475	1624	1628	1638	1641
		1644	1651	1697	1739	1763	1834	1847
		1854
HDR_ADDR	1255	1295#	1425	1430	1431	1432	1433
		1434	1435	1440
HDR_SIZE	1256	1294#	1295	1424
HIGH_EXEC_ADDR	 870	1065	1113#	1115	1118
H_GARD		1432	1433
H_HDLN		1294
H_LUN		1435
H_NLUN		1434
H_WND		1430	1431
INPINT		1566	1660#	1664#	1667	1701	1751
INSTAL		  81	1204*
KERNEL_FILE	 818	 865	 898#	 904	 917	 926	 930
		 931	 932	 936	 938	 948	 951	 956
		 958	 961	 967	 970	 974	 977	 979
		 980	 981	 982	 987	 988	 989	1005
		1008	1017	1057	1077	1082	1090	1095
		1104	1123	1124	1125	1128	1129	1130
		1134	1135	1139	1140	1143	1151	1161
		1170	1171	1175	1176	1179	1182	1190
		1192	1200	1204	1248	1290	1295	1324
		1331	1348	1349	1358	1363	1366	1368
		1369	1370	1371	1372	1376	1383	1390
		1395	1398	1403	1416	1417	1418	1425
		1430	1431	1432	1433	1434	1435	1439
		1440	1444	1456	1461	1467	1475	1492
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

		1494	1497	1500	1543	1594	1600	1606
		1607	1622	1624	1628	1629	1630	1632
		1637	1638	1640	1641	1644	1645	1650
		1651	1653	1655	1670	1674	1675	1687
		1688	1690	1691	1693	1694	1696	1697
		1698	1700	1701	1703	1704	1706	1712
		1716	1717	1729	1730	1732	1733	1735
		1736	1738	1739	1740	1742	1743	1745
		1746	1748	1763	1770	1776	1781	1784
		1823	1834	1847	1854	1864	1868	1870
KERNEL_LABEL	1064	1077#
L$BFLG		1286	1587
L$BHGV		1111	1284	1585
L$BPRI		1300
L$BSA		 191	 289	 395	 487	1110	1283	1584
LABEL_IMAGE	 166	 187#	 191	 264	 285#	 289	 369
		 391#	 395	 461	 483#	 487
LAST_DCB_ADDR	1557	1618#
LAST_SCB_ADDR	1559	1643#	1647
LNKDCB		  83#	1781	1784*
LOADD		  82	1500*
LOC		1569	1670#	1674	1687	1688	1689#	1690
		1692#	1693	1694	1695#	1696	1697	1698
		1699#	1700	1701	1702#	1703	1704	1705#
		1706	1712#	1716	1729	1730	1731#	1732
		1734#	1735	1736	1737#	1738	1739	1740
		1741#	1742	1743	1744#	1745	1746	1747#
		1748
LOCN		 126	 179	 193	 196	 204	 205	 224
		 277	 291	 294	 302	 303	 309	 327
		 381	 397	 400	 406	 407	 414	 419
		 473	 489	 491	 497	 498	 504	 510
		 651	 708	 713#	 748	 754	 761	 768
		 789
MCEX		  80	1017*
MIN_PCB_LEN	 819	 926
M_PCB		  79	 818*	1143	1348	1607
NEXT_DCB	1828	1834#	1841	1847	1853	1854#	1864
NLUN		1267	1434#	1435
NODID		1190	1193
NUNITS		1570	1622#	1634
OUTINT		1567	1658#	1663#	1709	1743	1751
OUTNUM		 120	 179	 218	 277	 321	 381	 383
		 473	 475	 576	 578	 645	 708	 710#
		 884	 886	1450	1452
OUTPUT		 117	 176	 177	 274	 275	 378	 379
		 470	 471	 574	 706
OUTSTR		 119	 178	 217	 276	 320	 380	 382
		 472	 474	 575	 577	 644	 707	 709
		 881	 882	 883	 885	1275	1276	1449
		1451	1576	1577
PARHD		1000	1319
PARTITION_BASE	1266	1444#	1450	1452	1456
PAR_BASE	 818	 884	 960	 966	1549	1606#	1607
		1608	1653	1776
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

PAR_MAIN	 818	 910	 917	 940	 943	 954	 958
PAR_NAME	 818	 882	 933
PAR_TOP		 818	 886	 898	 963	 966
PCB_ADDR	 869	 926#	 930	 931	 932	 936	 938
		 951	 956	 958	 961	 967	 970	 974
		 975	 977	 979	 980	 981	 982	 987
		 988	 989	1008	1014	1062	1143#	1145
		1254	1313#	1348#	1417	1435	1439	1440
		1444	1548	1607#	1632	1697	1739	1770
PCB_ARG		1204	1311	1313
PCB_BASE	1555
PCOR0		   9#
PCRLF		 118	 175	 273	 377	 469	 573	 705
		 880	1274	1575
PLACE		 567	 582#	 584	 588	 635#
POOL		 752
PREV_DCB	1827	1835#	1853#	1854	1866	1871
PRIORITY	1268	1300#	1305#	1363	1376	1469
PS_COM		1144
PS_DRV		1608
PS_SYS		 917	1333	1349	1608
PUTBYT		  75	 327*	 931	 932	 936	1151	1192
		1358	1363	1366	1376	1383	1425	1456
		1600	1776
PUTWRD		  76	 419*	 618#	 622	 742	 776	 782#
		 799#	 803	 930	 938	 951	 956	 958
		 961	 967	 970	 974	 977	 979	 980
		 981	 982	 987	 988	 989	1008	1125
		1128	1129	1130	1135	1170	1171	1175
		1176	1179	1182	1200	1368	1369	1370
		1371	1372	1416	1417	1418	1430	1432
		1435	1439	1440	1492	1494	1497	1629
		1630	1632	1637	1640	1645	1650	1653
		1674	1675	1687	1688	1690	1693	1694
		1696	1697	1698	1700	1701	1703	1704
		1706	1716	1717	1729	1730	1732	1735
		1736	1738	1739	1740	1742	1743	1745
		1746	1748	1770	1864	1868	1870
P_ATT		 988	 989
P_BUSY		 979
P_HDR		 982	1440
P_IOC		 932
P_LGTH		 926
P_LNK		 930	1005	1008	1337
P_MAIN		 956	 958
P_NAM		 936
P_PRI		 931
P_PRO		 987
P_REL		 961	1444	1697	1739
P_SIZE		 967
P_STAT		 917	 981	1331
P_SUB		 938	 948	 951
P_TCB		 980	1439	1770
P_WAIT		 970	 974	 975	 977
R50VAL		 875	 933	 936	1074
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

RESULT		 169	 197#	 205#	 218	 221	 267	 295#
		 303#	 321	 324	 568	 581#	 584	 635#
		 639	 645	 648
ROUTINE_NAME	 159#	 196	 257#	 294	 362#	 400	 454#
		 491	 555#	 639	 687#	 748	 754	 761
		 768	 789	 862#	1054#	1090	1095	1104
		1117	1245#	1540#	1753	1820#
SAVE		 698	 743#	 744#	 746	 759	 765	 772
		 781#	 785#	 787	 793
SCAN_DONE	 565	 599#	 601	 608#	 624#	 633#	 635
		 699	 724#	 726	 733#	 738#
SCB_ADDR	1560	1613#	1643	1644#	1645	1647	1650
		1652	1653	1655	1691	1733
SEARCH_DONE	1269	1320#	1322	1328#	1335#	1343	1389#
		1392	1399#	1405#	1411	1463#	1465	1471#
		1477#	1483	1829	1836#	1838	1843#	1850#
STAT_FLAGS	 818	 981
SYM_VAL		 124	1688	1730
S_FRK		1653
S_LHD		1650	1652
S_VCT		1655	1691	1733
T2_CHK		1371
T2_FXD		1371
T3_ACP		1374
T3_NSD		1375
T3_PMD		1372
T3_PRV		1373
TASK_BASE	1261	1283#	1285	1294	1425	1456	1551
		1584#	1586	1776
TASK_FILE	1204	1249	1276	1282	1294	1348	1425
		1456	1500	1544	1577	1583	1592	1593
		1600	1631	1660	1663	1664	1755	1776
TASK_FLAGS	1265	1286#	1373	1374	1375	1554	1587#
TASK_LABEL	1257	1282#	1283	1284	1286	1300	1550
		1583#	1584	1585	1587
TASK_NAME	1204	1299	1500
TASK_SIZE	1263	1285#	1349	1418	1452	1455	1553
		1586#	1608	1775
TASK_TOP	1262	1284#	1285	1552	1585#	1586
TCB_ADDR	1253	1290#	1358	1363	1366	1368	1369
		1370	1371	1372	1376	1383	1416	1417
		1418	1439	1492	1495	1497
TEMP		 566	 611#	 613	 616	 618	 619	 700
		 716#	 717#	 718	 757#	 759	 774#	 776
		 777#	 778	 784#	 785	 797#	 799
TEMP1		 872	 943#	 945	 947	 948#	 960#	 961
		 966#	 967	1000#	1002	1004	1005#	1069
		1123#	1124	1125	1126	1127	1134#	1139
		1140	1158#	1159	1161	1164#	1170	1171
		1175	1176	1178#	1179	1182	1258	1319#
		1324	1337#	1390#	1395	1398#	1403#	1405
		1416	1461#	1467	1474	1475#	1477	1497
TEMP2		 873	 947#	 948	 951	1004#	1005	1008
		1070	1124#	1127#	1130	1160#	1162#	1163#
		1165	1175	1177#	1178	1259	1324#	1326
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

		1331	1337	1348	1467#	1469
TEMP3		1071	1126#	1127	1128	1129	1130	1165#
		1167	1182	1260	1331#	1333	1462#	1474#
		1490	1495
TEMP4		1072	1159#	1160	1177
TEMP5		1073	1161#	1162	1163
TS$ACP		1374	1375
TS$NSD		1375
TS$PRV		1373
TSKHD		1461	1492
TS_EXE		1370
T_ASTL		1369
T_DPRI		1376
T_LBN		1383
T_LDV		1416
T_LGTH		1290	1357
T_MXSZ		1418
T_NAM		1366
T_PCB		1417
T_PRI		1363	1467
T_RCVL		1368
T_ST2		1371
T_ST3		1372
T_STAT		1370
T_TCBL		1475	1495	1497
UCB_ADDR	1562	1636#	1637	1639	1640	1642	1644
		1645
UCB_LENGTH	1563	1624#	1636
U_DCB		1637	1639
U_RED		1640	1642
U_SCB		1644	1645
VAL		 327	 383	 413	 419	 475	 503	 509
VALUES		 515	 559	 590	 591	 651	 691	 715
		 752	 757	 819	 866	 904	 917	 926
		 930	 931	 932	 936	 938	 948	 951
		 956	 958	 961	 967	 970	 974	 975
		 977	 979	 980	 981	 982	 984	 987
		 988	 989	1000	1005	1008	1017	1059
		1082	1088	1093	1102	1113	1123	1128
		1134	1135	1140	1144	1145#	1158	1190
		1193	1199	1200	1204	1250	1290	1294
		1295	1319	1331	1333	1337	1349	1357
		1363	1366	1368	1369	1370	1371	1372
		1373	1374	1375	1376	1383	1390	1395
		1398	1403	1416	1417	1418	1430	1431
		1432	1433	1434	1435	1439	1440	1444
		1461	1467	1475	1492	1495	1497	1500
		1545	1594	1608	1609	1622	1623	1624
		1628	1629	1630	1632	1637	1639	1640
		1642	1644	1645	1650	1652	1653	1655
		1670	1691	1697	1712	1733	1739	1763
		1770	1781	1784	1824	1834	1847	1848
		1854	1864	1868	1871
VNPVAL_BLOCK	 559	 691	 866	1059	1250	1545	1824
VRBL_SYM	 123	1592	1593	1631	1660	1663	1664
		DSK:PCOR0.XRF[4,31]              31-Aug-79 14:50

WHERE		 515	 578	 582#
XXDAT		1565	1593#	1594	1599	1600	1608	1628
		1639	1642	1644	1652
XXEND		1564	1592#	1594	1599	1608