Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ Contents1. Introduction2. Basic symbols and comments3. Identifiers, accumulators and cells4. Types and values5. Addresses and storage allocation6. Simple cell designation7. Assignment statements8. Integer accumulator assignments9. Real accumulator assignments10. Long accumulator assignments11. Cell assignments12. Block structure13. Procedures and labels14. Conditional and control statements15. Functions16. Cell declarations17. Synonym declarations18. Storage allocation19. Subcompilation and global storage20. Define statements, conditional compilation and include statements21. Compiler directives22. FORTRAN/PLASYD mixed programming23. ALGOL/PLASYD mixed programming24. Useful library routines25. Use of TASK macro to compile PLASYD programs26. SMO cell designation27. Compiler output28. PLAN instructions not provided for in PLASYD □ Appendices □ 1: Errors and comments2: 1900 character set3: Syntax definitions in alphabetical order4: Use of program XMED5: 1900 order code6: Code genereated for typical PLASYD statements7: A sample PLASYD program8: Less commonly used directivesReferences
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACLLiteratureICL 1906A manualsPLASYD
ACLLiteratureICL 1906A manualsPLASYD
ACL ACD C&A INF CCD CISD Archives
Further reading

Contents1. Introduction2. Basic symbols and comments3. Identifiers, accumulators and cells4. Types and values5. Addresses and storage allocation6. Simple cell designation7. Assignment statements8. Integer accumulator assignments9. Real accumulator assignments10. Long accumulator assignments11. Cell assignments12. Block structure13. Procedures and labels14. Conditional and control statements15. Functions16. Cell declarations17. Synonym declarations18. Storage allocation19. Subcompilation and global storage20. Define statements, conditional compilation and include statements21. Compiler directives22. FORTRAN/PLASYD mixed programming23. ALGOL/PLASYD mixed programming24. Useful library routines25. Use of TASK macro to compile PLASYD programs26. SMO cell designation27. Compiler output28. PLAN instructions not provided for in PLASYD
Appendices
1: Errors and comments2: 1900 character set3: Syntax definitions in alphabetical order4: Use of program XMED5: 1900 order code6: Code genereated for typical PLASYD statements7: A sample PLASYD program8: Less commonly used directivesReferences

16. CELL DECLARATIONS

16.1 Syntax

celldec      ::=xcelldec|rcelldec|xxcelldec|rrcelldec
αcelldec     ::=αtype αitemlist; {α=x|r|xx|rr}
xtype        ::=INTEGER|LOGICAL
rtype        ::=REAL
xxtype       ::=LONG INTEGER
rrtype       ::=LONG REAL
αitemlist    ::=αitem|αitemlist,αitem {α=x|r|xx|rr}
αitem        ::=αidentifier|αidentifier=αinitial|αidentifier(integer)|
                      αidentifier(integer)=(αinitiallist) {α=x|r|xx|rr}
αinitiallist ::=αinitial|αinitial*integer|αinitiallist,αinitial|
                      αinitiallist,αinitial*integer {α=x|r|xx|rr}
αidentifier  ::=identifier {α=x|r|xx|rr}

16.2 Naming of Cells

Before any cell is used it must be given an identifier as a name and the compiler must know its type. This is done by the cell declaration. As has been defined in Chapter 12, all declarations must appear at the beginning of a block before any executable statements. Each declaration consists of the symbol denoting the type 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. αidentifier: this specifies that sufficient storage is allocated for one item of the type specified to which the αidentifier given will be attached. INTEGER cells take up a single 1900 24-bit word. REAL and LONG INTEGER take up two 24-bit words while LONG REAL requires four 24-bit words. Examples are:
    INTEGER A, B, C;
    REAL D, E, F;
    LONG REAL G;
    LONG INTEGER ALONGIDENTIFIER, ANOTHERLONGONE;
    
    If this set of statements appeared in a program then 17 1900 words would be allocated.
  2. αidentifier (integer): an identifier followed by an integer, N, in parentheses denotes an array of cells, N in number, for which storage has been allocated. The first cell may be referred to by the αidentifier as though it were a simple identifier of the first type. The remaining members of the array are accessed by specifying it in one of the cell designations given in Chapter 6. For example:
    INTEGER AR(20),BR(10); 
    REAL CR(40); 
    LONG REAL DR(10);
    
    The integer cells will use 30 1900 words, the real cells 80 and the long real 40. Note that the first element of the array AR can be accessed as AR(0) and the last by AR(19). Also there is no reason why AR(20) should not be used when referring to the cell BR(0).
  3. αidentifier=αinitial: this form is similar to (a) except that as well as giving the cell a name and defining its type, an initial value is allocated to the variable. In the first type (a), the initial value will be undefined. As variables at levels other than the outer block level share storage, initialisation of cell values only makes sense in the outer block level. Consequently initialisation is only allowed at the outer block level. The possible initial values of each type are the same as for the DATA statement described in Section 13.8. For example:
    REAL A=1.7, B=].38&MINUS 7, C=MINUS 37.5;
    INTEGER D=7, E=#22, F='ABCD';
    LONG REAL G=1.75L;
    LONG INTEGER H=275D;
    INTEGER I=@LIX,   J=$LIX(3),   K=£LIA(-1);
    INTEGER L=CHAR 3, M=CHAR 2 OF @LIX;
    INTEGER N=@SQUARE, M=@LBL;
    
    The last example assumes SQUARE has been defined as a procedure and LBL as a label.
    INTEGER P=6CNT+3, Q=l7CNT+@LIX, R=5CNT+27T2; 
    INTEGER S=!FAD(3,LRX); T="ABCD";
    
  4. αidentifier(integer)=(αinitiallist): this form is similar to (b) except that as well as defining and naming an array of cells, it also sets initial values to some of the elements starting from the beginning. The αinitiallist is similar to the list defined for the DATA statement except that all items in the list must be of the same type. The form αinitial*integer is used to set the same value to a number of consecutive elements in the array (the integer defines the number to be assigned this initial value). The string, if used, can set the value of a number of consecutive cells. For example:
    INTEGER AR(20)=(1*12,2*8), BR(10)=(5*7);
    REAL CR(40)=(1.7*25,2.9,1.9*14);
    LONG REAL DR(10) = (2.7L*10);
    INTEGER ER(5)=("ABCDEFGH1JKLMNOPQRST");
    INTEGER FR(2)=("A""B' DEF");
    INTEGER GR(5)*(1,@LIX,CHAR3,@SQUARE,!FAD(3,LIX));
    
    Note that in the first declaration only the elements BR(0) to BR(6) are set to 5. The remainder have no defined value initially.

The cell type INTEGER can also be written LOGICAL. The two are completely interchangeable. They have been included to aid in the differentiation between 24-bit quantities used as numbers upon which arithmetic operations are performed and 24-bit quantities used as a set of individual bits. However, no check is made that INTEGER declarations are used if arithmetic is to be performed and LOGICAL declarations are used if logical operations are to be performed.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site