

; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE PATIHD (%IF %VARIANT EQL 1				! ROUTINES TO HANDLE IMAGE HEADER AND SECTIONS

;     L 0002			%THEN

;	0003						ADDRESSING_MODE (EXTERNAL = LONG_RELATIVE,

;	0004							 NONEXTERNAL = LONG_RELATIVE),

;	0005			%FI

;	0006			IDENT = 'X01.05'

;	0007			) =

;	0008	BEGIN

;	0009	

;	0010	!

;	0011	! COPYRIGHT (C) 1977,1978

;	0012	! DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

;	0013	!

;	0014	! THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

;	0015	! COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

;	0016	! ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

;	0017	! MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

;	0018	! EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

;	0019	! TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

;	0020	! REMAIN IN DEC.

;	0021	!

;	0022	! THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

;	0023	! AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

;	0024	! CORPORATION.

;	0025	!

;	0026	! DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

;	0027	! SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

;	0028	

;	0029	!++

;	0030	! FACILITY: PATCH

;	0031	!

;	0032	! ABSTRACT: ROUTINES TO HANDLE IMAGE HEADER DATA AND CREATE AND MAP IMAGE SECTIONS.

;	0033	!

;	0034	! ENVIRONMENT: PART OF IMAGE FILE PATCH UTILITY

;	0035	!

;	0036	! AUTHOR: K.D. MORSE	, CREATION DATE: 11-OCT-77

;	0037	!

;	0038	! MODIFICATIONS:

;	0039	!

;	0040	!  NO	DATE		PROGRAMMER		PURPOSE

;	0041	!  --	----		----------		-------

;	0042	!  01	27-JAN-78	K.D. MORSE		ADD ECO JOURNAL MESSAGE.

;	0043	!  02	07-MAR-78	K.D. MORSE		ADD CALL TO PAT$ADD_PAL.

;	0044	!  03	25-APR-78	K.D. MORSE		CONVERT TO NATIVE COMPILER.

;	0045	!  04	13-JUN-78	K.D. MORSE		ADD FAO COUNTS TO SIGNALS.

;	0046	!  05	20-JUN-78	K.D. MORSE		CHANGE CHECK IF LOCAL COPY OF

;	0047	!						GSD IS IN IMAGE.

;	0048	!

;	0049	!--



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 2

; Digital Equipment Corporation

;

;	0050	!

;	0051	! TABLE OF CONTENTS:

;	0052	!

;	0053	

;	0054	FORWARD ROUTINE

;	0055		PAT$GET_IHD: NOVALUE,					! READS AND PROCESSES IMAGE HEADER

;	0056		PAT$CREMAP: NOVALUE;					! CREATES AND MAPS IMAGE SECTIONS

;	0057	

;	0058	!

;	0059	! INCLUDE FILES:

;	0060	!

;	0061	

;	0062	LIBRARY	'SYS$LIBRARY:LIB.L32';					! SYSTEM STRUCTURE DEFINITIONS

;	0063	REQUIRE 'SRC$:PATPCT.REQ';					! DEFINES PSECTS

;	0079	REQUIRE 'SRC$:PREFIX.REQ';					! DEFINES STRUCTURE MACROS

;	0262	REQUIRE 'SRC$:PATPRE.REQ';					! DEFINES PATCH STRUCTURES

;	0402	REQUIRE 'LIB$:PATMSG.REQ';					! DEFINE ERROR CODES

;	0560	REQUIRE 'SRC$:PATGEN.REQ';					! DEFINE QUADWORD SIZE

;	0739	REQUIRE 'SRC$:SYSLIT.REQ';					! DEFINE TTY_OUT_WIDTH

;	0774	

;	0775	!

;	0776	! MACROS:

;	0777	!

;	0778	

;	0779	!

;	0780	! EQUATED SYMBOLS:

;	0781	!

;	0782	

;	0783	LITERAL

;	0784		START_OFF = 0,						! OFFSET TO STARTING ADDRESS

;	0785		END_OFF = 1,						! OFFSET TO ENDING ADDRESS

;	0786		IDENT_SIZE = 2;						! SIZE OF IDENT FIELD

;	0787	

;	0788	!

;	0789	! EXTERNAL REFERENCES:

;	0790	!

;	0791	

;	0792	EXTERNAL

;	0793		PAT$GL_IHPPTR: REF BLOCK[,BYTE],			! POINTER TO IMAGE HEADER

;	0794		PAT$CP_OUT_STR,						! POINTER TO OUTPUT BUFFER

;	0795		PAT$GL_BUF_SIZ,						! SIZE OF MESSAGE IN OUTPUT BUFFER

;	0796		PAT$GL_EXPANDVA,					! FIRST EXPAND VA ADDRESS

;	0797		PAT$GL_PATAREA,						! POINTER TO PATCH AREA DESCRIPTOR

;	0798		PAT$GL_ERRCODE,						! GLOBAL ERROR CODE

;	0799		PAT$GL_ISVADDR: VECTOR[,LONG],				! LAST MAPPED ADDRESS PAIR

;	0800		PAT$GB_INPBUF,						! INPUT BUFFER FOR IMAGE FILE

;	0801		PAT$GL_IMGHDR: REF BLOCK[,BYTE],			! IMAGE HEADER DATA ADDRESS

;	0802		PAT$GL_ISELHD,						! IMAGE SECTION TABLE LIST HEAD

;	0803		PAT$GL_ISETAIL : REF BLOCK[,BYTE],			! LAST ENTRY IN IMAGE SECTION TABLE

;	0804		PAT$GL_NEWVPNMX,						! MAX VPN IN IMAGE FILE

;	0805		PAT$GL_NEWVBNMX,						! MAX VBN IN IMAGE FILE

;	0806		PAT$GL_OLDVBNMX,					! OLD IMAGE FILE MAX ISD VBN

;	0807		PAT$GB_OLDNAME,						! OLD IMAGE FILE NAME

;	0808		PAT$GL_OLDFAB: BLOCK[,BYTE],				! FAB FOR INPUT IMAGE FILE

;	0809		PAT$GL_OLDNBK: BLOCK[,BYTE],				! NAME BLOCK FOR INPUT IMAGE FILE



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 2-1

; Digital Equipment Corporation

;

;	0810		PAT$GL_OLDRAB: BLOCK[,BYTE],				! RAB FOR INPUT IMAGE FILE

;	0811		PAT$GL_JNLRAB: BLOCK[,BYTE];				! RAB FOR JOURNAL FILE

;	0812	

;	0813	

;	0814	EXTERNAL ROUTINE

;	0815		PAT$ADD_PAL,						! ADD PATCH AREA TO LIST

;	0816		LIB$_CREMAPSEC,						! CREATES AND MAPS SECTIONS

;	0817		PAT$FAO_PUT,						! FORMATS OUTPUT MESSAGE

;	0818		PAT$WRITEFILE,						! WRITES OUTPUT MESSAGE TO A FILE

;	0819		PAT$ALLOBLK;						! ALLOCATES BLOCK OF FREE MEMORY

;	0820	!

;	0821	! OWN STORAGE:

;	0822	!

;	0823	

;	0824	OWN

;	0825		CURISD: REF BLOCK[,BYTE],				! CURRENT IMAGE SECTION DESCRIPTOR

;	0826		INPBUF: REF BLOCK[,BYTE] INITIAL(PAT$GB_INPBUF);	! INPUT BUFFER

;	0827	

;	0828	BIND

;	0829		MAJOR_IDENT= UPLIT (%ASCII'02'),			! VALUE OF MAJOR IDENT ABLE TO PATCH

;	0830		MINOR_IDENT= UPLIT (%ASCII'01');			! MINIMUM VALUE OF MINOR IDENT ABLE TO PATCH



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3

; Digital Equipment Corporation

;

;	0831	GLOBAL ROUTINE PAT$GET_IHD :NOVALUE =					! READS AND PROCESSES THE IMAGE HEADER

;	0832	

;	0833	!++

;	0834	! FUNCTIONAL DESCRIPTION:

;	0835	!

;	0836	!	THIS ROUTINE READS THE IMAGE HEADER AND STORES THE DATA.

