Contact us Heritage collections Image license terms
HOME ACL Associates Technology Literature Applications Society Software revisited
Further reading □ Contents □ 1. Introduction □ 2. Basic symbols and comments □ 3. Identifiers, accumulators and cells □ 4. Types and values □ 5. Addresses and storage allocation □ 6. Simple cell designation □ 7. Assignment statements □ 8. Integer accumulator assignments □ 9. Real accumulator assignments □ 10. Long accumulator assignments □ 11. Cell assignments □ 12. Block structure □ 13. Procedures and labels □ 14. Conditional and control statements □ 15. Functions □ 16. Cell declarations □ 17. Synonym declarations □ 18. Storage allocation □ 19. Subcompilation and global storage □ 20. Define statements, conditional compilation and include statements □ 21. Compiler directives □ 22. FORTRAN/PLASYD mixed programming □ 23. ALGOL/PLASYD mixed programming □ 24. Useful library routines □ 25. Use of TASK macro to compile PLASYD programs □ 26. SMO cell designation □ 27. Compiler output □ 28. PLAN instructions not provided for in PLASYD □ Appendices □ 1: Errors and comments □ 2: 1900 character set □ 3: Syntax definitions in alphabetical order □ 4: Use of program XMED □ 5: 1900 order code □ 6: Code genereated for typical PLASYD statements □ 7: A sample PLASYD program □ 8: Less commonly used directives □ References
ACD C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
⟶ ACL ⟶ Literature ⟶ ICL 1906A manuals ⟶ PLASYD
⟶ ACL ⟶ Literature ⟶ ICL 1906A manuals ⟶ PLASYD
ACL ACD C&A INF CCD CISD Archives
Further reading ⇓

□ Contents □ 1. Introduction □ 2. Basic symbols and comments □ 3. Identifiers, accumulators and cells □ 4. Types and values □ 5. Addresses and storage allocation □ 6. Simple cell designation □ 7. Assignment statements □ 8. Integer accumulator assignments □ 9. Real accumulator assignments □ 10. Long accumulator assignments □ 11. Cell assignments □ 12. Block structure □ 13. Procedures and labels □ 14. Conditional and control statements □ 15. Functions □ 16. Cell declarations □ 17. Synonym declarations □ 18. Storage allocation □ 19. Subcompilation and global storage □ 20. Define statements, conditional compilation and include statements □ 21. Compiler directives □ 22. FORTRAN/PLASYD mixed programming □ 23. ALGOL/PLASYD mixed programming □ 24. Useful library routines □ 25. Use of TASK macro to compile PLASYD programs □ 26. SMO cell designation □ 27. Compiler output □ 28. PLAN instructions not provided for in PLASYD
Appendices
□ 1: Errors and comments □ 2: 1900 character set □ 3: Syntax definitions in alphabetical order □ 4: Use of program XMED □ 5: 1900 order code □ 6: Code genereated for typical PLASYD statements □ 7: A sample PLASYD program □ 8: Less commonly used directives □ References

18. STORAGE ALLOCATION

18.1 Syntax

simpledeclist ::=celldec|basedec|simpledeclist celldec|simpledeclist basedec
basedec       ::=BASE;
lowerdec      ::=LOWER lwdeclist LOWEND;
lwdeclist     ::=celldec|lowerglobaldec|lwdeclist celldec|lwdeclist lowerglobaldec
celldeclist   ::=celldec|celldeclist celldec

18.2 Upper Storage

Most PLASYD cells will be allocated upper storage. That is some address other than the first 4096 words of storage. Variables placed in upper storage cannot be directly addressed and must be accessed by indirect means. In earlier sections the method of accessing upper storage using a modifier has been described. Any set of declarations in a block head defined as a simpledeclist will be allocated upper storage. To enable such cells to be used, the upper storage is 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 in its domain called the base for that 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 from its base. Given a cell identifier A, PLASYD defines the three addresses:

£A = base address of A, that is the address of the first word of the domain in which A appears.

$A = the displacement of A from its base.

