		Modifications to RSX11M v 3.1
		_____________________________


Executive:
----------

	There are two executive modules involved in the addition of a 
"PUTMCR" command. I have used directive code 79. for this directive in
both 3.0 and 3.1. The modules are DRGCL.MAC in [11,10] and DRDSP.MAC in
the same directory.

	DRDSP	This replaces an illegal directive code (79) by a jump
to the code for DRPCL (put command line). 

	DRGCL	This adds the code for the directive DRPCL to that for
DRGCL, the code is a slight modification of that in BL16 as TM049. It
uses the address T.UCB from the calling task to dispatch a command line
of up to 80 bytes to the command decoder MCR.
	This directive has the form

	PMCR$	addr,len
	.BYTE	79.,3
	len		;# of bytes
	addr

and is used to CCL to resubmit commands after analysing them. This allows
a simple non privileged ( originally Fortran) program to command decode as
the user requests. It also allows ease of change of the command decoder
task.
	The user who does not wish to do a SYSGEN may still incorporate
CCL into the system by using an MCR driver.  The KMS version of this
(EDDRV) is included along with the proper interface module(PTMCR.MAC).


MCR CHANGES
-----------

	The changes in MCRDIS are in two groups, 1) are those involved with
a more usable MCR, that is the interface to CCL and the removal of leading
junk from a command line. 2) is the changes needed to adapt to AT. with /-LI.

	1)	The code alterations about line 380 replace the tests for 
horizontal tabs and spaces by a test for all control characters and spaces,
and treats them all in the manner that was formerly used for tabs and spaces.
If the character in this group preceedes the first real character it is
thrown away so that lines containing <clear screen> do not result in 
MCR -- SYNTAX ERROR.!!.
	The error cases of less than 3 characters of name to convert to RAD50
and illegal terminator are replaced by a call to LODCCL which is an analogue
of LODAT. The case where an attempt is made to find ...XXX fails is also
replaced inline by a call to find ...CCL instead. If the task ...CCL is not
installed then the message MCR -- TASK NOT IN SYSTEM will accompany any 
command which would have been passed to CCL.
	The task is tested for CCL when setting T3.MCR to avoid a prompt when
CCL exits having sent a new version of the command to MCR.

	2)	The minor change for the /-LI switch in AT. is that the
command decoder never prompts for a command at the end of a task on a terminal
on which U2.AT. is true. The code to do this is moved into AT. so that listing
occurs with prompts, and without listing there is not a long stream of prompts.



AT.
---

	Modifications (mostly very small) are made to almost all segments of
the indirect command file processor to enable /-LI (/LI is default mode).
NOTE.  A new ODL is supplied for use in building AT.  Note also that the
taskbuild command file for AT. (INDBLD.CMD) must be modified to include an
EXTTSK=1000 or AT. must be installed with an increment to have sufficient
room for string variables.  In addition, a new module(INDMGCML) must be
added to IND.OLB.  INDMGCML is really just MGCML with some modifictions for
use in passing command lines to AT..

INDFIL		This is modified by the addition of the switch "LI".

INDFDC		This is altered to deal with parameters on indirect file calls
		e.g.
			@FTN,MYPROG,[100,34]MYLIB,,FTB

		which gives $A	=	"MYPROG"
			    $B	=	"[100,34]MYLIB"
			    $C	=	""
			    $D	=	"FTB"

		as parameters on entry to the command file FTN.CMD
		This routine REQUIRES that GNBLK be either moved to the root
		or added to this branch of the overlay tree.

INDINX		This is modified to initialise the options to /LI/-TR/MCR
		and ENABLE GLOBALS, SUBSTITUTION, LOWERCASE.

INDNP1		This is altered to detach the terminal if it is attached, it
		would normally be detached by the display of the command line
		but if the option /-LI is used then the program will hang
		waiting on the terminal. The flag PRFLAG is cleared regardless
		as AT. now does all the prompts.

INDMCR		This has three tests for the NOLIST bit inserted in it, causing
		parts of the text not to be displayed. This includes real MCR
		commands and lines beginning "!".

INDPRC		This has had .EXIT added to the commands, it is equivolent
		to the "/" command.
		This command has not been implemented on the KMS system.

INDROT		This has simply the global definition NOLIST==1