;	0837	!	IT THEN PROCESSES EACH IMAGE SECTION, BUILDING THE IMAGE SECTION TABLE.

;	0838	!	THE IMAGE SECTION ENTRIES CONSIST OF:

;	0839	!

;	0840	!		1. LINK TO NEXT IMAGE SECTION ENTRY (ISE)

;	0841	!		2. STARTING MAPPED VIRTUAL ADDRESS

;	0842	!		3. ENDING MAPPED VIRTUAL ADDRESS

;	0843	!		4. STARTING IMAGE VIRTUAL ADDRESS WITHIN IMAGE SECTION

;	0844	!		5. ENDING IMAGE VIRTUAL ADDRESS WITHIN IMAGE SECTION

;	0845	!		6. IMAGE SECTION DESCRIPTOR AS READ FROM IMAGE HEADER

;	0846	!

;	0847	!	THE MAPPED ADDRESSES ARE INITIALIZED TO ZERO.  WHEN THE PAGES

;	0848	!	ARE ACCESSED BY A PATCH COMMAND, THE IMAGE SECTION IS MAPPED

;	0849	!	AND THE MAPPED ADDRESSES SET.

;	0850	!

;	0851	!	THE BEGINNING ADDRESS INTO WHICH THE IMAGE SECTIONS ARE TO

;	0852	!	BE MAPPED IS ALSO INITIALIZED.

;	0853	!

;	0854	! FORMAL PARAMETERS:

;	0855	!

;	0856	!	NONE

;	0857	!

;	0858	! IMPLICIT INPUTS:

;	0859	!

;	0860	!	THE OLD IMAGE FILE HAS BEEN SET UP FOR INPUT.

;	0861	!

;	0862	! IMPLICIT OUTPUTS:

;	0863	!

;	0864	!	THE IMAGE SECTION TABLE IS SET UP AND THE IMAGE HEADER DATA STORED.

;	0865	!

;	0866	! ROUTINE VALUE:

;	0867	!

;	0868	! COMPLETION CODES:

;	0869	!

;	0870	!	NONE

;	0871	!

;	0872	! SIDE EFFECTS:

;	0873	!

;	0874	!	NONE

;	0875	!

;	0876	!--

;	0877	

;	0878	BEGIN

;	0879	BIND

;	0880		TIME_STR = UPLIT (%ASCIC 'DATE/TIME OF PATCH:		!%D'),

;	0881		ECO_MSG_STR = UPLIT (%ASCIC 'ECO LEVELS SET:		'),

;	0882		ECO_LVL_STR = UPLIT (%ASCIC '!UL, ');

;	0883	

;	0884	

;	0885	LITERAL



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-1

; Digital Equipment Corporation

;

;	0886		NO_MORE_ISE = 65535;					! CODE FOR NO MORE ISE'S ON THIS PAGE

;	0887	

;	0888	MAP

;	0889		PAT$GL_IMGHDR : REF BLOCK[,BYTE];			! REFERENCE IMAGE HEADER AS A BLOCK

;	0890	

;	0891	LOCAL

;	0892		ECO_PTR : REF BITVECTOR,				! POINTER TO ECO LEVEL BITS

;	0893		ECO_BIT,						! ECO BIT LEVEL COUNTER

;	0894		ISEADR: REF BLOCK[,BYTE],				! CONTAINS ADDRESS OF IMAGE SECTION ENTRY

;	0895		SRCPTR,							! SOURCE STRING POINTER

;	0896		DESPTR,							! DESTINATION STRING POINTER

;	0897		NXTPTR,							! STRING POINTER TO NEXT PART OF RECORD

;	0898		ALLOCSIZE,						! SIZE OF IMAGE HEADER TO ALLOCATE

;	0899		OUT_BUFFER : VECTOR[TTY_OUT_WIDTH,BYTE];		! OUTPUT MESSAGE BUFFER

;	0900	

;	0901	!++

;	0902	! INITIALIZE THE IMAGE SECTION TABLE LIST HEAD.

;	0903	!--

;	0904	PAT$GL_ISELHD=0;						! SET END OF TABLE

;	0905	PAT$GL_ISETAIL=0;						! SET TAIL OF TABLE

;	0906	

;	0907	!++

;	0908	! INITIALIZE MAXIMUM NEW FILE VIRTUAL PAGE AND BLOCK NUMBERS.

;	0909	!--

;	0910	PAT$GL_NEWVBNMX = 0;

;	0911	PAT$GL_NEWVPNMX = 0;

;	0912	

;	0913	!++

;	0914	! READ THE FIRST BLOCK OF THE IMAGE HEADER AND STORE THE DATA.

;	0915	!--

;	0916	PAT$GL_ERRCODE=$READ(RAB=PAT$GL_OLDRAB);			! GET THE IMAGE HEADER

;	0917	IF NOT .PAT$GL_ERRCODE

;	0918	THEN

;	0919		SIGNAL(PAT$_GETERR,3,.PAT$GL_ERRCODE,.PAT$GL_OLDNBK[NAM$B_RSL],PAT$GB_OLDNAME); ! REPORT ERROR

;	0920	

;	0921	!++

;	0922	! CHECK THAT THE PATCH UTILITY UNDERSTANDS THIS TYPE OF IMAGE HEADER.

;	0923	!--

;	0924	IF .INPBUF[IHD$W_MAJORID] NEQU .MAJOR_IDENT

;	0925	THEN

;	0926		SIGNAL(PAT$_BADIDENT,2,IDENT_SIZE,INPBUF[IHD$W_MAJORID]);

;	0927	IF .INPBUF[IHD$W_MINORID] LSSU .MINOR_IDENT

;	0928	THEN

;	0929		SIGNAL(PAT$_BADIDENT,2,IDENT_SIZE,INPBUF[IHD$W_MINORID]);

;	0930	

;	0931	!++

;	0932	! STORE THE IMAGE HEADER FOR FUTURE USE.  FIRST ENSURE THAT THERE

;	0933	! IS ROOM FOR A PATCH AREA HEADER SECTION.

;	0934	!--

;	0935	ALLOCSIZE=.INPBUF[IHD$W_SIZE];					! ASSUME HEADER IS CORRECT SIZE

;	0936	IF .INPBUF[IHD$W_PATCHOFF] EQL 0				! IF THERE IS NO PATCH SECTION IN HEADER

;	0937	THEN								! THEN 

;	0938		ALLOCSIZE=.ALLOCSIZE + IHP$K_LENGTH;			! ENLARGE IT TO INCLUDE ONE

;	0939	PAT$ALLOBLK(.ALLOCSIZE,PAT$GL_IMGHDR);				! ALLOCATE STORAGE FOR IMAGE HEADER

;	0940	SRCPTR=CH$PTR(.INPBUF,0);					! SET POINTER TO INPUT DATA



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-2

; Digital Equipment Corporation

;

;	0941	DESPTR=CH$PTR(.PAT$GL_IMGHDR,0);				! SET POINTER TO HEADER STORAGE

;	0942	CH$MOVE(.INPBUF[IHD$W_SIZE],.SRCPTR,.DESPTR);			! STORE HEADER DATA

;	0943	NXTPTR=.INPBUF[IHD$W_SIZE] + .SRCPTR;				! SET PTR TO BYTE PAST INPUT MOVED

;	0944	IF .PAT$GL_IMGHDR[IHD$W_PATCHOFF] EQL 0				! IF THERE WAS NO PATCH SECTION

;	0945	THEN								! THEN

;	0946		BEGIN

;	0947		PAT$GL_IMGHDR[IHD$W_PATCHOFF]=.PAT$GL_IMGHDR[IHD$W_SIZE];	! SET OFFSET TO PATCH SECTION

;	0948		PAT$GL_IMGHDR[IHD$W_SIZE]=.PAT$GL_IMGHDR[IHD$W_SIZE] + IHP$K_LENGTH; ! INCREMENT SIZE OF HEADER

;	0949		PAT$GL_IHPPTR=CH$PTR(.PAT$GL_IMGHDR, .PAT$GL_IMGHDR[IHD$W_PATCHOFF]);

;	0950		PAT$GL_IHPPTR[IHP$L_ECO1]=0;					! ZERO THE ECO LEVEL BITS

