PLASYD

A PROGRAMMER's GUIDE

PLN14, Version 2

J K Buckle, P H Dove

1969

1. Introduction

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).

2. Identifiers, Accumulators and Storage Cells

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.

2.1 Accumulators

Accumulators have fixed identifiers. These are as follows:

  1. Integer accumulators: These are eight known as X0, X1, X2, X3, X4, X5, X6, X7. Integer accumulators can hold integer values such as numbers, 24-bit patterns and addresses. Three of them X1, X2 and X3 can be used for special purposes and are known as modifiers.
  2. Real accumulator: There is one called A1, which is used to hold values that are real or floating point numbers.
  3. Long integer accumulators: There are eight called X01, X12, X23, X34, X45, X56, X67, X70. Each long integer accumulator is formed from two integer accumulators in an obvious way e.g. X01 is formed from X0 and X1. Long integer operations are dealt with in section 11. It should be noted that any alteration to the value of a long integer accumulator will in general destroy the values of its component integer accumulators, and vice versa. From this it also follows that alteration to X01 for example will in general destroy the values of X70 and X01 as well.
  4. Long real accumulator: There is one with the identifier A12. This is made up of the real accumulator A1 and a mantissa extension for increased accuracy. It is available only on some 1900's. Long real operations are dealt with in section 11.

All the accumulators may be given extra identifiers at the programmer's request by means of the synonym declaration defined in section 10.1.

2.2 Cells

Cells have no fixed names and may be assigned identifiers of the programmer's choice which conform with the following rules:-

  1. They must consist of letters and digits. For this purpose the symbol % is considered as a letter.
  2. The first character must be a letter (or %)
  3. The total number of characters must not exceed 32.
  4. The identifier must not contain layout characters such as spaces or new lines.
  5. The identifiers used for accumulators and the fixed word symbols (see below) may not be used for other purposes.

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.

3. Types and Values

This section deals only with the simple types REAL and INTEGER (or LOGICAL). LONG types are discussed in section 11.

3.1 Integer values

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:-

  1. integer number: a positive or negative decimal integer within the range given above. Positive integers are written without a sign thus:
    3671   29        0  4052
    
    Negative integers are preceded by the fixed word symbol MINUS thus:
    MINUS 6      MINUS 2732    MINUS 372615
    
    Note 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.
  2. octal value: a sequence of from 1 to 8 octal digits preceded by the symbol # e.g.
    #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.

  3. truncated number: these are dealt with in section 13
  4. count: this is an integer number in the range 0 to 511 which is to be held in the most significant 9 bits of the word with zeros elsewhere. It is written as an integer number followed by CNT with no intervening spaces or other characters:-
    257CNT         326CNT         2CNT
    
  5. character sequence: a sequence of from one to four characters of the 64 character 1900 set, enclosed within single quote marks ('). The single quote character itself is represented in the sequence by two consecutive single quotes which count as one of the four possible characters.
    '%'   '+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.

3.2 Real values

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:-

  1. fractional number: consists of an integer number followed by a decimal point followed by one or more integers -
    0.13261         321.67         215.0
    
    The number may be signed in the same way as integer numbers
    MINUS 136.0         MINUS 0.141579
    
  2. fractional number with exponent: any fractional number may be followed by an & and an integer number. The integer is taken to be a power of ten by which the fractional number is to be multiplied -
    1.4&20        MINUS 0.5613&3         1.414&MINUS 6
    
    There 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. integer number with exponent: an integer number followed by an exponent will also be considered a real number -
     3& MINUS 6         41107&4
     
  4. octal value: a sequence of from 1 to 16 octal digits preceded by the symbol # and followed by R. Spaces are allowed between # and the first octal digit but not elsewhere. This format is taken as being a right justified representation of a 1900 floating point number -
    #2000000000000400R   #400R
    
    The first example represents 0.5, the second unnormalized zero (0×100)

4. Declarations

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.

4.1 Integer (or logical) cell 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:-

  1. an identifier. This specifies that one word of storage is to be allocated to this cell which will be used to hold integer values, strings or addresses (see 4.5 below).
    Example: INTEGER I, VW, MGB
    
  2. an identifier followed by an integer in parentheses. This is called an array item and it specifies that the number of integer cells specified, each of one 1900 word, is to be allocated to this name. The first cell may be referred to by the identifier as a simple integer identifier. The method of referring to the rest is given in section 5 below.
    Example:  INTEGER A(41), B(22)
    
  3. either of the items (a) or (b) together with an initial value setting. These are defined in section 4.5 below.

4.2 Real cell declarations

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).

4.3 Lower declarations

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.

