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

APPENDIX 6: CODE GENERATED FOR TYPICAL PLASYD STATEMENTS

The statements used as examples assume the following declarations:

LOWER
INTEGER LIX,LIA(10);
REAL LRX,LRA(10);
LONG INTEGER LIIX;
LONG REAL LRRX;
LOWEND;
BASE;
INTEGER UIA(10),UIX;

In the examples following, the names of the lower identifiers will be used in the code to refer to the address of that identifier. The base directive will cause a lower cell with address BASEU to be defined and will contain the base address of the upper domain. The notation $UIX will be used to represent the address equal to the displacement of UIX from the base. Constants used in the programs are assumed to be stored at the following addresses:

ADDRESS      CONSTANT
L3             3
LM3            -3
L3P            3.0
L31CNT         #03700000 
LABCD          'ABCD'
LABCE          'ABCE'

Branches used in the program are written as L1, L2, L3 etc. A temporary working space is assumed to be allocated at address TEMP.

PLASYD instruction                   Code Generated
           Integer Accumulator Assignments
(1)  X1 := 3;                         LDN   1  3
(2)  X1 := X2;                        LDX   1  2
(3)  X2 := MINUS 3;                   LDX   2  LM3
(4)  X2 := #12;                       LDN   2  10
(5)  X2 := 31CNT;                     LDX   2  L31CNT
(6)  X2 :='ABCD';                     LDX   2  LABCD
(7)  X2 := LIX;                       LDX   2  LIX
(8)  X2 := LIA(-1);                   LDX   2  LIA-1
(9)  X2 := (30);                      LDX   2  30
(10) X2 := (X3+4);                    LDX   2  4(X3)
(11) X2 := LIA(X3);                   LDX   2  LIA(X3)
(12) X2 := UIX(X3);                   LDX   2  $UIX(X3)
(13) X2 := LIA(X3+1);                 LDX   2  LIA+1(X3)
(14) X2 := UIX(X3+1);                 LDX   2  $UIX+1(X3)
(15) X2 := (LIX);                     SMO      LIX
                                      LDX   2  0
(16) X2 := ((30));                    SMO      30
                                      LDX   2  0
(17) X2 := (LIA(X3+2)+X1);            SMO      LIA+2(X3)
                                      LDX   2  0(X1)
(18) X4 := LIA(LIX(X3+1)+2);          SMO      LIX+1(X3)
                                      LDX   4  LIA+2 
(19) X4 := NEG 3;                     NGN   4  3
(20) X4 := EX 3;                      LDEX  4  L3
(21) X4 := CH 3;                      LDCH  4  L3
(22) X4 := CARRY 3;                   LDNC  4  3
(23) X4 := NEG CARRY 3;               NGNC  4  3
(24) X4 := NEG X3;                    NGX   4  3
(25) X4 := EX X3;                     LDEX  4  3
(26) X4 := CH X3;                     LDCH  4  3
(27) X4 := CARRY X3;                  LDXC  4  3
(28) X4 := NEG CARRY X3;              NGXC  4  3
(29) X4 := CNT 3;                     LDCT  4  3
(30) X4 := CNT X2;                    LDCT  4  0(X2)
(31) X4 := £LIA;                      LDN   4  0
(32) X4 := £UIA(X3);                  LDX   4  BASEU(X3)
(33) X4 := @LIA;                      LDN   4  LIA
(34) X4 := @UIA;                      LDX   4  BASEU
                                      ADN   4  0
(35) X4 := @UIA(X3);                  LDX   4  BASEU
                                      ADN   4  0(X3)
(36) X4 := $UIA;                      LDN   4  $UIA
(37) X4 := $(X1+2);                   LDN   4  2(X1)
(38) X4 := X3+X2;                     LDX   4  3
                                      ADX   4  2
(39) X4 := 4++3-2;                    LDN   4  4
                                      ADNC  4  3
                                      SBN   4  2