;	0951		PAT$GL_IHPPTR[IHP$L_ECO2]=0;					! ZERO THE ECO LEVEL BITS

;	0952		PAT$GL_IHPPTR[IHP$L_ECO3]=0;					! ZERO THE ECO LEVEL BITS

;	0953		PAT$GL_IHPPTR[IHP$L_ECO4]=0;					! ZERO THE ECO LEVEL BITS

;	0954		PAT$GL_IHPPTR[IHP$L_RW_PATADR]=0;				! SET NO READ-WRITE PATCH AREA

;	0955		PAT$GL_IHPPTR[IHP$L_RW_PATSIZ]=0;				! SET NO READ-WRITE PATCH AREA

;	0956		PAT$GL_IHPPTR[IHP$L_RO_PATADR]=0;				! SET NO READ-ONLY PATCH AREA

;	0957		PAT$GL_IHPPTR[IHP$L_RO_PATSIZ]=0;				! SET NO READ-ONLY PATCH AREA

;	0958		PAT$GL_IHPPTR[IHP$L_PATCOMTXT]=0;				! SET NO PATCH COMMAND TEXT

;	0959		END

;	0960	ELSE

;	0961		PAT$GL_IHPPTR=CH$PTR(.PAT$GL_IMGHDR, .PAT$GL_IMGHDR[IHD$W_PATCHOFF]);

;	0962	PAT$GL_PATAREA = CH$PTR(PAT$GL_IHPPTR[IHP$L_RW_PATSIZ] ,0);	! SET POINTER TO PATCH AREA DESCRIPTOR

;	0963	PAT$GL_ERRCODE=$GETTIM(TIMADR=PAT$GL_IHPPTR[IHP$Q_PATDATE]);		! SET LATEST PATCH DATE

;	0964	IF NOT .PAT$GL_ERRCODE

;	0965	THEN

;	0966		SIGNAL(PAT$_GETTIM,1,.PAT$GL_ERRCODE);			! REPORT ERROR

;	0967	

;	0968	!++

;	0969	! WRITE OUT PATCH TIME TO JOURNAL FILE.

;	0970	!--

;	0971	PAT$CP_OUT_STR = CH$PTR(OUT_BUFFER,0);

;	0972	PAT$GL_BUF_SIZ = 0;

;	0973	PAT$FAO_PUT(TIME_STR, PAT$GL_IHPPTR[IHP$Q_PATDATE]);

;	0974	PAT$WRITEFILE(.PAT$GL_BUF_SIZ, CH$PTR(OUT_BUFFER, 0), PAT$GL_JNLRAB);

;	0975	

;	0976	!++

;	0977	! NOW OUTPUT THE ECO LEVELS SET TO THE JOURNAL FILE.

;	0978	!--

;	0979	ECO_PTR = CH$PTR(PAT$GL_IHPPTR[IHP$L_ECO1], 0);

;	0980	PAT$CP_OUT_STR = CH$PTR(OUT_BUFFER,0);

;	0981	PAT$GL_BUF_SIZ = 0;

;	0982	INCR ECO_BIT FROM PAT$K_MIN_ECO-1 TO PAT$K_MAX_ECO-1 BY 1

;	0983	DO

;	0984		BEGIN

;	0985		IF .ECO_PTR[.ECO_BIT]

;	0986		THEN

;	0987			BEGIN

;	0988			IF .PAT$GL_BUF_SIZ GEQ TTY_OUT_WIDTH-6

;	0989			THEN

;	0990				BEGIN

;	0991				PAT$WRITEFILE(.PAT$GL_BUF_SIZ-2, CH$PTR(OUT_BUFFER, 0), PAT$GL_JNLRAB);

;	0992				PAT$CP_OUT_STR = CH$PTR(OUT_BUFFER,0);

;	0993				PAT$GL_BUF_SIZ = 0;

;	0994				END;

;	0995			IF .PAT$GL_BUF_SIZ EQL 0



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-3

; Digital Equipment Corporation

;

;	0996			THEN

;	0997				PAT$FAO_PUT(ECO_MSG_STR);

;	0998			PAT$FAO_PUT(ECO_LVL_STR, .ECO_BIT+1);

;	0999			END;

;	1000		END;

;	1001	IF .PAT$GL_BUF_SIZ NEQ 0

;	1002	THEN

;	1003		PAT$WRITEFILE(.PAT$GL_BUF_SIZ-2, CH$PTR(OUT_BUFFER, 0), PAT$GL_JNLRAB);

;	1004	PAT$WRITEFILE(0, CH$PTR(OUT_BUFFER, 0), PAT$GL_JNLRAB);		! OUTPUT BLANK LINE

;	1005	

;	1006	!++

;	1007	! NOW PLACE THE DEFAULT PATCH AREA AS THE FIRST ENTRY ON THE PATCH AREA LIST.

;	1008	!--

;	1009	PAT$ADD_PAL(.PAT$GL_IHPPTR[IHP$L_RW_PATADR],

;	1010		    .PAT$GL_IHPPTR[IHP$L_RW_PATADR]+.PAT$GL_IHPPTR[IHP$L_RW_PATSIZ],

;	1011		    PAL$K_ADD_PAREA);

;	1012	

;	1013	!++

;	1014	! FIND THE BOTTOM OF THE PATCH CODE AND INITIALIZE THE CURRENT ISD ADDRESS IN

;	1015	! THE IMAGE HEADER RECORD TO GET READY FOR IMAGE SECTION PROCESSING.

;	1016	!--

;	1017	PAT$GL_ERRCODE=$EXPREG(	  PAGCNT=1

;     P 1018				, RETADR=PAT$GL_ISVADDR);		! FIND BOTTOM OF PATCH CODE

;	1019	IF NOT .PAT$GL_ERRCODE

;	1020	THEN

;	1021		SIGNAL(PAT$_EXPREG,1,.PAT$GL_ERRCODE);			! REPORT ERROR

;	1022	PAT$GL_EXPANDVA = .PAT$GL_ISVADDR[START_OFF];			! REMEMBER FIRST EXPAND ADDRESS

;	1023	PAT$GL_ISVADDR[END_OFF]=.PAT$GL_ISVADDR[START_OFF] - 1;		! SET NEXT ADDRESS FOR CREMAP TO MAP OVER

;	1024	CURISD=.NXTPTR;							! SET FIRST ISD ADDRESS

;	1025	

;	1026	!++

;	1027	! NOW PROCESS EVERY IMAGE SECTION DESCRIPTOR.

;	1028	!--

;	1029	WHILE .CURISD[ISD$W_SIZE] NEQ 0

;	1030	DO

;	1031		BEGIN

;	1032		LOCAL

;	1033			ALLOC_SIZE;					! SIZE OF ISE TO ALLOCATE

;	1034		IF .CURISD[ISD$W_SIZE] EQL NO_MORE_ISE			! IF THAT'S ALL IN THIS BLOCK,

;	1035		THEN

;	1036			BEGIN

;	1037			PAT$GL_ERRCODE=$READ(RAB=PAT$GL_OLDRAB);	! GET NEXT IMAGE HEADER BLOCK

;	1038			IF NOT .PAT$GL_ERRCODE

;	1039			THEN

;	1040				SIGNAL(PAT$_GETERR,3,.PAT$GL_ERRCODE,.PAT$GL_OLDNBK[NAM$B_RSL],

;	1041					PAT$GB_OLDNAME);		! REPORT ERROR

;	1042			NXTPTR=CH$PTR(.INPBUF,0);			! RESET POINTER TO NEXT ISD

;	1043			CURISD=.INPBUF;					! SET CURRENT ISD ADDRESS

;	1044			END;

;	1045		ALLOC_SIZE = .CURISD[ISD$W_SIZE] + ISE$C_SIZE;		! SET SIZE OF ISE

;	1046		IF .CURISD[ISD$V_DZRO]

;	1047		THEN

;	1048			ALLOC_SIZE = .ALLOC_SIZE + A_QUADWORD;		! ADD IN EXTRA SPACE FOR VBN AND IDENT

;	1049		!++

;	1050		! ****** THIS CHECK IS A FUTURE FEATURE WHICH WILL INSURE SPACE FOR AN IDENT



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-4