@A = the actual address of A, @A=£A+$A.

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 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. Each new block starts a new domain except that the block at the head of a procedure body is assumed to be part of the enclosing block's declaration.

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 4096'th will have to be addressed by a specially set up modifier.

If more than 4096 words are declared then a new base is defined and a comment to this effect is made on the program listing. Each base uses a word in lower storage to hold the address of the base of that domain. Each time a new domain is started, a word of lower storage is allocated at that point.

For example:

BEGIN
  INTEGER I(4095),J,K,L; 
  INTEGER M(5000); 
  INTEGER N;
  ..........
  BEGIN
    INTEGER P(4095),Q,R,S;
    ..........
    BEGIN
      INTEGER T,U,V(5000); 
      PROCEDURE FRED(X1); 
      BEGIN
        INTEGER PI,PJ(4000),PK(1000),PL(5000),PM;
        ....................
      END; 
    END;
    .........
    BEGIN
      INTEGER W,X(4000),Y(1000);
      ..........
    END; 
    ........
  END;
  ........
  BEGIN
    INTEGER Z,A,B(4000),C(1000),D;
    PROCEDURE DICK(X1);
    BEGIN
      INTEGER E,F(5000); 
    END;
    .......
  END;
END

would allocate the following bases and domains

Cell   Lower Storage Base Address Displacement
I          0             β            0
J          0             β            4095
K          1             β+4096       0
L          1             β+4096       1
M          2             β+4098       0
N          3             β+9098       0
P          4             β+9099       0
Q          4             β+9099       4095
R          5             β+13195      0
S          5             β+13195      1
T          6             β+13197      0
U          6             β+13197      1
V          7             β+13199      0
PI         8             β+18199      0
PJ         8             β+18199      1
PK         9             β+22200      0
PM         9             β+22200      1000
W          6             β+13197      0
X          6             β+13197      1
Y         10             β+17198      0
Z          4             β+9099       0
A          4             β+9099       1
B          4             β+9099       2
C         11             β+13101      0
D         11             β+13101      1000
E         11             β+13101      1001
F         12             β+14103      0

Notice that 12 lower storage cells have been used to hold base addresses. The storage for variables P, Q, R and S is reused for the variables Z, A, B, C. Similarly, T, U, V, and W, X, Y share storage.

18.3 BASE Declaration

The user may not like the arbitrary way in which new domains have been allocated. The base declaration forces a new domain to be started at this point. By using the BASE statement, certain cells can be forced in the same domain if that is required. For example:

BEGIN 
  INTEGER I(4095),   J,K,L;
END

would normally allocate I and J in one domain with K and L in a separate domain. J can be forced into the same domain as K and L as follows

BEGIN
  INTEGER I (4095); 
  BASE; 
  INTEGER J,K,L;
END

18.4 LOWER Storage

Although most cells are likely to be allocated upper storage, it may be advantageous to allocate lower storage to some cells. Such cells can be addressed directly and therefore do not have the overhead associated with upper cells where the base of the domain must be loaded into a modifier. A set of declarations are defined as having storage allocated in the lower area by placing the declarations between the symbols LOWER and LOWEND; to form a lower declaration. In the syntax given in Section 18.1 it can be seen that global declarations can also be defined as requiring lower storage. Details of global declarations are given later. Consider:

BEGIN
  INTEGER I,J;
  LOWER
  INTEGER K,L;
  REAL M;
  LOWEND;
  REAL N;
  LOWER
  INTEGER P=3;
  LOWEND;
  REAL Q; 
END

Here I, J, N and Q are allocated upper storage while K, L, M and P are allocated lower storage.

Lower storage is used for purposes other than the holding of cells declared as lower. Consequently, less than 4096 words will be available. Lower storage is allocated as follows:

  1. locations 0 to 7 are the integer accumulators
  2. locations 8 to 95 are reserved locations
  3. constants are allocated space in lower storage
  4. a location is allocated for each domain of upper storage defined and contains the base address of the domain.
⇑ 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