

; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE PATCMD (

;	0002			%IF %VARIANT EQL 1

;     L 0003			%THEN

;	0004				ADDRESSING_MODE (EXTERNAL = LONG_RELATIVE, NONEXTERNAL = LONG_RELATIVE),

;	0005			%FI

;	0006			IDENT = 'X01.09') =

;	0007	BEGIN

;	0008	

;	0009	! Copyright (C) 1976

;	0010	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0011	!

;	0012	! This software is furnished under a license for use only on a

;	0013	! single computer system and may be copied only with the inclusion

;	0014	! of the above copyright notice. This software, or any

;	0015	! other copies thereof, may not be provided or otherwise made

;	0016	! available to any other person except for use on such system

;	0017	! and to one who agrees to these license terms. Title to and

;	0018	! ownership of the software shall at all times remain in DEC.

;	0019	!

;	0020	! The information in this software is subject to change without

;	0021	! notice and should not be construed as a commitment by Digital

;	0022	! Equipment Corporation.

;	0023	!

;	0024	! DEC assumes no responsibility for the use or reliability of

;	0025	! its software on equipment which is not supplied by DEC.

;	0026	!

;	0027	! FACILITY:	PATCH

;	0028	!

;	0029	!++

;	0030	! FUNCTIONAL DESCRIPTION:

;	0031	!

;	0032	!	PATCH COMMAND LINE HANDLER

;	0033	!

;	0034	! Version:	X01.09

;	0035	!

;	0036	! History:

;	0037	!	Author:

;	0038	!		Carol Peters, 05 Oct 1976: DBGEXC.B32 Version 01

;	0039	!

;	0040	!

;	0041	! MODIFICATIONS:

;	0042	!

;	0043	!  NO	DATE		PROGRAMMER		PURPOSE

;	0044	!  --	----		----------		-------

;	0045	!

;	0046	!  00	13-OCT-77	K.D. MORSE		CONVERT FOR PATCH

;	0047	!  01	15-DEC-77	K.D. MORSE		ADD JOURNAL OUTPUT,

;	0048	!						CHANGE PROMPT

;	0049	!  02	3-JAN-78	K.D. MORSE		ADD CHECK FOR EOF.

;	0050	!  03	5-JAN-78	K.D. MORSE		TURN OFF TYPE AHEAD AFTER

;	0051	!						FIRST READ.

;	0052	!  04	16-JAN-78	K.D. MORSE		MAKE PAT$PROMPT_READ TO

;	0053	!						HANDLE COMMAND PROMPTING.

;	0054	!  05	23-JAN-78	K.D. MORSE		CHANGE PAT$CP_INP_STR TO

;	0055	!						PAT$CP_INP_DSCS, A BLOCK OF INPUT



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 1-1

; Digital Equipment Corporation

;

;	0056	!						LINE DESCRIPTORS TO HANDLE

;	0057	!						PROMPTING AND MULTIPLE INPUT LINES.

;	0058	!  06	21-MAR-78	K.D. MORSE		ADD CHECK FOR <CR><LF> AND

;	0059	!						NO PATCH COMMAND.

;	0060	!  07	25-APR-78	K.D. MORSE		CONVERT TO NATIVE COMPILER.

;	0061	!  08	13-JUN-78	K.D. MORSE		ADD FAO COUNT TO SIGNALS.

;	0062	!  09	19-JUN-78	K.D. MORSE		ADD CHECK TO IGNORE COMMENTS.

;	0063	!

;	0064	!--



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 2

; Digital Equipment Corporation

;

;	0065	FORWARD ROUTINE

;	0066		PAT$COM_PROC : NOVALUE,					! Accepts a command

;	0067		PAT$PROMPT_READ;					! Prompts and reads a command

;	0068	

;	0069	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0070	REQUIRE 'SRC$:VXSMAC.REQ';

;	0110	REQUIRE 'LIB$:PATMSG.REQ';

;	0268	REQUIRE 'SRC$:PATPCT.REQ';

;	0284	REQUIRE 'SRC$:PATGEN.REQ';

;	0463	REQUIRE 'SRC$:PATTER.REQ';

;	0543	REQUIRE 'SRC$:PATTOK.REQ';

;	0589	REQUIRE 'SRC$:SYSSER.REQ';

;      R0597	SWITCHES LIST (SOURCE);

;      R0598	

;      R0599	EXTERNAL ROUTINE

;      R0600		PAT$fao_out;		! formats a line and outputs to the terminal

;      R0601	

;      R0602	SWITCHES LIST (NOSOURCE);

;	0647	

;	0648	EXTERNAL ROUTINE

;	0649		PAT$ERR_HANDLER,					! Exception handler

;	0650		PAT$FREERELEASE,					! Releases free storage

;	0651		PAT$FREEZ,						! Allocates free storage

;	0652		PAT$PARS_A_LINE,					! Parses a line of input text

;	0653		PAT$WRITEFILE;						! Writes the journal file

;	0654	

;	0655	

;	0656	EXTERNAL

;	0657		PAT$CP_INP_DSCS : REF VECTOR [,LONG],			! Points to vector of input string descriptors

;	0658		PAT$GB_TAKE_CMD,					! Indicator to accept more commands

;	0659		PAT$GB_INPNAME,						! Input file name

;	0660		PAT$GL_ERRCODE,						! Global error code

;	0661		PAT$GL_INPRAB: BLOCK [, BYTE],				! RAB for 'SYS$INPUT'

;	0662		PAT$GL_JNLRAB: BLOCK [, BYTE];				! RAB for journal file

;	0663	

