Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99m-bb - lnk999.x19
There are no other files named lnk999.x19 in the archive.
TITLE	LNK999 - EMERGENCY SEGMENT FOR LINK
SUBTTL	D.M.NIXON/DMN/JBC/JNG/DZN/PAH/RJF 5-Feb-88

;COPYRIGHT (c) DIGITAL EQUIPMENT CORPORATION 1973,1986,1988.
; ALL RIGHTS RESERVED.
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERRED.
;
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;



SEARCH	LNKPAR,LNKLOW,MACTEN,UUOSYM,SCNMAC
SALL

ENTRY	LNK999
EXTERN	LNKCOR,LNKLOG


CUSTVR==0		;CUSTOMER VERSION
DECVER==5		;DEC VERSION
DECMVR==1		;DEC MINOR VERSION
DECEVR==2417		;DEC EDIT VERSION


VERSION

SEGMENT
SUBTTL	REVISION HISTORY


;START OF VERSION 1A
;64	REDUCE CORE SIZE IF ALL OF CORE IS TAKEN
;77	RESET VERBOSITY IF LNKERR GETSEG FAILS

;START OF VERSION 2

;START OF VERSION 2B
;363	UPDATE MINOR VERSION #

;START OF VERSION 3A
;560	Release on both TOPS-10 and TOPS-20 as LINK version 3A(560)

;START OF VERSION 4
;663	Save GS.FR over LNKCOR call.
;731	SEARCH MACTEN,UUOSYM
;765	Release on both TOPS-10 and TOPS-20 as LINK version 4(765)

;START OF VERSION 4A
;1174	Label and clean up error messages.
;1206	Fix a NO.COR that edit 1174 missed.
;1217	Clean up the listings for release.
;1220	Release on both TOPS-10 and TOPS-20 as version 4A(1220).

;Start of Version 5.1
;2026	Update copyright statements.
;2027	Update copyright statements.
;2417	Update copyright statements to 1988.
SUBTTL	EMERGENCY GETSEG


LNK999:
IFE FTSINGLE,<			;SO WE CAN ASSEMBLE WITH ONE CMD FILE
	JFCL	.+1
	MOVE	P,SAVEAC+P	;RESTORE PUSHDOWN POINTER
	MOVE	T1,['LNKERR']	;SEE WHICH SEGMENT WAS WANTED
	CAME	T1,SEGBLK+1	;AS LNKERR CAN CAUSE A LOOP
	JRST	.+4		;NO
	MOVEI	T1,V%M		;ONLY THIS MUCH
	CAMGE	T1,VERLVL	;BUT NO MORE
	MOVEM	T1,VERLVL	;AS WE WOULD LOOP
E$$EGD::.ERR.	(MS,,V%L,L%I,S%I,EGD,<Emergency GETSEG done>)
	HRRZ	T1,SEGBLK+2	;GET ERROR CODE
	CAIN	T1,ERNEC%	;NOT ENUF CORE?
	JRST	REDCOR		;YES, REDUCE SIZE
E01GSE::PUSH	P,[0]		;[1174] GETSEG ON CHAN 0
	.ERR.	(LRE,,V%L,L%F,S%F,GSE)
SUBTTL	REDUCE CORE


REDCOR:	MOVE	T1,GS.AB	;TOP OF ACTIVE CORE
	IOR	T1,.PGSIZ	;IN PAGES
	SUB	T1,.JBREL	;FIND WHATS FREE
	MOVM	T1,T1		;IN A POSITIVE WAY
	CAIL	T1,8*2000	;THIS SHOULD BE ENOUGH
	JRST	[MOVE	T1,.JBREL	;GET CURRENT TOP
		SUBI	T1,8*2000	;REMOVE ENOUGH
		JRST	CORUUO]
	PUSHJ	P,DY.GBC##	;RETURN ALL SPACE WE CAN
	PUSHJ	P,FX.GBC##
	MOVE	T1,GS.AB	;SAVE LENGTH OF GS AREA IN USE
	SUB	T1,GS.LB	;SINCE IT WILL MOVE AND GROW
	PUSH	P,T1		;DURING EXPANSION
	PUSH	P,GS.FR		;[663] SAVE # FREE WORDS
	PUSH	P,MAXCOR
	MOVE	T1,.JBREL	;DON'T ALLOW CORE TO EXPAND
	MOVEM	T1,MAXCOR	;INCASE NO ALL TAKEN YET
	MOVEI	P1,GS.IX
	MOVEI	P2,8*2000
	PUSHJ	P,LNKCOR##	;TRY TO GET ALL WE NEED
	  CAIA			;TRY AGAIN
	JRST	REDCR2		;GOT IT
	PUSHJ	P,FR.CNT##	;SEE WHATS LEFT
	ANDCM	T1,.PGSIZ	;IN PAGES OR K
	JUMPE	T1,E01GSE	;[1174] NO MEMORY AVAILABLE
	MOVE	P2,T1		;TRY FOR THIS
	PUSHJ	P,LNKCOR##
	  JRST	E$$MEF##	;[1206] CAN NOT FAIL
REDCR2:	POP	P,MAXCOR	;RESTORE FORMER LIMIT
	POP	P,GS.FR		;[663] RESTORE FREE WORD COUNT
	POP	P,T1		;GET LENGTH OF GS AREA BACK
	ADD	T1,GS.LB	;FIND END
	MOVEM	T1,GS.AB
CORUUO:	CORE	T1,		;CUT BACK
	  JFCL			;NEVER FAILS
	MOVE	T1,.JBREL	;END OF MEMORY
	MOVEM	T1,GS.UB
E02GSE::PUSH	P,[0]		;[1174] GETSEG ON CHAN 0
	.ERR.	(LRE,,V%L,L%W,S%W,GSE)
	MOVE	T1,SEGBLK+1	;GET NAME WE WANT
	JRST	@NXTSEG		;GET IT



>;END OF IFE FTSINGLE
SUBTTL	THE END


END	LNK999