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

10. LONG ACCUMULATOR ASSIGNMENTS

10.1 Syntax

xxassignment ::=xxacc:=xxprimary|xxacc:=NEG xxprimary|
                xxassignment xxarithmetic xxprimary|xxacc:=xprimary| 
                xxassignment shift coperand
xxprimary    ::=xxvalue|xxacc|xxcell
xxarithmetic ::=+|-|++|--
rrassignment ::=A12:=rrprimary|A12:=NEG  rrprimary|A12:=A12|
                rrassignment rrarithmetic rrprimary
rrprimary    ::=rrvalue|rrcell
rrarithmetic ::=+|-|*|/

10.2 Basic Long Integer Accumulator Assignments

Accumulator assignments for long integers are very similar to those for integers. The basic form allows a long integer value, accumulator or cell to be assigned to a long integer accumulator. Long integer values have been defined in Section 4.5. The code generated usually consists of two instructions per operation (one operation on the top accumulator of the pair while the other operates on the bottom).

Some typical examples are:

X12:=273D; X23:= #7777777777D; X34:=LIIX;
X45:=MINUS 32679D; X56:=LIIA(0); X67:=LIIA(X1+2);

Even for small integer constants, a pair of lower storage cells will be used to hold the value. Consequently X12:=273D; is less efficient in storage than X1:=0; X2:=273;. The monadic operator NEG can be used to assign the negative of the primary value to the accumulator. For example:

X70:=NEG LIIX; X01:=NEG X23;

Care should be taken that the same integer accumulator is not used on either side of the assignment. For example:

X56:=NEG X67;

will not give the result that would be expected as the code generated is equivalent to:

X6:=NEG CARRY X1; 
X5:=NEG X6;

In the case of the same long integer accumulator on both sides of the := symbol, no code is generated if it occurs on the same line while the accumulators are loaded from store if the split occurs after the :=. Thus:

X12:= 
X12+3D;

generates the code equivalent to:

X2:=(2); X1:=(1); X2:=X2++LIA(2); X1:=X1+LIA(1)

assuming LIA(1) and LIA(2) contained the constant 3 double length.

10.3 General Long Integer Accumulator Assignments

A general long integer accumulator assignment extends the simple form. As with integer assignments, the first part of the statement equivalent to the basic statement assigns a value to a long integer accumulator. The remaining terms of the statement then cause various arithmetic and shift operations to be performed on the contents of the long integer accumulator. These operations are performed strictly from left to right. The possible operations are similar to the arithmetic and shift operations defined for the integer accumulator assignments. The difference is that results apply to the 48 bit integer accumulator pair rather than a single integer accumulator. The full set of addition and subtraction operators are allowed including those which set CARRY (++ and --). Basically each operator/operand generates two instructions. In the case of the shift operations, use is made of the double-length instructions available on the 1900 so that, in this case, only a single order is often required. Some examples are:

X67:=X67 SLA 2 - LIIA(2) SRL 3; 
X12:=X67 - LIIX * LIIA(X3);

It is possible in some circumstances to use integer primaries in long integer assignments. Frequently the code generated is not what would be expected. As a general rule the address of the integer primary is assumed to be that of a long integer quantity so that the contents of the next address are also used. For example:

X67:=LIA(2);

does not set X67 equal to the value of LIA(2) but that contained in LIA(2) and LIA(3). Short integer quantities are compiled correctly so that X67:=3; gives the desired result. However, X67:=32670; accesses the addresses assigned to 32670 and also the following address which could contain anything. It is, therefore, dangerous to mix long integer and integer primaries in a statement even though the compiler does not fault it. The result will almost certainly be different from that expected.

The PLASYD compiler does allow * and / to be used in long integer assignments. However, the results are not what the user could normally expect. Consequently,their use is not advised. Basically the multiply only operates on the top halves of the long integer quantities, while the divide takes the 48 bit quantity and divides it by the top 24 bits of the operand. It would be sensible for anyone attempting to use these operators to examine the code generated first.

10.4 Long Real Accumulator Assignments

Accumulator assignments for long reals are quite simple in form. The basic assignment allows the long real accumulator to be assigned a long real value or a long real primary. For example:

A12:=1.75L; A12:=3.97825L; A12:=MINUS 9.58& MINUS 25L; 
A12:=LRRX; A12:=LRRA(2);

The monadic operator NEG can be used to assign the negative of the primary value to the long real accumulator. For example:

A12:=NEG 1.75L; A12:=NEG LRRX;

The general long real accumulator assignment extends the basic form. The first part, equivalent to the basic statement, assigns a value to the long real accumulator. The remaining terms of the statement then cause various arithmetic operations to be performed on the contents of the long real accumulator. These operations are performed strictly from left to right. For example:

A12:=A12+LRRX*LRRA(0)-LRRA(2)/LRRA(4);
A12:=LRRX*LRRX+LRRA;
⇑ 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