4.4 Base declarations

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.

4.5 Initial value declarations

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

  1. string: this is a sequence of characters enclosed in double quotes ("). The double quote symbol itself is denoted by two double quotes in succession. String is unique as an initial value in that one string may provide initial values for several items of an array. The characters are inserted in sequence, four per 1900 word and spaces are added at the end if necessary to bring the total number of characters to multiple of four. Examples:
     
    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".
  2. address: addresses specify the position of a cell within store or within its domain and are used for indirect accessing. More details are given in 6.7 below.
  3. count+: any of the preceding types of initial value, except another count or a string, may be preceded by a count and the symbol +. The count will be placed in the top 9 bits of the integer cell and the remainder, which must be expressable in 15 bits or less, will be placed in the remainder of the word. Examples:
    INTEGER LIST (4) = (6CNT+3, 17CNT + #7777)
    
  4. a function statement: this is a method of expressing a machine instruction which is to be stored in a word. Details are in 9.1 below.

5. Cell Designators

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;

5.1 Simple cell designators

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.

5.2 SMO designators

6. Assignment statements

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.

6.1 Basic accumulator assignment

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:

  1. The type of the accumulator and the primary must be identical. Thus A1←0 is illegal and must be written A1←0.0. Where the type of the primary is indeterminate it is assumed to be correct. Thus the statements A1←(1) and X2←(X1) cause A1 to be loaded with the floating point number in X1 and X2, and X2 to be loaded with the integer whose address is in X1 . A1←(1) is the only method of loading a floating point number from fixed point accumulators. A1←X1 does not type match and is illegal.
  2. Assignment of the value 0.0 to the real accumulator is more efficient than any other real assignment. Assignment of an integer value which can be stored in 12 bits takes no extra storage. Assignment of other values (as opposed to cell designators) to integer accumulators and all values other than 0.0 to the real accumulator cause words to be assigned in lower storage to hold the values. Several uses of the same number in one segment will result in only one lower storage cell being set aside.
  3. := can be used as an alternative to .

6.2 Monadic operators

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.

6.3 General accumulator assignments

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.

  1. integer multiplication and division have side effects. If the accumulator that is assigned a value is Xn, multiplication leaves the result in Xn but clears Xn+1 (where if n = 7, n+1 = 0). Similarly division places an unrounded result in Xn and a remainder in Xn-1.
  2. real arithmetic is rounded.
  3. A1 is not a primary so that although
    A1←A1+X
    
    is legal A1←X+A1 is not.
  4. If the same accumulator appears before and immediataly after ← and on the same line no code is generated for that operation.
  5. Assignment is executed first and then the operations in strict left to right order. Thus the sequence
    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)
    
  6. If an integer primary is less than 12 bits the comments for monadic operators apply for + and -.

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

6.4 Basic cell assignments

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.

6.5 Monadic integer cell operators

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;

6.6 General integer cell assignments

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.

6.7 Address assignments

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

  1. $ cell designator - the displacement of a cell. Examples:
    $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.
  2. £ cell identifier - the base of an identifier. Examples:
    £B  £U   £V
    
    The 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.
  3. @ cell designator - the address of a cell. Examples:
    @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.
    Types (a) to (c) are called word addresses
  4. @ instruction identifier - the address of a label or procedure. Example:
    @ SIGN
    
    An instruction identifier is the address in words of a label or procedure. These are explained in sections 7.1 and 9.2.
  5. a character address. Examples:
    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.

6.8 Character operations

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)

7. Control Statements

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.

7.1 Labels

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);

7.2 The GOTO statement

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

7.3 The OBEY statement

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).

7.4 The CASE statement

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.

8. Block Structure and Conditional Statements

8.1 Blocks

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.

8.2 Declarations

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:

8.3 Statements

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.

8.4 The IF statement

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.

8.5 The FOR statement

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;

8.6 The WHILE statement

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;

9. Procedures and Functions

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.

9.1 Functions

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.

9.2 Procedure declarations

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;

9.3 Procedure statements

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).

9.4 Parameters

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.

9.5 Labels and procedures

Labels and procedures are to a large extent interchangeable. This can be exploited in two ways:-

  1. The first statement of the body of a procedure may be jumped to by a GO TO statement. Examples:
    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.
  2. A label declared in the body of a procedure may be treated as a procedure with the same link as the procedure itself. This can be used to provide alternative entry points to a procedure:-
    PROCEDURE SIN (X1); 
         BEGIN
         ..........
    COS: .......
         .........;
         END;
    

    Label identifiers and procedure identifiers are collectively known as instruction identifiers.

9.6 RETURN statement

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.