; Digital Equipment Corporation

;

;	1051		! ****** LONGWORD IN ANY PROCESS PRIVATE IMAGE SECTION DESCRIPTOR.

;	1052		! ****** THIS WILL ENABLE PATCH TO CREATE AN IDENT FOR A PROCESS

;	1053		! ****** PRIVATE IMAGE SECTION, WHICH WILL PROBABLY BE NECESSARY WHEN

;	1054		! ****** GLOBAL SECTIONS ARE PATCHED AND BECOME PRIVATE SECTIONS.

;	1055		!--

;	1056		IF PAT$K_LENPRIV NEQ ISD$K_LENPRIV			! CHECK IF LENGTH INCLUDES IDENT

;	1057		THEN

;	1058			IF .CURISD[ISD$W_SIZE] EQL ISD$K_LENPRIV	! CHECK IF THIS IS PROCESS PRIVATE ISD

;	1059			THEN

;	1060				ALLOC_SIZE = .ALLOC_SIZE + A_LONGWORD;	! ADD IN IDENT LENGTH

;	1061		PAT$ALLOBLK(.ALLOC_SIZE,ISEADR);			 ! GET IMAGE SECTION ENTRY

;	1062		DESPTR=CH$PTR(.ISEADR,ISE$C_SIZE);			! SET DESTINATION POINTER

;	1063		CH$MOVE(.CURISD[ISD$W_SIZE],.NXTPTR,.DESPTR);		! MOVE IN ISD

;	1064		NXTPTR=.CURISD[ISD$W_SIZE] + .NXTPTR;			! SET PTR TO NEXT ISD

;	1065		IF .PAT$GL_ISETAIL EQLA 0				! IF FIRST ENTRY

;	1066		THEN

;	1067			BEGIN

;	1068			PAT$GL_ISELHD=CH$PTR(.ISEADR, 0);		! SET TABLE LIST HEAD

;	1069			PAT$GL_ISETAIL=CH$PTR(.ISEADR, 0);		! SET TABLE TAIL

;	1070			END

;	1071		ELSE

;	1072			BEGIN

;	1073			PAT$GL_ISETAIL[ISE$L_NXTISE]=CH$PTR(.ISEADR, 0); ! SET LINK TO THIS ISE

;	1074			PAT$GL_ISETAIL=CH$PTR(.ISEADR, 0);		! SET NEW TAIL OF TABLE

;	1075			END;

;	1076		ISEADR[ISE$L_NXTISE]=0;					! SET FORWARD LINK

;	1077		ISEADR[ISE$L_IMGVST]=.CURISD[ISD$V_VPG]^9;		! SET STARTING IMAGE VIRTUAL ADDRESS

;	1078		ISEADR[ISE$L_IMGVEND]=(.CURISD[ISD$V_VPG]+.CURISD[ISD$W_PAGCNT])^9 - 1; ! SET ENDING IMAGE VIRTUAL ADDRESS

;	1079		ISEADR[ISE$L_MAPVST]=0;					! SET NO START MAPPED ADDRESS

;	1080		ISEADR[ISE$L_MAPVEND]=0;				! SET NO ENDING MAPPED ADDRESS

;	1081		IF .CURISD[ISD$B_TYPE] NEQ ISD$K_USRSTACK

;	1082		THEN

;	1083			IF .PAT$GL_NEWVPNMX LSSU .CURISD[ISD$V_VPG]	! SEE IF LARGER VPN

;	1084			THEN

;	1085				PAT$GL_NEWVPNMX = .CURISD[ISD$V_VPG] +.CURISD[ISD$W_PAGCNT] - 1;

;	1086		IF NOT .CURISD[ISD$V_DZRO]			! IF NOT DEMAND ZERO

;	1087		THEN							! THEN CHECK IF LARGER VBN

;	1088			IF .PAT$GL_NEWVBNMX LSS .CURISD[ISD$L_VBN]

;	1089			THEN

;	1090				PAT$GL_NEWVBNMX = .CURISD[ISD$L_VBN] + .CURISD[ISD$W_PAGCNT] - 1;

;	1091		CURISD=.CURISD + .CURISD[ISD$W_SIZE];			! SET NEXT ISD ADDRESS

;	1092		END;

;	1093	PAT$GL_OLDVBNMX = .PAT$GL_NEWVBNMX;				! REMEMBER OLD FILE MAX ISD VBN USED

;	1094	END;								! END OF PAT$GET_IHD





							    .TITLE  PATIHD

							    .IDENT  \X01.05\



							    .PSECT  _PAT$PLIT,NOWRT,NOEXE,0



					      00000 P.AAA:  .ASCII  \02\<0><0>						      ;

					      00004 P.AAB:  .ASCII  \01\<0><0>						      ;

					      00008 P.AAC:  .ASCII  <24>\DATE/TIME OF PATCH:\<9><9>\!%D\<0><0><0>	      ;

					      00024 P.AAD:  .ASCII  <17>\ECO LEVELS SET:\<9><9><0><0>			      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-5

; Digital Equipment Corporation

;

					      00038 P.AAE:  .ASCII  <5>\!UL, \<0><0>					      ;



							    .PSECT  _PAT$OWN,NOEXE,2



					      00000 CURISD: .BLKB   4

					      00004 INPBUF: .ADDRESS  PAT$GB_INPBUF					      ;



						    ISE$C_SIZE==	20

						    TXT$C_SIZE==	4

						    PAL$C_SIZE==	16

						    ASD$C_SIZE==	9

						    FWR$C_SIZE==	24

						    MAJOR_IDENT=	P.AAA

						    MINOR_IDENT=	P.AAB

						    TIME_STR=		P.AAC

						    ECO_MSG_STR=	P.AAD

						    ECO_LVL_STR=	P.AAE

							    .GLOBL  PAT$GL_IHPPTR, PAT$CP_OUT_STR, PAT$GL_BUF_SIZ

							    .GLOBL  PAT$GL_EXPANDVA, PAT$GL_PATAREA, PAT$GL_ERRCODE

							    .GLOBL  PAT$GL_ISVADDR, PAT$GB_INPBUF, PAT$GL_IMGHDR, PAT$GL_ISELHD

							    .GLOBL  PAT$GL_ISETAIL, PAT$GL_NEWVPNMX, PAT$GL_NEWVBNMX

							    .GLOBL  PAT$GL_OLDVBNMX, PAT$GB_OLDNAME, PAT$GL_OLDFAB

							    .GLOBL  PAT$GL_OLDNBK, PAT$GL_OLDRAB, PAT$GL_JNLRAB, PAT$ADD_PAL

							    .GLOBL  LIB$_CREMAPSEC, PAT$FAO_PUT, PAT$WRITEFILE, PAT$ALLOBLK

							    .GLOBL  SYS$READ, SYS$GETTIM, SYS$EXPREG



							    .PSECT  _PAT$CODE,NOWRT,2



					 0FFC 00000 	    .ENTRY  PAT$GET_IHD, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11	      ; 0831

		         5A 00000000G  EF  9E 00002 	    MOVAB   PAT$GL_ERRCODE, R10					      ;

		         5B 00000000'  EF  9E 00009 	    MOVAB   CURISD, R11						      ;

		         5E	FF78   CE  9E 00010 	    MOVAB   -136(SP), SP					      ;

			    00000000G  EF  D4 00015 	    CLRL    PAT$GL_ISELHD					      ; 0904

			    00000000G  EF  D4 0001B 	    CLRL    PAT$GL_ISETAIL					      ; 0905

			    00000000G  EF  D4 00021 	    CLRL    PAT$GL_NEWVBNMX					      ; 0910

			    00000000G  EF  D4 00027 	    CLRL    PAT$GL_NEWVPNMX					      ; 0911

			    00000000G  EF  9F 0002D 	    PUSHAB  PAT$GL_OLDRAB					      ; 0916

	      00000000G  9F	       01  FB 00033 	    CALLS   #1, @#SYS$READ					      ;

		         6A	       50  D0 0003A 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         1E	       6A  E8 0003D 	    BLBS    PAT$GL_ERRCODE, 1$					      ; 0917

			    00000000G  EF  9F 00040 	    PUSHAB  PAT$GB_OLDNAME					      ; 0919

		         7E 00000000G  EF  9A 00046 	    MOVZBL  PAT$GL_OLDNBK+3, -(SP)				      ;

				       6A  DD 0004D 	    PUSHL   PAT$GL_ERRCODE					      ;

				       03  DD 0004F 	    PUSHL   #3							      ;

			    006D818C   8F  DD 00051 	    PUSHL   #7176588						      ;

	      00000000G  00	       05  FB 00057 	    CALLS   #5, LIB$SIGNAL					      ;

		         50	  04   AB  D0 0005E 1$:     MOVL    INPBUF, R0						      ; 0924

      0C   A0	         10	       00  ED 00062 	    CMPZV   #0, #16, 12(R0), MAJOR_IDENT			      ;

			    00000000'  EF     00067									      ;

				       14  13 0006C 	    BEQL    2$							      ;

				  0C   A0  9F 0006E 	    PUSHAB  12(R0)						      ; 0926

				       02  DD 00071 	    PUSHL   #2							      ;

				       02  DD 00073 	    PUSHL   #2							      ;

			    006D814C   8F  DD 00075 	    PUSHL   #7176524						      ;

	      00000000G  00	       04  FB 0007B 	    CALLS   #4, LIB$SIGNAL					      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-6