;	0664	EXTERNAL LITERAL

;	0665		PAT$K_INPNAMLNG;					! Input file name length

;	0666	

;	0667	LITERAL

;	0668		PATCH_PMT = 90;						! Patch command prompt offset



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 3

; Digital Equipment Corporation

;

;	0669	GLOBAL ROUTINE PAT$COM_PROC : NOVALUE =

;	0670	

;	0671	!++

;	0672	! FUNCTIONAL DESCRIPTION:

;	0673	!

;	0674	!	Accepts a single command line from the user at patch command level.

;	0675	!	A command is read from SYS$INPUT.

;	0676	!

;	0677	! CALLING SEQUENCE:

;	0678	!

;	0679	!	PAT$COM_PROC 

;	0680	!

;	0681	! INPUTS:

;	0682	!

;	0683	!	none

;	0684	!

;	0685	! IMPLICIT INPUTS:

;	0686	!

;	0687	!	none

;	0688	!

;	0689	! OUTPUTS:

;	0690	!

;	0691	!	none

;	0692	!

;	0693	! IMPLICIT OUTPUTS:

;	0694	!

;	0695	!	none

;	0696	!

;	0697	! ROUTINE VALUE:

;	0698	!

;	0699	!	NOVALUE

;	0700	!

;	0701	! SIDE EFFECTS:

;	0702	!

;	0703	!	The parser is called with the contents of the input buffer.

;	0704	!

;	0705	!--

;	0706	

;	0707	BEGIN

;	0708	

;	0709	LOCAL

;	0710		STG_DESC: BLOCK [8, BYTE];				! String descriptor for parser

;	0711	

;	0712	ENABLE PAT$ERR_HANDLER;

;	0713	

;	0714	!++

;	0715	! Request patch command.

;	0716	!--

;	0717	STG_DESC[DSC$W_LENGTH] = 0;

;	0718	WHILE (.STG_DESC[DSC$W_LENGTH] EQL 0)

;	0719	DO

;	0720		IF NOT PAT$PROMPT_READ (PATCH_PMT, STG_DESC)

;	0721		THEN

;	0722			RETURN;

;	0723	



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 3-1

; Digital Equipment Corporation

;

;	0724	!++

;	0725	! Parse the command and execute it.

;	0726	!--

;	0727	PAT$PARS_A_LINE (STG_DESC);

;	0728	RETURN;

;	0729	END;





							    .TITLE  PATCMD

							    .IDENT  \X01.09\



							    .GLOBL  PAT$FAO_OUT, PAT$ERR_HANDLER, PAT$FREERELEASE

							    .GLOBL  PAT$FREEZ, PAT$PARS_A_LINE, PAT$WRITEFILE, PAT$CP_INP_DSCS

							    .GLOBL  PAT$GB_TAKE_CMD, PAT$GB_INPNAME, PAT$GL_ERRCODE

							    .GLOBL  PAT$GL_INPRAB, PAT$GL_JNLRAB, PAT$K_INPNAMLNG



							    .PSECT  _PAT$CODE,NOWRT,2



					 0000 00000 	    .ENTRY  PAT$COM_PROC, Save nothing				      ; 0669

		         5E	       08  C2 00002 	    SUBL2   #8, SP						      ;

		         6D 00000023   EF  DE 00005 	    MOVAL   4$, (FP)						      ; 0707

				       6E  B4 0000C 	    CLRW    STG_DESC						      ; 0717

				       6E  B5 0000E 1$:     TSTW    STG_DESC						      ; 0718

				       12  12 00010 	    BNEQ    2$							      ;

				       5E  DD 00012 	    PUSHL   SP							      ; 0720

		         7E	  5A   8F  9A 00014 	    MOVZBL  #90, -(SP)						      ;

	      00000000V  EF	       02  FB 00018 	    CALLS   #2, PAT$PROMPT_READ					      ;

		         0B	       50  E9 0001F 	    BLBC    R0, 3$						      ;

				       EA  11 00022 	    BRB     1$							      ;

				       5E  DD 00024 2$:     PUSHL   SP							      ; 0727

	      00000000G  EF	       01  FB 00026 	    CALLS   #1, PAT$PARS_A_LINE					      ;

					   04 0002D 3$:     RET     							      ; 0669

					 0000 0002E 4$:     .WORD   Save nothing					      ; 0707

				       7E  D4 00030 	    CLRL    -(SP)						      ;

				       5E  DD 00032 	    PUSHL   SP							      ;

		         7E	  04   AC  7D 00034 	    MOVQ    4(AP), -(SP)					      ;

	      00000000G  EF	       03  FB 00038 	    CALLS   #3, PAT$ERR_HANDLER					      ;

					   04 0003F 	    RET     							      ;



; Routine Size:  64 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4

; Digital Equipment Corporation

;

;	0730	GLOBAL ROUTINE PAT$PROMPT_READ(PROMPT_CODE, STG_DESC) =

;	0731	

;	0732	!++

;	0733	! FUNCTIONAL DESCRIPTION:

;	0734	!

;	0735	!	This routine requests a line of input from SYS$INPUT.  The prompt

;	0736	!	string is based on the prompt code passed as input.  The command

;	0737	!	line is read.

;	0738	!

;	0739	!	If the command read from the device SYS$INPUT is interpreted by

;	0740	!	RMS as EOF, or any other nonsuccessful return from RMS is seen,

;	0741	!	THEN cancel the command taking flag, and return.

;	0742	!

;	0743	!

;	0744	! CALLING SEQUENCE:

;	0745	!

;	0746	!	PAT$PROMPT_READ(PROMPT_CODE, STG_DESC) 

