MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2





      1						.TITLE	MULSG                                                           ;**NEW**

      2						.IDENT	/08/

      3					                                                                                ;**NEW**

      4					;                                                                               ;**NEW**

      5					; COPYRIGHT   1976,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.

      6					;                                                                               ;**NEW**

      7					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE               ;**NEW**

      8					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION                ;**NEW**

      9					; OF DEC'S COPYRIGHT NOTICE) ONLY FOR USE IN SUCH SYSTEM, EXCEPT                ;**NEW**

     10					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.                               ;**NEW**

     11					;                                                                               ;**NEW**

     12					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT                ;**NEW**

     13					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL                ;**NEW**

     14					; EQUIPMENT CORPORATION.                                                        ;**NEW**

     15					;                                                                               ;**NEW**

     16					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY                ;**NEW**

     17					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.                 ;**NEW**

     18					;                                                                               ;**NEW**

     19					; VERSION 08

     20					;                                                                               ;**NEW**

     21					; D. N. CUTLER/C. MONIA 12-DEC-73                                               ;**NEW**

     22					;                                                                               ;**NEW**

     23					; MODIFICATIONS:                                                                ;**NEW**

     24					;                                                                               ;**NEW**

     25					; NO.		DATE		PROGRAMMER                                      ;**NEW**

     26					; ---		----		----------                                      ;**NEW**

     27					;                                                                               ;**NEW**

     28					; 021		11-JAN-74	C. MONIA                                        ;**NEW**

     29					; 043		21-OCT-75	C. MONIA

     30					; 052		22-MAR-76	C. MONIA

     31					;                                                                               ;**NEW**

     32					; GENERATE SEGMENT DESCRIPTORS FOR MULTI-SEGMENT TASK                           ;**NEW**

     33					;                                                                               ;**NEW**

     34					; EQUATED SYMBOLS                                                               ;**NEW**

     35					;

     36					; RESIDENCY FLAG

     37					;

     38

     39		000200 			RS$FLG==200			;

     40

     41					;                                                                               ;**NEW**

     42					; PARSED DIRECTIVE OFFSET DEFINITIONS                                           ;**NEW**

     43					;                                                                               ;**NEW**

     44					                                                                                ;**NEW**

     45		000002 			T$YP==2				; OFFSET-TYPE OF ENTRY                          ;**NEW**

     46		000004 			L$AB==4				; OFFSET-LABEL OF ENTRY                         ;**NEW**

     47		000010 			N$XT==10			; OFFSET-NEXT BYTE ADDRESS                      ;**NEW**

     48		000010 			F$LG==N$XT			; OFFSET-CONTROL SECTION FLAGS                  ;**NEW**

     49					                                                                                ;**NEW**

     50					;                                                                               ;**NEW**

     51					; ITEM TYPES                                                                    ;**NEW**

     52					;                                                                               ;**NEW**

     53					                                                                                ;**NEW**

     54

     55	000000					.DSECT

     56

     57	000000				S$OS::	.BLKW	1		; START OF STRING

MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2-1





     58	000002				E$OS::	.BLKW	1		; END OF STRING

     59	000004				L$PAR::	.BLKW	1		; LEFT PARENTHESES

     60	000006				R$PAR::	.BLKW	1		; RIGHT PARENTHESES

     61	000010				C$OMA::	.BLKW	1		; COMMA

     62	000012				D$ASH::	.BLKW	1		; DASH (MINUS SIGN)

     63	000014				S$TAR::	.BLKW	1		; ASTERISK

     64	000016				E$XCL::	.BLKW	1		; EXCLAMATION POINT

     65

     66					;

     67					; ALL OPERATOR ASSIGNMENTS MUST FOLLOW SECTION NAME

     68					;

     69

     70	000020				S$CTN::	.BLKW	1		; SECTION NAME

     71	000022				S$EGN::	.BLKW	1		; SEGMENT NAME

     72	000024				F$ILE::	.BLKW	1		; FILE

     73

     74					                                                                                ;**NEW**

     75					;                                                                               ;**NEW**

     76					; NUMBER OF NESTED PARENTHESIS LEVELS ALLOWED                                   ;**NEW**

     77					;                                                                               ;**NEW**

     78					                                                                                ;**NEW**

     79		000040 			N$PLVL==32.			;                                               ;**NEW**

     80					                                                                                ;**NEW**

     81					;                                                                               ;**NEW**

     82					; NUMBER OF SEGMENT DESCRIPTION NAME LEVELS ALLOWED                             ;**NEW**

     83					;                                                                               ;**NEW**

     84					                                                                                ;**NEW**

     85		000040 			N$SLVL==32.			;                                               ;**NEW**

     86					                                                                                ;**NEW**

     87					;                                                                               ;**NEW**

     88					; LOCAL MACROS                                                                  ;**NEW**

     89					;                                                                               ;**NEW**

     90					; GENERATE LEGAL CONSTRUCTION MACTRIX                                           ;**NEW**

     91					;                                                                               ;**NEW**

     92					; GCON TYPE,^/A/                                                                ;**NEW**

     93					;                                                                               ;**NEW**

     94					; WHERE:                                                                        ;**NEW**

     95					;                                                                               ;**NEW**

     96					;	TYPE=ITEM TYPE                                                          ;**NEW**

     97					;                                                                               ;**NEW**

     98					;	A=LEGAL PRECEDING ITEM TYPES                                            ;**NEW**

     99					;                                                                               ;**NEW**

    100					                                                                                ;**NEW**

    101						.MACRO	GCON	TYPE,A                                                  ;**NEW**

    102						.PSECT	CMAT.D,D,GBL                                                    ;**NEW**

    103					.=$CBAS+TYPE                                                                    ;**NEW**

    104					MASK=0                                                                          ;**NEW**

    105						.IF	NB, <A>                                                         ;**NEW**

    106						.IRP	X,<A>                                                           ;**NEW**

    107					N=1                                                                             ;**NEW**

    108						.REPT	X/2                                                             ;**NEW**

    109					N=N*2                                                                           ;**NEW**

    110						.ENDR                                                                   ;**NEW**

    111					MASK=MASK!N                                                                     ;**NEW**

    112						.ENDM                                                                   ;**NEW**

    113						.ENDC                                                                   ;**NEW**

    114						.WORD	MASK                                                            ;**NEW**

MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2-2





    115						.PSECT                                                                  ;**NEW**

    116						.ENDM                                                                   ;**NEW**

    117					                                                                                ;**NEW**

    118					;                                                                               ;**NEW**

    119					; LOCAL DATA                                                                    ;**NEW**

    120					;                                                                               ;**NEW**

    121

    122	000000					.PSECT

    123

    124					;

    125					; AUTOLOAD LEVEL COUNT                                                          ;**NEW**

    126					;                                                                               ;**NEW**

    127					                                                                                ;**NEW**

    128	000000				$ALVL::	.BLKW	1		;                                               ;**NEW**

    129					                                                                                ;**NEW**

    130					;                                                                               ;**NEW**

    131					; AUTOLOAD REQUIRED FLAG                                                        ;**NEW**

    132					;                                                                               ;**NEW**

    133					                                                                                ;**NEW**

    134	000002				$AFLG::	.BLKW	1		;                                               ;**NEW**

    135					                                                                                ;**NEW**

    136					;                                                                               ;**NEW**

    137					; LEGAL CONSTRUCTION MATRIX                                                     ;**NEW**

    138					;                                                                               ;**NEW**

    139					; THE MATRIX IS AN N-WORD BY N-BIT ARRAY . WHERE N =ITEM TYPE/2.                ;**NEW**

    140					; THE ARRAY IS USED IN 'MLSG1' TO VERIFY THAT EACH LINE OF ODL INPUT IS         ;**NEW**

    141					; OF THE PROPER SYNTAX.                                                         ;**NEW**

    142					;                                                                               ;**NEW**

    143					                                                                                ;**NEW**

    144	000000					.PSECT	CMAT.D,D,GBL                                                    ;**NEW**

    145	000000				$CBAS::				; REF LABEL                                     ;**NEW**

    146	000000					GCON	S$OS                                                            ;**NEW**

    147	000004					GCON	E$OS,^/R$PAR,S$CTN,S$EGN,F$ILE/                                 ;**NEW**

    148	000004					GCON	L$PAR,^/L$PAR,C$OMA,D$ASH,S$TAR,E$XCL/

    149	000004					GCON	R$PAR,^/R$PAR,S$CTN,S$EGN,F$ILE/                                ;**NEW**

    150	000004					GCON	C$OMA,^/R$PAR,S$CTN,S$EGN,F$ILE/                                ;**NEW**

    151	000004					GCON	D$ASH,^/S$CTN,S$EGN,F$ILE/                                      ;**NEW**

    152	000004					GCON	S$TAR,^/S$OS,L$PAR,C$OMA,D$ASH/                                 ;**NEW**

    153	000004					GCON	E$XCL,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/

    154	000004					GCON	S$CTN,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**

    155	000004					GCON	S$EGN,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**

    156	000004					GCON	F$ILE,^/S$OS,L$PAR,C$OMA,D$ASH,S$TAR/                           ;**NEW**

    157					                                                                                ;**NEW**

    158					;                                                                               ;**NEW**

    159					; PARSED DIRECTIVE LISTHEAD                                                     ;**NEW**

    160					;                                                                               ;**NEW**

    161					                                                                                ;**NEW**

    162	000004				$DIRHD::.BLKW	2		;                                               ;**NEW**

    163					                                                                                ;**NEW**

    164					;                                                                               ;**NEW**

    165					; SEGMENT DESCRIPTION STACK                                                     ;**NEW**

    166					;                                                                               ;**NEW**

    167					; EACH ENTRY IN THIS STACK IS A LISTHEAD CONSISTING OF TWO WORDS.               ;**NEW**

    168					; THE LISTHEADS ARE USED TO COLLECT THE SEGMENT DESCRIPTION FOR                 ;**NEW**

    169					; EACH PARENTHESIS LEVEL.                                                       ;**NEW**

    170					;                                                                               ;**NEW**

    171					                                                                                ;**NEW**

MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2-3





    172	000010				$DSTK::	.BLKW	N$PLVL*2                                                        ;**NEW**

    173					                                                                                ;**NEW**

    174

    175					;

    176					; EXCLAMATION POINT (RESIDENCY OPERATOR)

    177					;

    178

    179	000210	000000 			$EXCL::	.WORD	0		;

    180	000212	   016 	   000 			.BYTE	E$XCL,0		;

    181

    182					;                                                                               ;**NEW**

    183					; LAST ITEM OPERATOR ENTRY                                                      ;**NEW**

    184					;                                                                               ;**NEW**

    185					                                                                                ;**NEW**

    186	000214	000000 			$EOSOP::.WORD	0		; LINK TO NEXT IS ALWAYS ZERO                   ;**NEW**

    187	000216	   002 	   000 			.BYTE	E$OS,0		;                                               ;**NEW**

    188					                                                                                ;**NEW**

    189					;                                                                               ;**NEW**

    190					; SOS OPERATOR ENTRY                                                            ;**NEW**

    191					;                                                                               ;**NEW**

    192					                                                                                ;**NEW**

    193	000220				$SOSOP::.BLKW	1		;                                               ;**NEW**

    194	000222	   000 	   000 			.BYTE	S$OS,0		;                                               ;**NEW**

    195

    196					;

    197					; ASTERISK OPERATOR ENTRY

    198					;

    199

    200	000224	000000 			$STAR::	.WORD	0		;

    201	000226	   014 	   000 			.BYTE	S$TAR,0		;

    202

    203					                                                                                ;**NEW**

    204					;                                                                               ;**NEW**

    205					; ROOT SEGMENT PARSED DIRECTIVE POINTER.                                        ;**NEW**

    206					;                                                                               ;**NEW**

    207					                                                                                ;**NEW**

    208	000230				$RTDIR::.BLKW	1		;                                               ;**NEW**

    209					                                                                                ;**NEW**

    210					;                                                                               ;**NEW**

    211					                                                                                ;**NEW**

    212					                                                                                ;**NEW**

    213					                                                                                ;**NEW**

    214					;                                                                               ;**NEW**

    215					; TEXT POINTER STACK                                                            ;**NEW**

    216					;                                                                               ;**NEW**

    217					                                                                                ;**NEW**

    218	000232					.BLKW	N$SLVL*2	;                                               ;**NEW**

    219	000432				$TSTK::				; REF LABEL                                     ;**NEW**

    220					                                                                                ;**NEW**

    221					;                                                                               ;**NEW**

    222					;+                                                                              ;**NEW**

    223					; **-$MULSG-CREATE MULTISEGMENT DESCRIPTION                                     ;**NEW**

    224					;                                                                               ;**NEW**

    225					; INPUTS:                                                                       ;**NEW**

    226					;                                                                               ;**NEW**

    227					;	THE ODL FILE.                                                           ;**NEW**

    228					;                                                                               ;**NEW**

MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2-4





    229					; OUTPUTS:                                                                      ;**NEW**

    230					;                                                                               ;**NEW**

    231					;	THE SEGMMENT TABLES AND ELEMENT LISTS DESCRIBING                        ;**NEW**

    232					; A MULTI-SEGMENT TASK ARE BUILT IN DYNAMIC STORAGE.                            ;**NEW**

    233					;                                                                               ;**NEW**

    234					;	CREATION OF THE SEGMENT TABLES FROM THE ODL INPUT                       ;**NEW**

    235					; IS A THREE STEP PROCESS. IN STEP 1 THE ODL FILE IS READ                       ;**NEW**

    236					; ONE LINE AT A TIME AND RETAINED IN DYNAMIC STORAGE AFTER                      ;**NEW**

    237					; VERIFYING CORRECT LINE FORMAT. IN STEP TWO THE ENTIRE                         ;**NEW**

    238					; ODL IS PARSED INCLUDING A 'PARSE/FIND' ON EACH INPUT FILE.                    ;**NEW**

    239					; CONSTRUCTION OF THE SEGMENT TABLES AND ELEMENT DESCRIPTORS                    ;**NEW**

    240					; IS DONE IN PHASE THREE.                                                       ;**NEW**

    241					;                                                                               ;**NEW**

    242					;	THE ODL ROUTINES CONSIST OF THE FOLLOWING PRINCIPLE                     ;**NEW**

    243					; MODULES:                                                                      ;**NEW**

    244					;                                                                               ;**NEW**

    245					;	MULSG:	TOP LEVEL CALLS, COMMON DATA AND SUBROUTINES                    ;**NEW**

    246					;	MLSG0:	READ THE ODL AND VERFIFY LINE FORMAT                            ;**NEW**

    247					;	MLSG1:	PARSE THE SEGMENT DESCRIPTION                                   ;**NEW**

    248					;	MLSG2:	CREATE THE SEGMENT TABLES                                       ;**NEW**

    249					;                                                                               ;**NEW**

    250					;-                                                                              ;**NEW**

    251					;                                                                               ;**NEW**

    252					                                                                                ;**NEW**

    253	000432				$MULSG::			;                                               ;**NEW**

    254	000432					SAVRG			; SAVE NON-VOLATILE REGISTERS                   ;**NEW**

    255	000436					CALL	$MLSG0		; READ ODL FILE, BUILD PARSED SEGMENT DESCRIPTOR;**NEW**

    256	000442					CALL	$MLSG1		; PARSE SEGMENT DESCRIPTION                     ;**NEW**

    257	000446					CALLR	$MLSG2		; GENERATE SEGMENT TABLES, EXIT                 ;**NEW**

    258					                                                                                ;**NEW**

    259					;                                                                               ;**NEW**

    260					; COMMON SUBROUTINE TO SCAN PARSED DIRECTIVE LIST FOR A MATCH                   ;**NEW**

    261					;                                                                               ;**NEW**

    262					; THE PARSED DIRECTIVE LIST POINTED TO BY '$DIRHD' IS SCANNED FOR               ;**NEW**

    263					; A LABEL MATCH.                                                                ;**NEW**

    264					;                                                                               ;**NEW**

    265					;                                                                               ;**NEW**

    266					; INPUTS:                                                                       ;**NEW**

    267					;                                                                               ;**NEW**

    268					;	R5: POINTS TO TWO-WORD RADIX 50 NAME                                    ;**NEW**

    269					;                                                                               ;**NEW**

    270					; OUTPUTS:                                                                      ;**NEW**

    271					;                                                                               ;**NEW**

    272					;	C-SET: MATCHING LABEL NOT FOUND                                         ;**NEW**

    273					;	C-CLEAR: MATCHING LABEL FOUND                                           ;**NEW**

    274					;                                                                               ;**NEW**

    275					                                                                                ;**NEW**

    276	000452				$SCNL::				;                                               ;**NEW**

    277	000452	012701 	000004'			MOV	#$DIRHD,R1	; GET ADDRESS OF LISTHEAD                       ;**NEW**

    278	000456	011101 			10$:	MOV	(R1),R1		;GET ADDRESS OF NEXT ENTRY                      ;**-1120

    279	000460	000261 				SEC			;ASSUME NO MORE

    280	000462	001407 				BEQ	20$		;IF EQ YES DONE

    281	000464	021561 	000004 			CMP	(R5),L$AB(R1)	; FIRST HALF MATCH?                             ;**NEW**

    282	000470	001372 				BNE	10$		;IF NE NO                                       ;**-1

    283	000472	026561 	000002 	000006 		CMP	2(R5),L$AB+2(R1) ; SECOND HALF MATCH?                           ;**NEW**

    284	000500	001366 				BNE	10$		;IF NE NO                                       ;**-1

    285	000502				20$:	RETURN			;

MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2-5





    286					                                                                                ;**-4

    287		000001 				.END

MULSG                          	MACRO M1110  22-AUG-78 01:49  PAGE 2-6

SYMBOL TABLE



CR    = 000015   	LF    = 000012   	R$PAR   000006 G 	$AFLG   000002RG 	$MLSG2= ****** GX

C$OMA   000010 G 	L$AB  = 000004 G 	R$$11M= 000000   	$ALVL   000000RG 	$MULSG  000432RG

D$ASH   000012 G 	L$PAR   000004 G 	SPA   = 000040   	$CBAS   000000RG    002	$RTDIR  000230RG

E$OS    000002 G 	MASK  = 000165   	S$CTN   000020 G 	$DIRHD  000004RG 	$SAVRG= ****** GX

E$XCL   000016 G 	N     = 000100   	S$EGN   000022 G 	$DSTK   000010RG 	$SCNL   000452RG

FF    = 000014   	N$PLVL= 000040 G 	S$OS    000000 G 	$EOSOP  000214RG 	$SOSOP  000220RG

F$ILE   000024 G 	N$SLVL= 000040 G 	S$TAR   000014 G 	$EXCL   000210RG 	$STAR   000224RG

F$LG  = 000010 G 	N$XT  = 000010 G 	T$YP  = 000002 G 	$MLSG0= ****** GX	$TSTK   000432RG

HT    = 000011   	RS$FLG= 000200 G 	VT    = 000013   	$MLSG1= ****** GX	$$    = 000001



. ABS.	000026	   000

      	000504	   001

CMAT.D	000026	   002

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  1756 WORDS  ( 7 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:22

OBJ$:MULSG,LIS$:MULSG/-SP=SRC$:MACFLM,MULSG