; Digital Equipment Corporation

;

		         50	  04   AB  D0 00082 2$:     MOVL    INPBUF, R0						      ; 0927

      0E   A0	         10	       00  ED 00086 	    CMPZV   #0, #16, 14(R0), MINOR_IDENT			      ;

			    00000000'  EF     0008B									      ;

				       14  1E 00090 	    BGEQU   3$							      ;

				  0E   A0  9F 00092 	    PUSHAB  14(R0)						      ; 0929

				       02  DD 00095 	    PUSHL   #2							      ;

				       02  DD 00097 	    PUSHL   #2							      ;

			    006D814C   8F  DD 00099 	    PUSHL   #7176524						      ;

	      00000000G  00	       04  FB 0009F 	    CALLS   #4, LIB$SIGNAL					      ;

		         50	  04   AB  D0 000A6 3$:     MOVL    INPBUF, R0						      ; 0935

		         51	       60  3C 000AA 	    MOVZWL  (R0), ALLOCSIZE					      ;

				  08   A0  B5 000AD 	    TSTW    8(R0)						      ; 0936

				       03  12 000B0 	    BNEQ    4$							      ;

		         51	       2C  C0 000B2 	    ADDL2   #44, ALLOCSIZE					      ; 0938

			    00000000G  EF  9F 000B5 4$:     PUSHAB  PAT$GL_IMGHDR					      ; 0831

				       51  DD 000BB 	    PUSHL   ALLOCSIZE						      ; 0939

	      00000000G  EF	       02  FB 000BD 	    CALLS   #2, PAT$ALLOBLK					      ;

		         57	  04   AB  D0 000C4 	    MOVL    INPBUF, R7						      ; 0940

		         58	       57  D0 000C8 	    MOVL    R7, SRCPTR						      ;

		         56 00000000G  EF  D0 000CB 	    MOVL    PAT$GL_IMGHDR, R6					      ; 0941

		         59	       56  D0 000D2 	    MOVL    R6, DESPTR						      ;

	   69	         68	       67  28 000D5 	    MOVC3   (R7), (SRCPTR), (DESPTR)				      ; 0942

		         50	       67  3C 000D9 	    MOVZWL  (R7), R0						      ; 0943

		         58	       50  C0 000DC 	    ADDL2   R0, NXTPTR						      ;

				  08   A6  B5 000DF 	    TSTW    8(R6)						      ; 0944

				       2A  12 000E2 	    BNEQ    5$							      ;

		    08   A6	       66  B0 000E4 	    MOVW    (R6), 8(R6)						      ; 0947

		         66	       2C  A0 000E8 	    ADDW2   #44, (R6)						      ; 0948

		         50	  08   A6  3C 000EB 	    MOVZWL  8(R6), R0						      ; 0949

00000000G  EF	         56	       50  C1 000EF 	    ADDL3   R0, R6, PAT$GL_IHPPTR				      ;

		         50 00000000G  EF  D0 000F7 	    MOVL    PAT$GL_IHPPTR, R0					      ; 0950

				       60  7C 000FE 	    CLRQ    (R0)						      ;

				  08   A0  7C 00100 	    CLRQ    8(R0)						      ; 0952

				  10   A0  7C 00103 	    CLRQ    16(R0)						      ; 0955

				  18   A0  7C 00106 	    CLRQ    24(R0)						      ; 0957

				  20   A0  D4 00109 	    CLRL    32(R0)						      ; 0958

				       0C  11 0010C 	    BRB     6$							      ; 0944

		         50	  08   A6  3C 0010E 5$:     MOVZWL  8(R6), R0						      ; 0961

00000000G  EF	         56	       50  C1 00112 	    ADDL3   R0, R6, PAT$GL_IHPPTR				      ;

00000000G  EF 00000000G  EF	       10  C1 0011A 6$:     ADDL3   #16, PAT$GL_IHPPTR, PAT$GL_PATAREA			      ; 0962

	   7E 00000000G  EF	       24  C1 00126 	    ADDL3   #36, PAT$GL_IHPPTR, -(SP)				      ; 0963

	      00000000G  9F	       01  FB 0012E 	    CALLS   #1, @#SYS$GETTIM					      ;

		         6A	       50  D0 00135 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         11	       6A  E8 00138 	    BLBS    PAT$GL_ERRCODE, 7$					      ; 0964

				       6A  DD 0013B 	    PUSHL   PAT$GL_ERRCODE					      ; 0966

				       01  DD 0013D 	    PUSHL   #1							      ;

			    006D8194   8F  DD 0013F 	    PUSHL   #7176596						      ;

	      00000000G  00	       03  FB 00145 	    CALLS   #3, LIB$SIGNAL					      ;

	      00000000G  EF	  04   AE  9E 0014C 7$:     MOVAB   OUT_BUFFER, PAT$CP_OUT_STR				      ; 0971

			    00000000G  EF  D4 00154 	    CLRL    PAT$GL_BUF_SIZ					      ; 0972

	   7E 00000000G  EF	       24  C1 0015A 	    ADDL3   #36, PAT$GL_IHPPTR, -(SP)				      ; 0973

			    00000000'  EF  9F 00162 	    PUSHAB  TIME_STR						      ; 0831

	      00000000G  EF	       02  FB 00168 	    CALLS   #2, PAT$FAO_PUT					      ; 0973

			    00000000G  EF  9F 0016F 	    PUSHAB  PAT$GL_JNLRAB					      ; 0974

				  08   AE  9F 00175 	    PUSHAB  OUT_BUFFER						      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-7

; Digital Equipment Corporation