10. Synonyms and Defined Variables

10.1 Synonym declarations

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)

10.2 The DEFINE declaration

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

  1. Any integer value, example:
    DEFINE A=3, B= 7, C= #37377, D='%%%';
    
  2. A previously DEFINEd identifier, example:
    DEFINE AA = A, BE = B; 
    
  3. An absolute expression. This takes one of the forms:
    1. $ fixed cell designator (see 10.1)
    2. @ fixed cell designator - @ fixed cell designator
    3. £ cell identifier - £ cell identifier
    4. @ instruction identifier - @ instruction identifier
    In classes (ii) and (iii) the cells must either be both in upper or both in lower storage (and both in the same common block or neither in common.) The value of absolute expression (i) is the displacement considered as a number of words. The other forms give the number of words that separate the two words designated. Examples:
    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.
  4. Any of the expressions (a) to (c), followed by any number of operator - operand pairs. The permitted operators are:
    + - * /
    
    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;
    

11. Long Types

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.

11.1 Long integer values

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

11.2 Long integer accumulator assignments

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);

11.3 Long integer cell assignments

These are very similar to the corresponding integer cell assignments. The four possible forms are:-

  1. long integer cell designator← 0;

    Examples:

    II←0; JJ(K(X1 + 3) +X2 - 1)←0;
    
  2. long integer cell designator ← long integer accumulator

    Examples:

    KK←X01; JJ(K)←X67;
    
  3. long integer cell designator←NEG long integer accumulator

    Example:

    II← NEG X67;
    
  4. any of the forms a) to c) followed by any number of add operator (+,-,++ or --) long integer accumulator pairs.

    Example:

    II← NEG X67 - X67 + X34;
    

12. Segmentation and the Include Statement

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.

12.1 Glabels

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;
.............

12.2 Entry points

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).

12.3 Common storage

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);

12.4 Overlays

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;

12.5 The INCLUDE statement

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.

13 Miscellaneous Features

13.1 Comments

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.

13.2 Conditional computation

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-;

13.3 Type changing

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;

13.4 Truncated numbers

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.

13.5 MEMBER statement

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);

13.6 NONPLASYD declarations and statements

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);

13.7 CUEOVERLAY statement

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;

14. Operating System

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

  1. the PUC loops
  2. there is insufficient data for the slow peripherals
  3. a peripheral or file is required
  4. more core store is required but not available
  5. the monitor has to be deleted.

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.

14.1 YAPC directive

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.

14.2 NAME directive

This directive which can occur only once in a batch of jobs is used by CALM for two purposes namely:

  1. to take special action whenever this program is run. The program specified in the NAME directive is assumed to be under development and if this is a compiler for example, failure of a particular run is not fatal for the remaining jobs in the batch. CALM will output standard error information and search for the next occurrence of the NAME Program.
  2. to specify to the PLASYD or PSFUL compilers the name of the program that is to be compiled.

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)

14.3 Status directive

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:-

  1. ENTRUST (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
    
    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)
    
  2. FREETRUST (xxxx) where xxxx is a four character program name. In exceptional circumstances it may be necessary to operate a program by means of console messages and other operator action. The FREETRUST directive causes the monitor to delete itself and find xxxx when the program directive xxxx is encountered. The file from which xxxx is to be found must have been previously specified in an ENTRUST or NAME directive. Example:
    FREETRUST (XPCL)
    

14.4 Card and paper tape directives

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

  1. READ FROM (TR) If the current input is from cards then on reading this directive CALM will allocate a tape reader and read from that device. The card reader is released.
  2. READ FROM (CR) If the current input is from paper tape then on reading this directive CALM will allocate a card reader and read from that device. The tape reader is released.

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.

14.5 PUC control directive

The parameters, source, etc for any particular program are enclosed in what can be considered as matching brackets namely

  1. the four character name of the PUC, possibly qualified
  2. ****

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.

14.6 Standard and error halts

There are three classes of PUC halts:-

  1. halts which require operator intervention. These halts are transmitted to the console typewriter and the system halts until the operator takes appropriate action.
  2. halts which do not require operator intervention and are standard to the system. These halts include messages that occur when a program is loaded or is terminated and also DELTY LO and DELTY FI messages. The action taken is to run the next program specified by the directives unless the usual action has been overridden by action specified in the events list.
  3. halts which do not require operator intervention and are either in the PUC's events list (see 14.7) or are not specified. Included in this class are all illegal messages that may occur in the PUC. If the halt appears in the event list the halt is listed on the line printer and the appropriate action is taken but if the halt is not in the event list the action taken by CALM is dependent on the type of the PUC. If the PUC has been specified in the NAME directive or has been generated by #XPCL using disc parameters as against slow peripheral parameters then CALM lists the halt on the line printer, outputs 3000 words of core store of the PUC starting at word 0, searches for the next PUC name then activates that program. If the PUC is not of this type CALM merely lists the halt unless it is an illegal message on the line printer. If it is an illegal message a 3000 word core dump is given. The batch is then considered to be terminated and CALM searches for a YAPC directive or ***E.