INDIF1		This has the code for the additional .IF statements, .IFEXI &
		.IFNEXI filespec.(If file exists, If file does not exist)

INDMGCML	This is the module handling the indirect command file operations
		it has checks for extra files, and wildcards removed, and
		tries a second directory ([1,5]) if it fails to find the indirect 
		command file first time. This module is produced from MGCML.MAC.



INS
---

	The modifications to INSTALL to support /PRM=text and /PRM="TEXT"
	are minor but scattered over a three files. This modification also
	enables     RUN filespec/PRM="text"  where 'text' is a command line
	to pass to the task when it is run. By appending a /TASK=...XYZ  
	the task XYZ is temporarily installed as an MCR command and will
	correctly spawn(and then remove) if other users try to use it.

INSHD	The code for the insertion of the MCR command line is added in after
	setting the status bits in the task header.  This module also contains 
	the code necessary to assign run privleges on a user by user
	basis.  It is used with the KMS Accounting Enhancements package.
	If it is not wished to implement this package, the appropriate
	sections of the SLP file should be removed.  The audit trail
	indicates which code goes with which feature.

INSROT	An 80 byte buffer with a preset 3 character + space header is set up
	for the prototype to pass to the user task. The only task I know which
	objects to being called with a random name is TECO.

INSPS	The code for the parsing of switch /PRM= itself.




CCL
---

	This program is the result of optimising a Fortran IV Plus program
which was initially used for two months about a year ago. Despite the size
(about 12k) the program proved useful.  The current program is about 4k
(3k with F4PRES).  The program flow is fairly simple.

	0	Get mcr command line and extract keyword from it.

	1	FIND USERCCL.CCL in SY: current user.
		IF not present goto 4

	2	Lookup keyword of up to 8 chars in current file
		IF found goto 7

	3	close current file

	4	FIND [1,5]SYSCCL.CCL on LB:.
		IF not present give error & exit

	5	lookup keyword in file. If present Goto 7

	6	close file, print failed message ?keyword?

	7	get any required parameters

	8	find substitution line and insert parameters.

	9	submit command.

There are of course exceptions. If the keyword is not found and its last char
is "?" then the command "? keyword" is tried. Thus help? can be made to list the
names of all subjects on which help can be found, while file? gives "HELP FILE".

	The command keywords are matched to 8 characters and parameters may be
up to 30 characters each. If a request for a required parameter is answered by
CTRL/Z then the program abandons the command.




CCL was developed as a fortran program, the current version was initially 
compiled in F4P and the compiler listing of the program then attacked to
give the current result. The straight access to records from GET$ is more
suited to the job than the Fortran 80A1 which it replaced....

Subroutines:

GETMCR		The F4P library routine. Building with F4PRES is very 
		advantagious.
PUTMCR		A short routine to give an MCR command line to MCR from a 
		program.(using the PUTMCR executive directive.)
PTMCR		A short routine to give an MCR command line to MCR from a
		program using an MCR driver.

OPEN		Opens the file whose dataset descriptor pointer is in R1
		if it fails to open then jumps to the address in R2.
CLOS		Closes the current open file.
TYPEIT		Types an error message from an ASCIZ at R0.
PRMPT		Called for each line beginning "?n" , If params up to
		n are defined returns, else outputs the text message of the
		prompt and reads back the answer. a CTRL/Z causes CCL to 
		exit.
LOOKUP		Scans the open file for a match for the users keyword. If not
		found returns R0=0, if found R0<>0
FIXUP		fixes up the parameters in the prototype line.

CCL COMMAND FILE FORMAT
-----------------------


	The CCL command file has a rigid format, some fields of which were
intended to be used but which have been lost in the mists of time.
A command specification consists of a number of keyword lines, followed
by a number of parameter lines and finally by an action or skeleton command
line.

	example:

	$1111M
	$2811ASSEMBLE
	?1Filename
	*MAC %1%=[1,1]exemc/ml,[11,10]rsxmc/pa:1,[12,10]%1%
	$1411TYPE
	$2411LIST
	?1File to be listed
	*PIP TI:=%1.MAC%%2,.MAC%%3,.MAC%
	$2822COMPARE
	?1Files
	?2Output
	*CMP %2.SLP%/SL=%1;-1%,%1;0%

