MACFLM	MACRO M1110  22-AUG-78 01:38  PAGE 2





      1		000000 			A$$DRM=0

MACFLM	MACRO M1110  22-AUG-78 01:38  PAGE 3





						.IF	DF	A$$DRM

      2

      3						.TITLE	ADRSM

      4

      5

      6						.IFF

      7

      8						.TITLE	ADRST

      9

     10						.ENDC

     11

     12

     13						.IDENT	/09/

     14					                                                                                ;**-1

     15					;

     16					; COPYRIGHT   1973,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.

     17					; COPYRIGHT   1974,  DIGITAL  EQUIPMENT  CORP.,  MAYNARD,   MASS.

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

     19					; COPYRIGHT (C) 1977

     20					;

     21					; THIS SOFTWARE IS FURNISHED TO PURCHASER UNDER A LICENSE FOR USE

     22					; ON A  SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH INCLUSION

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

     24					; AS MAY OTHERWISE BE PROVIDED IN WRITING BY DEC.

     25					;

     26					; THE  INFORMATION IN THIS DOCUMENT IS SUBJECT TO CHANGE WITHOUT

     27					; NOTICE AND  SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL

     28					; EQUIPMENT CORPORATION.

     29					;

     30					; DEC  ASSUMES NO  RESPONSIBILITY  FOR  THE  USE  OR RELIABILITY

     31					; OF ITS  SOFTWARE ON  EQUIPMENT WHICH  IS NOT SUPPLIED BY DEC.

     32					; VERSION 09

     33					; VERSION 08

     34					;                                                                               ;**-1

     35					; D. N. CUTLER/C. MONIA 27-JAN-74

     36					;

     37					; MODIFICATIONS

     38					;

     39					; NO.		DATE		PROGRAMMER

     40					; ---		----		----------

     41					;

     42					; 021		11-JAN-74	C. MONIA

     43					; 048		12-FEB-76	C. MONIA

     44					; 052		02-APR-76	C. MONIA

     45					; JAK100	15-FEB-77	CHANGES FOR MULTIUSER TASKS

     46					;

     47					;+

     48					; **-$ADRSM-ADDRESS LIMITS SETUP

     49					; **-$ADRST-ADDRESS LIMITS SETUP AND TASK IMAGE BUFFER FLUSHED

     50					;

     51					; THIS ROUTINE IS CALLED TO SET UP THE ADDRESS LIMITS FOR A SEGMENT.

     52					; IF THE SPECIFIED SEGMENT IS THE SAME AS THE CURRENT SEGMENT THAT IS

     53					; IS BEING WRITTEN, THEN AN IMMEDIATE RETURN IS EXECUTED. ELSE THE

     54					; CURRENT OUTPUT BUFFER IS FLUSHED AND THE NEW ADDRESS LIMITS ARE ES-

     55					; TABLISHED.

     56					;

     57					; INPUTS:

ADRSM	MACRO M1110  22-AUG-78 01:38  PAGE 3-1





     58					;

     59					;	R0=VIRTUAL ADDRESS OF SEGMENT DESCRIPTOR

     60					;

     61					; OUTPUTS:

     62					;

     63					;	THE ADDRESS LIMITS FOR THE SPECIFIED SEGMENT ARE ESTABLISHED.

     64					;-

     65

     66

     67						.IF	NDF	A$$DRM

     68

     69					$ADRST::			;

     70						CMP	R0,$WRSEG	; IS SPECIFIED SEGMENT SAME AS CURRENT?

     71						BEQ	50$		;IF EQ YES

     72						MOV	R0,-(SP)	;SAVE SEGMENT ADDRESS

     73						CALL	$FLUSH		;FLUSH CURRENT OUTPUT BUFFER

     74						MOV	(SP)+,R1	; RETRIEVE VIRTUAL SEGMENT ADDRESS

     75

     76					 	.IFF

     77

     78	000000				$ADRSM::			;

     79	000000	010001 				MOV	R0,R1		; COPY VIRTUAL SEGMENT DESCRIPTOR

     80

     81						.ENDC

     82

     83	000002					CALL	$CVRL		; CONVERT TO REAL ADDRESS

     84	000006	016067 	000000G	000000G		MOV	S$GSTS(R0),$WRFLG ; SAVE  SEGMENT FLAGS

     85	000014	010002 				MOV	R0,R2		; SAVE REAL ADDRESS

     86	000016	016200 	000000G			MOV	S$GLDA(R2),R0	; GET VIRTUAL STARTING ADDRESS

     87

     88						.IF	DF	R$$11M

     89

     90	000022	005067 	000000G			CLR	$LOWRW		; SET LOW R/W MEMORY LIMIT

     91

     92						.ENDC

     93

     94	000026	020167 	000000G			CMP	R1,$RTSEG	; RESIDENT ROOT?				;**-2

     95	000032	001004 				BNE	15$		; IF NE NO

     96	000034	005000 				CLR	R0		;++021 CLEAR RELOCATION BIAS

     97

     98						.IF	DF	R$$11M

     99

    100	000036	016767 	000000G	000000G		MOV	$HDSIZ,$LOWRW	; SET LOW R/W LIMIT TO EXCLUDE HEADER

    101

    102						.ENDC

    103

    104	000044				15$:										;JAK100

    105	000044	066700 	000000G			ADD	$OFFST,R0	; GET OFFSET BIAS				;JAK100

    106	000050	010067 	000000G			MOV	R0,$BEGRW	; SET BEGINNING OF RW AREA			;JAK100

    107	000054	010067 	000000G			MOV	R0,$BEGRO	; SET BEGINNING OF R-O				;JAK100

    108	000060	066200 	000000G			ADD	S$GLNG(R2),R0	 ; ADD IN SEGMENT R-W LENGTH			;JAK100

    109	000064	005300 				DEC	R0		; BACK OFF ONE					;JAK100

    110	000066	010067 	000000G			MOV	R0,$ENDRW							;JAK100

    111	000072	010067 	000000G			MOV	R0,$ENDRO	; SET END OF R-O AREA				;JAK100

    112	000076	005762 	000000G			TST	S$GRO(R2)	; ANY READ ONLY LENGTH				;JAK100

    113	000102	001423 				BEQ	40$		; IF EQ NO					;JAK100

    114	000104	020167 	000000G			CMP	R1,$RTSEG	; ROOT SEGMENT?					;JAK100