Halts which are currently in type (a) are:

  1. HALTED CP, HALTED CR, HALTED LP, HALTED TP, HALTED TR, the operator will if possible make the required peripheral available and should then type GO # name where name is the current PUC or possibly #YAPC itself.
  2. HALTED ST more core is required, the operator will if possible make more core available and type GO# name as above
  3. HALTED PL more paper is required in the line printer. The operator will type GO# name after loading the paper
  4. HALTED OK the system has read ***E
  5. LOAD.............or NEED .............. these halts cover all disc file or magnetic tape requests to the operator. The operator will if possible make available the file or magnetic tape and type GO# name.
  6. HALTED SYSTEM OVERLOAD. The operator will if possible wait until other programs have been deleted and continue with GO# name.

Halts which are currently in (b) are:-

  1. HALTED LD the PUC has been loaded, CALM automatically activates the program
  2. HALTED EC, HALTED OK, HALTED AH, HALTED HH, HALTED EN,
    DELETED HH, DELETED MX, DELETED EC,
    HALTED AE, DELETED AE: the PUC has terminated its run, the next PUC required is then loaded and activated
  3. HALTED EE, HALTED ZZ: the PUC has terminated its run. If the PUC is either the one specified in the NAME directive or has been generated by XPCL the the next PUC required is then loaded and activated. If the PUC is not as above the batch is terminated.
  4. DELTY FI the PUC has deleted specifying: the next program to be run. CALM loads the next PUC which need not be the one specified in the FI message, although the accumulators will be remembered
  5. DELTY LO the PUC has deleted specifying the next program to be run. CALM loads the next PUC which need not be the one specifind in the LO message. The accumulators are not passed to the next program, go type entry blocks are only allowed from magnetic tape if the load peripheral is to be retained.

14.7 Event list

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:-

  1. AT followed by one of HALTED, DELETED, DISPLAY, LOOPING, ILLEGAL, FAIL. Each of these is terminated by the first open bracket of the qualifier or if no qualifier by a comma.
  2. an optional qualifier which if present is enclosed in round brackets. This qualifier can consist of any two characters including ▽▽ or ▽ "non space character".
  3. the action to be taken by CALM if this event occurs. This action can take one of the following forms
    1. GO: the program under control is continued at the next instruction
    2. GO m: where m is an integer. The PUC is continued at instruction m.
    3. GO abcd: where abcd is any four character program name. The current PUC is deleted and a search made through the remaining parameters of the system for the program specified by abcd. This program is then loaded.
    4. HALT: the system will display the message in the event list and HALT awaiting operator action
    5. FINISH: the system will display ZZ and then search for either a YAPC line or ***E
    6. CONTINUE: the system will display the message, terminate the current PUC and search for the next PUC control
    7. OU m n: where m, n specify the core dump required, namely, n words starting at decimal address m
    8. AL p q: where p is a core store address in decimal, q is in octal format. At the specified event the system will alter word p to the new contents
    9. ON (n1,n2,..... , nq) 0<nq<23: At the event the system will set to 1 the bits of word 30 of the PUC specified in the ON action
    10. OF (n1,n2,..... , nq) 0<nq<23: At the event the system will set to 0 the bits of word 30 of the PUC specified in the OF action

    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).

14.8 Changes to standard CALM actions

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
           

14.9 CALM entry points

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.

  1. GO #name 20,#YAPC will read from eight track paper tape and search for a line which says "YAPC"
  2. GO #name 21, #YAPC will read from a standard card reader and search for a card which says "YAPC"
  3. GO #name 22 This causes the system to skip forward to the next program and continue.
  4. GO #name 25 This entry is used if the operator considers the PUC is looping. CALM will search the current PUC event list for AT LOOPING or AT FAIL (see 14.7) and if present will take the action requested otherwise an automatic core dump of the PUC is given.
  5. GO #name 26 This entry enables the operator to give an automatic core dump of the PUC if an unexpected halt occurs.
  6. GO #name 27 This entry enables the operator to give an automatic core dump of the PUC and the controlling system if it is suspected that CALM has broken.