;	0747	!

;	0748	! INPUTS:

;	0749	!

;	0750	!	PROMPT_CODE - Code for which prompt to display

;	0751	!	STG_DESC - Input line string descriptor

;	0752	!

;	0753	! IMPLICIT INPUTS:

;	0754	!

;	0755	!	SYS$INPUT is already opened as the input channel.

;	0756	!

;	0757	! OUTPUTS:

;	0758	!

;	0759	!	The input line string descriptor is set.

;	0760	!

;	0761	! IMPLICIT OUTPUTS:

;	0762	!

;	0763	!	The new input line is read.

;	0764	!

;	0765	! ROUTINE VALUE:

;	0766	!

;	0767	!	Status code from read.

;	0768	!

;	0769	! SIDE EFFECTS:

;	0770	!

;	0771	!	The command line is written to the journal file.

;	0772	!

;	0773	!--

;	0774	

;	0775	BEGIN

;	0776	

;	0777	LITERAL

;	0778		NUM_OF_DSCS = 5,					! Number of default input line descriptors

;	0779		MORE_DSCS = 2,						! Size to increment input line table

;	0780		RIGHT_ANGLE = %X'3E',

;	0781		SPACES = %X'20',

;	0782		COMMENT_CHAR = %X'21',					! Comment delimiter

;	0783		NULL_BYTE_LOC	= 1,

;	0784		MAX_PMT_SIZ = 8,



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-1

; Digital Equipment Corporation

;

;	0785		CONTINUE_PMT = 7;

;	0786	

;	0787	MACRO

;	0788		PROMPT_MSG(PROMPT_STR) = UPLIT BYTE (%ASCII %STRING

;     M 0789					 (%CHAR (CARRIAGE_RET),%CHAR(LINEFEED),

;     M 0790					   PROMPT_STR,%CHAR(RIGHT_ANGLE)))%,

;	0791		PROMPT_SIZ(PROMPT_STR) = %CHARCOUNT (%ASCII %STRING

;     M 0792					 (%CHAR (CARRIAGE_RET),%CHAR(LINEFEED),

;     M 0793					  PROMPT_STR,%CHAR(RIGHT_ANGLE)))%;

;	0794	

;	0795	OWN

;	0796		PROMPT_MSG_PTR : VECTOR[8,LONG] INITIAL (		! Prompt texts

;	0797					PROMPT_MSG('PATCH'),

;	0798					PROMPT_MSG('OLD'),

;	0799					PROMPT_MSG('NEW'),

;	0800					PROMPT_MSG('LOC'),

;	0801					PROMPT_MSG('NAM'),

;	0802					PROMPT_MSG('EXP'),

;	0803					PROMPT_MSG('ECO'),

;	0804					PROMPT_MSG('_')),

;	0805		PROMPT_MSG_SIZ : VECTOR[8,BYTE] INITIAL ( BYTE(		! Prompt text lengths

;	0806					PROMPT_SIZ('PATCH'),

;	0807					PROMPT_SIZ('OLD'),

;	0808					PROMPT_SIZ('NEW'),

;	0809					PROMPT_SIZ('LOC'),

;	0810					PROMPT_SIZ('NAM'),

;	0811					PROMPT_SIZ('EXP'),

;	0812					PROMPT_SIZ('ECO'),

;	0813					PROMPT_SIZ('_')));

;	0814	

;	0815	LOCAL

;	0816		PMT_OFFSET,						! Offset into prompt tables

;	0817		PROMPT_BUFFER: VECTOR [MAX_PMT_SIZ-2+NO_OF_INP_CHARS+A_LONGWORD, BYTE],

;	0818		INPUT_BUFFER: REF VECTOR[,BYTE],

;	0819		PREV_COUNT,						! Current character count

;	0820		OLD_POINTER,						! Pointer to previous buffer

;	0821		LOOP,							! Loop counter

;	0822		NEW_DSCS,						! Pointer to new input line descriptor table

;	0823		NEW_POINTER : REF VECTOR [, BYTE];			! Pointer to current buffer

;	0824	

;	0825	LABEL

;	0826		GET_LINE,						! Block to get a command line

;	0827	

;	0828		FIND_COMMENT;						! Block to find comment lines

;	0829	

;	0830	MAP

;	0831		STG_DESC: REF BLOCK [8, BYTE];				! String descriptor for parser

;	0832	

;	0833	!++

;	0834	! Compute the offset into the prompt tables for the prompt code.

;	0835	! Set the INPUT_BUFFER to be the local input buffer.

;	0836	!--

;	0837	PMT_OFFSET = .PROMPT_CODE - MIN_PMT_CODE;

;	0838	INPUT_BUFFER = CH$PTR(PROMPT_BUFFER[MAX_PMT_SIZ-2], 0);

;	0839	



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-2

; Digital Equipment Corporation

;

;	0840	!++

;	0841	! Collect an entire command line.  Enter a loop that collects multiple lines of

;	0842	! input, ceasing only when a line ends with other than a hyphen ("-"), which

;	0843	! is the line continuation character. Buffer the possibly multiple lines into

;	0844	! free storage.

;	0845	!--

;	0846	PREV_COUNT = 0;

;	0847	OLD_POINTER = 0;

;	0848	PAT$GL_INPRAB [RAB$L_PBF] = CH$PTR(.PROMPT_MSG_PTR[.PMT_OFFSET],0);

;	0849	PAT$GL_INPRAB [RAB$B_PSZ] = .PROMPT_MSG_SIZ[.PMT_OFFSET];