ADRSM	MACRO M1110  22-AUG-78 01:38  PAGE 3-2





    115	000110	001014 				BNE	20$		; IF NE NO					;JAK100

    116	000112	016200 	000000G			MOV	S$GROB(R2),R0	; GET R-O BASE ADDRESS				;JAK100

    117	000116	066700 	000000G			ADD	$OFFST,R0	; INCLUDE OFFSET BIAS				;JAK100

    118	000122	010067 	000000G			MOV	R0,$BEGRO	; CALC. END OF R-O				;JAK100

    119	000126	066200 	000000G			ADD	S$GRO(R2),R0 ; ADD IN R-O LENGTH				;JAK100

    120	000132	005300 				DEC	R0		; BACK OFF ONE					;JAK100

    121	000134	010067 	000000G			MOV	R0,$ENDRO	; SAVE END OF R-O				;JAK100

    122	000140	000404 				BR	40$								;JAK100

    123	000142				20$:										;JAK100

    124	000142	005067 	000000G			CLR	$BEGRW		; READ ONLY SEGMENT - ZERO R-W			;JAK100

    125	000146	005067 	000000G			CLR	$ENDRW		;						;JAK100

    126	000152				40$:										;JAK100

    127					 										;JAK100

    128						.IF NDF	A$$DRM								;JAK100

    129					 										;JAK100

    130						MOV	S$GBLK(R2),$RLBLK ; SET STARTING BLK NUM OF R-W			;JAK100

    131						MOV	S$GBLK+2(R2),$RLBLK+2 ; SET START BLK NUM OF R-O		;JAK100

    132					 										;JAK100

    133						.ENDC									;JAK100

    134					 										;JAK100

    135															;**-50

    136						.IF	DF	R$$11M

    137

    138	000152	066767 	000000G	000000G		ADD	$BEGRW,$LOWRW	; OFFSET LOW R/W LIMIT

    139

    140						.ENDC

    141

    142	000160				50$:	RETURN			;

    143

    144		000001 				.END

ADRSM	MACRO M1110  22-AUG-78 01:38  PAGE 3-3

SYMBOL TABLE



A$$DRM= 000000   	R$$11M= 000000   	S$GROB= ****** GX	$BEGRW= ****** GX	$LOWRW= ****** GX

CR    = 000015   	SPA   = 000040   	S$GSTS= ****** GX	$CVRL = ****** GX	$OFFST= ****** GX

FF    = 000014   	S$GLDA= ****** GX	VT    = 000013   	$ENDRO= ****** GX	$RTSEG= ****** GX

HT    = 000011   	S$GLNG= ****** GX	$ADRSM  000000RG 	$ENDRW= ****** GX	$WRFLG= ****** GX

LF    = 000012   	S$GRO = ****** GX	$BEGRO= ****** GX	$HDSIZ= ****** GX	$$    = 000001



. ABS.	000000	   000

      	000162	   001

ERRORS DETECTED:  0



VIRTUAL MEMORY USED:  650 WORDS  ( 3 PAGES)

DYNAMIC MEMORY:  2772 WORDS  ( 10 PAGES)

ELAPSED TIME:  00:00:07

OBJ$:ADRSM,LIS$:ADRSM/-SP=SRC$:MACFLM,ADRSM,ADRST