14.10 Operation

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

  1. FI # YAPC # yyyy: where PROGRAM yyyy is the file holding #YAPC
  2. load card or paper tape directives and any magnetic media required
  3. GO # YAPC 20 if first directive is on paper tape
    GO # YAPC 21 if first directive is on cards

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.

15. Compilation System

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.

15.1 Listing format directives

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:-

  1. the directives controlling the system
  2. the source or pseudo semi-compiled of the PLASYD and PSFUL compilers
  3. PUC output not included in (ii) but using a line printer e.g. #XMED or #XPCL 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.

15.2 Program specification directives

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:

  1. NAME (xxxx): where xxxx is a four character program name, xxxx may be followed by up to eight characters which are taken as the account code. xxxx is the name of the program CALM is generating. If the NAME directive is omitted the name is taken to be #XXXX. This directive must appear before the first YAPP or YAPI line, examples:
    NAME(JACK)
    NAME(XFOC16003)
    
  2. PRIORITY (ab): where ab is a two digit integer and specifies the priority to be given to the program specified in the NAME directive. A priority of 50 is assigned if the directive is omitted. This directive must appear before the first YAPP or YAPI line. Example:
    PRIORITY (87)
    
  3. OVERLAY (A,U) n1 , n2 , n3 ....: where
    • A is tho area number of the overlay A < 255
    • U is the unit number of the overlay U <1023
    • n1 , n2 , n3 are names of segments and procedures in overlay A,U. This directive must appear immediately after the first YAPP line.
    Examples:
    OVERLAY (1,2) FRED, JACK, JIM 
    OVERLAY (2,1) JOHAN
    
  4. OVERCOMMON (A,U) m1, m2, m3......: where A and U are as in (c) and m1 , m2 , m3 are the names of global areas in overlay A,U. Examples:
    OVERCOMMON (1,2) WORKBUFF, STORE
    OVERCOMMON (6,5) FUNCTIONS, SYMBOLTABLE
    
    There 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.
  5. PROGRAM MODE (nAM, xBM, mCH): where
    • nAM can be 15AM or 22AM
    • xBM can be DBM or EDM
    • mCH can bo 15CH, 22CH, or MIXAM

    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)
    

15.3 Disc file and subfile directives

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:-

  1. f is a filename
  2. s is a subfile name

    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.

  3. g is the generation number
  4. gs is the subfile generation number
  5. Generation numbers are optional and if omitted, together with enclosing brackets, the file or subfile name of highest generation number is taken. If g is omitted in a SENDTO directive (see 15.3 a) then 0 is substituted.
  6. YAPP is a qualifier to indicate a file or subfile for use with the PLASYD compiler for holding semi-compiled.
  7. YAPI is a qualifier to indicate a file or subfile is for use with the PSFUL compiler for holding semi-conpiled.

    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:-

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:

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:-

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)
****
..........

15.4 Switch directives

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)

15.5 Segment description directives

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:

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.

15.6 Editing and dump facilities

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.

15.7 Operation of the PLASYD compiler YAPP

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.

15.8 Examples

Examples of three jobs using PLASYD and PSFUL follow:-

(a) All the standard facilities of CALM are used:-

  1. to specify the name of the program and its overlay structure
  2. to specify previously compiled segments
  3. to alter one line in the PLASYD source of the subfile LISTSYSTEM
  4. to compile the subfile LISTSYSTEM using the PLASYD compiler YAPP
  5. to consolidate the specified subfiles using XPCL
  6. to run two test programs JACK and JOHN

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

16. Debugging Facilities

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.