;

			    00000000G  EF  DD 00178 	    PUSHL   PAT$GL_BUF_SIZ					      ;

	      00000000G  EF	       03  FB 0017E 	    CALLS   #3, PAT$WRITEFILE					      ;

		         53 00000000G  EF  D0 00185 	    MOVL    PAT$GL_IHPPTR, ECO_PTR				      ; 0979

	      00000000G  EF	  04   AE  9E 0018C 	    MOVAB   OUT_BUFFER, PAT$CP_OUT_STR				      ; 0980

			    00000000G  EF  D4 00194 	    CLRL    PAT$GL_BUF_SIZ					      ; 0981

				       52  D4 0019A 	    CLRL    ECO_BIT						      ; 0982

	   58	         63	       52  E1 0019C 8$:     BBC     ECO_BIT, (ECO_PTR), 11$				      ; 0985

	      0000007E   8F 00000000G  EF  D1 001A0 	    CMPL    PAT$GL_BUF_SIZ, #126				      ; 0988

				       26  19 001AB 	    BLSS    9$							      ;

			    00000000G  EF  9F 001AD 	    PUSHAB  PAT$GL_JNLRAB					      ; 0991

				  08   AE  9F 001B3 	    PUSHAB  OUT_BUFFER						      ;

	   7E 00000000G  EF	       02  C3 001B6 	    SUBL3   #2, PAT$GL_BUF_SIZ, -(SP)				      ;

	      00000000G  EF	       03  FB 001BE 	    CALLS   #3, PAT$WRITEFILE					      ;

	      00000000G  EF	  04   AE  9E 001C5 	    MOVAB   OUT_BUFFER, PAT$CP_OUT_STR				      ; 0992

			    00000000G  EF  D4 001CD 	    CLRL    PAT$GL_BUF_SIZ					      ; 0993

			    00000000G  EF  D5 001D3 9$:     TSTL    PAT$GL_BUF_SIZ					      ; 0995

				       0D  12 001D9 	    BNEQ    10$							      ;

			    00000000'  EF  9F 001DB 	    PUSHAB  ECO_MSG_STR						      ; 0831

	      00000000G  EF	       01  FB 001E1 	    CALLS   #1, PAT$FAO_PUT					      ; 0997

				  01   A2  9F 001E8 10$:    PUSHAB  1(ECO_BIT)						      ; 0998

			    00000000'  EF  9F 001EB 	    PUSHAB  ECO_LVL_STR						      ; 0831

	      00000000G  EF	       02  FB 001F1 	    CALLS   #2, PAT$FAO_PUT					      ; 0998

	   9C	         52 0000007F   8F  F3 001F8 11$:    AOBLEQ  #127, ECO_BIT, 8$					      ; 0982

		         50 00000000G  EF  D0 00200 	    MOVL    PAT$GL_BUF_SIZ, R0					      ; 1001

				       13  13 00207 	    BEQL    12$							      ;

			    00000000G  EF  9F 00209 	    PUSHAB  PAT$GL_JNLRAB					      ; 1003

				  08   AE  9F 0020F 	    PUSHAB  OUT_BUFFER						      ;

				  FE   A0  9F 00212 	    PUSHAB  -2(R0)						      ;

	      00000000G  EF	       03  FB 00215 	    CALLS   #3, PAT$WRITEFILE					      ;

			    00000000G  EF  9F 0021C 12$:    PUSHAB  PAT$GL_JNLRAB					      ; 1004

				  08   AE  9F 00222 	    PUSHAB  OUT_BUFFER						      ;

				       7E  D4 00225 	    CLRL    -(SP)						      ;

	      00000000G  EF	       03  FB 00227 	    CALLS   #3, PAT$WRITEFILE					      ;

				       7E  D4 0022E 	    CLRL    -(SP)						      ; 1009

		         50 00000000G  EF  D0 00230 	    MOVL    PAT$GL_IHPPTR, R0					      ; 1010

	   7E	    14   A0	  10   A0  C1 00237 	    ADDL3   16(R0), 20(R0), -(SP)				      ;

				  14   A0  DD 0023D 	    PUSHL   20(R0)						      ; 1009

	      00000000G  EF	       03  FB 00240 	    CALLS   #3, PAT$ADD_PAL					      ;

				       7E  7C 00247 	    CLRQ    -(SP)						      ; 1018

			    00000000G  EF  9F 00249 	    PUSHAB  PAT$GL_ISVADDR					      ;

				       01  DD 0024F 	    PUSHL   #1							      ;

	      00000000G  9F	       04  FB 00251 	    CALLS   #4, @#SYS$EXPREG					      ;

		         6A	       50  D0 00258 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         11	       6A  E8 0025B 	    BLBS    PAT$GL_ERRCODE, 13$					      ; 1019

				       6A  DD 0025E 	    PUSHL   PAT$GL_ERRCODE					      ; 1021

				       01  DD 00260 	    PUSHL   #1							      ;

			    006D8184   8F  DD 00262 	    PUSHL   #7176580						      ;

	      00000000G  00	       03  FB 00268 	    CALLS   #3, LIB$SIGNAL					      ;

	      00000000G  EF 00000000G  EF  D0 0026F 13$:    MOVL    PAT$GL_ISVADDR, PAT$GL_EXPANDVA			      ; 1022

00000000G  EF 00000000G  EF	       01  C3 0027A 	    SUBL3   #1, PAT$GL_ISVADDR, PAT$GL_ISVADDR+4		      ; 1023

		         6B	       58  D0 00286 	    MOVL    NXTPTR, CURISD					      ; 1024

				  00   BB  B5 00289 14$:    TSTW    @CURISD						      ; 1029

				       03  12 0028C 	    BNEQ    15$							      ;

				     010B  31 0028E 	    BRW     24$							      ;

		  FFFF   8F	  00   BB  B1 00291 15$:    CMPW    @CURISD, #65535					      ; 1034



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-8

; Digital Equipment Corporation

;

				       39  12 00297 	    BNEQ    17$							      ;

			    00000000G  EF  9F 00299 	    PUSHAB  PAT$GL_OLDRAB					      ; 1037

	      00000000G  9F	       01  FB 0029F 	    CALLS   #1, @#SYS$READ					      ;

		         6A	       50  D0 002A6 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         1E	       6A  E8 002A9 	    BLBS    PAT$GL_ERRCODE, 16$					      ; 1038

			    00000000G  EF  9F 002AC 	    PUSHAB  PAT$GB_OLDNAME					      ; 1040

		         7E 00000000G  EF  9A 002B2 	    MOVZBL  PAT$GL_OLDNBK+3, -(SP)				      ;

				       6A  DD 002B9 	    PUSHL   PAT$GL_ERRCODE					      ;

				       03  DD 002BB 	    PUSHL   #3							      ;

			    006D818C   8F  DD 002BD 	    PUSHL   #7176588						      ;

	      00000000G  00	       05  FB 002C3 	    CALLS   #5, LIB$SIGNAL					      ;

		         58	  04   AB  D0 002CA 16$:    MOVL    INPBUF, NXTPTR					      ; 1042

		         6B	  04   AB  D0 002CE 	    MOVL    INPBUF, CURISD					      ; 1043

		         50	       6B  D0 002D2 17$:    MOVL    CURISD, R0						      ; 1045

		         51	       60  3C 002D5 	    MOVZWL  (R0), ALLOC_SIZE					      ;

		         51	       14  C0 002D8 	    ADDL2   #20, ALLOC_SIZE					      ;

	   03	    08   A0	       02  E1 002DB 	    BBC     #2, 8(R0), 18$					      ; 1046

		         51	       08  C0 002E0 	    ADDL2   #8, ALLOC_SIZE					      ; 1048

		         10	       60  B1 002E3 18$:    CMPW    (R0), #16						      ; 1058

				       03  12 002E6 	    BNEQ    19$							      ;

		         51	       04  C0 002E8 	    ADDL2   #4, ALLOC_SIZE					      ; 1060

				4002   8F  BB 002EB 19$:    PUSHR   #^M<R1,SP>						      ; 1061

	      00000000G  EF	       02  FB 002EF 	    CALLS   #2, PAT$ALLOBLK					      ;

		         57	       6E  D0 002F6 	    MOVL    ISEADR, R7						      ; 1062

	   59	         57	       14  C1 002F9 	    ADDL3   #20, R7, DESPTR					      ;

		         56	       6B  D0 002FD 	    MOVL    CURISD, R6						      ; 1063

	   69	         68	       66  28 00300 	    MOVC3   (R6), (NXTPTR), (DESPTR)				      ;

		         50	       66  3C 00304 	    MOVZWL  (R6), R0						      ; 1064

		         58	       50  C0 00307 	    ADDL2   R0, NXTPTR						      ;

		         50 00000000G  EF  D0 0030A 	    MOVL    PAT$GL_ISETAIL, R0					      ; 1065

				       09  12 00311 	    BNEQ    20$							      ;

	      00000000G  EF	       57  D0 00313 	    MOVL    R7, PAT$GL_ISELHD					      ; 1068

				       03  11 0031A 	    BRB     21$							      ; 1065

		         60	       57  D0 0031C 20$:    MOVL    R7, (R0)						      ; 1073

	      00000000G  EF	       57  D0 0031F 21$:    MOVL    R7, PAT$GL_ISETAIL					      ; 1069

				       67  D4 00326 	    CLRL    (R7)						      ; 1076

      04   A6	         17	       00  EF 00328 	    EXTZV   #0, #23, 4(R6), R0					      ; 1077

				       50     0032D									      ;

      04   A7	         50	       09  78 0032E 	    ASHL    #9, R0, 4(R7)					      ;

      04   A6	         17	       00  EF 00333 	    EXTZV   #0, #23, 4(R6), R0					      ; 1078

				       50     00338									      ;

		         51	  02   A6  3C 00339 	    MOVZWL  2(R6), R1						      ;

		         50	       51  C0 0033D 	    ADDL2   R1, R0						      ;

	   50	         50	       09  78 00340 	    ASHL    #9, R0, R0						      ;

      08   A7	         50	       01  C3 00344 	    SUBL3   #1, R0, 8(R7)					      ;

				  0C   A7  7C 00349 	    CLRQ    12(R7)						      ; 1079

		    FD   8F	  0B   A6  91 0034C 	    CMPB    11(R6), #253					      ; 1081

				       21  13 00351 	    BEQL    22$							      ;

      04   A6	         17	       00  ED 00353 	    CMPZV   #0, #23, 4(R6), PAT$GL_NEWVPNMX			      ; 1083

			    00000000G  EF     00358									      ;

				       15  1B 0035D 	    BLEQU   22$							      ;

      04   A6	         17	       00  EF 0035F 	    EXTZV   #0, #23, 4(R6), R0					      ; 1085

				       50     00364									      ;

		         51	  02   A6  3C 00365 	    MOVZWL  2(R6), R1						      ;

		         50	       51  C0 00369 	    ADDL2   R1, R0						      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 3-9