;	0850	PAT$GL_INPRAB [RAB$L_UBF] = CH$PTR(.INPUT_BUFFER, 0);

;	0851	

;	0852	!++

;	0853	! Now get a command line.  If the first character is a comment delimiter

;	0854	! then get another command line.

;	0855	!--

;	0856	GET_LINE:

;	0857	BEGIN

;	0858	REPEAT

;	0859		BEGIN

;	0860		PAT$GL_ERRCODE = $GET (RAB = PAT$GL_INPRAB);

;	0861		IF NOT .PAT$GL_ERRCODE

;	0862		THEN

;	0863			BEGIN

;	0864			!++

;	0865			! The $GET failed. Set status so that PATCH returns to CLI.

;	0866			!--

;	0867			IF (.PAT$GL_ERRCODE EQL RMS$_EOF)

;	0868			THEN

;	0869				BEGIN

;	0870				PAT$GB_TAKE_CMD = FALSE;

;	0871				RETURN(.PAT$GL_ERRCODE);

;	0872				END

;	0873			ELSE

;	0874				SIGNAL (PAT$_GETERR,3,.PAT$GL_ERRCODE,PAT$K_INPNAMLNG,PAT$GB_INPNAME);

;	0875			END

;	0876		ELSE

;	0877		    FIND_COMMENT:

;	0878			BEGIN

;	0879			LOCAL

;	0880				MSG_SIZ;

;	0881			MSG_SIZ=.PAT$GL_INPRAB[RAB$W_RSZ];

;	0882			WHILE (.MSG_SIZ GTR 0)

;	0883			DO

;	0884				BEGIN

;	0885				IF (.INPUT_BUFFER[.PAT$GL_INPRAB[RAB$W_RSZ]-.MSG_SIZ] EQL %X'20')

;	0886				    OR (.INPUT_BUFFER[.PAT$GL_INPRAB[RAB$W_RSZ]-.MSG_SIZ] EQL %X'09')

;	0887				THEN

;	0888					MSG_SIZ = .MSG_SIZ - 1

;	0889				ELSE

;	0890					IF (.INPUT_BUFFER[.PAT$GL_INPRAB[RAB$W_RSZ]-.MSG_SIZ] EQL COMMENT_CHAR)

;	0891					THEN

;	0892						LEAVE FIND_COMMENT

;	0893					ELSE

;	0894						LEAVE GET_LINE;



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-3

; Digital Equipment Corporation

;

;	0895				END;

;	0896			END;

;	0897		END;

;	0898	END;

;	0899	

;	0900	!++

;	0901	! Insert the prompt (without the <CR><LF>) at the start of the input buffer and

;	0902	! write the prompt plus the command to the journal file.

;	0903	!--

;	0904	CH$COPY(.PROMPT_MSG_SIZ[.PMT_OFFSET]-2, CH$PTR(.PROMPT_MSG_PTR[.PMT_OFFSET],2),

;	0905			SPACES, MAX_PMT_SIZ-2, CH$PTR(PROMPT_BUFFER,0));

;	0906	PAT$WRITEFILE(.PAT$GL_INPRAB[RAB$W_RSZ]+MAX_PMT_SIZ-2, PROMPT_BUFFER,

;	0907			PAT$GL_JNLRAB);

;	0908	

;	0909	!++

;	0910	! Now change the prompt to an underscore in case there are continuation lines.

;	0911	!--

;	0912	CH$COPY(.PROMPT_MSG_SIZ[CONTINUE_PMT]-2, CH$PTR(.PROMPT_MSG_PTR[CONTINUE_PMT],2),

;	0913			SPACES, MAX_PMT_SIZ-2,	CH$PTR(PROMPT_BUFFER,0));

;	0914	PAT$GL_INPRAB [RAB$V_PTA] = FALSE;

;	0915	PAT$GL_INPRAB [RAB$L_PBF] = CH$PTR(.PROMPT_MSG_PTR[CONTINUE_PMT],0);

;	0916	PAT$GL_INPRAB [RAB$B_PSZ] = .PROMPT_MSG_SIZ[CONTINUE_PMT];

;	0917	

;	0918	!++

;	0919	! Loop, reading all continuation lines for this command.

;	0920	!--

;	0921	REPEAT

;	0922		BEGIN

;	0923	

;	0924		LOCAL

;	0925			CONT_LINE;					! Boolean test for end of line character

;	0926	

;	0927		IF (.INPUT_BUFFER [.PAT$GL_INPRAB [RAB$W_RSZ] - 1] EQL '-')

;	0928		THEN

;	0929			BEGIN

;	0930			PAT$GL_INPRAB [RAB$W_RSZ] = .PAT$GL_INPRAB [RAB$W_RSZ] - 1;

;	0931			CONT_LINE = TRUE;

;	0932			END

;	0933		ELSE CONT_LINE = FALSE;

;	0934	

;	0935		!++

;	0936		! Allocate space for this buffer plus all previous buffers.

;	0937		! If the space can be found, write the old and new buffers

;	0938		! into the new space.

;	0939		!--

;	0940		NEW_POINTER = PAT$freez ((.PREV_COUNT + NULL_BYTE_LOC +

;	0941			.PAT$GL_INPRAB [RAB$W_RSZ] + 3) / 4);

;	0942	

;	0943		IF (.OLD_POINTER NEQ 0)

;	0944		THEN

;	0945			BEGIN

;	0946			CH$MOVE (.PREV_COUNT, .OLD_POINTER, .NEW_POINTER);

;	0947			PAT$FREERELEASE (.OLD_POINTER, (.PREV_COUNT + NULL_BYTE_LOC + 3) / 4);