16.1 CALM messages

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.

  1. NEEDS FILE "PROGRAM yyyy"
    This will occur if the file specified in the ENTRUST, NAME or YAPC directive is not available. The operator should make the file available and type GO. Note that accumulators carried forward will be lost and set to zero if this message occurs. The file may be on disc or magnetic tape.
  2. xxxx NOT FOUND IN FILE "PROGRAM yyyy"
    This will occur if xxxx is not in the file PROGRAM yyyy as specified in the ENTRUST, NAME directives. Generally there is no operator action possible unless another file PROGRAM yyyy can be put on line when the operator can type GO.

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) YAPC DIRECTIVE ERROR
YAPC will ignore the line, which may cause subsequent lines to be listed as if in error.
(b) INVALID NAME OR ENTRY POINT
YAPC has read a PUC name directive which has not been referenced in a NAME or ENTRUST directive, or has not been created incore by XPCL. YAPC will ignore this line and scan for ****. It will then run the next PUC specified.
(c) LINE TOO LONG
A line of more than 72 characters has been read from paper tape, cards or disc. The remaining characters on the line are ignored.
(d) NO SUBFILE FOUND
A subfile specified in a READFROM or MACROFILE directive is not in the given file. The line is ignored.
(e) DATA SUBFILE WITHIN LIST
A subfile, which is not the last subfile specified in a subfile string, is a data subfile. The line is ignored.
(f) WRONG SUBFILE TYPE
The subfile has type other than source. The line is ignored.
(g) NO MACROFILE DIRECTIVE
This occurs if an INCLUDE statement occurs in PLASYD and no file has been specified by a MACROFILE directive.
(h) EVENT LIST ITEM ERROR
There is an error in the event list, the rest of the line is ignored.
(i) PROGRAM NOT AVAILABLE
A program specified by the PUC directive is not in core store and has not been specified in an ENTRUST or NAME directive.
(j) PROGRAM TO FREETRUST ALREADY IN STORE
A program specified by the FREETRUST directive has been created in corestore by XPCL. Line is ignored; CALM searches for either **** or the next YAPC card after displaying ZZ.
(k) LONG BUCKET READ AND IGNORED
A bucket read from disc is longer than 128 words.
(l) ENTRUST LIST FULL
CALM cannot add to its known program list, either the name of a program specified in the ENTRUST or NAME directive, or the name of the program generated in core store by XPCL. Subsequent references to this program will cause message described in (i).
(m) FILE abcdefghijkl NOT pqr BUCKETS
This message is listed if the file specified in the SEND TO directive has been extended.
(n) SUBFILE abcdefghijkl OCCUPIES mno BUCKETS IN pqrstuvwxyz
This message is listed when the subfile specified in the SEND TO directive is closed.

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.

16.2 PLASYD messages

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.

16.3 Listing of code generated

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.

16.4 Symbol table listing

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:

(a) SEGMENT
If the segment is a procedure, details are given in the form:
Segment name.    Link.    n WORDS
If the segment is a master segment, details are given thus:
 MASTER SEGMENT OF Program Name, n WORDS
 
(b) GLABEL PROCEDURES
Details are given in the form:
Procedure name.    Link.    Entry W
where W indicates the word of the segment at which the procedure starts
(c) INTERNAL PROCEDURES
Details as for glabel procedures
(d) EXTERNAL
Details are given in the form:
Name of item.    Link.
(e) DEFINEES
Details are given in the form:
Name of item    value of item (#abcdefgh)
(f) LITERALS n WORDS
Details are given in the form:
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.
(g) GLABELS
Details are given in the form:
m.    Glabel name.
m is the word of the segment at which the glabel occurs. Glabels are listed in ascending values of n.
(h) LABELS
Details as for glabels.
(i) LOWER PRESET n WORDS
Details are given in the form:
m    (t)    Symbolic name
m 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).
(j) UPPER PRESET
Details are given as for lower preset
(k) LOWER GLOBAL block name. n WORDS
Details of the items in the block are given as for lower preset. This format is repeated for each lower global block.
(l) UPPER GLOBAL block name n WORDS
Details are given as for lower global.
(m) SYNONYMS OF ABSOLUTE ADDRESSES
Details are given in the form:
m    (t)    Synonym name
m is the absolute location, t is type as in lower preset etc.
(n) ACCUMULATOR SYNONYMS
Details are given in the form:
Accumulator name.    Synonym name 

Absence of any items (apart from (a) which must occur) is indicated by 'NONE'.

16.5 TRACE facilities

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.

PROCEDURE OUTIDENT (X0);

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.

PROCEDURE OUTACC (X0);

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.
PROCEDURE OUTINTEGER (X0);

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
PROCEDURE OUTREAL (X0);

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
PROCEDURE OUTCORE (X0);

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.

PROCEDURE FREEOUTCORE (X0);

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.

Appendices

1. Examples of a PLASYD procedure segment

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;

2. PLASYD error list