; Digital Equipment Corporation

;

00000000G  EF	         50	       01  C3 0036C 	    SUBL3   #1, R0, PAT$GL_NEWVPNMX				      ;

	   1A	    08   A6	       02  E0 00374 22$:    BBS     #2, 8(R6), 23$					      ; 1086

		    0C   A6 00000000G  EF  D1 00379 	    CMPL    PAT$GL_NEWVBNMX, 12(R6)				      ; 1088

				       10  18 00381 	    BGEQ    23$							      ;

		         50	  02   A6  3C 00383 	    MOVZWL  2(R6), R0						      ; 1090

		         50	  0C   A6  C0 00387 	    ADDL2   12(R6), R0						      ;

00000000G  EF	         50	       01  C3 0038B 	    SUBL3   #1, R0, PAT$GL_NEWVBNMX				      ;

		         50	       66  3C 00393 23$:    MOVZWL  (R6), R0						      ; 1091

		         6B	       50  C0 00396 	    ADDL2   R0, CURISD						      ;

				     FEED  31 00399 	    BRW     14$							      ; 1029

	      00000000G  EF 00000000G  EF  D0 0039C 24$:    MOVL    PAT$GL_NEWVBNMX, PAT$GL_OLDVBNMX			      ; 1093

					   04 003A7 	    RET     							      ; 0831



; Routine Size:  936 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 4

; Digital Equipment Corporation

;

;	1095	GLOBAL ROUTINE PAT$CREMAP(ISEADR) :NOVALUE =				! CREATES AND MAPS AN IMAGE SECTION

;	1096	

;	1097	!++

;	1098	! FUNCTIONAL DESCRIPTION:

;	1099	!

;	1100	!	THIS ROUTINE CREATES AND MAPS IMAGE SECTIONS.  ALL SECTIONS

;	1101	!	ARE MAPPED WRITABLE.  GLOBAL SECTIONS WHICH MUST ALWAYS BE 

;	1102	!	OBTAINED EXTERNALLY, WILL NOT BE MAPPED (AS PATCH HAS NO WAY TO

;	1103	!	OBTAIN THEM) AND INSTEAD, AN ERROR IS REPORTED.  IF THERE

;	1104	!	IS A LOCAL COPY OF THE GLOBAL SECTION, THEN THAT WILL BE PATCHED

;	1105	!	NO MATTER WHAT THE MATCH CONTROL FIELD CONTAINS.

;	1106	!

;	1107	!	THE IMAGE SECTION DESCRIBING THE STACK MAY NOT BE PATCHED.

;	1108	!

;	1109	!	THE IMAGE SECTION ENTRY IS UPDATED TO CONTAIN THE MAPPED VIRTUAL ADDRESSES.

;	1110	!

;	1111	! FORMAL PARAMETERS:

;	1112	!

;	1113	!	CURISE - ADDRESS OF IMAGE SECTION ENTRY TO BE MAPPED

;	1114	!

;	1115	! IMPLICIT INPUTS:

;	1116	!

;	1117	!	THE OLD IMAGE FILE HAS BEEN SET UP FOR INPUT.

;	1118	!

;	1119	! IMPLICIT OUTPUTS:

;	1120	!

;	1121	!	THE IMAGE SECTION IS MAPPED AND THE IMAGE SECTION ENTRY UPDATED.

;	1122	!

;	1123	! ROUTINE VALUE:

;	1124	!

;	1125	! COMPLETION CODES:

;	1126	!

;	1127	!	NONE

;	1128	!

;	1129	! SIDE EFFECTS:

;	1130	!

;	1131	!	ERROR MESSAGE IS REPORTED IF UNABLE TO MAP OR MAP FAILS.

;	1132	!	IMAGE SECTION IS MAPPED.

;	1133	!

;	1134	!--

;	1135	

;	1136	BEGIN

;	1137	

;	1138	LOCAL

;	1139		IMG_FIL_DESC: VECTOR[2,LONG],				! TEMPORARY IMAGE FILE NAME DESCRIPTOR

;	1140		CURISD: REF BLOCK[,BYTE];				! CONTAINS ADDRESS OF ISD PART OF ISE

;	1141	MAP

;	1142		ISEADR: REF BLOCK[,BYTE];				! CONTAINS ADDRESS OF IMAGE SECTION ENTRY

;	1143	

;	1144	!++

;	1145	! SET UP THE VIRTUAL PAGES TO MAP IMAGE SECTION TO.

;	1146	!--

;	1147	CURISD=.ISEADR + ISE$C_SIZE;					! SET ADDRESS OF ISD PART OF ISE

;	1148	PAT$GL_ISVADDR[START_OFF]=.PAT$GL_ISVADDR[END_OFF]+1;		! SET NEXT ADDRESS TO MAP TO

;	1149	PAT$GL_ISVADDR[END_OFF]=.PAT$GL_ISVADDR[END_OFF] + (.CURISD[ISD$W_PAGCNT] * 512); ! SET END ADDRESS FOR THIS SECTION



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 4-1

; Digital Equipment Corporation

;

;	1150	

;	1151	IMG_FIL_DESC[0]=.PAT$GL_OLDNBK[NAM$B_RSL];			! SET LENGTH OF NAME

;	1152	IMG_FIL_DESC[1]=PAT$GB_OLDNAME;					! SET ADDRESS OF NAME

;	1153	

;	1154	!++

;	1155	! CHECK FOR STACK IMAGE SECTION DESCRIPTOR.

;	1156	!--

;	1157	IF .CURISD[ISD$B_TYPE] EQL ISD$K_USRSTACK

;	1158	THEN

;	1159		SIGNAL(PAT$_NOACCESS);					! REPORT ERROR

;	1160	

;	1161	!++

;	1162	! CHECK FOR DEMAND ZERO IMAGE SECTIONS.

;	1163	!--

;	1164	IF .CURISD[ISD$V_DZRO]

;	1165	THEN

;	1166		BEGIN

;	1167	!	PAT$GL_ERRCODE=$CRMPSC(	  INADR=PAT$GL_ISVADDR		! CREATE AND MAP IMAGE SECTION

;	1168	!				, RETADR=ISEADR[ISE$L_MAPVST]	! RETURNED MAP START AND END ADDRESSES

;	1169	!				, FLAGS=(SEC$M_DZRO OR SEC$M_WRT OR SEC$M_CRF) ! READ/WRITE AND DEMAND ZERO

;	1170	!				, CHAN=.PAT$GL_OLDFAB[FAB$L_STV]! CHANNEL NUMBER

;	1171	!				, PAGCNT=.CURISD[ISD$W_PAGCNT]); ! NUMBER OF PAGES TO MAP