;	0948			END;

;	0949		CH$MOVE (.PAT$GL_INPRAB [RAB$W_RSZ], CH$PTR(.INPUT_BUFFER,0),



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-4

; Digital Equipment Corporation

;

;	0950				CH$PLUS (.NEW_POINTER, .PREV_COUNT));

;	0951		PREV_COUNT = .PREV_COUNT + .PAT$GL_INPRAB [RAB$W_RSZ];

;	0952		NEW_POINTER [.PREV_COUNT] = 0;

;	0953		OLD_POINTER = .NEW_POINTER;

;	0954	

;	0955		!++

;	0956		! See whether this line ends with a continuation character.

;	0957		! If so, get another line.

;	0958		!--

;	0959		IF NOT .CONT_LINE

;	0960		THEN EXITLOOP;

;	0961		PAT$GL_ERRCODE = $GET (RAB = PAT$GL_INPRAB);

;	0962		IF NOT .PAT$GL_ERRCODE

;	0963		THEN

;	0964			SIGNAL (PAT$_GETERR,3,.PAT$GL_ERRCODE,PAT$K_INPNAMLNG,PAT$GB_INPNAME);

;	0965		PAT$WRITEFILE(.PAT$GL_INPRAB[RAB$W_RSZ]+MAX_PMT_SIZ-2, PROMPT_BUFFER,

;	0966				PAT$GL_JNLRAB);

;	0967		END;

;	0968	

;	0969	!++

;	0970	! A complete line has been collected.  Now set up the return input line descriptor.

;	0971	!--

;	0972	STG_DESC [dsc$w_length] = .PREV_COUNT;

;	0973	STG_DESC [dsc$a_pointer] = .NEW_POINTER;

;	0974	

;	0975	!++

;	0976	! The input line must be entered in the input descriptor table for deallocation

;	0977	! when the command is over.  PAT$CP_INP_DSCS is a pointer to a vector of

;	0978	! longwords.  The first longword is the number of string descriptors in the

;	0979	! vector.  The remaining space is string descriptors, one for each input line

;	0980	! used for this command.  Any unused descriptors are filled with zeros.

;	0981	! PAT$END_OF_LINE in PATACT.B32 will deallocate the input lines.

;	0982	!--

;	0983	

;	0984	!++

;	0985	! First check that there is a descriptor table allocated.

;	0986	! If not, then allocate one and initialize the count of descriptors.

;	0987	!--

;	0988	IF (.PAT$CP_INP_DSCS EQLA 0)

;	0989	THEN

;	0990		BEGIN

;	0991		PAT$CP_INP_DSCS = PAT$FREEZ(((A_QUADWORD * NUM_OF_DSCS) + A_LONGWORD +3)/4);

;	0992		PAT$CP_INP_DSCS[0] = NUM_OF_DSCS;

;	0993		END;

;	0994	

;	0995	!++

;	0996	! Now enter a string descriptor for the input line just read.  Use the first

;	0997	! zero entry in the descriptor table.  If there is none, then a larger table

;	0998	! must be allocated and the old table deallocated.

;	0999	!--

;	1000	INCR LOOP FROM 1 TO .PAT$CP_INP_DSCS[0]*2 BY 2

;	1001	DO

;	1002		IF (.PAT$CP_INP_DSCS[.LOOP] EQL 0)

;	1003		THEN

;	1004			BEGIN



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-5

; Digital Equipment Corporation

;

;	1005			PAT$CP_INP_DSCS [.LOOP] = .PREV_COUNT + 1;

;	1006			PAT$CP_INP_DSCS [.LOOP + 1] = .NEW_POINTER;

;	1007			RETURN(.PAT$GL_ERRCODE);

;	1008			END;

;	1009	

;	1010	!++

;	1011	! There was not enough room in the descriptor table.  Therefore allocate a

;	1012	! larger table, copy in the old table, deallocate the old table, and insert

;	1013	! the new descriptor into the table.

;	1014	!--

;	1015	NEW_DSCS = PAT$FREEZ( (((.PAT$CP_INP_DSCS[0] + MORE_DSCS)* A_QUADWORD) + A_LONGWORD

;	1016					+3) / 4);

;	1017	CH$MOVE(((.PAT$CP_INP_DSCS[0] * A_QUADWORD) + A_LONGWORD), CH$PTR(.PAT$CP_INP_DSCS, 0),

;	1018		CH$PTR(.NEW_DSCS, 0));

;	1019	PAT$FREERELEASE(.PAT$CP_INP_DSCS, ((.PAT$CP_INP_DSCS[0] * A_QUADWORD) + A_LONGWORD

;	1020				+ 3) / 4);

;	1021	PAT$CP_INP_DSCS = CH$PTR (.NEW_DSCS, 0);

;	1022	PAT$CP_INP_DSCS[(.PAT$CP_INP_DSCS[0]*2)+1] = .PREV_COUNT + 1;

;	1023	PAT$CP_INP_DSCS[(.PAT$CP_INP_DSCS[0]*2)+2] = .NEW_POINTER;

;	1024	PAT$CP_INP_DSCS[0] = .PAT$CP_INP_DSCS[0] + MORE_DSCS;

;	1025	RETURN(.PAT$GL_ERRCODE);