(40) X4 := LIX(3)--LIA(2);            LDX   4  LIX+3
                                      SBXC  4  LIA+2
(41) X4 := LIX*LIA;                   LDX   4  LIX
                                      MPY   4  LIA
                                      SLA2  4  23
(42) X4 := LIX/LIA;                   LDX   4  LIX
                                      DVS   3  LIA
(43) X4 := X4 AND 3 OR LIX;           ANDN  4  3
                                      ORX   4  LIX
(44) X4 := 4 SLL 3 SRL 2;             LDN   4  4
                                      SLL   4  3
                                      SRL   4  2
(45) X4 := X4 SLL X3 SLL(X1);         SLL   4  0(X3)
                                      SMO      0(X1)
                                      SLL   4  0
           Real Accumulator Assignments
(46) A1 := LRX;                       LFP      LRX
(47) A1 := A1+LRX*LRA;                FAD      LRX
                                      FMPY     LRA
(48) A1 := LRX(X1+3)-URX(X2);         LFP      LRX+3(X1)
                                      FSB      $URX(X2)
(49) A1 := NEG LRX;                   LFPZ
                                      FSB      LRX
(50) A1 := A1/LRX FROM LRA;           FDVD     LRX
                                      FSB   4  LRA
(51) A1 := A1 UNDER LRX;              FDVD  4  LRX
           Long Integer Accumulator Assignments
(52) X12:= LIIX                       LDX   2  LIIX+1
                                      LDX   1  LIIX
(53) X12:= NEG LIIX;                  NGXC  2  LIIX+1
                                      NGX   1  LIIX
(54) X12:= X67+X67-LIIX               LDX   2  7
                                      LDX   1  6
                                      ADXC  2  7
                                      ADX   1  6
                                      SBXC  2  LIIX+1
                                      SBX   1  LIIX
(55) X67:= X67 SLA 2 SRL 3            SLA2  6  2
                                      SRL2  6  3
(56) X67:= (X1)                       LDX   7  1(X1)
                                      LDX   6  0(X1)
(57) X67:= X67+(X1)                   ADXC  7  1(X1)
                                      ADX   6  0(X1)
           Long Real Accumulator Assignments
(58) A12:= LRRX;                      LFP   2  LRRX
(59) A12:= NEG LRRX+LRRX;             LFPZ
                                      FSB   2  LRRX
                                      FAD   2  LRRX
(60) A12:= A12-LRRX*LRRX/LRRX;        FSB   2  LRRX
                                      FMPY  2  LRRX
                                      FDVD  2  LRRX
           Integer Cell Assignments
(61) LIX:= X1;                        STO   1  LIX
(62) (3):= X4;                        STO   4  3
(63) (X1):= X2;                       STO   2  0(X1)
(64) UIA(X1-5) := X2;                 STO   2  $UIA-5(X1)
(65) LIX := 0;                        STOZ     LIX
(66) LIX := NEG X3;                   NGS   3  LIX
(67) LIX := CARRY X3;                 STOC  3  LIX
(68) LIX := NEG CARRY X3;             NGSC  3  LIX
(69) LIX := EX X3;                    DEX   3  LIX
(70) LIX := SA X3;                    DSA   3  LIX
(71) LIX := LA X3;                    DLA   3  LIX
(72) LIX := CH X3;                    DCH   3  LIX
(73) LIX := X1-X2+X3--X4;             STO   1  LIX
                                      SBS   2  LIX
                                      ADS   3  LIX
                                      SBSC  4  LIX
(74) LIX := LIX AND X1 OR X2;         ANDS  1  LIX
                                      ORS   2  LIX
(75) (3) := (3)+X2;                   ADS   2  3
           Real Cell Assignments
(76) LRX := 0.0;                      STOZ     LRX
                                      STOZ     LRX+1
(77) LRX := A1;                       SFP      LRX
           Long Cell Assignments