The commands " M file " and "ASSEMBLE FILE" have the same effect, they
create an object file from the source in [12,10]. The command ASSEMBLE given
without any parameters would result in the prompt "Filename?" since the 
specification for the command requires at least one parameter, and it is to
prompt for one parameter if it is not present. The specification ensures that
"M " is matched by the single character alone, and ASSEMBLE by the characters
AS ASS ASSE ASSEM thru ASSEMBLE.




	KEYWORD LINES
	-------------

$mnpqKEYWORD	First line of a command set
			there may be many keyword lines for the same action line

		m	Minimum number of characters to match
		n	Maximum number of characters to match (extra ignored)
			(ignored in current version but must be present)
		p	Minimum number of parameters required
			If this number of parameters is not present then
			parameters will be prompted for.
		q	Maximum number of parameters to question for.
			In the case where prompting occurs then this number
			is the highest prompt to be requested

		the keyword may consist of up to 8 characters to be matched
		identically by the CCL processor. The only terminators for
		the keyword typed by the user are <space> and <carriage return>.



?nQUESTION	where n is the parameter number ( they should be in order )
		in the range 1-9 . If the correct number of parameters are
		supplied no questions are asked, otherwise questions are
		asked and the associated parameters are filled in.
		If parameters are skipped then they will only have values if
		they were given on the original command line.


*COMMAND LINE parasub1 parasub2 parasub3 ......

		Command or Action lines are indicated by a '*' in column 1
		their text is copied except that parameters are substituted.

	parasub

		%n { absent } { absent } %
		   {   ,    } { .ext   }
		   {   =    } { ;gen   }

	The '%' denote a parameter substitution argument. The number n is
	the number of the associated parameter to be substituted.  Each
	parameter must be seperated by a delimiter.  Valid delimiters are:
	space, comma(','), '=','<', '<-'. A [UIC] is treated as a special 
	case in that the comma seperating the group and member numbers is
	not treated as a delimiter(all of the UIC) can be one parameter.

	The first group of optional elements denote a character to be inserted
	before the parameter if the parameter is not null.  Only ',' or '=' 
	may appear in this position(ie be inserted in front of the  parameter.
	The second group denote elements to be appended if their initial 
	character is not present in the input parameter string.  Typically
	these are only those which denote file extensions and version
	numbers.  Finally a '$' is interpreted as as an 'escape' key
	to be used in terminating the command rather than MCR.
	
 
	




from the above examples.

In assemble / M the filename given would normally be a plain name eg MCRDIS
which would result in 

	MAC MCRDIS=[1,1]exemc/ml,[11,10]rsxmc/pa:1,[12,10]MCRDIS

In list or type since the required number of arguments is set to one, and the
number of arguments to be prompted for is one the results are

TY file				->	PIP TI:=file.MAC
T file.slp			->	PIP TI:=file.slp
TYPE file,file2			->	PIP TI:=file.MAC,file2.MAC
TYPE
File to be listed?[100,3]herfile	->	PIP TI:=[100,3]herfile.MAC
COMPARE MCRDIS
Output? TI:				-> CMP TI:.SLP/SL=MCRDIS;-1,MCRDIS
CO
Files? INDROT
Output? [12,40]INDROT		-> CMP [12,40]INDROT.SLP/SL=INDROT;-1,INDROT

or alternatively with the definition
	$2722COMPARE
	?1Files
	?2Output
	*CMP %2%%1.SLP%/SL=%1;-1%,%;0%

one then has
MCR>COM
Files? INDROT
Output? [12,40]		-> CMP [12,40]INDROT.SLP/SL=INDROT;-1,INDROT;0
or
MCR>COM
Files?INDROT
Output?TI:			-> CMP TI:INDROT.SLP/SL=INDROT;-1,INDROT;0

 however altering this to
	$2712COMPARE
	..........
 leads to
MCR> COM INDROT		-> CMP INDROT.SLP/SL=INDROT;-1,INDROT;0
MCR> COM INDROT TI:	-> CMP TI:INDROT.SLP/SL=INDROT;-1,INDROT;0
and
MCR> COMPARE
Files?INDROT
Output?TI:		->       ditto
 because the number of parameters to prompt for was set to 2 if the required #
of 1 was not present.

SAVE
----

	The minor patches to save are the change of name( choose your own)
and to avoid the overwriting of the prompts from saves startup.

This because it inserts CR or LF before text commands only works when MCR
ignores leading control characters