;	1026	END;







							    .PSECT  _PAT$PLIT,NOWRT,NOEXE,0



					      00000 P.AAA:  .ASCII  <13><10>\PATCH>\					      ;

					      00008 P.AAB:  .ASCII  <13><10>\OLD>\					      ;

					      0000E	    .BLKB   2

					      00010 P.AAC:  .ASCII  <13><10>\NEW>\					      ;

					      00016	    .BLKB   2

					      00018 P.AAD:  .ASCII  <13><10>\LOC>\					      ;

					      0001E	    .BLKB   2

					      00020 P.AAE:  .ASCII  <13><10>\NAM>\					      ;

					      00026	    .BLKB   2

					      00028 P.AAF:  .ASCII  <13><10>\EXP>\					      ;

					      0002E	    .BLKB   2

					      00030 P.AAG:  .ASCII  <13><10>\ECO>\					      ;

					      00036	    .BLKB   2

					      00038 P.AAH:  .ASCII  <13><10>\_>\					      ;



							    .PSECT  _PAT$OWN,NOEXE,2



					      00000 PROMPT_MSG_PTR:

							    .ADDRESS  P.AAA , P.AAB , P.AAC , P.AAD , P.AAE , P.AAF , -       ;

								    P.AAG , P.AAH					      ;

					      00020 PROMPT_MSG_SIZ:

							    .BYTE   8, 6, 6, 6, 6, 6, 6, 4				      ;



							    .GLOBL  SYS$GET



							    .PSECT  _PAT$CODE,NOWRT,2



					 0FFC 00040 	    .ENTRY  PAT$PROMPT_READ, Save R2,R3,R4,R5,R6,R7,R8,R9,R10,R11     ; 0730



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-6

; Digital Equipment Corporation

;

		         5B 00000000G  EF  9E 00042 	    MOVAB   PAT$GL_INPRAB+34, R11				      ;

		         5E	FF70   CE  9E 00049 	    MOVAB   -144(SP), SP					      ;

	   52	    04   AC 0000005A   8F  C3 0004E 	    SUBL3   #90, PROMPT_CODE, PMT_OFFSET			      ; 0837

		         56	  06   AE  9E 00057 	    MOVAB   PROMPT_BUFFER+6, INPUT_BUFFER			      ; 0838

				       5A  D4 0005B 	    CLRL    PREV_COUNT						      ; 0846

				       58  D4 0005D 	    CLRL    OLD_POINTER						      ; 0847

		    0E   AB 00000000'EF42  D0 0005F 	    MOVL    PROMPT_MSG_PTR[PMT_OFFSET], PAT$GL_INPRAB+48	      ; 0848

		    12   AB 00000000'EF42  90 00068 	    MOVB    PROMPT_MSG_SIZ[PMT_OFFSET], PAT$GL_INPRAB+52	      ; 0849

		    02   AB	       56  D0 00071 	    MOVL    INPUT_BUFFER, PAT$GL_INPRAB+36			      ; 0850

				  DE   AB  9F 00075 1$:     PUSHAB  PAT$GL_INPRAB					      ; 0860

	      00000000G  9F	       01  FB 00078 	    CALLS   #1, @#SYS$GET					      ;

	      00000000G  EF	       50  D0 0007F 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         50 00000000G  EF  D0 00086 	    MOVL    PAT$GL_ERRCODE, R0					      ; 0861

		         2F	       50  E8 0008D 	    BLBS    R0, 3$						      ;

	      0001827A   8F	       50  D1 00090 	    CMPL    R0, #98938						      ; 0867

				       07  12 00097 	    BNEQ    2$							      ;

			    00000000G  EF  D4 00099 	    CLRL    PAT$GB_TAKE_CMD					      ; 0870

					   04 0009F 	    RET     							      ; 0871

			    00000000G  EF  9F 000A0 2$:     PUSHAB  PAT$GB_INPNAME					      ; 0874

			    00000000G  8F  DD 000A6 	    PUSHL   #PAT$K_INPNAMLNG					      ;

				       50  DD 000AC 	    PUSHL   R0							      ;

				       03  DD 000AE 	    PUSHL   #3							      ;

			    006D818C   8F  DD 000B0 	    PUSHL   #7176588						      ;

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

				       B6  11 000BD 	    BRB     1$							      ; 0861

		         50	       6B  3C 000BF 3$:     MOVZWL  PAT$GL_INPRAB+34, MSG_SIZ				      ; 0881

				       50  D5 000C2 4$:     TSTL    MSG_SIZ						      ; 0882

				       AF  15 000C4 	    BLEQ    1$							      ;

		         51	       6B  3C 000C6 	    MOVZWL  PAT$GL_INPRAB+34, R1				      ; 0885

		         51	       50  C2 000C9 	    SUBL2   MSG_SIZ, R1						      ;

		         20	     6146  91 000CC 	    CMPB    (R1)[INPUT_BUFFER], #32				      ;

				       06  13 000D0 	    BEQL    5$							      ;

		         09	     6146  91 000D2 	    CMPB    (R1)[INPUT_BUFFER], #9				      ; 0886

				       04  12 000D6 	    BNEQ    6$							      ;

				       50  D7 000D8 5$:     DECL    MSG_SIZ						      ; 0888

				       E6  11 000DA 	    BRB     4$							      ; 0885

		         51	       6B  3C 000DC 6$:     MOVZWL  PAT$GL_INPRAB+34, R1				      ; 0890

		         51	       50  C2 000DF 	    SUBL2   MSG_SIZ, R1						      ;

		         21	     6146  91 000E2 	    CMPB    (R1)[INPUT_BUFFER], #33				      ;

				       8D  13 000E6 	    BEQL    1$							      ;

		         51 00000000'EF42  9A 000E8 	    MOVZBL  PROMPT_MSG_SIZ[PMT_OFFSET], R1			      ; 0904

		         51	       02  C2 000F0 	    SUBL2   #2, R1						      ;

		         50 00000000'EF42  D0 000F3 	    MOVL    PROMPT_MSG_PTR[PMT_OFFSET], R0			      ;

	   20	    02   A0	       51  2C 000FB 	    MOVC5   R1, 2(R0), #32, #6, PROMPT_BUFFER			      ;

		         6E	       06     00100									      ;

			    00000000G  EF  9F 00102 	    PUSHAB  PAT$GL_JNLRAB					      ; 0906

				  04   AE  9F 00108 	    PUSHAB  PROMPT_BUFFER					      ;

		         7E	       6B  3C 0010B 	    MOVZWL  PAT$GL_INPRAB+34, -(SP)				      ;

		         6E	       06  C0 0010E 	    ADDL2   #6, (SP)						      ;

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

		         50 00000000'  EF  9A 00118 	    MOVZBL  PROMPT_MSG_SIZ+7, R0				      ; 0912

		         50	       02  C2 0011F 	    SUBL2   #2, R0						      ;

		         57 00000000'  EF  D0 00122 	    MOVL    PROMPT_MSG_PTR+28, R7				      ;

	   20	    02   A7	       50  2C 00129 	    MOVC5   R0, 2(R7), #32, #6, PROMPT_BUFFER			      ;

		         6E	       06     0012E									      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-7