;	1172		PAT$GL_ERRCODE=LIB$_CREMAPSEC(	PAT$GL_ISVADDR

;	1173						, ISEADR[ISE$L_MAPVST]

;	1174						, (SEC$M_DZRO OR SEC$M_WRT OR SEC$M_CRF)

;	1175						, 0

;	1176						, 0

;	1177						, IMG_FIL_DESC

;	1178						, .CURISD[ISD$W_PAGCNT]

;	1179						, 0);

;	1180		IF NOT .PAT$GL_ERRCODE

;	1181		THEN

;	1182			SIGNAL(PAT$_CRMPSC,1,.PAT$GL_ERRCODE);		! REPORT ERROR

;	1183		END

;	1184	

;	1185	!++

;	1186	! IF NOT DEMAND ZERO, THEN CHECK FOR A GLOBAL SECTION THAT HAS NO LOCAL COPY.

;	1187	!--

;	1188	ELSE

;	1189		BEGIN

;	1190		IF .CURISD[ISD$V_GBL]					! IF IT IS GLOBAL

;	1191		THEN

;	1192			IF (.CURISD[ISD$L_VBN] EQL 0)			! and does not have a local copy

;	1193			THEN

;	1194				SIGNAL(PAT$_GBLONLY,1,CURISD[ISD$T_GBLNAM]); ! THEN REPORT ERROR AND UNWIND/EXIT

;	1195	!	PAT$GL_ERRCODE=$CRMPSC(	  INADR=PAT$GL_ISVADDR		! CREATE AND MAP IMAGE SECTION

;	1196	!				, RETADR=ISEADR[ISE$L_MAPVST]	! RETURNED MAP STAR AND END ADDRESSES

;	1197	!				, VBN=.CURISD[ISD$L_VBN]	! BLOCK ADDRESS OF FIRST BLOCK TO MAP

;	1198	!				, FLAGS=(SEC$M_WRT OR SEC$M_CRF)		! READ/WRITE

;	1199	!				, CHAN=.PAT$GL_OLDFAB[FAB$L_STV] ! CHANNEL NUMBER

;	1200	!				, PAGCNT=.CURISD[ISD$W_PAGCNT]); ! NUMBER OF PAGES TO MAP

;	1201		PAT$GL_ERRCODE=LIB$_CREMAPSEC(	PAT$GL_ISVADDR

;	1202						, ISEADR[ISE$L_MAPVST]

;	1203						, (SEC$M_WRT OR SEC$M_CRF)

;	1204						, 0



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 4-2

; Digital Equipment Corporation

;

;	1205						, 0

;	1206						, IMG_FIL_DESC

;	1207						, .CURISD[ISD$W_PAGCNT]

;	1208						, .CURISD[ISD$L_VBN]);

;	1209		IF NOT .PAT$GL_ERRCODE

;	1210		THEN

;	1211			SIGNAL(PAT$_CRMPSC,1,.PAT$GL_ERRCODE);		! REPORT ERROR

;	1212		RETURN							! RETURN ALWAYS SUCCESSFULLY

;	1213		END;

;	1214	

;	1215	

;	1216	END;								! END OF PATMAP











					 0E0C 003A8 	    .ENTRY  PAT$CREMAP, Save R2,R3,R9,R10,R11			      ; 1095

		         59 00000000G  EF  9E 003AA 	    MOVAB   PAT$GL_ERRCODE, R9					      ;

		         5A 00000000G  00  9E 003B1 	    MOVAB   LIB$SIGNAL, R10					      ;

		         5B 00000000G  EF  9E 003B8 	    MOVAB   PAT$GL_ISVADDR+4, R11				      ;

		         5E	       04  C2 003BF 	    SUBL2   #4, SP						      ;

	   52	    04   AC	       14  C1 003C2 	    ADDL3   #20, ISEADR, CURISD					      ; 1147

      FC   AB	         6B	       01  C1 003C7 	    ADDL3   #1, PAT$GL_ISVADDR+4, PAT$GL_ISVADDR		      ; 1148

		         50	  02   A2  3C 003CC 	    MOVZWL  2(CURISD), R0					      ; 1149

	   50	         50	       09  78 003D0 	    ASHL    #9, R0, R0						      ; 0000

		         6B	       50  C0 003D4 	    ADDL2   R0, PAT$GL_ISVADDR+4				      ; 1149

		         7E 00000000G  EF  9A 003D7 	    MOVZBL  PAT$GL_OLDNBK+3, IMG_FIL_DESC			      ; 1151

		    04   AE 00000000G  EF  9E 003DE 	    MOVAB   PAT$GB_OLDNAME, IMG_FIL_DESC+4			      ; 1152

		    FD   8F	  0B   A2  91 003E6 	    CMPB    11(CURISD), #253					      ; 1157

				       09  12 003EB 	    BNEQ    1$							      ;

			    006D80E2   8F  DD 003ED 	    PUSHL   #7176418						      ; 1159

		         6A	       01  FB 003F3 	    CALLS   #1, LIB$SIGNAL					      ;

	   53	    04   AC	       0C  C1 003F6 1$:     ADDL3   #12, ISEADR, R3					      ; 1173

	   0F	    08   A2	       02  E1 003FB 	    BBC     #2, 8(CURISD), 2$					      ; 1164

				       7E  D4 00400 	    CLRL    -(SP)						      ; 1172

		         7E	  02   A2  3C 00402 	    MOVZWL  2(CURISD), -(SP)					      ;

				  08   AE  9F 00406 	    PUSHAB  IMG_FIL_DESC					      ;

				       7E  7C 00409 	    CLRQ    -(SP)						      ;

				       0E  DD 0040B 	    PUSHL   #14							      ;

				       25  11 0040D 	    BRB     4$							      ;

		         13	  08   A2  E9 0040F 2$:     BLBC    8(CURISD), 3$					      ; 1190

				  0C   A2  D5 00413 	    TSTL    12(CURISD)						      ; 1192

				       0E  12 00416 	    BNEQ    3$							      ;

				  14   A2  9F 00418 	    PUSHAB  20(CURISD)						      ; 1194

				       01  DD 0041B 	    PUSHL   #1							      ;

			    006D8048   8F  DD 0041D 	    PUSHL   #7176264						      ;

		         6A	       03  FB 00423 	    CALLS   #3, LIB$SIGNAL					      ;

				  0C   A2  DD 00426 3$:     PUSHL   12(CURISD)						      ; 1201

		         7E	  02   A2  3C 00429 	    MOVZWL  2(CURISD), -(SP)					      ;

				  08   AE  9F 0042D 	    PUSHAB  IMG_FIL_DESC					      ;

				       7E  7C 00430 	    CLRQ    -(SP)						      ;

				       0A  DD 00432 	    PUSHL   #10							      ;

				       53  DD 00434 4$:     PUSHL   R3							      ;

				  FC   AB  9F 00436 	    PUSHAB  PAT$GL_ISVADDR					      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 4-3

; Digital Equipment Corporation

;

	      00000000G  EF	       08  FB 00439 	    CALLS   #8, LIB$_CREMAPSEC					      ;

		         69	       50  D0 00440 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         0D	       69  E8 00443 	    BLBS    PAT$GL_ERRCODE, 5$					      ; 1209

				       69  DD 00446 	    PUSHL   PAT$GL_ERRCODE					      ; 1211

				       01  DD 00448 	    PUSHL   #1							      ;

			    006D816C   8F  DD 0044A 	    PUSHL   #7176556						      ;

		         6A	       03  FB 00450 	    CALLS   #3, LIB$SIGNAL					      ;

					   04 00453 5$:     RET     							      ; 1095



; Routine Size:  172 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 02:59:42	DBB3:[PATCH.SRC]PATIHD.B32;12					Page 5

; Digital Equipment Corporation

;

;	1217	END				!End of module

;	1218	ELUDOM









							    .GLOBL  LIB$SIGNAL



;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  _PAT$OWN       	     8    WRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  _PAT$PLIT      	    64  NOWRT,  RD ,NOEXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(0)

;  _PAT$CODE      	  1108  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)

;  $CODE$         	     0  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582        36         0       234











; Size:		1108 code + 72 data bytes

; Run Time:	00:42.3

; Elapsed Time:	01:05.7

; Memory Used:	456 pages

; Compilation Complete