(78) LIIX := 0;                       STOZ     LIIX
                                      STOZ     LIIX+1
(79) LIIX := X12;                     STO   2  LIIX+1
                                      STO   1  LIIX
(80) LIIX := NEG X12;                 NGSC  2  LIIX+1
                                      NGS   1  LIIX
(81) LIIX := LIIX+X12--X56;           ADSC  2  LIIX+1
                                      ADS   1  LIIX
                                      SBSC  6  LIIX+1
                                      SBSC  5  LIIX
(82) LRRX := A12;                     SFP   2  LRRX+2
                                      SFP      LRRX
(83) (X1) := X67;                     STO   7  1(X1)
                                      STO   6  0(X1)
           Procedure Calling 
Assume that link used is X1
(84) FRED;                            CALL  1  FRED
(85) OBEY(X1+2);                      OBEY     2(X1)
(86) RETURN;                          EXIT  1  0
(87) RETURN(5);                       EXIT  1  5
(88) GOTO F;                          BRN      F
           Case Statement
(89) CASE X1 OF                       BRN      L3
                                   L1          L2
     A1 := A1+LRX                  L2 FAD      LRX
     A1 := A1-LRX;                    FSB      LRX
     GOTO F;                          BRN      F
     X1 := NEG LIX;                   NGX   1  LIX
     LIX := 0;                        STOZ     LIX
     CASEND;                          BRN      L4
                                   L3 ADX   1  L1
                                      OBEY     0(X1)
                                   L4
                                   
           If Statement
(90) IF X1=0                          BNZ   1  L2
       AND OVERFLOW                   BVCR     L2
       AND A1=3.0                     SFP      TEMP
                                      FSB      L3P
                                      BFP   0  L1
                                      LFP      TEMP
                                      BRN      L2
                                   L1 LFP      TEMP
     THEN X2 :=0;                     LDN   2  0
                                   L2
(91) IF X1=0                          BZE   1  L2
        OR OVERFLOW                   BVCR     L2
        OR A1=3.0                     SFP      TEMP
                                      FSB      L3P
                                      BFP   0  L1
                                      LFP      TEMP
                                      BRN      L2
                                   L1 LFP      TEMP
      THEN X2 := 0;                   LDN   2  0
                                   L2
(92)  IF FOVERFLOW                    BFP   4  L1
      THEN X2 := 0;                   LDN   2  0
                                   L1
(93)  IF CARRY                        BCC      L1
      THEN X2 := 0;                   LDN   2  0
(94)  IF NOT FOVERFLOW                BFP   5  L1
      THEN X2 := 0;                   LDN   2  0
(95)  IF A1>0.0                       BFP   0  L2
                                      BFP   3  L2
      AND A1<0.0                      BFP   2  L2
      AND A1=0.0                      BFP   1  L2
      AND A1≤0.0                      BFP   0  L1
                                      BFP   2  L2
      AND A1≥0.0                   L1 BFP   3  L2
      AND A1 NOT=0.0                  BFP   0  L2
      THEN X1 := 0;                   LDN   1  0
                                   L2 
(96)  IF X1 <CH 'ABCD'                TXL   1  LABCD
                                      BCC      L1
      THEN X2 :=0;                    LDN    2 0
                                   L1
(97) IF X1 >CH 'ABCE'                 TXL    1  LABCE
                                      BCS       L1
     THEN X2 :=0;                     LDN    2  0
                                   L1
(98) IF X1=0                          BNZ    1  L1
     THEN X2 :=0                      LDN    2  0
                                      BRN       L2
     ELSE X3 :=0;                  L1 LDN    3  0
                                   L2
(99) IF X1 <3                         BNG   2  L1
     THEN X1 := 0;                    TXL   2  3
                                      BCC      L2
                                   L1 LDN   1  0
                                   L2