; Digital Equipment Corporation

;

		    E5   AB	       20  8A 00130 	    BICB2   #32, PAT$GL_INPRAB+7				      ; 0914

		    0E   AB	       57  D0 00134 	    MOVL    R7, PAT$GL_INPRAB+48				      ; 0915

		    12   AB 00000000'  EF  90 00138 	    MOVB    PROMPT_MSG_SIZ+7, PAT$GL_INPRAB+52			      ; 0916

		         50	       6B  3C 00140 7$:     MOVZWL  PAT$GL_INPRAB+34, R0				      ; 0927

		         50	       56  C0 00143 	    ADDL2   INPUT_BUFFER, R0					      ;

		         2D	  FF   A0  91 00146 	    CMPB    -1(R0), #45						      ;

				       07  12 0014A 	    BNEQ    8$							      ;

				       6B  B7 0014C 	    DECW    PAT$GL_INPRAB+34					      ; 0930

		         59	       01  D0 0014E 	    MOVL    #1, CONT_LINE					      ; 0931

				       02  11 00151 	    BRB     9$							      ; 0927

				       59  D4 00153 8$:     CLRL    CONT_LINE						      ; 0933

		         50	       6B  3C 00155 9$:     MOVZWL  PAT$GL_INPRAB+34, R0				      ; 0940

		         50	       5A  C0 00158 	    ADDL2   PREV_COUNT, R0					      ;

		         50	       04  C0 0015B 	    ADDL2   #4, R0						      ;

	   7E	         50	       04  C7 0015E 	    DIVL3   #4, R0, -(SP)					      ; 0941

	      00000000G  EF	       01  FB 00162 	    CALLS   #1, PAT$FREEZ					      ; 0940

		         57	       50  D0 00169 	    MOVL    R0, NEW_POINTER					      ;

				       58  D5 0016C 	    TSTL    OLD_POINTER						      ; 0943

				       15  13 0016E 	    BEQL    10$							      ;

	   67	         68	       5A  28 00170 	    MOVC3   PREV_COUNT, (OLD_POINTER), (NEW_POINTER)		      ; 0946

	   50	         5A	       04  C1 00174 	    ADDL3   #4, PREV_COUNT, R0					      ; 0947

	   7E	         50	       04  C7 00178 	    DIVL3   #4, R0, -(SP)					      ;

				       58  DD 0017C 	    PUSHL   OLD_POINTER						      ;

	      00000000G  EF	       02  FB 0017E 	    CALLS   #2, PAT$FREERELEASE					      ;

	 6A47	         66	       6B  28 00185 10$:    MOVC3   PAT$GL_INPRAB+34, (INPUT_BUFFER), -			      ; 0949

								    (PREV_COUNT)[NEW_POINTER]				      ;

		         50	       6B  3C 0018A 	    MOVZWL  PAT$GL_INPRAB+34, R0				      ; 0951

		         5A	       50  C0 0018D 	    ADDL2   R0, PREV_COUNT					      ;

				     6A47  94 00190 	    CLRB    (PREV_COUNT)[NEW_POINTER]				      ; 0952

		         58	       57  D0 00193 	    MOVL    NEW_POINTER, OLD_POINTER				      ; 0953

		         52	       59  E9 00196 	    BLBC    CONT_LINE, 12$					      ; 0959

				  DE   AB  9F 00199 	    PUSHAB  PAT$GL_INPRAB					      ; 0961

	      00000000G  9F	       01  FB 0019C 	    CALLS   #1, @#SYS$GET					      ;

	      00000000G  EF	       50  D0 001A3 	    MOVL    R0, PAT$GL_ERRCODE					      ;

		         21 00000000G  EF  E8 001AA 	    BLBS    PAT$GL_ERRCODE, 11$					      ; 0962

			    00000000G  EF  9F 001B1 	    PUSHAB  PAT$GB_INPNAME					      ; 0964

			    00000000G  8F  DD 001B7 	    PUSHL   #PAT$K_INPNAMLNG					      ;

			    00000000G  EF  DD 001BD 	    PUSHL   PAT$GL_ERRCODE					      ;

				       03  DD 001C3 	    PUSHL   #3							      ;

			    006D818C   8F  DD 001C5 	    PUSHL   #7176588						      ;

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

			    00000000G  EF  9F 001D2 11$:    PUSHAB  PAT$GL_JNLRAB					      ; 0965

				  04   AE  9F 001D8 	    PUSHAB  PROMPT_BUFFER					      ;

		         7E	       6B  3C 001DB 	    MOVZWL  PAT$GL_INPRAB+34, -(SP)				      ;

		         6E	       06  C0 001DE 	    ADDL2   #6, (SP)						      ;

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

				     FF55  31 001E8 	    BRW     7$							      ; 0916

		         50	  08   AC  D0 001EB 12$:    MOVL    STG_DESC, R0					      ; 0972

		         60	       5A  B0 001EF 	    MOVW    PREV_COUNT, (R0)					      ;

		    04   A0	       57  D0 001F2 	    MOVL    NEW_POINTER, 4(R0)					      ; 0973

			    00000000G  EF  D5 001F6 	    TSTL    PAT$CP_INP_DSCS					      ; 0988

				       17  12 001FC 	    BNEQ    13$							      ;

				       0B  DD 001FE 	    PUSHL   #11							      ; 0991

	      00000000G  EF	       01  FB 00200 	    CALLS   #1, PAT$FREEZ					      ;

	      00000000G  EF	       50  D0 00207 	    MOVL    R0, PAT$CP_INP_DSCS					      ;



; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 4-8

; Digital Equipment Corporation

;

	      00000000G  FF	       05  D0 0020E 	    MOVL    #5, @PAT$CP_INP_DSCS				      ; 0992

		         51 00000000G  EF  D0 00215 13$:    MOVL    PAT$CP_INP_DSCS, R1					      ; 1000

	   52	         61	       01  78 0021C 	    ASHL    #1, (R1), R2					      ;

		         50	       01  CE 00220 	    MNEGL   #1, LOOP						      ;

				       11  11 00223 	    BRB     15$							      ;

				     6140  D5 00225 14$:    TSTL    (R1)[LOOP]						      ; 1002

				       0C  12 00228 	    BNEQ    15$							      ;

	 6140	         5A	       01  C1 0022A 	    ADDL3   #1, PREV_COUNT, (R1)[LOOP]				      ; 1005

		    04 A140	       57  D0 0022F 	    MOVL    NEW_POINTER, 4(R1)[LOOP]				      ; 1006

				       68  11 00234 	    BRB     16$							      ; 1007

	   50	         02	       52  F1 00236 15$:    ACBL    R2, #2, LOOP, 14$					      ; 1000

				     FFE9     0023A									      ;

		         50	       61  D0 0023C 	    MOVL    (R1), R0						      ; 1015

		         50	       08  C4 0023F 	    MULL2   #8, R0						      ;

		         50	       17  C0 00242 	    ADDL2   #23, R0						      ;

	   7E	         50	       04  C7 00245 	    DIVL3   #4, R0, -(SP)					      ; 1016

	      00000000G  EF	       01  FB 00249 	    CALLS   #1, PAT$FREEZ					      ; 1015

		         59	       50  D0 00250 	    MOVL    R0, NEW_DSCS					      ;

		         58 00000000G  EF  D0 00253 	    MOVL    PAT$CP_INP_DSCS, R8					      ; 1017

		         56	       68  D0 0025A 	    MOVL    (R8), R6						      ;

		         56	       08  C4 0025D 	    MULL2   #8, R6						      ;

		         56	       04  C0 00260 	    ADDL2   #4, R6						      ;

	   69	         68	       56  28 00263 	    MOVC3   R6, (R8), (NEW_DSCS)				      ;

		         56	       03  C0 00267 	    ADDL2   #3, R6						      ; 1019

	   7E	         56	       04  C7 0026A 	    DIVL3   #4, R6, -(SP)					      ; 1020

				       58  DD 0026E 	    PUSHL   R8							      ; 1019

	      00000000G  EF	       02  FB 00270 	    CALLS   #2, PAT$FREERELEASE					      ;

	      00000000G  EF	       59  D0 00277 	    MOVL    NEW_DSCS, PAT$CP_INP_DSCS				      ; 1021

		         51 00000000G  EF  D0 0027E 	    MOVL    PAT$CP_INP_DSCS, R1					      ; 1022

		         52	       61  D0 00285 	    MOVL    (R1), R2						      ;

	   50	         52	       01  78 00288 	    ASHL    #1, R2, R0						      ;

      04 A140	         5A	       01  C1 0028C 	    ADDL3   #1, PREV_COUNT, 4(R1)[R0]				      ;

	   50	         52	       01  78 00292 	    ASHL    #1, R2, R0						      ; 1023

		    08 A140	       57  D0 00296 	    MOVL    NEW_POINTER, 8(R1)[R0]				      ;

		         61	       02  C0 0029B 	    ADDL2   #2, (R1)						      ; 1024

		         50 00000000G  EF  D0 0029E 16$:    MOVL    PAT$GL_ERRCODE, R0					      ; 1025

					   04 002A5 	    RET     							      ; 0730



; Routine Size:  614 bytes







; Bliss-32 7.352	Saturday 22-AUG-1978 03:02:12	DBB3:[PATCH.SRC]PATCMD.B32;23					Page 5

; Digital Equipment Corporation

;

;	1027	END

;	1028	ELUDOM









							    .GLOBL  LIB$SIGNAL



;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

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

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

;  _PAT$OWN       	    40    WRT,  RD ,NOEXE,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        13         0       230











; Size:		678 code + 100 data bytes

; Run Time:	00:27.8

; Elapsed Time:	00:45.5

; Memory Used:	400 pages

; Compilation Complete