Error
Number
MeaningCorrective action taken
0; or END scanned and STACK brokenSTACK is discarded until correct symbol appears.
1END not matched by BEGIN on STACKSTACK is discarded until BEGIN appears or STACK terminates.
2BASE statement in LOWER declarationThe statement is ignored.
3**** read as sourceEND's forced in to match BEGIN's on stack
4Type declaration not followed by identifier listSkip to a recognisable symbol.
5Illegal symbol in identifier listSkip to a recognisable symbol.
6Incorrect array length (not absolute const, or defined) Array length 1 is assumed.
7Identifier declared twiceIdentifier ignored
8Incorrect structure of LOCAL (ALL) (BUT)The statement is ignored.
9Illegal symbol in label listThe statement is ignored.
10Unmatched bracketingAssume )
11Identifier already declaredSkip to ;
12Illegal source constructionSkip to ;
13
14LOWEND or GLOBEND missingNo action
15PURE storage not initialisedSets to zero
16
17Too many items in an arraySurplus items ignored
18$ of a lower item used in a DEFINE statementSkip to a, or ;
19LOWEND without corresponding LOWERLOWEND ignored
20DEFINE not followed by identifierSkip to a comma or ;
21Identifier after DEFINE already declaredSkip to a comma or ;
22Identifier not followed by = in DEFINE statementSkip to a comma or ;
23Separator missing in initial value list, assumed
24GLOBEND without matching GLOBALGLOBEND ignored
25Impossible error (Stack not free for begin)Error ignored
26LOWER not followed by a type or GLOBALType INTEGER is assumed
27GLOBAL not followed by block identifierAn area %%%G is created
28Block identifier not followed by :A colon is assumed to be present
29Block identifier followed by illegal declarationType INTEGER is assumed
30LONG not followed by xtype or rtype declarationType INTEGER is assumed
31SYN of item already declaredSkip to a comma or ;
32Illegal displacementZero substitued
33Error after ACC or SYNSkip to a comma or ;
34ACC αidentifier not followed by SYNSkip to a comma or ;
35Identifier list not terminated by SYN or ;; assumed
36Illegal expression in DEFINE declarationValue of definee indeterminate
37Illegal format in DEFINE declarationSkip to a comma or ;
38Illegally formed absolute expression in DEFINE declarationSkip to a comma or ;
39Error in initial value list (incorrect type, undefined ident. etc.)Zero substituted
40Illegal symbol within (----) sequenceAssume constant of 0
41Illegal symbol following a modifierAssume closing right bracket
42Illegal symbol following SMO indexAssume closing right bracket
43Illegal symbol in simple SMO indexThe statement is ignored
44Closing bracket not foundAssume closing right bracket
45Link accumulator not specified in PROCEDURELink accumulator X0 is assumed
46Illegal accumulator given for PROCEDURELink accumulator X0 is assumed
47PROCEDURE not followed by identifierSkip to ;
48OBEY, not an xcellThe statement is ignored
49Illegal operand.Zero substituted
50Undeclared identifier in L.H.S.The statement is ignored
51Identifier undeclared at current blockThe statement is ignored
52Unmodified cell asignment to UPPERNo action
53Undeclared identifier in statement R.H.S.A null instruction is generated
54Identifier undeclared at current blockA null instruction is generated
55Incompatible typesA null instruction is generated
56Cell assignment: αcell := αcellRest of statement is ignored
57Accumulator assignment ofThe statement is ignored
58Cell assignment of constant not equal zeroThe statement is ignored
59Illegal operatorA null instruction is generated
60Identifier too longThe identifier is truncated to 32 characters
61Real number out of rangeZero substituted
62Illegal characters following & of real numberNumber is ignored
63NOT encountered on its ownNOT is ignored
64Too many characters in character sequenceTruncated to four characters
65Count (CNT) greater than 511Count field is zeroised
66Octal longer than 16 digitsOctal is truncated
678 or 9 appearing in an octal numberPut in as #10 or #11
68#, or & standing aloneCharacter is ignored
69Subfile name after INCLUDE too longStatement is ignored
70Subfile name in INCLUDE not found on MACROFILEStatement is ignored
71INCLUDE statement not on a line by itselfOther code on the line is ignored
72MINUS not followed by a numberMINUS ignored
73?number not followed by (( is assumed
74Conditional compilation switch >10No conditional action taken
75? not followed by a numberNo conditional action taken
76String longer than 244 charactersString is truncated
77Truncation to >23 bits No truncation done
78Error in function statementStatement ignored; NULL output
79Accumulator used as label:= assumed
80Undeclared identifier in a bracketed sequenceIdentifier ignored
81END found within a CASE statementCASEND inserted before END
82Illegal operatorRest of statement is ignored
83More than 100 branch aheads at this pointBranch ahead table cleared
84WHILE clause not terminated by DOThe statement is ignored
85IF clause not terminated by THENThe statement is ignored
86Stack error on fixing-up IF statementThe statement is ignored
87Label identifier previously declaredItem redeclared as label
88Not :=0 in a cell assignmentNull generated
89Illegal modifier in CASE clauseModifies X1 is assumed
90Multiple assignment in a single statementRest of statement is ignored
91Illegal symbol in place of operatorA semicolon is inserted following previous operand
92Program or segment starts with illegal symbolA BEGIN is assumed missing
93Illegal first character of a statementThe statement is ignored
94Statement starts with identifier and illegal symbolA semi-colon is inserted between identifier and symbol
95Cell designator not followed by ← or :=The statement is ignored
96Illegal symbol in place of operandThe statement is ignored
97END, ELSE or; should have been foundA semi-colon is inserted
98Wrong type of identifier in PROCEDURE or GOTO statementThe statement is ignored
99ENTRY not in range 0-9Entry not generated
A0@ or £ not followed by identifierThe statement is ignored
A1Illegal operator before addressThe statement is ignored
A2Illegal address assignmentThe statement is ignored
A3CHAR sequence incorrectly terminatedThe statement is ignored
A4Undeclared identifier after $No action
A5Undeclared identifier after £No action
A6Illegal declarationOperand set to zero
A7Illegal identifier after @Operand set to zero
B0BRINGOVERLAY not followed by identifierThe statement is ignored
B1CUEOVERLAY not followed by identifierThe statement is ignored
B2Identifier not correctly declaredThe statement is ignored
C0Illegal condition statementThe condition is ignored skip to next THEN or DO
C1Illegal symbol following relationThe condition is ignored skip to next THEN or DO
C2Base symbol not followed by identifierThe condition is ignored skip to next THEN or DO
C3Displacement symbol not followed by identifierThe condition is ignored skip to next THEN or DO
C4Character comparison with $'CH' is ignored
C5$ identifier (index) outside range 0 - 4095The condition is ignored skip to next THEN or DO
C6AND, OR appear in same compound conditionThe first to appear is assumed
C7Undeclared identifier in conditionZero is substituted
C8Incompatible types in conditionThe condition is ignored skip to next THEN or DO
C9Not integer accumulator on LHS of conditionThe condition is ignored skip to next THEN or DO
D0SMO in a condition when SMOMACRO is set or assumedThe condition is ignored skip to next THEN or DO
E1FOR not followed by integer acc. assignmentNo action
E2Illegal increment in FOR clauseThe statement is ignored up to DO
E3UNTIL not found in FOR clauseNo action
E4Illegal limit in FOR clauseThe statement is ignored up to DO
E5DO does not terminate FOR clauseNo action
E6Illegal item following '-' in limitThe statement is ignored up to DO
E7Stack is broken on fixing-up DONo action
E8No STEP between FOR and UNTILStep 1 assumed
E9END not followed by ; END or ELSE; inserted
F1Illegal operand in function statementThe statement is ignored
F2Illegal constant operandThe statement is ignored
F3Function statement not terminated by )No action
F4Undeclared operand in function statementThe statement is ignored
G0GOTO not followed by identifierThe statement is ignored
G6Illegal character in DATA statementThe symbol is ignored
G7Block identifier declared differently elsewhereSkip to ;
G8Redefinition of GLOBAL area in different modeThe area is forced into LOWER
G9Too many GLOBAL declarations in segmentCompiler HALTS:-XX at this point
M0Monadic operator in wrong contextThe statement is ignored
M1Unrecognised monadic operatorRest of statement is ignored
M2MEMBER not followed by (The statement is ignored
M3Member number >5The statement is ignored
M4Member number not followed by commaThe statement is ignored
M5Member priority >99The statement is ignored
M6No ) at close of member statement) assumed
M7) not followed by ; in member statement; assumed
P0Not integer or definee after comma in a procedure statement0 substituted
P1Procedures nested to depth > 16SENDTO file (if any) is closed
P2Number after comma in a procedure statement >630 substituted
P3Accumulator not followed by comma or ) in a procedure statement) assumed
R0Identifier not found where expectedSkip to ;
R1Identifier not followed by ( in replacers statementSkip to ;
R2( not followed by integer in replacers statementSkip to ;
R3Integer >510 in replacers statement510 substituted
R4Integer not followed by ) in replacers statementSkip to ;
R5; should terminate a replacers statement; asumed
Comment
Number
Meaning
1Section of source not compiled as conditional compilation switch is off
2A second [ has been found before a ]
3A ] has been found without a matching [
4a double-length 'shift-type' instruction has been generated
5Nested LOWER declarations have been used
6, not followed by SL in an INCLUDE statement, SL assumed
7A SMO macro has been generated
8CARRY or NOT CARRY not the first in a compound condition
9Trivial condition, eg >=#400CNT
10No D after a double length integer
11Base generated, though no BASE statement present
12Attempt to access item outside normal domain
20Other than one machine instruction generated by a statement in a case sequence
21Division will corrupt an accumulator not explicitly mentioned in the statement (as in PLAN)
22Multiplication will use an accumulator not explicitly mentioned in the statement (as in PLAN)

3. Index

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.16.1