(100) IF X2 < CH 3                    TXL   2  3
      THEN X1 := 0;                   BCC      L1
                                      LDN   1  0
                                   L1
(101) IF X2 > 3                       BNG   2  L1
      THEN X1 := 0;                   TXL   2  3
                                      BCS      L1
                                      LDN   1  0
                                   L1
(102) IF X2 >CH 3                     TXL   2  3
      THEN X1 := 0;                   BCS      L1
                                      LDN   1  0
                                   L1
(103)  IF X2 > X1                     STO   2  TEMP
       THEN X3 := 0;                  SBX   2  1
                                      BZE   2  L1
                                      BPZ   2  L2
                                   L1 LDX   2  TEMP
                                      BRN      L3
                                   L2 LDX   2  TEMP
                                      LDN   3  0
                                   L3
(104)  IF X2  >CH X1                  TXU   2  1
       THEN X3 := 0;                  BCC      L1
                                      TXL   2  1
                                      BCS      L1
                                      LDN   3  0
                                   L1
(105)  IF X2 < X1                     STO   2  TEMP
       THEN X3 := 0;                  SBX   2  1
                                      BNG   2  L1
                                      LDX   2  TEMP
                                      BRN      L2
                                   L1 LDX   2  TEMP
                                      LDN   3  0
                                   L2
(106)  IF X4 <CH X1                   TXL   4  1
       AND X5  <CH X1                 BCC      L1
       THEN X3 := 0;                  TXL   5  1
                                      BCC      L1
                                      LDN   3  0
                                   L1
(107)  IF X4  <CH X1                  TXL   4  1
       AND X5  <CH X1                 BCC      L1
       THEN GOTO FRED;                TXL   5  1
                                      BCS      FRED
                                   L1
(108)  IF X4  <CH X1                  TXL   4  1
          OR X5  <CH X1               BCS      L1
       THEN X3 := 0;                  TXL   5  1
                                      BCC      L2
                                   L1 LDN   3  0
                                   L2
           For Statement
(109)  FOR X1 := LIX STEP 5           LDX   1  LIX
       UNTIL UIX(3) DO             L1 STOZ     LIA(X1)
       LIA(X1) := 0;                  TXU   1  $UIX(X3)
                                      BCC      L2
                                      ADN   1  5
                                      BRN      L1
                                   L2
(110) FOR X1 := LIX STEP -1           LDX   1  LIX
      UNTIL 3 DO                   L1 STOZ     LIA(X1)
      LIA(X1) := 0;                   SBN   1  3
                                      BZE   1  L2
                                      ADN   1  3
                                      SBN   1  1
                                      BRN      L1
(111) FOR X1 := LIX STEP -1           LDX   1  LIX
      UNTIL 0 DO                   L1 STOZ     LIA(X1)
      LIA(X1) := 0;                   BZE   1  L2
                                      SBN   1  1
                                      BRN      L1
                                   L2
(112) FOR X1 := LIX STEP 1            LDX   1 LIX
      UNTIL LIA DO                 L1 STOZ    LIA(X1)
      LIA(X1) := 0;                   SBX   1  LIA
                                      BZE   1  L2
                                      ADX   1  LIA
                                      ADN   1  1
                                      BRN      L1
                                   L2      
      
(113) FOR X2 := CHAR 1 OF £UIA        LDCT  2  128
      STEP CHAR                       ADX   2  BASEU
      UNITL LIX DO                 L1 LDCH  6  $UIA(X2)
      X6 := CH UIA(X2);               TXU   2  LIX
                                      BCC      L2
                                      BCHX  2  L1
                                   L2
           While Statement
(114) WHILE A1<LRX DO              L1 SFP      TEMP
      A1 := A1+LRA;                   FSB      LRX
                                      BFP   3  L2
                                      LFP      TEMP
                                      BRN      L3
                                   L2 LFP      TEMP
                                      FAD      LRA
                                      BRN      L1
                                   L3
⇑ 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