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

12. BLOCK STRUCTURE

12.1 Syntax

block       ::=BEGIN blockbody label? END|BEGIN declist blockbody label? END
blockbody   ::=statement;|blockbody statement;
declist     ::=dec|declist dec
dec         ::=accsyndec|cellsyndec|definedec|externaldec|
               nonplasyddec|proceduredec|puredec|storagedec

12.2 Block Structure

In the previous sections the most frequently used executable statements, the assignment statements, have been defined. These will normally be executed sequentially as written. However, PLASYD does contain control and conditional statements which can change the order in which statements are executed. For example, it is possible to skip a group of statements using the conditional statement. To make these instructions as powerful as possible, statements may be grouped together in a block which can then act as though it were a single statement. A block consists of the word BEGIN followed possibly by some declarations, then some executable statements and the word END, possibly preceded by a label (labels will be defined later). For example:

BEGIN
INTEGER I,J;
X1:=£J;
X4:=3;
J(X1):=X4;
I(X1):=X4;
END

The semicolon terminating the statement immediately preceding the END statement may be omitted.

A single PLASYD program will usually consist of a single block. In general, though, a program will consist of a number of blocks. As a block is a special case of a PLASYD statement, it can be part of another block so that blocks can be nested to any depth. For example:

BEGIN
   INTEGER I,J;
   ......
   BEGIN
      INTEGER K;
      .....
      BEGIN
         INTEGER L;
         X4:=I(X2)+K(X1)+L(X3); 
      END;
      .....
   END;
   .....
   BEGIN
      INTEGER M,N;
      .....
   END; 
END

Unlike Algol 60, identifiers must be unique within the complete segment being compiled. The block structure is therefore a means of allocating storage and reusing it. It does not have any effect on the identifiers allowed.

The only variables which can be used at any point in the program are those which have been declared in the current block or a surrounding block. In the example above, statements in the innermost block containing the assignment to X4 can access the variables whose names are I, J, K and L but cannot access the variables M and N.

There is no dynamic storage allocation in PLASYD. Variables are allocated storage space at compile time. An attempt is made to do this as efficiently as possible. Storage allocated to variables declared in low level blocks may be reused at a later point in a program. In the example above, the variables L and M would be allocated the same storage.

12.3 Label on END

A label may be placed before the END symbol of a block as follows:

LB:END

If a jump is made to this statement, the effect is as though a jump was made to a null statement immediately before the END statement. No null instruction will be generated in this case.

⇑ 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