PLASYD, standing for Programming LAnguage for SYstem Development, is a language for the 1900 series. It is Algol-like in its block structure and control facilities but is otherwise closely tied to the basic machine code of the series.
The initial part of the guide describes the facilities available for simple complete PLASYD programs, the later sections describe the segmentation facilities and the compiler and operating system.
A more formal description of the language can be found in the document
PLASYD Syntax and Notes: PLN 2.
An understanding of 1900 storage formats and instruction code is assumed.
PLASYD programs are written using the 1900 64-character card set of symbols and can have a maximum of 72 characters in any line. If the program is to be punched on paper tape tab characters may be used. Tabs are considered to be at six character intervals by the compiler.
A space, tab, newline or end of card will serve to terminate an identifier or fixed word symbol (see 2.2). Spaces outside strings and character sequences, and tabs are non-significant otherwise and may be used to improve layout. Newline or end of card are also in general non-significant with the exception of INCLUDE statements (see 12.5) and at one point in assignment statements (see 6.3(a) and 6.6).
A PLASYD program consists of a series of declarations and statements. A statement corresponds to one or more computer instructions to be executed at object program run time. A declaration gives information to the compiler notably about storage layout and intercommunication.
Statements are basically of two kinds: control statements and assignment statements. Control statements can cause the normal sequence in which statements are obeyed to be altered. This can be used for example to conditionally omit the execution of statements or to loop over a number of statements. Assignment statements are the means by which calculations are carried out. Their effect is to cause a value to be calculated and assigned to a variable. Variables are themselves of two kinds (which correspond closely to the internal structure of the 1900) called accumulators and cells. Each cell corresponds to one or more words in the main storage of the computer.
Variables are also divided into classes in PLASYD according to the type of data that they are used to hold and the mode of arithmetic that can be carried out on them. Types of data are dealt with more fully in the next section and section 11.
Each variable has an identifier or name by which it is referenced in the PLASYD program. The remainder of this section is devoted to consideration of these identifiers.
Accumulators have fixed identifiers. These are as follows:
All the accumulators may be given extra identifiers at the programmer's request by means of the synonym declaration defined in section 10.1.
Cells have no fixed names and may be assigned identifiers of the programmer's choice which conform with the following rules:-
Examples of cell identifiers:
A X X9 KAREN CATCH22 A1B2 ROOT1 ROOT2 PLASYD ANDY %ABHEAD
Note that ANDY is legal although AND is a fixed word symbol. Similarly CHAR1 is allowed.
There are 70 fixed word symbols. They are:-
ACC AND BASE BEGIN BRINGOVERLAY CARRY CASE CASEND CH CHAR CNT CUEOVERLAY DATA DEFINE DO ELSE END ENTRY ER EX EXTERNAL FIX FLOAT FOR FOVERFLOW FROM FUNCTION GLABEL GLOBAL GLOBEND GO GOTO IF INCLUDE INTEGER INTERPRET LA LOGICAL LONG LOWEND LOWER MINUS NEG NONPLASYD NOT NULL OBEY OF OR OVERFLOW PROCEDURE PURE PUREND REAL RETURN SA SLA SLC SLL SRA SRAV SRC SRL STEP SYN THEN TO UNDER UNTIL WHILE
Within these limitations identifiers may be freely chosen to aid human understanding of the program. Identifiers have no inherent meaning and, for example ROOT1 and ROOT2 need have no connection in the program. Identifiers are terminated by any layout character (space, tab, newline) or by any non-alphanumeric character other than %, for example + or /. Fixed word symbols are terminated in the same way. No two items within a program which is a single segment may be given the same identifier.
This section deals only with the simple types REAL and INTEGER (or LOGICAL). LONG types are discussed in section 11.
The 24-bit 1900 storage word which makes up an integer cell, or an integer accumulator may be considered to hold:
24 bits considered as separate values of 0 or 1,
four six-bit characters,
an octal number in the range 0 to octal 77777777,
or a decimal number in the range - 8388608 to 8388607.
A cell used to hold any of these is said to be of type INTEGER. If no arithmetic is to be carried out on its contents, for example if the bits are being used as markers, the cells may be said to be of type LOGICAL. The compiler makes no distinction between cells of integer and logical type.
Integer cells and accumulators may be used to hold integer values. These take one of the following forms in a PLASYD program:-
3671 29 0 4052Negative integers are preceded by the fixed word symbol MINUS thus:
MINUS 6 MINUS 2732 MINUS 372615Note that MINUS must be terminated by a layout character, usually space (MINUS6 is an identifier), and that the integer must not contain spaces or other non-numeric characters. The integer number is held in the machine in 24-bit two's complement binary form.
#12 #2763 #77777
Spaces or other layout characters may occur between the # and the first digit but nowhere else. The number will be stored in the right most octal positions of the word. Unspecified octal positions to the left are set to zero.
257CNT 326CNT 2CNT
'%' '+23' 'ABCD' '''A''' '2 3'Note that a space counts as one character. The characters will be held in the right-most six-bit character position of the integer variable, any unspecified characters being zero filled.
Integer cells and accumulators may also be used to hold addresses.
This is dealt with in 6.7.
A real variable consists of either the floating point accumulator A1 or two consecutive 24-bit words in main storage which constitute a real cell. A real variable can hold a (generally normalized) floating point binary number in standard 1900 format. The numbers are held with an accuracy of about 11 decimal digits and can be in the approximate ranges -5.6 × 1076 to -10-77 and 10-77 to 5.6 × 1076, numbers between the two ranges being held as zero. Real values can be written in PLASYD as decimal numbers or, if strict accuracy of representation is required, as octal numbers. The formats are:-
0.13261 321.67 215.0The number may be signed in the same way as integer numbers
MINUS 136.0 MINUS 0.141579
1.4&20 MINUS 0.5613&3 1.414&MINUS 6There must be no spaces between the fraction and the & symbol. Spaces between the & and the exponent are permitted but unnecessary. MINUS must be terminated by a space as usual.
3& MINUS 6 41107&4
#2000000000000400R #400RThe first example represents 0.5, the second unnormalized zero (0×100)
Before any cell is used it must be given an identifier and the compiler must be told its type by means of a declaration. All declarations must appear at the beginning of a block. Blocks are dealt with more fully in section 8 but a brief description is given here. A block begins with the fixed word symbol BEGIN which is followed by one or more declarations separated by semicolons. This is called the blockhead. Then follow one or more statements (which may themselves be blocks) and finally the fixed word symbol END. The cells that are defined in the blockhead may be used throughout the block. A simple PLASYD program takes the form of a block.
The data storage on the 1900, in which cells can be located is divided into two parts, upper storage and lower storage. Lower storage consists of the first 4096 words of store and variables in this area can be directly addressed. Upper storage consists of the rest of the store and variables placed in upper store can be accessed only by indirect means described below. The PLASYD programmer may direct the compiler to place particular cells in lower store for immediate access and certain data generated automatically by the compiler will also go into lower store. The remainder of the programmer's declarations will go into upper store.
If a program is written in separately compilable sections (called segments) the programmer can designate that certain cells are to be placed in a section of store (called a global block) which is accessible by more than one segment. This facility is dealt with in section 12.3.
The following subsections are concerned with some of the more common forms of declarations.
This is written as the fixed word symbol INTEGER (or LOGICAL) followed by a number of items which will be given consecutive storage locations. Each item is separated from the next by a comma. Items can take one of the following forms:-
Example: INTEGER I, VW, MGB
Example: INTEGER A(41), B(22)
This is written in a similar form to an integer cell declaration except the first symbol is REAL. Each identifier and each cell requested in an array item will occupy two 1900 words and will be used to hold a floating point or real number.
Example: REAL F, FP, ARRY(20).
Any sequence of declarations (other than lower declarations) may be placed between the fixed word symbols LOWER and LOWEND to form a lower declaration. All storage cells declared within a lower declaration will be placed in lower storage and can be directly accessed. All other cells will be placed in upper storage.
Cells that are not in lower storage cannot be directly accessed by the 1900. To enable such cells to be used the upper storage may be divided into arbitrary sections called domains which must not exceed 4096 words. An upper cell is then accessed by specifying the address of the first word of its domain called the base of the cell and the number of words (which must be less than 4096) between this, base and the cell required. This number is called the displacement of the cell. These two quantities are specified in a PLASYD program by preceding the cell identifier by the symbol £ and $ respectively. Thus £A means the address of the first word of the domain in which A appears and $A means the displacement of the cell A from that word. The two added together i.e. the actual address of A, are denoted by @A. For lower cells $A = @A and £A = 0. The first upper declaration will cause a new domain to be set up and successively declared items will be assigned store locations in that domain in order until the appearance of a base declaration or until the next declaration would cause the size of the domain to exceed 4096 words. A new domain will then be started in the next available word. A base declaration takes the form
BASE
and is separated from other declarations by a semi-colon in the normal way. Whenever a new base is started one word of lower storage will be used to store the address of the first word of the base.
Note that if a single array item is more than 4096 words a new base will be started coinciding with its first word, and another new base will be started immediately after it. Any cells above the 4096th will have to be addressed by a specially set up modifier. This is explained more fully in section 5.
A real or integer storage cell which is declared in the outermost block only may be given an initial value of the appropriate type. For a simple cell this is done by following the cell identifier by the symbol = and a value, for example
REAL A, B, C=36.5, D=MINUS 215.4; INTEGER X=3, Y=#1151;
For array items the equals sign is followed by a list of initial values, separated by commas and enclosed in parentheses thus:-
INTEGER I(20)=(3, 7, 9, 15), J(20), K(3)= (1,2,1);
These values will be assigned to successive array elements beginning at the first. If the same value appears several times in a list, for example
REAL X(6)=(0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
an alternative form is allowed. For this the value is written once followed by * followed by the number of times it is to be repeated. Thus the example above is equivalent to
REAL X(6)=(0.0*6)
In the case of integer items some initial values are allowed which are not strictly integer values. These are
INTEGER A="AB", X(4)=("1234567890", 6)
Note that "A" and 'A' are not the same. "A" is the same
as 'A ' and 'A' is the same as "000A".INTEGER LIST (4) = (6CNT+3, 17CNT + #7777)
Once a cell has been declared it can be referenced in a statement in order to assign a value to it, to use its value in an expression or to test its value. Simple cells or the first element of an array in lower storage may be specified merely by quoting the identifier. Other elements must be specified by quoting the identifier and an index which specifies the particular element or by denoting a base and displacement. The index may take various forms and with some of them the identifier may be omitted. The reference to the cell is known as a designator and the various possible types are given below. In the examples the following declarations are assumed to have appeared:
LOWER REAL X, A(20), C; INTEGER B; LOWEND; BASE; INTEGER U(12), V;
A, B, C, X.Note that V cannot be referred to in this way since it is in upper storage.
There is also no check to see that an identifier refers to an array so that for example one can designate X(0) which is the same as X and X(2) which is the same cell as A or A(0). These facilities allow the programmer to effectively declare one array but to name individual elements of it, and if necessary to give them values. Thus we could consider X as a 22 element real array whose second element is called A and whose last element is called C.
(30) (X1) (X3+1)These are taken as elements of a hypothetical array whose first word is word 0 of the store. Thus (30) is the thirtieth word of store. Similarly (1) is X1 considered as a storage cell. The size or type of the cell designated is not immediately apparent in this form and is determined from context. In the case of the modifier index the cell is that whose first word is specified by the contents or value of X1, modified by the integer if necessary. This value will be 15 or 22 bits depending on the addressing mode in use. The value of the integer must be in the range 0 to 4095 but the value of the expression if a modifier is involved may be any possible store location of the machine. By loading the modifier with an address this provides one method of accessing upper storage cells. Thus if X1 has the current value @V, (X1) designates the cell V.
A(X1) U(X2-3) X(X3+4)With a lower identifier the index is evaluated in the same way as in the free index (minus also being allowed) and this is taken as a number of words beyond the identifier specified, e.g. if X1 has value 3, A(X1-1) is equivalent to A(2) the second real element of the array A. With an upper identifier the value of the index is added to the displacement of the identifier from the base of its domain. Thus if X2 contains the address of the base, U(X2) designates U itself, U(X2+3) designates the third word following U and so on. The method of setting a base address in a modifier is given below. Note that U(3) is illegal and meaningless. When the integer in the index if any, is added to the address of a lower identfier or the displacement of an upper identifier the result must be in the range 0 to 4095. Thus V(X1-20) is illegal. The modifier is not restricted to have only the value of the base of the identifier's domain. For example if the value of X1 were the address of the base of V (i.e. £V) minus 10 the designator
V(X1-2)would access the first word of the array U.
Designators (a) to (d) are known as simple cell designators and are available on all machines of the 1900 series. The designator types which follow make use of a machine instruction (SMO) which is only available on larger machines of the range. The PLASYD compiler can be made to insert code to simulate this instruction on other machines but there is a corresponding drop in efficiency.
Examples: ((30)) (B) (U(X1+3)) ((X3)) (£V)In the case of a cell designator the value currently assigned to that cell is used as the address of designated cell. Thus if the cells (30), B or U(X1+3) have the value @V, the address of V, the first three examples designate the cell V. If X3 also has the value @B then (X3) designates the cell B so that ((X3)) designates the cell V. If a base is placed in parentheses the cell designated is the first of the domain in which the identifier appears. Thus (£V) and (£U) both designate the first element of U. As with the free indices of (c) the type of the cell designated must be determined from context.
(B+3) (U(X1+3)+X2) ((X3)+X2) (£V+X3)The order (SMO index, fixed index) is essential. The two parts of the index will be calculated and the values obtained added. The resulting address is taken to be that of the cell designated. Again the type of the cell designated is not immediately apparent. As examples if B has the value @U (B+3) designates the fourth word of U, and if X3 has the value 12, (£V+X3) would designate the cell V itself.
examples: C(B-3) V(£V) U(V(X1)+X2)The designator is evaluated in similar fashion to (d) and as in (d) if the outside identifier is lower the index specifies a number of words beyond it, while if an upper identifier is used its displacement is added to the value of the index. Thus the second example V(£V) is probably the simplest way of designating the cell V. If SMO is not available the same effect can be achieved by setting a modifier, say X1, to the value £V and then designating V by V(X1). This is in fact in general more efficient than using the SMO if it is not frequently required to alter the value of X1. For example since U and V have the same base, without altering the value of X1, U(X1) designates the first cell of U and V(X1+12) designates V. U(£U+1) designates the same cell as U(X1+1) i.e. the second cell of U but, assuming that X1 did not have to be set up specifically, the first form generates one extra machine instruction. It is thus convenient when working with upper quantities which are in one domain to set aside a modifier to refer to the base of this domain. It also follows that upper quantities which are logically connected by the processing should be placed in the same domain.
Note that if it is required to consider the contents of a non-modifier accumulator in an index or it is is required to specify that the SMO cell should be a second modifier, the accumulators should be called as store locations. For example X6 can be referred to as (6) in the designator U((6)) and the contents of X1 and X2 can be added to produce an index by the designators ((1) + X2) or ((2)+X1).
The constant part of the index when added to the displacement of the outer identifier must as usual be in the range 0 to 4095.Assignment statements are the means by which storage cells and accumulators are given values. The form of the value assigned to a variable can vary from a simple value as described in section 3 to a complicated expression involving the current values of other variables. There is a distinction between cell and accumulator assignment, cell assignments being in general much more restrictive, since few 1900 machine orders are available to do arithmetic in cells. In most cases therefore calculations are carried out using accumulators and the resulting values are then assigned to storage cells. A new term primary is used in the descriptions that follow. A primary of a given type is either a value of that type as defined in section 3), or the designator of a cell of that type as defined in section 5. In the case of integers only it can also be an integer accumulator.
In the following subsections accumulator assignment is dealt with first, and, as in preceding sections only real and integer types are dealt with. Assignment statements may run over several lines if necessary, or several short statements may be placed on one line. Statements, like declarations are separated by a semicolon. Assignments in general affect only the value of the accumulator or cell to the left of the assignment operator. Cases where this is not so are specifically mentioned.
This takes the form
accumulator identifier ← primary
and results in the accumulator specified being given the value specified by the primary; that is, either an actual value is used, or a value previously assigned to the cell by an initial value declaration or previous assignment statement. Examples:
A1←3.0; X2←132; X6←#1332; X6←421CNT; X7←B; X4←(£U); A1←A(X1); A1←(1); X2←(X1); A1←MINUS 3.1415; X5←'%%'; X1←X3;
The following points should be noted:
The primary on the right of the assignment symbol may be preceded by a monadic operator. For real assignments only one operator is allowed which is denoted by the reserved word NEG. Examples:
A1←NEG X; A1←NEG A(X1)
The effect is to assign to A1 the value of the primary, negated. Note that this operation takes two machine instructions and for this reason should not normally be used with values as primaries.
A1←NEG 3.0 and A1←MINUS 3.0
achieve the same effect but in the first case 3.0 is stored in lower and is negated to A1 by two instructions while in the second case MINUS 3.0 is stored in lower and is loaded into A1 by one instruction.
For integer assignments several monadic operators are allowed:-
NEG - has a similar effect to real NEG
EX - cause B only the bottom 9 bits of the primary to be assigned
to the accumulator
CH - causes a 6-bit character to be assigned to the accumulator -
more of this in 6.7 below.
CARRY - causes the value of the primary without its most significant bit
to be assigned to the accumulator and the top bit to set the
carry register, which is included in any immediately following
integer arithmetic operation - see the PLAN Manual.
NEG CARRY - CARRY is performed on the negated value of the primary
Each of these assignments, unlike real NEG, is performed by one machine instruction. In addition, as with basic assignments if the primary is a value of less than twelve bits no lower store location is used. Thus in the case of integers
X1←NEG 3 and X1←MINUS 3
again have the same effect but the former is both faster and uses no lower storage.
There is also a special integer operator CNT which may have as its primary only one of the following:-
The effect is to assign to the most significant nine bits of the accumulator the least significant nine bits of the primary. The last type of primary involves an extra machine instruction. These three primary types are known as C operands.
Sections 6.1 and 6.2 specified methods of assigning a single value to an accumulator. A general assignment statement can assign a value and then cause various arithmetic or logical operations to be performed on that value. These operations are performed in the order specified within the statement, that is left to right and not in the normal arithmetical hierachy order. A general accumulator assignment is written as one of the previously defined simple assignments or possibly A1←A1 followed by any number of operator-primary pairs. For example:
X1←X2+B A1←A1+A(X1) UNDER X X6←U(X3) SLL 6 - (X2-1) * V(X3-4);
The possible operators are as follows:
a) arithmetic operators: + - * /
These operators have the effect of addition, subtraction, multiplication and division respectively. They are available with both real and integer assignment statements. Examples:
X1←X1 + B + B A1←A(X1)/A(X2) - A(X1 - 1) X2←NEG B*2
The following points must be noted.
A1←A1+Xis legal A1←X+A1 is not.
X1←3; X2←2;
X1←X1+X2
gives X1 the value 5
X1←3; X2←2;
X1←X2+X1;
gives X1 the value 4 (i.e. X1←X2;X1←X1+X1)
b) carry setting operators: ++ --
These have the effect of + or - compounded with the effect of the operator CARRY in simple assignment statements. They are available only for integer operands. Examples:
X1←X1++B
c) reverse operators: FROM UNDER
These are available only with real operands and have the effect of a reverse subtraction and division respectively. That is, the accumulator is set to the value of the operand minus, or divided by, the previous accumulator value. Examples:
A1←A1 FROM X(2); A1←(X2) UNDER A(3)
d) logical operators: AND OR ER
These are available only with integer operands and specify collation, logical or, and logical non-equivalence respectively. Comments (v) and (vi) of (a) apply. Examples:
X1←X2 AND B OR #1770004
e) shift operators: SLL SRL SLC SRC SLA SRA SRAV
These are available only with integer operands and specify binary shifts right or left. The shifts may be logical, circular, arithmetic or arithmetic taking care of carry (SRAV - see PLAN manual). The operands of shift operators are restricted to C operands as defined for the CNT operator in 6.2. Examples
X1←X1 SRL 4 AND #77 X7←TEST SLA X2 X3←X3 SLC 2 - 1 SRC 2
The forms of assignment statement which give values to cells are much more limited than those to assign values to accumulators. Indeed in the case of real cells only the value of the real accumulator or zero may be assigned. A basic assignment takes the form
Cell designator ← accumulator
or
integer cell designator ← 0
or
real cell designator ← 0.0
As with accumulator assignments the left and right hand sides of the statement must agree in type and the performance of the assignment only alters the value of the left hand side. Examples:
B←X7; A(X1)←A1; U(£U)←X3; (X1)←X0; (1)←A1; B←0
Assignments of the value zero are more efficient than any other. Note that absolute values cannot be directly assigned to cells so that to give B the value 3 two statements would be needed, for example:
X7←3; B←X7;
The basic forms are the only forms of real cell assignment allowed.
These operators are analagous to those described in 6.2 but in the case of cell assignments none are available for real quantities.
The general form of an assignment involving a monadic operator is:
integer cell designator←operator integer accumulator
The possible operators and their effects are:-
NEG - similar to the NEG of 6.2, this causes the negated value of the accumulator to be assigned to the cell. CARRY - similar to the monadic operator of section 6.2 NEC CARRY - similar to the monadic operator of section 6.2 EX - causes the bottom nine bits of the accumulator to be assigned to the cell designated but does not alter the value of the other 15 bits. It is thus not strictly analagous to the 6.2 EX which clears the rest of the accumulator. CH - causes the bottom character of the accumulator to be placed in the designated cell - see 6.8 below. SA - this has a similar effect to the EX described above but deposits 12 bits instead of 9. The remaining bits are unaltered. LA - this is again similar to EX but deposits 15 bits without changing the rest of the cell value.
Examples:
B←NEG X6; U(X1)←CH X4;
Certain arithmetic and logical operations can be carried out on the values of integer cells without going via an accumulator. A general integer cell assignment statement takes one of the forms of 6.4 or 6.5 followed by any number of operator-accumulator pairs in a similar manner to the operator-primary pairs of 6.3.
Examples:
B←X2+X1 U(X3)←X7 AND X1-X6
If it is required to perform an operation on a value which the cell already has, for example to add the value of X1 to B's current value, one may write
B←B+X1
The two occurrences of B must be on the same line.
This is the only way in which a cell designator can appear on the right of a cell assignment. It must be the cell to which the assignment is being made and it must be the first item after ←. Thus B←B(1)+X1 and B←X1+B are both illegal. The effect of the former must be achieved by using an intermediate accumulator for example:-
X7←B(1)+X1; B←X7
or
X1←X1+B(1); B←X1
which would be faster but destroys X1.
The possible operators, which have the same effect as in accumulator assignments are:
a) add operators: + - ++ --
and
b) logical operators: AND OR ER
As for accumulator assignments all operations are carried out from left to right and assignments of the type B←B+X take only the time of the add operation.
It should be noted that when the left hand cell designator involves a modifier or SMO index then a modification or SMO will be involved in every operation in the right hand side. This can be inefficient particularly where SMO's are concerned. For example:
U(B)←X7+X6+X5+X3
produces eight machine instructions (one store, three adds and four SMO's) if SMO is available and a fantastic number if pseudo-SMO instructions are used. If, say, X7 is not needed again the same effect aay be achieved by
X7←X7+X6+X5+X3; (three adds) U(B)←X7; (one store, one SMO)
a total of 5. Alternatively for one extra instruction another accumulator (say X4) could be used as intermediate storage.
Integer cells and accumulators may be assigned integer values by the statements already specified in this section. However, they can also be given a value which is an address. The use of variables with such values has been described in the section on cell designators. This subsection shows how such values can be assigned. Address assignments can only be made to accumulators and, if it is necessary to assign an address as value to an integer cell, for use as temporary storage or in a SMO designator, an intermediate accumulator must be used. Addresses may also be specified as initial value settings as described in 4.5.
An address takes one of the following forms
$B $U(3) $V(B+X1-3)The displacement has as value the number of words that the cell designator is displaced from the base of its domain. In the case of a lower cell, of course, this is the address of the cell itself. If the cell designator does not consist of a simple identifier the displacement of the cell designated by the identifier alone will be modified by the value of the index in the normal way. Values of such addresses may thus be greater than 4095. In addition to normal cell designators with $ an upper identifier with a fixed index is legal. Thus $U(3) is allowed although U(3) is not.
£B £U £VThe base is the address in words of the first word of the domain in which the identifier appears. In the case of lower cells it is identically zero. Note that only identifiers are allowed, not general cell designators. Thus £B(3) is illegal.
@B @U(3) @V(B+X1-3)This is the complete address in words of the cell designated. @X is identically equal to £X + $X. As with $ upper cell identifiers with fixed indices are allowed.
@ SIGNAn instruction identifier is the address in words of a label or procedure. These are explained in sections 7.1 and 9.2.
CHAR 3 CHAR 1 OF @B CHAR 0 OF $U(X1)This takes the general form of the fixed symbol CHAR followed by an unsigned integer, optionally followed by OF and a word address. The effect is to specify a particular six-bit character within the word address which follows. Characters are dealt with in the next subsection.
Any of the addresses above may be given as a value to an integer accumulator or added to the value of an integer accumulator by an address assignment e.g.
X1←CHAR 1 OF @B X2←£U X0←X0+$V(3)
It should be noted however that the character portion of an address may cause the two most significant bits of the accumulator to be set and an addition should not therefore cause an overflow into these two bits. Addition of the CHAR part of a character address will be done by BCHX instructions. Assignment of CHAR n will be more efficient if n < 4. It is also possible to subtract the value of a word address (but not a character address) from an accumulator. Example:
X7←X7 - @V(B+X1-3)
Once an address has been loaded into a modifer that modifer can be used in subsequent cell designators. Similarly addresses may be stored and their values used in SMO indices. If an address is used as an initial value it must be a fixed address. That is the index if any must not be a SMO index nor contain a modifier. Indices are thus restricted to an unsigned integer, or - and an unsigned integer i.e. the fixed index of 5.1.(b)
To assign, add or subtract an identifier base always takes only one machine instruction. To assign, add or subtract a word displacement takes one instruction, modified if a modifier is used in the index, plus a SMO if a SMO index is used. A cell address takes one more instruction than a displacement and if the address has a character part an extra instruction is involved.
An address assignment of the form specified above may be followed by any operator/operand pairs as defined in section 6.3. Example:
X1←$A(3)+6-X1 SRL 1
However, addresses may not be used as primaries so that X1←6+$A(3) is illegal. Thus the address part, if any, of an expression must always appear immediately after the ← symbol.
As an example of the use of address assignments consider the various ways of setting an upper integer cell I to zero. We could load the complete address of I in a modifier thus
X1←@I; (X1)←0;
However, loading the @ address takes one more instruction than loading the base and it is not immediately obvious what the second statement is doing. Better would be
X1←£I; I(X1)←0;
Not only does this take one less instruction and read better but, if J is in the same domain as I we can write, for example
J(X1)←X3;
without resetting X1.
If SMO is available we can use any store location at the cost of one extra instruction in the first case and none in the second e.g.
X7←@I; ((7))←0;
or for one more instruction
X7←@I; B←X7; (B)←0; or I(£I)←0;
The latter is obviously a neat method but is not as flexible as the use of a modifier. For example
J(£J)←0
takes as long as I(£I)←0 even though £I and £J are the same. Similarly if I is a 100 element array, to set all elements to zero we can set X1 by
X1←£I;
and then arrange to obey
I(X1)←0; X1←X1+1
100 times. There is no comparable way using a SMO of £I since the value of £I cannot be altered.
Each integer cell or accumulator can, if desired, be considered as four 6-bit characters. If all four are to be dealt with at once normal assignments or initial values involving character sequences or strings may be used. If it is necessary to deal with characters separately the CH operator and, normally a modifier must be used. (Note that a SMO'ed cell is not equivalent in effect to a modifier in this case).
A character address as described in 6.7(e) is held in a modifier as a word address in the bottom 22 bits and a character number (0, 1, 2, or 3) in the top two bits. Examples:
CHAR 3 is word address 0, character number 3 CHAR 1 OF @B is word address @B, character number 1 CHAR 6 OF @B is word address @B+1, character number 2
If such a modifier appears as part of a normal cell designator only the word address is used. However when used with the monadic operator CH a particular character will be designated. Thus to place in accumulator X7 character 1 of the upper integer I we can write
X1←CHAR 1 OF @I; X7←CH(X1) or X1←CHAR 1 OF £I; X7←CH I(X1) or X1←CHAR 1 ; X7←CH I(£I+X1) etc
If CH is used without a modifier then character 3 is considered to be designated. Note that this is not the same as using a modifier of zero.
If X6←'ABCD'; X1←0 have been obeyed X7←CH (6) is equivalent to X7←'D' but X7←CH (X1+6) is equivalent to X7←'A'
CH can also be used as a monadic store operator, in which case, in common with other store operators, only the character designated is altered, the remainder of the cell remaining unchanged. The bottom character (number 3) of the accumulator is used others being ignored. Thus with X6 and X1 as above and the value of the lower integer B intitally '1234'.
B←CH X6 sets B to '123D' while B(X1)←CH X6 sets B to 'D234'
A modifier containing a character address may be altered by normal assignment statements. In particular it can be made to point to the next character address by
X1←X1+CHAR 1
This construction takes care of crossing word boundaries. It is not however possible to step backwards in the same way and the best way of doing this is probably
X1←X1 SLC 2 - 1 SRC 2
Note also that if + CHAR 1 is used in 15AM, bits 2-8 of the modifier will be altered (BCHX is used). If this is unwelcome the sequence
X1←X1 SLC 2 + 1 SRC 2
must be used. In addition one machine instruction is generated for each character specified by CHAR n. Thus numbers of more than 3 should never be used and for
X1←X1 + CHAR 6 (6 instructions)
one should write instead
X1←X1+CHAR 2 OF 1 (3 instructions) or X1←X1+CHAR 2 + 1 (3 instruotions)
Normally a PLASYD program will be entered at the first statement following the initial declaration and the following statements will be obeyed in the order in which they appear, intervening declarations being skipped. If it is required to alter the order in which statements are obeyed a control statement must be used. Control statements either cause a number of statements to be obeyed out of line before continuing in sequence or they cause a new sequence to be started beginning with a designated statement. Some of the first type are dealt with in section 8. The remainder of the first type and all the second type are dealt with here.
In order to designate a statement to which control is to be passed the statement must be labelled. The simplest way of doing this is to precede the statement by an identifier and a colon. The identifier must be unique within the program (or separately compiled segment - see 12 ). Examples:
L: X1←X1+6; NEXTCH: B←X4-X2; DB4: X1←$NEST(X1)
Several labels may be given to one statement if desired, thus
A:B:C:OLE: X3←B(£B);
The simplest way to transfer control unconditionally is by a GO TO statement written
GO TO label;
GO TO can be written as one or two words.
The effect of this statement is to cause the statement designated by the label and all statements following it to be obeyed in sequence until another control statement is reached. Examples:
GOTO L; GO TO NEXTCH
This statement is written
OBEY integer cell designator
Example:
OBEY B(U(X1)+1)
The integer cell in question must contain a binary representation of a 1900 machine code instruction (which will usually be stored there by a function initial value see 4.5 (d) and 9.1). The result will be to obey this instruction, and if it does not cause a change of control to return to the next instruction in sequence after the OBEY. (See PLAN reference Manual OBEY instruction).
This causes one of a number of statements to be obeyed according to the value of a modifier.It is written
CASE modifier OF
followed by a sequence of statements, each of which take only one word, followed by CASEND. Example:
CASE X1 OF A1←A1+B;
A1←A1-B;
A1←A1*B;
A1←A1 UNDER B;
GO TO L3;
X1←NEG BZ;
CASEND;
The effect of the statement is to cause the ith instruction of the sequence to be obeyed where the seguence is numbered beginning at zero and i is the value of the modifier. The value of the modifier is thereby destroyed and unless a control statement has been executed, the statement following CASEND is the next to be executed. The more common statements which generate only one machine instruction are the following, none of which may contain SMO indices:-
1. a function statement (see section 9.1) 2. an accumulator assignment whose right hand side consists of a single primary (e.g. X1←B(-2)); or whose right hand side consists of the left hand side, an operator and a primary (e.g. X1←X1+B(X2)). The operator must not be * with integer operands. 3. a cell assignment of an equivalent form. 4. a procedure statement (see 9.3) 5. a GOTO statement 6. an OBEY statement 7. a NULL statement (see 8.3)
If the modifier value specifies a non-existent instruction the effect is undefined.
A block consists of the word BEGIN, possibly followed by some declarations separated by semicolons, possibly followed by some statements separated by semicolons, followed by END. A block is itself a statement and thus blocks may be nested. The statements in a block may only make use of those quantities which are declared in the block itself or in surrounding blocks. For example consider
BEGIN INTEGER I; ---------------; BEGIN INTEGER J; ---------------; END; ---------------; BEGIN INTEGER K; P:-------------; END; ---------------; END
At the point labelled P use can be made of the quantities I and K but not J. In fact with this simple set-up J and K will share the same storage.
Only cells in the outermost block of a program (or separately compiled segment) may be given initial values and normally it is in the outermost block that most variables will be declared. Cells declared in inner blocks will share storage with those in parallel blocks and their values are thus indeterminate on entry to the block. Entry to a block may be made either by coming to the BEGIN in a normal sequence of control, in which case the first statement of the block will be the next obeyed, or by jumping to an internal label by a GOTO statement.
A label may be placed before the END symbol of a block thus
L : END
If a GOTO L statement is then obeyed the effect is as though a jump was made to a NULL statement placed immediately before the END. However unless NULL is actually written, no instruction is generated.
Type, lower and base declarations have already been dealt with in section 4. Other types of declaration and the section in which they are described are:
There is a subclass of statements called simple statements. These are:
A null statement is written as
NULL;
and has no effect but occupies one instruction position.
It can therefore be used in CASE instructions for example.
A data statement is written either
DATA initial value or DATA (initial value list)
Its effect is to store the initial value(s) at that point in the program. The programmer must arrange not to obey this data as instructions. The chief use envisaged for this statement is in conjunction with procedure calls - see 9.3. Examples:
DATA 6 DATA (2.4, 6.8, @BETA, 7)
Note that real initial values will occupy two words and integer initial values one.
All simple statements can be labelled as described in Section 7.1.
The other possible statements in a PLASYD program, beside simple statements are:-
The first three are conditional statements which cause a statement or group of statements to be obeyed only if certain conditions hold. These are dealt with in the following sections. The INCLUDE statement is an operating system facility and is dealt with in section 12.5.
A typical example of an IF statement is:
IF X1 = 0 THEN GOTO L3
Here the statement GOTO L3 will be obeyed only if the condition X1 = 0 is true i.e. X1 has value zero. If the condition is not true then the next statement in sequence will be obeyed. If the statement following THEN does not cause a change of control and if the condition is true, after the statement has been obeyed, processing will continue in sequence.
The general IF statement takes one of two forms
IF condition THEN statement or IF condition THEN simple statement ELSE statement
In the second example if the condition is false the statement following the ELSE will be obeyed instead of the statement following THEN. In either case if the statement obeyed does not cause a change of control, the next statement in sequence will then be obeyed. Note that if this form is used the statement following the THEN must be a simple statement. This is to remove ambiguity from such statements as
IF X1 = 0 THEN IF X2 = 0 THEN GO TO L1 ELSE GO TO L2
By the above definition this must mean the same as
IF X1 = 0 THEN BEGIN IF X2 = 0 THEN GO TO L1 ELSE GO TO L2; END and not IF X1 = 0 THEN BEGIN IF X2 = 0 THEN GO TO L1; END ELSE GO TO L2
BEGIN and END can always be used in this way if necessary.
Note also that there must be no semicolon immediately before ELSE.
There are two chief types of condition - status conditions and accumulator conditions.
A status condition is one of the following:-
OVERFLOW - true if the overflow indicator is set FOVERFLOW - true if the floating point (real) overflow indicator is set. CARRY - true if the carry bit is set NOT OVERFLOW - true if the overflow indicator is not set NOT CARRY - true if the carry bit is not set NOT FOVERFLOW - true if real overflow is not set
Accumulator conditions depend on the current value of an accumulator and are written
accumulator relation primary
where the primary and accumulator are the same type, or
integer accumulator relation part address
A relation takes one of the following forms
< <= = >= > NOT=
which are self explanatory or
<CH <=CH >CH >=CH
These are mainly concerned with character comparisons and can be used only with integer (or long integer) accumulators. The effect is to test the accumulator value considered as four six-bit characters against the primary similarly considered. They may also be used for arithmetic comparisons providing both operands are of the same sign. If they are of different signs a negative number will be considered greater than a positive one. CH comparisons are more efficient than normal relations. CH is implied if the primary is a character sequence or string in a normal relation. For full details of efficiency of relations and code generated see PLN 12. Note that relations such as <= and >=CH are single symbols and should not therefore contain spaces.
A part address is either a base (i.e. £ identifier) or a displacement ($ cell designator).
Conditions may also be compounded
Example:
IF X1<B AND X3>CH X5 THEN SUM←SUM+X1
A compound condition is either a combined condition or an alternative condition.
A combined condition is any number of simple conditions connected by AND's. Example:
X1<B AND X1>=A AND NOT OVERFLOW
It is true only if all the component conditions are true.
An alternative condition is any number of simple conditions connected by OR's. Example:
X1<0 OR A1<0.0 OR OVERFLOW
It is true if any of the component conditions are true.
NOTE that AND's and OR's cannot be mixed and to jump to L2 if X1 is zero and either X2 or X3 are also zero a construction of the form
IF X1 = 0 THEN IF X2 = 0 OR X3 = 0 THEN GO TO L2
must be used.
Although loops can be written using an if statement and a goto statement the FOR statement provides an easier method of causing a group of statements to be obeyed a specified number of times.
The general form of a for statement is
FOR integer accumulator assignment STEP increment UNTIL limit DO statement
Example:
FOR X1←3 STEP 1 UNTIL 10 DO X7←X7 + X3
Its effect is to carry out the accumulator assignment and obey the statement, add the increment to the accumulator and obey the statement and repeat the last step until the accumulator takes the value of the limit. The statement is obeyed with this value and control then passes to the next statement in sequence. Note that the loop continues until the exact value of the limit is reached. Thus the statement:
FOR X1←3 STEP 2 UNTIL 10 DO X7←X7 + 3 and FOR X1←3 STEP 1 UNTIL 2 DO X7←X7 + 3
are both infinite loops. If it is not known whether exact agreement will ever occur a WHILE statement should be used.
Any integer accumulator assignment, including an address assignment is allowed after the reserved word FOR. An increment may be any integer primary optionally preceded by a - sign. Examples:
FOR X1←10+B STEP - 1 UNTIL 0 DO ..... FOR X6←S(X1) STEP - B(X2 + 1) UNTIL 0 DO .....
The increment may also be the fixed word symbol CHAR. This will cause the value of the accumulator, treated as a character address to be incremented by one character address at each iteration of the loop. Note that a BCHX is used to do this and if the compilation is in 15AM the count position of the accumulator will be altered. The limit value must therefore take account of this. The second example below is probably only meaningful in 22AM.
A limit must be an integer primary so if the final value is a complicated expression this should be calculated first and assigned to an accumulator or store location. Any statement may follow the DO including a block or another FOR statement.
Examples:
FOR X3←S STEP 1 UNTIL BEG(X1) DO BEGIN
B(X3)←0;
(X3)←1;
END;
X7←£BUFF + 6 + X1; ENDBUFF ← X7;
FOR X2←CHAR 1 OF £ BUFF STEP CHAR UNTIL ENDBUFF DO
BEGIN X6←CH BUFF(X2);
IF X6>'Z' THEN GO TO EXTRA;
END;
This is similar in effect to a FOR statement in that it allows a statement to be executed repeatedly but in this case execution ceases when a condition specified by the programmer no longer holds. Example:
WHILE A1 < MAX(X1) DO BEGIN
X1←X1 + 1;
A1←A1 + STEP;
END;
The general form is
WHILE condition (possibly compound) DO statement
The effect is to test the condition and if it holds to execute the statement and repeat the test. If the condition does not hold control passes to the next statement in sequence. This is more flexible than a FOR statement e.g.
X6←2; or X6←10; followed by FOR X1←3 STEP 2 UNTIL X6 DO .......
will both be infinite loops. On the other hand
X6←2; or X6←10; followed by X1←3; WHILE X1<X6 DO BEGIN.......; X1←X1+2 END
will cause ....... to be executed zero or four times respectively.
There is a special form of WHILE statement for the repeated execution of a block from which there is some conditional exit. This could be done by labelling the start of the block and making the last instruction a GOTO label. It can also be done however by a DO statement. Example:
DO BEGIN X1←X1+1; X7←BUFF(X1); NEW(X1)←X7; IF X7 = '*' THEN GO TO END1 ELSE IF X1 = 0 AND X7 = 0 THEN GOTO END2; END;
A procedure is a named group of PLASYD statements which may be obeyed at any point in a program by a procedure statement. After they have been obeyed control will normally return to the statement following the call. Functions on the other hand are means of inserting 190O machine instructions into a program either to serve as data (in a compiler for example) or to be obeyed by a CASE or OBEY statement, or to be obeyed as normal statements. The latter form is normally useful only if the particular instruction is not available directly by means of other PLASYD statements. Examples of this are the 126 order (MOVE), the 127 (SUM) and the 150 and 160 groups of extracode instructions.
A function statement is written as the symbol ! followed by an identifier which designates the machine instruction required. The identifier is not a reserved PLASYD word and can be used as a normal identifier at other points of the program. The identifier is followed by a pair of parentheses which enclose the X and N fields of the machine instruction. The instruction identifiers are those used as PLAN mnemonics with the following exceptions.
F = 111 Nt = 0 is SLC2
Nt = 1 is SLL2
Nt = 2 is SLA2
F = 113 Nt = 0 is SRC2
Nt = 1 is SRL2
Nt = 2 is SRA2
Nt = 3 is SRAV2
F = 115 is NORM2
Examples:
! CDB(X3,C(X1)); ! SMO(0,7); ! FAD(3,B);
! DISP('%%'); ! BVCI(LABI); ! FSB(,A(XD))
Additional mnemonics for writing TRUSTED programs have been introduced namely:
! SPP (Set PUC parameter) ! ACT (Activate PUC) ! RMS (Request console message)
The parameters representing the X and N fields will vary according to the instruction involved !SUSAR, !NULL and !LFPB are written without X and N fields. The following instructions require only an N parameter:
!BRN, !BVS, !BVSR, !BVC, !BVCR, !BCS, !BCC, !BVCI, !SUSTY, !DISTY, !DELTY, !SUSWT, !DISP, !DEL, !OBEY, !MODE, !FLOAT, !FIX, !SFP, !SFPZ, !LFP, !STOB, !ACT, !RMS.
All other instructions require an X parameter and an N parameter which must be separated by a comma. If the X parameter is zero it may be omitted but the comma must appear e.g. !FAD(,A). An X parameter may be an octal digit or an integer (or long integer) accumulator identifier. If it is an accumulator identifier the corresponding octal number will be inserted in the X field of the instruction.
A function which is not a branch instruction may have as an N parameter an unsigned integer number or octal value which does not exceed 12 bits (10 bits in the case of shifts) or a one or two character sequence. The binary representation of any of these quantities will be placed in the N field of the machine instruction. Alternatively the N parameter may be a simple cell designator. In this case the address specified will be placed in the N field of the instruction.
For branch instructions the N field may be either a label or the name of a procedure. The address of the statement so designated will be placed in the N field of the instruction. Alternatively an unsigned integer number or octal value will be interpreted as an absolute address.
A procedure declaration specifies the group of statements that are to form the procedure and assigns a name to them. It also specifies an accumulator called the link accumulator. When the procedure is invoked from another part of the program the address of the next instruction to the call will be placed in this accumulator. Procedure declarations, like other declarations, must appear at the head ot a block. However it is permissible to call a procedure at a point in the program before the declaration, if required and even to call it from outside the block in which it is declared. The form of a procedure declaration is
PROCEDURE identifier (integer accumulator, integer); statement;
The identifier is the name by which the procedure will be known; the accumulator is the link accumulator; and the statement is the definition of the procedure. Normally this statement will in fact be a block but it can be any statement. It is called the procedure body. The integer which is optional and, if absent is assumed to be zero, specifies the number of words of data (for example in a DATA statement, which must be ignored when control is changed at the end of the statement or at the occurrence of a RETURN statement (see 9.6).
Example:
PROCEDURE SORT(X0);
BEGIN LOWER INTEGER ENDA LOWEND; X1←£A + 10;
ENDA←X1;
FOR X1←X1-10 STEP 1 UNTIL ENDA DO
BEGIN X6←A(X1); X3←X1;
FOR X2←X1 + 1 STEP UNTIL ENDA DO
IF X6< A(X2) THEN
BEGIN X6←A(X2); X3←X2 END;
X2←A(X1); A(X1)←X6; A(X3)←X2;
END;
END;
A procedure may be activated at any point in the program by a procedure statement. This is a simple statement and consists merely of the procedure identifier. Examples:
SORT; IF A(1) > 0 THEN SORT ELSE GOTO OUT;
The effect of a procedure statement is to store the address of the word following the call in the designated link accumulator and to change control to the beginning of the statement that forms the body of the procedure. When the end of this statement is reached, providing the link accumulator has the value it had on entry, control will pass to the statement following the call and proceed in normal sequence from there. If it is required to use the link accumulator for other purposes in the body of the procedure its entry value should be stored and restored before exit. Exit can be achieved from within the procedure body either by jumping to the final END of the body, which must therefore be labelled, or by use of the !EXIT function or by use of the RETURN statement see 9.6.
Procedures should not directly or indirectly call themselves since recursion is not catered for by the PLASYD system. If recursion is necessary the user must make his own arrangements to stack the link unless return down the recursion train is not needed. In this case the final procedure must be left by a GOTO an external label. Exit by GOTO is permissible in non-recursive procedures as well, for example the SORT procedure above could have contained the statement
IF A(X1) < O THEN GO TO ERRORLAB;
Normally when a procedure is called it will have already been declared or it will be declared in the current block or some enclosed block.
If it is declared within a parallel block the programmer must take special arrangements to store vital data in accumulators (or common areas - see 12.3) since crossing block boundaries causes the loss of corresponding storage (see 8.1).
Normally data will be passed between a procedure call and the body of the procedure by using the accumulators and common variables. There is no standard method of passing parameters. However the programmer may use any method he likes. For example the standard 1900 method may be used by following the call by statements to load X3 with addresses.
Examples:
SIN; SPLURGE; X3←@FP1; or !LDN(3,25);
(Note that in the first of these FP1 must be in lower storage since otherwise the assignment will take two instructions).
These instructions may be obeyed from the procedure by using the OBEY instruction and the link accumulator, providing this is a modifier. Examples:
OBEY(X1); OBEY(X2 + 3);
The programmer must then arrange to jump round these instructions on return from the procedure either by adding to the link -
X1←X1 + 1;
or by using an !EXIT -
!EXIT (X1, 1);
or by using the RETURN statement (see 9.6).
An alternative way of passing parameters is to store actual values following the procedure statement by using the data statement. Example:
ADD; DATA(3,7, @A);
This could be a call of the following procedure:
PROCEDURE ADD (X3,3)
BEGIN
X7←(X3) + (X3 + 1);
X2←(X3 + 2);
(X2)←X7;
END;
As with the previous method the programmer must arrange to exit round the DATA statement. Any combinations of these forms may also be used if desired.
Note that the use of overlays imposes certain restrictions on the passing of parameters - see 12.4, 9.5.
Labels and procedures are to a large extent interchangeable. This can be exploited in two ways:-
GO TO SORT; GO TO SIN;No link will be stored and if the end of the body is reached the next instruction will be determined by the contents of the link accumulator at that pont. This facility will normally be used to obey a sequence of procedures from which no return is required.
PROCEDURE SIN (X1);
BEGIN
..........
COS: .......
.........;
END;
Label identifiers and procedure identifiers are collectively known as instruction identifiers.
This statement causes the compiled program to exit from the procedure in which the RETURN statement appears and to return control to a statement other than the one after the procedure call. The format of the statement is RETURN optionally followed by an integer in parentheses. Examples:
RETURN; RETURN (3);
If the integer is absent, control is returned to the (n+1)th statement after the procedure call, n is as specified in the procedure declaration (see 9.2). If the integer m is present then control is returned to the (m+1)th instruction after the procedure statement. The link must if necessary be restored into the accumulator before the RETURN statement. Note that a RETURN is automatically compiled, at the end of a procedure so in normal circumstances the user does not need a RETURN statement.
It is sometimes convenient to refer to a cell by more than one name, to give individual array elements names of their own or to treat say a real cell as two integer cells on occasion. It also often increases the readability of a program if accumulators can be given other identifiers so that one can talk of A(I) or A(COUNT) and mean A(X1). All these can be achieved by a synonym declaration.
A cell synonym declaration consists of the type of the new cell being declared, the identifier chosen for the new cell followed by the word SYN and the designator of the cell which is to be given the extra identifier. For example:
INTEGER B3 SYN XX ;
gives the extra name B3 to the cell XX if XX is integer. If XX is real it considers the first word of the real cell to be called B3 and this word may now be used as an integer cell. To name the second word of a real XX one could write
INTEGER XXEND SYN XX(1)
The cell designator following SYN must be a fixed cell designator, that is either an identifier or an identifier followed by a fixed index. If an index is used it should not be such that it designates a cell in a different domain to the identifier. Thus if A and B are declared
BASE; INTEGER A(3), B(3)
then X SYN B(-2) is legal but X SYN B(-12) is not. Designators of the type A(X1) are not allowed. The identifier following the SYN must have been previously declared by a normal or synonym declaration. Several synonyms may be specified within the same type declaration e.g.
REAL A SYN X, B SYN X(12),Y SYN Z(-3);
Each synonym is separated from the next by a comma. An identifier declared by synonym can be used anywhere that a more conventionally declared identifier could be used.
Cell synonym declarations may also be used to give names to absolute store locations. In this case initial values can be assigned as long as these do not upset the loading process.
For example:
INTEGER MEM SYN (0), SWITCH SYN (30) = #7700; REAL FP SYN (0)
In particular this form allows the fixed point accumulators to be considered as integer or real storage cells.
To assign extra identifiers to accumulators the accumulator synonym declaration must be used. This is similar to a cell synonym declaration but the type is replaced by the fixed word symbol ACC and only accumulator identifiers may follow SYN. An example is:
ACC I SYN X1, J SYN X2, IJ SYN X3, SUM SYN A1;
The new identifiers can then be used whenever the corresponding fixed accumulator identifier could be used.
For example:
J←A(I + 3); SUM←SUM + FP(I,J)
This declaration serves to associate absolute integer values with identifiers at compile time. Whenever the identifiers subsequentially appear the corresponding integer value will be substituted. Once an identifier has been defined in this way it can appear whenever the corresponding integer value can be written.
As an example of the use of defined variables consider the following program:-
LOWER INTEGER TABLE (10) = (0*10), TABLE2 (10);
................................................
FOR X1← 0 STEP 1 UNTIL 9 DO
BEGIN X6←TABLE (X1) ; TABLE2(X1)←X6; END;
If it is later found that the size of the tables should be 11, not 10, at least four alterations must be made and there may be others throughout the program. If the program were written instead as
DEFINE N = 10, P = N-1 LOWER INTEGER TABLE (N) = (0*N), TABLE2 (N); ..................................... FOR X1←1 STEP 1 UNTIL P DO .......
only the DEFINE line would need to be altered.
A define statement, which must always appear in a block head before the identifier defined is used, takes the general form
DEFINE identifier1 = expression1, identifier2 = expression2, ..........
Identifiers defined in this way may not be used for other purposes in the program (or segment). An expression may take one of four forms
DEFINE A=3, B= 7, C= #37377, D='%%%';
DEFINE AA = A, BE = B;
INTEGER X(A), Y(20), Z(16);
REAL XX(12), YY(BB);
INTEGER W(24);
DEFINE E = $X(6),F = $YY(-2), G = @YY-@XX,
H = £W-£X, I =@COS - @SIN;
All identifiers appearing to the right of the = sign in a define statement must have been
previously defined or declared.+ - * /and the operands must be either integer values or previously defined identifiers. The final and intermediate results must be acceptable integer values. All operations are carried out from left to right. Examples:
DEFINE J = G + 5/2, K = F + J + BB * 4, L = @W(4) - @X(BB) /2 + 1;
Preceding sections have dealt mainly with the types INTEGER and REAL although mention has been made of the types LONG INTEGER and LONG REAL. This section examines the long integer type more closely. Long real types are available only on some 1900's and are not implemented in the first versions of PLASYD. They are therefore not considered in detail in this edition.
Long integer accumulators were considered in 2.1 (c). Long integer cells may be declared in a similar fashion to real or integer cells by use of the fixed word symbols LONG INTEGER. Examples:
LONG INTEGER X, Y, Z(20), NEXT (3);
They may be assigned initial values in the same way as other cells. Example:
LONG INTEGER X = 37D, Z(20) = (0D * 20);
Possible long integer values are given below. Long integer cells occupy two 1900 words each and are therefore the same size as real cells. Cell designators obey the same rules for long integers as for other types.
There are two forms of long integer value and each consists of a form of integer value following by D. The two integer forms allowed are integer numbers and octal values. The integer number may be between MINUS 140,737,488,355,328 and 140,737,488,355,327. The octal value may be up to sixteen octal digits. The D must in both cases follow the last digit without intervening spaces. Examples:
27D MINUS 37221567D #7676767676767676D
Accumulator assignments for long integers are very similar to those for integers and in some cases the two can be mixed. A long integer primary is either a long integer accumulator or a long integer cell or a long integer value. For the following examples these declarations are assumed to be in force
INTEGER I, J, K; LONG INTEGER II, JJ, KK;
A basic cell assignment takes the form
accumulator identifier ← primary
Examples:
X10←II; X34←X70; X45←MINUS 3722D;
It is also possible to assign an integer primary to a long-integer accumulator. The effect is as though an integer assignment were made to the second word of the long integer, and then the sign bit removed and propagated through the first word. The operators +,-,++,-- cannot be followed by integer primaries when the cell assignment is long integer. Examples:
X70←I; X34←X2; X45←3; X45←32679;
From the description above it can be deduced that the last example is less efficient than the penultimate, since this is true for integer assignments of the same quantities.
The monadic operator NEG can be used on either of these forms. Examples:
X70←NEG II; X34←NEG X1; X12←NEG JJ(K);
To build more complicated assignments the operators +,-,++ and -- may be used with either long integer or integer primaries. If the primaries are integer there is a similar effect to that in the assignment of integer primaries described above. Example:
X01←X67 + X67 - JJ;
Shift operators may be used with C operands. Examples:
X34←X34 SLA 2 - KK (X1) SRL 3;
A long integer assignment may also be followed by a / and an integer cell designator. Example:
X23←JJ(X1 + 2) + II/J
The effect of this operator is to cause the current double length integer in the accumulator to be divided by the value of the integer cell. The integer result of this is placed in the second word of the double length accumulator (i.e. X3 in the case above) and the integer remainder is left in the first word (X2). The resulting contents of X23 are thus not a standard long integer value and it would not therefore be usual to follow this operator by any others. X3 and X2 could then be used separately. In order to produce a long integer result from the product of two integers a function must be used. Example:
X1←I; !MPY(X1,J);
X12 now contains the product and may be used as a long integer:-
X12←X12 - II(2);
These are very similar to the corresponding integer cell assignments. The four possible forms are:-
Examples:
II←0; JJ(K(X1 + 3) +X2 - 1)←0;
Examples:
KK←X01; JJ(K)←X67;
Example:
II← NEG X67;
Example:
II← NEG X67 - X67 + X34;
Up to this point PLASYD programs have been considered as monolithic sections of program which are compiled in one run. It is however possible to split a program into segments which may be compiled separately, and then consolidated to form a program. The mechanics of compilation and combination are defined in section 13.
Each segment must be either a master segment which takes the form of a block, or a procedure which takes the form of a procedure declaration. Any complete program must contain one master segment and zero or more procedure segments.
All identifiers used for the purposes described in earlier sections will be local to the segment in which they are declared. Thus the same identifier may be used for different purposes in different segments. Other means are available for communication between segments and a means is provided to tell the compiler certain attributes of other segments, for example the link accumulator used by a separately compiled procedure. The methods of dealing with this form of intersegment communication are dealt with in the rest of this section.
Since identifiers are normally local to the block in which they are declared, special steps must be taken to indicate to the compiler procedure names and labels to which control may be passed from separately compiled segments. This is done by preceding the label definition or the procedure declaration by the reserved word GLABEL (Global LABEL). Examples:
GLABEL OUT : X←X + X3 GLABEL PROCEDURE FRED (X1);...........................
This will cause the compiling system to remember the identifier concerned for use in other segments. The name of a separately compiled procedure is automatically a glabel and the symbol GLABEL is not required.
A glabel may be called or GOTOed from any external segment in the same way as a local label or procedure name could. However each separately compiled segment must inform the compiler of the external glabels that it is using and, if it is to call any of them the link accumulators which are to be used. This is done by an EXTERNAL declaration. Example:
EXTERNAL OUT, IN, FRED (X1), IGNATIUS (X4);
This specifies the identifiers of all external glabels which are to be used and, in the case of FRED and IGNATIUS the link accumulators. Note that if an identifier does not appear in an EXTERNAL declaration it can be used as a local identifier in spite of the fact that it may be declared as a glabel in another segment of the program. There is the same interchangeability between glabel labels and procedures as between local ones. Thus one may write
EXTERNAL FRED (X1), OUT (X7); ........... GO TO FRED; ............ OUT; .............
Every program must contain at least one entry point at which the program may be started. This is done by an entry label which is written
ENTRY digit:
and may precede any statement in the same way as a label. Examples:
ENTRY 0: GO TO START; ENTRY 9: MONITOR←X1;
The particular entry point needed during any particular run may be specified to the operating system by reference to the digit (see section 13).
The accumulators are common to all segments and may be used to pass information across. It is also possible to specify that certain store locations are common to more than one segment by means of a global declaration. This declares one or more named common blocks of storage. A block is written as
identifier: declaration list
The identifier is assigned to that block and the same identifier must be used in all segments which wish to make use of that storage. The declaration list may be made up of any number of type declarations (INTEGER, REAL, LONG INTEGER or LONG REAL) and BASE declarations separated by semicolons. All the entities declared will be placed in the common block in the order stated and their identifiers will be local to the segment in which they are declared. The size of the common block will be the largest specified in any segment of the complete program. Initial values may be assigned to variables in a common block but they should either be identical in all segments using the block or should be assigned in only one segment. If the global declaration is in upper (see below) a new domain will be started for each common block.
A global declaration consists of the word GLOBAL followed by any number of common blocks, separated by semicolons followed by the reserved symbol GLOBEND. A block identifier and a cell identifier must not have the same name e.g. GLOBAL JACK: JACK is not allowed. Example:
GLOBAL BUFF: INTEGER B(32), CB = 32CNT;
PARAMS: REAL A(3) = (7.1, 2.6, 9.4);
INTEGER BB = 27;
GLOBEND;
All the blocks of a global declaration can be made to occupy lower storage by placing the global declaration within a lower declaration. Block identifiers may be used as simple SMO indices in the same way as bases. Example:
X3←CB(BUFF);
In general the code generated by the PLASYD compiler will allow for any overlay structure to be set up between segments (see section 15 and PLN2 page 23). If it is known that a segment or at least some of its glabels are to be called only from places in the same overlay unit or that program identifiers addressed are in the same overlay unit some redundant code can be avoided. This is done by preceding the segment by a local directive which takes one of three forms.
LOCAL: a list of glabels; LOCAL ALL: LOCAL ALL BUT: a list of glabels;
The first of these says that all the glabels in the list, which are written separated by commas and appear in the following segment are only accessed from the same overlay unit and that glabels appearing in the list and in the EXTERNAL declarations of that segment are always in the same overlay unit as the segment. Example:
LOCAL: FRED, JIM;
The second form says that all glabels including the identifier of the segment if it has one are local in the sense given above. This would be the normal statement for a non-overlayed program. The last form says that all glabels except those in the list are to be treated as local. Note that these statements are not part of the PLASYD language proper and LOCAL, ALL and BUT are thus not reserved words.
If a procedure is called from a different unit in the same area there are certain restrictions imposed on it. First it cannot access data following the call instruction in the way described in section 9.4 and any parameters must be passed in accumulators or permanent common areas. Secondly, no return can be made at the end of the procedure. The last restriction also applies if the unit from which the call is made is not in store, even if it is in a different area. Any attempt to return to a unit which is not in store will not be detected and a jump will be made to the corresponding word in the current unit in the relevant area.
A BRINGOVERLAY statement is available to allow the user to bring an overlay into core store without actually entering the overlay. The format of the statement is as follows (note there is no space between the G and O):-
BRINGOVERLAY instruction identifier
Any instruction identifier in the overlay may be specified provided it has been specified in compiling directives see 15.2. Example:
BRINGOVERLAY JACK;
This statement provides a macro-like facility for incorporating into PLASYD segments, sections of PLASYD program which have been previously stored on disc. Each section of program, which may consist of any number of statements or declarations or even parts of statements, must have previously been stored as a subfile in a file whose name is given to the PLASYD operating system CALM (see section 16). Such sections may not contain INCLUDE statements. A particular subfile may then be included in the PLASYD segment by writing.
INCLUDE (subfile name); or INCLUDE (subfile name, SL);
The effect will be as though the contents of the subfile had been written at that point in the segment. INCLUDE statements must always appear on a line by themselves. Note that lines included by this means will be compiled and listed as normal statements by the PLASYD compiler but will not be line numbered but they will be preceded by *. If SL is present the subfile is short listed.
The facility is particularly useful in connection with quantities that are used in several segments. For example, the definition of a common block need only be written once and can then be INCLUDE'd in all segments which require it. Similarly DEFINE'd variables may effectively be made global to several segments by INCLUDEing their definitions.
Comments may be placed at any point in a program, except within a string or character sequence, by enclosing them within the characters [ and ]. The brackets and everything between them will be completely ignored.
If a section of PLASYD program is enclosed between the symbols
? integer ( and ) ? integer
the contents of the parentheses will be treated as comment unless the switch specified by the integer is on. There must be no spaces between the parenthesis, the integer and the ?. Example:
?3( DEFINE N = 45; X←X1 + X2 )?3
The integer must be between 0 and 10 and since zero is used for other purposes as well it will normally be between 1 and 10. Methods of setting the switch are described in section 15.
Conditional parentheses may be nested. Thus
?1(A?2(+)?2?3(B?2(-)?2)?3;)?1
will have the following effect
Switch 1 Switch 2 Switch 3 Code Compiled OFF ON or OFF ON or OFF NONE ON OFF OFF A; ON OFF ON AB; ON ON OFF A+; ON ON ON A+B-;
Although normally quantities of different types cannot be mixed in statements it is sometimes necessary to convert from one type to another. Automatic conversion from integer to long integer has been discussed in 11.2. Conversion from long integer to integer can be done merely by taking the second word if the long integer is positive. If its sign is not known special steps must be taken to put the correct sign bit in the second word. There are many ways of doing this of which the following example is one. This places a single length representation of II in I. The value of II is assumed to be within single length limits.
X12←II; X2←X2 SLL 1; X12←X12 SRL 1; T←X2;
Two special functions are also provided for conversion between integer and real. These are FLOAT and FIX. Both are rather non-standard functions. FLOAT is used in a special form of accumulator assignment -
A1 ← FLOAT cell designator
The cell designated must be either an integer or a long integer cell. If it is integer there should be another integer cell following with zero contents. The effect is then to convert the integer to real form in the floating point accumulator. If the following cell is not zero its contents will be taken as the binary representation of a fraction (i.e. its integer value multiplied by 2-23) and included in the conversion. If a double length integer is designated its two words are treated in exactly the same way as the integer and following word. Thus if II is long integer
II←3; A1←FLOAT II
FIX is used in a special form of cell assignment -
long integer cell designator ← FIX A1
This is the opposite of the FLOAT operation and will place in the first word of the long integer the integer part of the value of A1 and the fractional part in the second word. Thus to set the integer I to the integer part of the accumulator one could say
(6)←FIX A1; [(6) is X6 and X7] I←X6; or LONG INTEGER II; INTEGER T SYN II; II←FIX A1;
These are an alternative form of integer value and are written
integer number T unsigned integer number
Examples:
MINUS 12T15 1976215T22
There must be no spaces between the T and either of the numbers. If the number is considered as
aTb
its value is the rightmost b bits of the number a. It will normally only be used with b = 12, 15 or 22 although other values are possible. If a is negative it can be used to set up negative addresses.
This statement allows the user when compiling multimember programs to specify the member number and priority of individual members. The statement which must appear before the head of a procedure, similar to LOCAL, has the following format
MEMBER (m,n)
where m and n are integers
m ≤ 5 Member Number n ≤ 99 Priority
The statement need only appear once for each member although there may be more than one segment in a member. Example:
MEMBER (3,25);
The nonplasyd declarations and nonplasyd statements enable segments with multiple unlabelled entry points to be incorporated into a PLASYD program. The nonplasyd declaration has the same format as an external declaration with NONPLASYD replacing EXTERNAL. Example:
NONPLASYD JACK (X0), JOHN (X1)
A nonplasyd statement which must refer to an identifer declared in a nonplasyd declaration allows the user to enter a procedure at other than the first statement of the procedure or to goto an instruction after a glabel. The formats are
instruction identifier ( unsigned integer number ); and GOTO instruction identifier ( unsigned integer number );
The bracketted sequence may be omitted, in which case 0 is assumed. Examples:
JACK (3); JOHN (2); GOTO FRED (4);
The CUEOVERLAY statement enables programmers to compile the A/U (Overlay Area and Unit number) of an identifier. The identifier must be either a glabel name or a segment name. The A/U appears in the body of the compiled code at the occurrence of the statement and hence can be used as data similar to the code compiled at a DATA statement. The format of the statement is
CUEOVERLAY instruction identifier;
Example:
CUEOVERLAY JACK;
An operating system, CALM (Control And Logistics Monitor), is used when compiling programs with the PLASYD language compiler described in this document and also the PSFUL (Plasyd System FUnctional Language) compiler. The monitor, which requires an executive offering range compatible trusted program facilities, not only controls the operation of any program entrusted to it (hereafter called PUC (Program Under Control)), but also controls the generation of the source records for the PLASYD and PSFUL compilers and transfers the semi-compiled records output by these compilers to specified disc files. Paper tape, card and disc files are accepted as source media for the compilers. The directives to control CALM are interleaved with the parameters, data and source for the programs it controls, enabling extra programs to be easily inserted into a batch. Every program to be run is identified by its standard four character name and its data is terminated by ****.
The monitor, although primarily intended to control the PLASYD and PSFUL compilers, can control any batch of programs, but in this case it may be necessary to supply an events list before each PUC name. For standard batches it is not necessary to supply event lists as there are predefined actions on standard halts and unexpected occurrences in the PUC such as illegal. Programs entrusted to CALM may be found and loaded from magnetic tape.
No operator action is required except to find the monitor, to activate the monitor, and to take standard error action if
The monitor always requires a line printer and one slow input peripheral. The monitor will open all disc files necessary for the two compilers but all other peripheral activity such as the use of disc files by #XMED or of magnetic tapes by #XPMU is allowed without intervention. Programs with trusted status such as #XJEC (file allocator) cannot be run under CALM. The CALM monitor program name is #YAPC and it changes its name to that of the PUC when the PUC is loaded although there are in effect two programs operating in the same program slot.
All the directives described in the subsequent parts of this chapter are terminated by newline if on paper tape or the end of a card; spaces are ignored except within brackets and the directives may start at any character position on a line.
The initial card or line on paper tape of a batch of programs must be YAPC optionally qualified. The format of the directive is
YAPC, yyyy, g
where yyyy is the last four characters of the disc file PROGRAM yyyy from which YAPC was loaded and g is the generation of the file. If yyyy is omitted tho file is assumed to be PROGRAM YAPC and if g is omitted a file of appropriate name but of highest generation number will be opened.
It is intended that most programs required will be held in the PROGRAM YAPC file.
The occurrence of a YAPC directive reinitialises and enables more than one batch of jobs to be run without refinding the system. Note that if YAPC is not qualified the file name PROGRAM yyyy remains unchanged. If g is present yyyy must be specified.
This directive which can occur only once in a batch of jobs is used by CALM for two purposes namely:
The format of the directive is
NAME (xxxx, yyyy, g)
where
xxxx is a four character program name.
yyyy is the first four characters of the name of a file PROGRAM yyyy holding xxxx. The file may be on disc or magnetic tape.
g is the generation number
yyyy must always be present (even if xxxx is identical to yyyy) unless xxxx is held in the file from which #YAPC is loaded or if xxxx is being generated by the PLASYD or PSFUL compilers, when it can be omitted. If g is omitted a file of highest generation number will be opened on disc or the first on line if on magnetic tape. If g is present yyyy must be specified.
xxxx may have a charge code added for use with PLASYD or PSFUL
Examples:
NAME(JACK) NAME(FRED16041) NAME(XALE, DISC, 730)
CALM has a built in list of the names of programs it recognises. This list will be published whenever a version of the system is issued. All these programs are known to the monitor and are automatically entrusted to CALM which assumes they are to be found in the file from which itself was found. A further class of programs is also automatically entrusted, this class contains programs which have been consolidated by #XPCL earlier in the same run and which #XPCL has attempted to load into store.
One further program known to CALM and automatically entrusted is the program specified in the NAME directive (see 14.2).
To add programs to the list held in CALM or exceptionally to free a program from the control of CALM two directives are available. The first directive ENTRUST may appear any number of times and both directives must appear before the first program name directive. The directives are:-
where
xxxx is a four character program name
yyyy is the first four characters of the name of a
file PROGRAM yyyy holding xxxx. The file may be
on disc or magnetic tape
g is the generation number
g must always be present (even if xxxx is identical to yyyy)
unless xxxx is held in the file from which #YAPC is loaded, when it can be omitted.
If g is omitted a file of highest generation number will be opened on disc
or the first on line if on magnetic tape. If g is present yyyy must be specified.
Examples:
ENTRUST (XALE, DISC) ENTRUST (XPMV, TAPE, 100) ENTRUST (XPLZ)
FREETRUST (XPCL)
Two directives are available to change the medium of a slow input; they may appear between programs or between source segments of the PLASYD and PSFUL compilers
If the device specified in the directive is the same as the current input then the directive is ignored. There should be a blank line or card after the READ FROM directive.
The parameters, source, etc for any particular program are enclosed in what can be considered as matching brackets namely
The four character name is only read by CALM and is required for every program that is to be run under the system, even those which outside the system would be loaded by DELTY FIND or DELTY LOAD instructions. If a PUC does a DELTY FI then the accumulators are carried forward if and only if the program is found from disc. If a PUC does a DELTY LO or DELTY FI, the program name and if specified the file name, are stored by CALM. The program is not loaded until the occurrence of the corresponding program name and it is then loaded by the standard FI technique.
**** must be present even if the data of the PUC is terminated by ****. **** is ignored after a successful run but is used by CALM in its search for the end of data of an unsuccessful PUC run.
The four character name can be qualifed to give the entry point required and whether the PUC, if already in core store, is to be used without reloading. The format is
name, xy, INCORE
where
name is the four character name xy is the entry point in the range 20 to 29 INCORE indicates the PUC is not to be reloaded.
Either or both of the qualifiers may be omitted. If the entry point is omitted then the one corresponding to the current slow input medium is assumed:-
20 for paper tape 21 for cards
xamples:
XPCL XALE, 22 XMED, INCORE
There is one further pair of brackets outside the batch of jobs. The opening bracket is the YAPC directive, and the closing bracket is the batch terminator, ***E. YAPC, wherever it appears, reinitialises the system. Thus it is possible to run several batches in one run by removing the ***E from the end of each sub-batch except the last.
There are three classes of PUC halts:-
Halts which are currently in type (a) are:
Halts which are currently in (b) are:-
Each program may have an event list describing the action CALM is to take on any specified halt. The event list may over-ride the standard action described in 14.6. If the PUC does not have an event list or the halt that occurs does not appear in the event list then the action described in 14.6 is taken.
The event list will appear immediately before the PUC name and will apply to that run of the PUC unless the PUC is not reloaded (see 14.5 INCORE).
Each directive in the list consists of three parts:-
Actions (vii) to (x) can be followed by any of (vii) to (x) enabling more than one action to be taken at an event, and must be terminated by one of the actions (i) to (vi). Continuation lines are allowed for actions (vii) to (x) as one of the actions (i) to (vi) must appear. Examples:
AT ILLEGAL, OU 0 10000, FINISH
AT HALTED (ER) , CONTINUE
AT LOOPING, OU 5000, GO JACK
AT DELETED, GO FRED
AT DISPLAY (AB), GO
AT HALTED (LD), AL 60 *10, AL 70 *20,
AL 2056 *76542121,
ON (0,1,2,3), GO 20
AT HALTED (AB), OF (0,23), ON (2),
AL 2765 *7, GO
Event list messages are listed when they occur on the line printer and displayed on the console typewriter unless suppressed (see 14.8).
It is possible to change the standard action of CALM when a display message or an error occurs. The changes are carried out by altering the state of bits in word 30 of CALM. Note that CALM's word 30 is not the same as word 30 of the PUC. The initial state of CALM's word 30 is all bits set to 0. Two directives are available namely
ON (n , n2,.... nq) 0<nq<23 and OFF (n , n2,.... nq) 0<nq<23
At ON, CALM will set the specified bits to 1 and at OFF, CALM will set the specified bits to 0. Word 30 of CALM after ON or OFF remains set for all subsequent PUC, until the occurrence of another ON or OFF directive or a YAPC directive when word 30 is set to 0.
At present the setting of bits 0,1,2,3, 4 and 5 of word 30 only have an effect.
Bit 0 1 Complete core print of PUC at an unexpected event
0 Core print of the first 3000 words of the PUC at an unexpected event
Bit 1 1 All display messages from the PUC are suppressed
0 Display messages cause typing
Bit 2 1 Excutive message referring to name changing is suppressed
0 Name changing message is typed :-
AAAA was BBBB
Bit 3 1 Page throws to the line printer generated by
the TRACE package (see 16) are suppressed
0 Page throws are not suppressed
Bit 4 1 Event list messages are not "displayed" or listed when they occur
0 Event list messages are "displayed" on the console typewriter and
listed on the line printer
Bit 5 1 Disengage messages from the PUC will cause a fix message to be displayed
on the console typewriter
0 Disengage messages are ignored
There are at present six entry points in use in the CALM system 20, 21, 22, 25, 26, 27. The operator is informed by a console message when the PUC name changes and in the following name represents the current program name; when #YAPC is initially loaded name is YAPC.
CALM is normally a disc based operating system but it is possible to hold the system on magnetic tape provided the executive has disc find facilities.
The CALM system program is #YAPC and the following programs can appear in the same program file as #YAPC and used in a CALM batch of jobs without being referenced in an ENTRUST directive.
#XMED Disc editor #YAPP PLASYD compiler #YAPI PSFUL compiler #XPCL Disc consolidator #XPEU Disc program library update #XPES Disc subroutine library update #XPMX Disc cosy editor #XPMY Disc cosy create #XPLZ Disc Plan compiler #YADM Disc to magnetic tape dump #SCPR Semicompiled print
Other programs may be added to the program file containing YAPC but these must be referenced by ENTRUST or NAME directives
Once the program file is established the operator action required to run a batch of programs is minimal. The operations are
The directives will be read by #YAPC and the required programs in the batch will be run as described in the previous section of this chapter. Name changes will appear on the console and the batch will finally HALT OK. If an error has occurred in the batch DISPLAY ZZ appears on the console and the batch parameters are then searched for a YAPC line or ***E when either a new batch will be started or CALM will HALT OK. The only action required of the operator after the initial GO is to load parameter, source or data packs as required.
A very simple standard job sheet is also possible. The CALM program occupies approximately 7000 words of core store and is resident in core all the time and there are no overlays held on disc.
The latest version of YAPC is described in PLN 16 which is reissued when a new version of CALM is available.
Messages from YAPC are described in Chapter 16.
An example of a CALM batch in which a program #XMFR is compiled and consolidated using PLAN and then a number of tests run on the compiled program is given below
YAPC, MINE, 100 ENTRUST (JACK) ENTRUST (XRAA, DISC) NAME (XMFR, EMF1) XPMX .... Data XPMX **** XPLZ .... Data XPLZ **** XPCL **** XMFR .... Data XMFR **** AT HALTED, CONTINUE XPCL .... Data XPCL **** AT HALTED (AB), GO JACK, 20 **** XMFR .... Data XMFR **** AT HALTED, CONTINUE XRAA .... Data XRAA **** ***E
Note. JACK has to be entrusted as it is created by XPCL using slow parameters. XMFR and JACK have standard default actions on error. Any unexpected halts in XPMX, XPLZ, XPCL will cause the system to scan to ****E and HALT. XPMX, XPLZ, XPCL are not entrusted as it is assumed they are found from the file containing YAPC i.e. #PROGRAM MINE, generation number 100. XRAA is assumed to be on PROGRAM DISC.
As described in Chapter 14 CALM is used to control the generation of PLASYD and PSFUL programs. In this chapter are described the directives that specify the mode and type of program to be compiled, the environment of the source and semi-compiled, and the type of listing required.
All listing is carried out on a line printer allocated by CALM unless the PUC specifies some other device in which case CALM's printer and the other device will both be used. There are three types of information output:-
(i) is listed as it appears on the input medium without line numbers unless it was input from a file specified in a READFROM directive
(ii) is listed as it appears on the input medium and if input from a file specified in a READFROM, the line is preceded by line numbers (except when input from an INCLUDE subfile), for use with the disc editor #XMED
(iii) is listed in the format that the PUC specifies, this may or may not include line or statement numbers depending on whether or not the PUC produces them. The CALM system may add comments to the directive lines and also add, to the type (ii) output, messages output by the two standard compilers. All such messages start in column 93 of the line printer enabling the pages of listing to be photo-copied onto A4 paper without including the comments. Types (i) and (iii) are always listed regardless of the steering directives. This steering directive influences the type (ii) output. The directive may take one of three forms:-
The form of listing; can be changed between segments. The default action is LIST. Details of the comment and error numbers will appear in Appendix 2.
There is a further directive TAB n which effects tab settings.
The following directives specify the name and priority of the program CALM is generating. They also specify the structure and mode of the program. The directives include the NAME directive previously described in 14.2. but repeated here as far as it affects the generation of new programs. Programs generated in a previous run using the PLASYD and PSFUL compilers and intended for use under CALM with full development facilities should be specified using the full NAME directive as in 14.2. The directives are:
NAME(JACK) NAME(XFOC16003)
PRIORITY (87)
OVERLAY (1,2) FRED, JACK, JIM OVERLAY (2,1) JOHAN
OVERCOMMON (1,2) WORKBUFF, STORE OVERCOMMON (6,5) FUNCTIONS, SYMBOLTABLEThere may be any number of OVERLAY and OVERCOMMON directives but each one must be at most one line in length. This directive must appear immediately after the first YAPP line.
nAM specifies the address mode in which the program is to operate after loading. xBM specifies the branch mode of the program. mCH specifies the checks the consolidator carries out on the segments comprising the program, MIXAM implies make no check.
The parameters of PROGRAM MODE nAM, xBM and mCH may appear in any order. The directive must appear before the YAPP or YAPI line.
If nAM is omitted tho mode of the machine is taken to be 15AM.
If xBM is omitted DBM is assumed.
If mCH is omitted then 15CH is assumed if nAM≡15AM, 22CH is assumed if nAM≡22AM
If the directive PROGRAM MODE is omitted then PROGRAM MODE (15AM, DBM, 15CH) is assumed.
Examples:
PROGRAM MODE (22AM, EBM, 22CH) PROGRAM MODE (MIXAM, EBM) PROGRAM MODE (22AM, DBM)
The file and subfile directives specify all files to be used by CALM in compiling the program specified in the NAME directive. All other files used, for example, in an #XMED run are specified in the parameters for that program. In the directives described in this section the following definitions hold:-
Each file or subfile name can consist of up to 12 characters chosen from the set A to Z, 0 to 9, space, and "-" (hyphen). The first character must be a letter.
If the qualifier is omitted and the compilation consists of runs of both the PLASYD and PSFUL compilers then all output from both compilers will go to this file and subfile. The qualifiers are only required if in a mixed compilation the semi-compiled output is required to be to separate files.
The directives are:-
SEND TO (PROGRAM FILE(10).SUBFILE (G))/YAPP SEND TO (PROGRAM MINE.PSFULSEG)/YAPI)
SEND TO (PROGRAM OPEC,.SOURCE 1)/ YAPPThere may be at most two SEND TO directives. One may be used to specify the file and subfile for the new PLASYD segments and the other may be used for the new PSFUL segments. The first subfile so referred to will also hold the steering information for #XPCL, the disc consolidator. The order in which the subfiles are read by #XPCL is given after 15.3 c.
SEMICOMPILED (PROGRAM JACK. MASTERSEG)
LIBRARY (MONITOR FILE.TRACESEGS)Use of the SEMICOMPILED and the LIBRARY directives enable segments written in other languages such as PLAN to be consolidated with PLASYD and PSFUL segments.
Any number of the preceding subfile directives may appear before the first PUC name directive. The subfiles will be presented to the consolidator in the order that they appear as parameters to CALM hence the user must ensure that these parameters are in the order in which he wishes the segments to be consolidated. The first directive does not have to be a SEND TO directive. Thus steering and master segments generated in a previous run can be presented to the consolidator before the new code output to a SENDTO file. This facility also allows users to specify the order of segments in core store as, in general, non-overlay program segments are loaded in the order of presentation to the consolidator.
One further directive required for use by the consolidator is:
If this directive is omitted the compiled program is automatically loaded into core store. If an overlayed program is consolidated it is necessary to have a DUMP ON directive. Example:
DUMPON (PROGRAM JOHN(100))
Note that if there is no SEND TO directive then it is not possible to consolidate and the directives (b), (c) and (d), if they appear, will be ignored. No semi-compiled will be generated from any source read but syntax checking and the appropriate listing will take place.
The following two directives specify the disc files that can be used to hold source for the PLASYD and PSFUL compilers and, optionally, in the case of the file specified in the READFROM directive, control directives for CALM as described in 14.1 to 14.10. The files and subfiles specified in these directives must have been created by #XMED. The directives are:-
READ FROM (FORTSOURCE (4). INPUT SOURCE (6))
MACROFILE (GLOBAL FILE (1))
The file names and subfile names are used only by the CALM monitor so these can be the same as procedure names in a PLASYD segment.
In the following example only the parts relevant to these directives have been included. It is assumed there is an INCLUDE directive in the PLASYD source held in the source subfile NEWSEG. Example:
SEMICOMPILED(PROGRAM JACK(10). MASTER) SENDTO (PROGRAM FRED(1). FIRSTSEG) SEMICOMPILED (FORTSEGS. OUTPUT) LIBRARY (TRACE. MONITORSEGS) DUMP ON (PROGRAM COMP(1)) YAPP MACROFILE (PLASYD MACRO) READ FROM (COMPSOURCE.NEWSEG) **** YAPI READ FROM (COMPPSFUL.FIRSTSEG) **** ..........
To implement conditional compilation described in 14.2 and to list the code compiled by PLASYD, it is necessary to set bits in word 30 of the PLASYD or the PSFUL compiler. The directive takes the form
SWITCH (n1, n2, n3,......ni) 0<ni<10
where n1, n2, n3,...... etc correspond to the bits of word 30. Example:
SWITCH(0,1,3,5)
this sets bits 0, 1, 3 and 5 to one, the remaining bits are zero.
The directive can appear after the YAPP or YAPI line before a segment, or between segments. The directive and hence the bit setting applies only to the next segment to be compiled from source. Once this segment has been compiled word 30 is set to 0 unless another SWITCH directive occurs. Successive directives before a segment of source have an additive effect. The example SWITCH (0, 1, 3, 5) could have been written:
SWITCH(0) SWITCH(1) SWITCH(3) SWITCH(5)
These directives describe the environment of the PLASYD or PSFUL segments that follow the directives which must appear after a YAPP or YAPI line before the first segment, or between segments are as follows:
If nAM is omitted MIXAM is assumed.
If xBM is omitted currently MIXBM is assumed.
nAM and xBM specify the program modes that the following segments will run in. SEGMENT MODE has the same scope as the directives LIST etc, in that it holds for all succeeding segments unless changed. If the directive is omitted SEGMENT MODE MIXAM,MIXBM) is assumed. Examples:
SEGMENT MODE (22AM) SEGMENT MODE (DBM, 22AM)
If both SMOMACRO and COMPILESMO are omitted the environment of the machine is taken as to whether SMO instructions are allowed.
The following directives affect the size of the compiled program's cue list and only have a limited use and are not recommended for general use.
The default action if no directive is specified is to generate 9 cues.
Note that if a user has specified LOCALSEGMENTS all other segments in that program must have external procedures and glabels referenced by LOCAL directives if they appear in segments compiled after the LOCALSEGMENTS directive.
There are no basic editing and dump facilities in the CALM system. All editing of source on disc files must be carried out using #XMED. Both the PLASYD and the PSFUL compilers accept disc source via the CALM system. The job directive referred to in XMED can until a specific one is available for PLASYD be *ALGOL, *EMA or *FORTRAN. The system checks only that it is a source subfile.
A special progran #YADM is available for security dumps of disc files. The program is described in PLN 17.
YAPP is the name of the PLASYD compiler and all source must be preceded by the PUC control directive YAPP and terminated by ****. The directives specifying the input and output media are described in 15.1 to 15.5. All errors and comments listed by the PLASYD compiler are described in chapter 16. The examples in the following section (15.8) show how PLASYD is used in conjunction with XMED etc.
Examples of three jobs using PLASYD and PSFUL follow:-
(a) All the standard facilities of CALM are used:-
If an error halt occurs during the first test program a core dump of 3000 words is obtained and then the second test program JOIIN is run.
YAPC SEND TO (PROGRAM OPEC. SYNTAX) DUMP ON (PROGRAM FILE (6)) SEMICOMPILED (XFOC(1). INPUT SEGS) SEMICOMPILED (XFOC(100). OUTPUTSEGS) LIBRARY (PLASYD. TRACESEGS) NAME (XFOC76103) PRIORITY (60) OVERLAY (1,1) PROGDSC, FILE OPEN OVERLAY (1,2) SYNTAX, LIST OVERCOMMON (1,1) LISTSYST, TABLE LIST XMED *OUT (OPTSOURCE(106)) *IN (OPTSOURCE(105)) *FORTRAN LISTSYSTEM *ALTER 10,1 X1 ← @TABLEA; **** //// **** YAPP SEQUENT MODE(EBM,22AM) MACROFILE (FORTGLOBAL) READFROM (OFTSOURCE(106). LISTSYSTEM) **** XPCL ....... **** XFOC PROGRAM (JACK) ........ **** XFOC PROGRAM (JOHN) ......... **** ***E
(b) A similar job to (a) but in this case the standard actions are overridden by the event lists. It is assumed that the changes in the two XMED runs are independent such that the test programs will yield useful results provided the second XMED run was correct. The action on the XFCS runs is specified in the XFCS event lists.
YAPC ENTRUST (SCPR, DISC) SEND TO (PROGRAM XFCS.MASTER) NAME (XFCS76104) PRIORITY (70) LIST PROGRAM MODE (22AM, DBM) AT HALTED (ZZ), GO XMED XMED *OUT (OPTSOURCE(106)) *IN (OPTSOURCE(105)). *FORTRAN MASTERSEG 1 *ALTER 12,1 **** //// **** XMED *OUT (XFCS SOURCE(107)) *IN (XFCS SOURCE(105)) *FORTRAN MASTERSEG2 *ALTER 14,3 X6 ← JACK; **** //// **** YAPP COMPILESMO READ FROM (OPTSOURCE.MASTERSEG1) SWITCH (0,1,2,3) READ FROM (XFCS SOURCE.MASTERSEG2) **** XPCL **** AT HALTED (AB) GO 900 AT HALTED (CD), OU O 5000, GO SCPR AT ILLEGAL, OU O 10000 AT HALTED (DE), GO XFCS PROGRAM (JACK) ......... source for JACK **** ON (O) AT LOOPING, OU O 5000 AT HALTED (JK), GO SCPR AT HALTED (CD), HALT XFCS PROGRAM (JOHN) ................source for JOHN **** SCPR ............. **** ***E
(c) This example shows how a previously consolidated program such as one produced in (a) can be run using CALM. The programs TES1 and TES2 are also consolidated and run.
YAPC NAME (XFOC, FILE) XFOC PROGRAM (TES100) ...............source for TES1 **** XPCL **** TES1 ...............data for TES1 **** XFOC PROGRAM (TES200) .............. source for TES2 **** XPCL **** TES2 TES2 has no data **** ***E
The error messages produced by CALM and the PLASYD compiler are described in this chapter together with the action taken. The last section describes the TRACE facilities available.
As CALM handles all the input and output media for the PLASYD and PSFUL compilers the standard slow peripheral, disc and tape messages may occur. These are described in 14.6 together with the relevant operator action. There are two console messages which may occur during the search for a PUC.
The other console messages referring to disc failures on opening and extending files are given below as are messages which may occur on reading from or writing to disc. Some of these halts should never occur in practice, but are listed below because they correspond to particular reply information from Executive
HALTED Gl File not in system or incorrect generation number. HALTED G2 Failure of integrity code check. HALTED C2 Insufficient space in core store for further file descriptions. HALTED D1 Purge date not exceeded. HALTED L1 Other file opened when trying to open System File for writing. HALTED L2 System File opened for writing when trying to open another file. HALTED C1 System control area full. Unable to extend file. HALTED M1 No space for file extension. HALTED M2 Should not occur. HALTED M3 File to be extended is not open as a write file. HALTED M4 Insufficient space for file extension. HALTED I1 Logical bucket number out of range or zero. HALTED I2 Should not occur. HALTED K1 Unclearable parity error. HALTED C3 Auxiliary control area full HALTED Z1 Should not occur.
Of the above error halts, only the first six may be recoverable.
The following messages may occur on the line printer against any of the directives described in chapters 14 and 15.
A normal CALM batch will end with the following message on the console
#name HALTED OK
where name is the current PUC name
If CALM itself goes illegal a postmortem dump is automatically produced and the system halts with the message
#name HALTED!!
Note that during the loading of a PUC any of the messages occuring in XPED may occur, see Library Specifications Manual.
The PLASYD compiler attempts to recover from most of the compilation errors that occur. The error number is listed on the line printer beside the relevant source line. A list of errors is given in Appendix 2 together with a list of comment numbers. Comment numbers do not imply errors but are used to give to the user additional information about the code compiled.
At the end of the compilation if errors have occurred and YAPP has been able to recover then YAPP halts ER. To consolidate, ignoring errors, the user must specify an event list item to cover the halt.
AT HALTED (ER), CONTINUE
If errors have occurred and it has been impossible to generate sensible semi-compiled YAPP will continue to syntax check until the end of the source and will then halt EX. It is not then possible to continue.
The action taken by YAPP at any error is also described in Appendix 2.
Other messages:-
HALTED YY
Symbol or literal tables full at this point.
HALTED XX
More than 64 global areas in this segment at this point.
At both these halts compilation ceases. No attempt to re-enter YAPP should be made.
The code generated by the PLASYD compiler can be listed against the relevant source by the use of the SWITCH directive described in 15.4. To obtain a listing bit 0 must be set by
SWITCH (0)
Note that the switch setting only covers the next PLASYD segment. Further SWITCH (0) directives must appear for later segments.
After each PLASYD segment, an optional listing of the storage usage of that segment may be produced, depending on the setting of SWITCH (21). If this switch is off, the listing is produced, starting on a new page. The summary appears under the following headings:
Segment name. Link. n WORDSIf the segment is a master segment, details are given thus:
MASTER SEGMENT OF Program Name, n WORDS
Procedure name. Link. Entry Wwhere W indicates the word of the segment at which the procedure starts
Name of item. Link.
Name of item value of item (#abcdefgh)
No. of literal. Value (#abcdefgh) R. Value (As four characters).The R in the second item is the appropriate two character relativiser if this is needed.
m. Glabel name.m is the word of the segment at which the glabel occurs. Glabels are listed in ascending values of n.
m (t) Symbolic namem is the position of the item; t is the type of the item (where t is one of I = integer, LI = long integer, R = Real, LR = Long Real).
m (t) Synonym namem is the absolute location, t is type as in lower preset etc.
Accumulator name. Synonym name
Absence of any items (apart from (a) which must occur) is indicated by 'NONE'.
Facilities are available to trace the action of a program compiled by the PLASYD system. These facilities take the form of procedures which can be called at any point in a run. The procedures must be declared EXTERNAL at the head of any segment of procedure in which calls to them occur. It is assumed that a line printer is available. The procedures will be held in semi-compiled form in a library file. The "calls" to these procedures could appear as conditional compilation (PLN 2 pg.2). The "call" to the trace procedures consists of a procedure statement followed by a data statement which may be an initial value or an initial value list (PLN 2 pg.21).
The accumulators except for the link accumulator will be preserved. The Trace procedures must be in permanent or in the same overlay as the calls or in a different overlay area to the call.
The data statement consists of a string of up to four characters. Example:
OUTIDENT; DATA "AB";
A call to the procedure OUTIDENT will cause the characters in the string to be output to the line-printer on a new line.
The data statement consists of a string of up to four characters. Example:
OUTACC; DATA "CD";
A call to the procedure OUTACC will cause the contents of the INTEGER accumulators X0 to X7 and the REAL accumulator A1 to be output in octal, character and integer formats preceded by a line identifying the procedure call. Example:
ACCUMULATORS AT CD X0 00004142 00AB 2146 etc.
The data statement consists of a string of up to four characters followed by the address of the integer value. Examples:
OUTINTEGER: DATA ("EF"; @X);
A call to the procedure OUTINTEGER will cause the contents of the integer X to be output in octal, character and integer formats preceded by a character string identifying- the procedure call Example:
INTEGER VALUE AT EF 00004143 00AC 2147
The data statement consists of a string of up to four characters followed by the address of the real value. Example:
OUTREAL; DATA ("GH", @Y);
A call to the procedure OUTREAL will cause the contents of the real value Y to be output in octal, character and integer formats preceded by a character string identifying the procedure call. Example:
REAL VALUE AT GH 01004142 10AB 264290
00000000 0040 256
The data statement consists of a string of up to four characters followed by the address of the location in core store and the number of 1900 words required. Example:
OUTCORE; DATA ("IJ", @Z, 100);
OUTCORE; DATA ("KL", 0, 2000);
It can be seen from the examples that an address can be specified either as a relative value or an actual value. The output is two words to a line in instruction, octal and character format preceded by the core location in decimal and octal.
All the procedures so far described require YAPC to be present when they are incorporated in a program compiled by the PLASYD system. The following procedure does not require YAPC to do its printing.
The data statement consists of a string of up to four characters followed by the address of the location in core store and the number of 1900 words required. Example:
FREEOUTCORE; DATA ("IJ", @Z, 100);
FREEOUTCORE; DATA ("KL", 0, 2000);
It can be seen from the examples that an address can be specified either as a relative value or an actual value.
If the start address and number of words parameters have bit 0 set to 1 the contents of the word specified in address field will be used. Example:
FREEOUTCORE; DATA("AB",#400CNT+@BILL,#400CNT+@FRED);
The number of words specified in FRED starting at the address specified in BILL will be printed.
PROCEDURE MAGICSQUARE(X0); [EXAMPLE Of PLASYD PROGRAMMING]
[THIS PROCEDURE ESTABLISHES A MAGIC SQUARE OF ORDER N WHERE
N IS ODD AND > 1,X7 MUST CONTAIN N ON ENTRY AND THE ARRAY
A, INTO UHICH THE MAGIC SQUARE IS PLACED IN A LINEARIZED
FORM, MUST HAVE ITS FIRST N^2 LOCATIONS SET TO ZERO.
X2-6 ARE USED AS WELL AS ONE LOWER LOCATION ]
BEGIN ACC N SYN X7,IJ SYN X3,AIJ SYN X4,J SYN X6 ,I SYN X5,
K SYN X2;
LOWER INTEGER NSQ LOWEND;
X5←N*N; NSQ←X5; [OR QUICKER !MPY(X5,N);NSQ←X6]
I←N SRL 1; J←N-1 [INITIAL POINT HALFWAY DOWN RIGHT COL];
FOR K←1 STEP 1 UNTIL NSQ DO
BEGIN IJ← I*N+J; [QUICKER TO DO X2←I,IJ←J;
!MPA(X2,N);BUT NOT MUCH]
AIJ←A(IJ);
IF AIJ NOT=0 THEN [WE'VE DONE THIS ALREADY]
BEGIN I←I-1; J←J-2;
IF I<0 THEN I←I + N;
IF J<0 THEN J←J+N;
IJ←I*N+J; [STEP LEFT TO NEXT DIAGONAL]
END;
A(IJ)←K;
I←I+1;IF I=N THEN I←0; [MOVE DOWN A DIAGONAL]
J←J+1;IF J=N THEN J←0; [LOOPING IF NECESSARY]
END; [OF FOR LOOP]
END;
| Error Number | Meaning | Corrective action taken |
|---|---|---|
| 0 | ; or END scanned and STACK broken | STACK is discarded until correct symbol appears. |
| 1 | END not matched by BEGIN on STACK | STACK is discarded until BEGIN appears or STACK terminates. |
| 2 | BASE statement in LOWER declaration | The statement is ignored. |
| 3 | **** read as source | END's forced in to match BEGIN's on stack |
| 4 | Type declaration not followed by identifier list | Skip to a recognisable symbol. |
| 5 | Illegal symbol in identifier list | Skip to a recognisable symbol. |
| 6 | Incorrect array length (not absolute const, or defined) | Array length 1 is assumed. |
| 7 | Identifier declared twice | Identifier ignored |
| 8 | Incorrect structure of LOCAL (ALL) (BUT) | The statement is ignored. |
| 9 | Illegal symbol in label list | The statement is ignored. |
| 10 | Unmatched bracketing | Assume ) |
| 11 | Identifier already declared | Skip to ; |
| 12 | Illegal source construction | Skip to ; |
| 13 | ||
| 14 | LOWEND or GLOBEND missing | No action |
| 15 | PURE storage not initialised | Sets to zero |
| 16 | ||
| 17 | Too many items in an array | Surplus items ignored |
| 18 | $ of a lower item used in a DEFINE statement | Skip to a, or ; |
| 19 | LOWEND without corresponding LOWER | LOWEND ignored |
| 20 | DEFINE not followed by identifier | Skip to a comma or ; |
| 21 | Identifier after DEFINE already declared | Skip to a comma or ; |
| 22 | Identifier not followed by = in DEFINE statement | Skip to a comma or ; |
| 23 | Separator missing in initial value list | , assumed |
| 24 | GLOBEND without matching GLOBAL | GLOBEND ignored |
| 25 | Impossible error (Stack not free for begin) | Error ignored |
| 26 | LOWER not followed by a type or GLOBAL | Type INTEGER is assumed |
| 27 | GLOBAL not followed by block identifier | An area %%%G is created |
| 28 | Block identifier not followed by : | A colon is assumed to be present |
| 29 | Block identifier followed by illegal declaration | Type INTEGER is assumed |
| 30 | LONG not followed by xtype or rtype declaration | Type INTEGER is assumed |
| 31 | SYN of item already declared | Skip to a comma or ; |
| 32 | Illegal displacement | Zero substitued |
| 33 | Error after ACC or SYN | Skip to a comma or ; |
| 34 | ACC αidentifier not followed by SYN | Skip to a comma or ; |
| 35 | Identifier list not terminated by SYN or ; | ; assumed |
| 36 | Illegal expression in DEFINE declaration | Value of definee indeterminate |
| 37 | Illegal format in DEFINE declaration | Skip to a comma or ; |
| 38 | Illegally formed absolute expression in DEFINE declaration | Skip to a comma or ; |
| 39 | Error in initial value list (incorrect type, undefined ident. etc.) | Zero substituted |
| 40 | Illegal symbol within (----) sequence | Assume constant of 0 |
| 41 | Illegal symbol following a modifier | Assume closing right bracket |
| 42 | Illegal symbol following SMO index | Assume closing right bracket |
| 43 | Illegal symbol in simple SMO index | The statement is ignored |
| 44 | Closing bracket not found | Assume closing right bracket |
| 45 | Link accumulator not specified in PROCEDURE | Link accumulator X0 is assumed |
| 46 | Illegal accumulator given for PROCEDURE | Link accumulator X0 is assumed |
| 47 | PROCEDURE not followed by identifier | Skip to ; |
| 48 | OBEY, not an xcell | The statement is ignored |
| 49 | Illegal operand. | Zero substituted |
| 50 | Undeclared identifier in L.H.S. | The statement is ignored |
| 51 | Identifier undeclared at current block | The statement is ignored |
| 52 | Unmodified cell asignment to UPPER | No action |
| 53 | Undeclared identifier in statement R.H.S. | A null instruction is generated |
| 54 | Identifier undeclared at current block | A null instruction is generated |
| 55 | Incompatible types | A null instruction is generated |
| 56 | Cell assignment: αcell := αcell | Rest of statement is ignored |
| 57 | Accumulator assignment of | The statement is ignored |
| 58 | Cell assignment of constant not equal zero | The statement is ignored |
| 59 | Illegal operator | A null instruction is generated |
| 60 | Identifier too long | The identifier is truncated to 32 characters |
| 61 | Real number out of range | Zero substituted |
| 62 | Illegal characters following & of real number | Number is ignored |
| 63 | NOT encountered on its own | NOT is ignored |
| 64 | Too many characters in character sequence | Truncated to four characters |
| 65 | Count (CNT) greater than 511 | Count field is zeroised |
| 66 | Octal longer than 16 digits | Octal is truncated |
| 67 | 8 or 9 appearing in an octal number | Put in as #10 or #11 |
| 68 | #, or & standing alone | Character is ignored |
| 69 | Subfile name after INCLUDE too long | Statement is ignored |
| 70 | Subfile name in INCLUDE not found on MACROFILE | Statement is ignored |
| 71 | INCLUDE statement not on a line by itself | Other code on the line is ignored |
| 72 | MINUS not followed by a number | MINUS ignored |
| 73 | ?number not followed by ( | ( is assumed |
| 74 | Conditional compilation switch >10 | No conditional action taken |
| 75 | ? not followed by a number | No conditional action taken |
| 76 | String longer than 244 characters | String is truncated |
| 77 | Truncation to >23 bits | No truncation done |
| 78 | Error in function statement | Statement ignored; NULL output |
| 79 | Accumulator used as label | := assumed |
| 80 | Undeclared identifier in a bracketed sequence | Identifier ignored |
| 81 | END found within a CASE statement | CASEND inserted before END |
| 82 | Illegal operator | Rest of statement is ignored |
| 83 | More than 100 branch aheads at this point | Branch ahead table cleared |
| 84 | WHILE clause not terminated by DO | The statement is ignored |
| 85 | IF clause not terminated by THEN | The statement is ignored |
| 86 | Stack error on fixing-up IF statement | The statement is ignored |
| 87 | Label identifier previously declared | Item redeclared as label |
| 88 | Not :=0 in a cell assignment | Null generated |
| 89 | Illegal modifier in CASE clause | Modifies X1 is assumed |
| 90 | Multiple assignment in a single statement | Rest of statement is ignored |
| 91 | Illegal symbol in place of operator | A semicolon is inserted following previous operand |
| 92 | Program or segment starts with illegal symbol | A BEGIN is assumed missing |
| 93 | Illegal first character of a statement | The statement is ignored |
| 94 | Statement starts with identifier and illegal symbol | A semi-colon is inserted between identifier and symbol |
| 95 | Cell designator not followed by ← or := | The statement is ignored |
| 96 | Illegal symbol in place of operand | The statement is ignored |
| 97 | END, ELSE or; should have been found | A semi-colon is inserted |
| 98 | Wrong type of identifier in PROCEDURE or GOTO statement | The statement is ignored |
| 99 | ENTRY not in range 0-9 | Entry not generated |
| A0 | @ or £ not followed by identifier | The statement is ignored |
| A1 | Illegal operator before address | The statement is ignored |
| A2 | Illegal address assignment | The statement is ignored |
| A3 | CHAR sequence incorrectly terminated | The statement is ignored |
| A4 | Undeclared identifier after $ | No action |
| A5 | Undeclared identifier after £ | No action |
| A6 | Illegal declaration | Operand set to zero |
| A7 | Illegal identifier after @ | Operand set to zero |
| B0 | BRINGOVERLAY not followed by identifier | The statement is ignored |
| B1 | CUEOVERLAY not followed by identifier | The statement is ignored |
| B2 | Identifier not correctly declared | The statement is ignored |
| C0 | Illegal condition statement | The condition is ignored skip to next THEN or DO |
| C1 | Illegal symbol following relation | The condition is ignored skip to next THEN or DO |
| C2 | Base symbol not followed by identifier | The condition is ignored skip to next THEN or DO |
| C3 | Displacement symbol not followed by identifier | The condition is ignored skip to next THEN or DO |
| C4 | Character comparison with $ | 'CH' is ignored |
| C5 | $ identifier (index) outside range 0 - 4095 | The condition is ignored skip to next THEN or DO |
| C6 | AND, OR appear in same compound condition | The first to appear is assumed |
| C7 | Undeclared identifier in condition | Zero is substituted |
| C8 | Incompatible types in condition | The condition is ignored skip to next THEN or DO |
| C9 | Not integer accumulator on LHS of condition | The condition is ignored skip to next THEN or DO |
| D0 | SMO in a condition when SMOMACRO is set or assumed | The condition is ignored skip to next THEN or DO |
| E1 | FOR not followed by integer acc. assignment | No action |
| E2 | Illegal increment in FOR clause | The statement is ignored up to DO |
| E3 | UNTIL not found in FOR clause | No action |
| E4 | Illegal limit in FOR clause | The statement is ignored up to DO |
| E5 | DO does not terminate FOR clause | No action |
| E6 | Illegal item following '-' in limit | The statement is ignored up to DO |
| E7 | Stack is broken on fixing-up DO | No action |
| E8 | No STEP between FOR and UNTIL | Step 1 assumed |
| E9 | END not followed by ; END or ELSE | ; inserted |
| F1 | Illegal operand in function statement | The statement is ignored |
| F2 | Illegal constant operand | The statement is ignored |
| F3 | Function statement not terminated by ) | No action |
| F4 | Undeclared operand in function statement | The statement is ignored |
| G0 | GOTO not followed by identifier | The statement is ignored |
| G6 | Illegal character in DATA statement | The symbol is ignored |
| G7 | Block identifier declared differently elsewhere | Skip to ; |
| G8 | Redefinition of GLOBAL area in different mode | The area is forced into LOWER |
| G9 | Too many GLOBAL declarations in segment | Compiler HALTS:-XX at this point |
| M0 | Monadic operator in wrong context | The statement is ignored |
| M1 | Unrecognised monadic operator | Rest of statement is ignored |
| M2 | MEMBER not followed by ( | The statement is ignored |
| M3 | Member number >5 | The statement is ignored |
| M4 | Member number not followed by comma | The statement is ignored |
| M5 | Member priority >99 | The statement is ignored |
| M6 | No ) at close of member statement | ) assumed |
| M7 | ) not followed by ; in member statement | ; assumed |
| P0 | Not integer or definee after comma in a procedure statement | 0 substituted |
| P1 | Procedures nested to depth > 16 | SENDTO file (if any) is closed |
| P2 | Number after comma in a procedure statement >63 | 0 substituted |
| P3 | Accumulator not followed by comma or ) in a procedure statement | ) assumed |
| R0 | Identifier not found where expected | Skip to ; |
| R1 | Identifier not followed by ( in replacers statement | Skip to ; |
| R2 | ( not followed by integer in replacers statement | Skip to ; |
| R3 | Integer >510 in replacers statement | 510 substituted |
| R4 | Integer not followed by ) in replacers statement | Skip to ; |
| R5 | ; should terminate a replacers statement | ; asumed |
| Comment Number | Meaning |
|---|---|
| 1 | Section of source not compiled as conditional compilation switch is off |
| 2 | A second [ has been found before a ] |
| 3 | A ] has been found without a matching [ |
| 4 | a double-length 'shift-type' instruction has been generated |
| 5 | Nested LOWER declarations have been used |
| 6 | , not followed by SL in an INCLUDE statement, SL assumed |
| 7 | A SMO macro has been generated |
| 8 | CARRY or NOT CARRY not the first in a compound condition |
| 9 | Trivial condition, eg >=#400CNT |
| 10 | No D after a double length integer |
| 11 | Base generated, though no BASE statement present |
| 12 | Attempt to access item outside normal domain |
| 20 | Other than one machine instruction generated by a statement in a case sequence |
| 21 | Division will corrupt an accumulator not explicitly mentioned in the statement (as in PLAN) |
| 22 | Multiplication will use an accumulator not explicitly mentioned in the statement (as in PLAN) |
A ABSOLUTE EXPRESSION 10.2 ACCUMULATOR 2 2.1 ACCUMULATOR ASSIGNMENT 6.1 6.3 11.2 ACCUMULATOR CONDITION 8.4 ADD OPERATOR 6.6 ADDRESS 3.1 4.1 4.4 4.5 6.7 ADDRESS ASSIGNMENT 6.7 AL 14.7 ALGOL 1 ALTERNATIVE CONDITION 8.4 AND 6.3 6.6 84 ARITHMETIC OPERATOR 6.3 ARRAY 4.1 ASSIGNMENT STATEMENT 2 6 11.2 11.3 AT DELETED 14.7 AT DISPLAY 14.7 AT FAIL 14.7 AT HALTED 14.7 AT ILLEGAL 14.7 AT LOOPING 14.7 B BASE 4.4 6.7 BASE DECLARATION 4.4 BASIC CELL ASSIGNMENT 6.4 BEGIN 4 8 BLOCK 4 8.1 BLOCK STRUCTURE 8 BLOCKHEAD 4 BRINGOVERLAY 12.4 C C OPERAND 6.2 CALM 12.5 14 CALM ENTRY POINTS 14.9 CALM MESSAGES 16.1 CARRY 6.2 6.5 8.4 CARRY SETTING OPERATOR 6.3 CASE STATEMENT 7.4 CELL 2 2.2 6.7 CELL ASSIGNMENT 6.4 6.6 11.3 CELL DESIGNATOR 5 CH 6.2 6.5 6.8 8.4 CHAR 6.8 8.5 CHARACTER ADDRESS 6.7 CHARACTER OPERATIONS 6.8 CHARACTER SEQUENCE 3.1 CNT 3.1 6.2 CODE GENERATED 16.3 COMBINED CONDITION 8.4 COMMENTS 13.1 COMMON BLOCK 12.3 COMPILATION SYSTEM 15 CCMPILESMO 15.5 COMPOUND CONDITION 8.4 CONDITION 8.4 CONDITIONAL COMPUTATION 13.2 CONDITIONAL STATEMENT 8 8.3 CONTINUE 14.7 CONTROL DIRECTIVE 13.6 CONTROL STATEMENT 2 7 COUNT 3.1 4.5 D DATA STATEMENT 8.3 9.4 DEBUGGING 16 DECLARATION 2 4 8.2 DEFINE DECLARATION 10.2 DESIGNATOR 6.7 DISC DIRECTIVES 15.3 DISPLACEMENT 4.4 5.1 6.7 DO 8.5 8.6 DOMAIN 4.4 DUMPING 15.6 DUMPON 15.3 E EDITING 15.6 ELSE 8.4 END 4 8 ENTRUST 14.3 ENTRY 12.2 ENTRY POINT 12.2 ER 6.3 6.6 ERROR HALTS 14.6 EVENT LIST 14.7 EX 6.2 6.5 EXPONENT 3.2 EXTERNAL 12.1 F FINISH 14.7 FIX 13.3 FIXED ADDRFSS 6.7 FIXED CELL DESIGNATOR 10.1 FIXED INDEX 5.1 FIXED WORD SYMBOL 2.2 FLOAT 13.3 FOR 8.5 FOR STATEMENT 8.5 FOVERFLOW 8.4 FRACTIONAL NUMBER 3.2 FREE INDEX 5.1 FREETRUST 14.3 FROM 6.3 FUNCTION 9 9.1 FUNCTION STATEMENT 4.5 G GLABEL 12.1 GLOBAL 12.3 GLOBAL BLOCK 4 GLOBALSEGMENTS 15.5 GLOBEND 12.3 GO 14.7 GOTO STATEMENT 7.2 H HALT 14.7 I IDENTIFIER 2 2.2 5.1 6.7 IF 8.4 IF STATEMENT 8.4 INCLUDE 15.3 INCLUDE STATEMENT 12.5 INDEX 5 5.1 INITIAL VALUE 4.5 8.3 INSTRUCTION IDENTIFIER 9.5 INTEGER 4.1 INTEGER ACCUMULATOR 2.1 INTEGER CELL DECLARATION 4.1 INTEGER NUMBER 3.1 INTEGER VALUE 3.1 L LA 6.5 LABEL 7.1 9.5 LIBRARY 15.3 LINK 9.2 LISTING 15.1 LOCAL 12.4 LOCALSEGMENTS 15.5 LOGICAL 3.1 4.1 LOGICAL OPFRATOR 6.3 6.6 LONG INTEGER 11.1 LONG INTEGER ACCUMULATOR 2.1 LONG REAL ACCUMULATOR 2.1 LONG TYPE 11 LOWEND 4.3 LOWER 4.3 LOWER DECLARATION 4.3 LOWER STORAGE 4 M MACROFILE 15.3 MEMBER STATEMENT 13.5 MINUS 3.1 MODIFIER 2.1 MONADIC INTEGER CELL OPERATOR 6.5 MONADIC OPERATOR 6.2 N NAME 15.2 NAME DIRECTIVE 14.2 NEG 6.2 6.5 NEG CARRY 6.5 NONPLASYD STATEMENT 13.6 NOT 8.4 NULL STATEMENT 8.3 NUMBER 3.1 O OBEY STATEMENT 7.3 OCTAL VALUE 3.1 3.2 OF 14.7 OFF 14.8 ON 14.8 14.7 OPERATING INSTRUCTIONS 14.1 OPERATING SYSTEM 14 OPERATOR 6.2 6.3 6.5 6.6 OR 6.3 6.6 8.4 OU 14.7 OUTACC 16.5 OUTCORE 16.5 OUTIDENT 16.5 OUTINTEGER 16.5 OUTREAL 16.5 OVERCOMMON 15.2 OVERFLOW 8.4 OVERLAY 15.2 OVERLAYS 12.4 P PAPER TAPE 1 PARAMETER 9.4 PART ADDRESS 8.4 PLASYD 1 PLASYD MESSAGES 16.2 PLN2 1 PLN 17 15.6 PRIMARY 6 PRIORITY 15.2 PROCEDURE 9 PROCEDURE BODY 9.2 PROCEDURE DECLARATION 9.2 PROCEDURE STATEMENT 9.1 9.3 PROGRAM MODE 15.2 PSFUL 14 PUC CONTROL DIRECTIVES 14.5 R READFROM 15.3 READFROM DIRECTIVES 14.4 REAL 4.2 REAL ACCUMULATOR 2.1 REAL CELL DECARATION 4.2 REAL VALUE 3.2 RELATION 8.4 RETURN 9.3 RETURN STATEMENT 9.6 REVERSE OPERATOR 6.3 S SA 6.5 SEGMENT 4 12 SEGMENT MODE 15.5 SEMICOMPILED 15.3 SEND TO 15.3 SHIFT OPERATOR 6.3 SIMPLE CELL DESIGNATOR 5.1 SIMPLE STATEMENT 8.3 SLA 6.3 SLC 6.3 SLL 6.3 SMO 5.1 6.6 SMO DESIGNATOR 5.2 SMOMACRO 15.5 SRA 6.3 SRAV 6.3 SRC 6.3 SRL 6.3 STANDARD HALTS 14.6 STATEMENT 2 8.3 STATUS CONDITION 8.4 STATUS DIRECTIVES 14.3 STFP 8.5 STORAGE CELL 2 STRING 4.1 4.5 SWITCH 15.4 13.2 SYMBOL TABLE LISTING 16.4 SYN 10.1 SYNONYM DECLARATION 10.1 T TAB 15.1 TAB CHARACTER 1 THEN 8.4 TRACE FACILITIES 16.5 TRUNCATED NLMBER 3.1 TRUNCATED NUMBERS 13.4 TYPE 3 TYPE CHANGING 13.3 U UNDER 6.3 UNTIL 8.5 UPPER STORAGE 4 V VALUE 2 3 3.1 VARIABLE 2 VARIABLE INDEX 5.1 W WHILE 8.6 WHILE STATEMENT 8.6 WORD 5.1 WORD ADDRESS 6.7 X XMED 14 1900 CHARACTER SET 1.0 := 6.1 ; 6.0 < 8.6 = 8.4 > 8.4 ? 13.2 ! 9.1 " 4.5 # 3.1 6.3 £ 4.4 5.2 6.3 % 2.2 & 3.2 ' 3.1 * 6.3 **** 14.0 14.5 ***E 18.5 + 5.1 6.3 6.6 ++ 6.3 6.6 - 5.2 6.3 6.6 -- 6.3 6.6 / 6.3 @ 4.4 5.2 6.7 [ 13.1 $ 4.4 6.7 ] 13.1 ← 6.1