! Copyright (c) 1988 Edinburgh Portable Compilers Ltd. All Rights Reserved.
!
!     ECODES
!     ------
! 
!     Author : Geoff Millard      Created on : 09 Feb 88
! 
!     Modifications :
! 
!     Date     Dev Vers   Description of Modification
!     ----     --- ----   ---------------------------
!     27/07/92  GA   33.7 Reintroduce ECCOps LOGVAL,LOGSTK and LOGNEG
!     02/04/91  RT   33.6 Removed ECCOps LOGVAL,LOGSTK and LOGNEG
!     05/12/90  RT   33.5 Added ECOps CJTRUE, CJFALSE, CDUPADD and CDUPSUB 
!     18/04/90  CMcP 33.4 Add Pascal-E operators STRTOCH,STRPLUS,STRMOVE,PUSHSTR
!     09/03/90  GM   33.3 Add operator DCXUCHECK
!     22/02/90  TR   33.2 Renumber the bit Pasops since pascal-I/E conflict
!     28/01/90  AK   33.1 Merge Pascal changes (from 32.6)
!     07/01/90  GM   33   Common version
!     25/01/90  TR   32.6 Add BITADDR for Pascal
!     23/01/90  TR   32.6 Add SAVEBITREF and RESTBITREF for Pascal
!     22/01/90  TR   32.6 Add UPBITII, UPBITUU, UPBITIU, UPBITUI for Pascal
!                         and rename INDEXP as INDEXBITS
!     18/12/89  AK   32.5 Merge Pascal changes
!     01/12/89  TR   32   Reinstate BNOT as generic EOP
!     28/11/89  TR   32   Add PasOps RCHKRNG and RCHKXX
!     30/11/89  GM   32.4 Merge Pascal changes   
!     30/10/89  TR   32   Add PasOp CHKUOVF to complement CHKIOVF
!     27/10/89 AJH   32   Add PasOps BAND BOR BNOT
!     22/11/89  GM   32.2 Add direct complex ops
!     29/08/89 AJH   32   Reduced set of Pascal/Modula ecodes
!     09/08/89  TR   32   Rename PIMOD to INMOD and add UNMOD & IMDIV
!     24/05/89  TR   32   Add SETSD, SETINCL, SETEXCL & remove SETEMPTY
!     28/02/89  GB   32   Add operator PSEUDONOP
!     09/12/88  GB   31   Add operator GATHER
!     04/12/88  GB   30   Add operators FORCE, ENDFORCE
!     11/10/88  GB   30   Add operator VCSEDEF
!     07/06/88  GB   29   Add operator VVSUB
!     04/09/88  GM   28   Basis version for tracking changes
!
{00} %constinteger      HALT =   0
!
!--------------------------------------- generic int operations -------
!
{01} %constinteger      IADD =   1     { (Etos-1) + (Etos) => (Etos)   }
{02} %constinteger      ISUB =   2     { (Etos-1) - (Etos) => (Etos)   }
{03} %constinteger     IMULT =   3     { (Etos-1) * (Etos) => (Etos)   }
{04} %constinteger      IDIV =   4     { (Etos-1) / (Etos) => (Etos)   }
{05} %constinteger      INEG =   5     {          - (Etos) => (Etos)   }
{06} %constinteger      IABS =   6     {     abs( (Etos) ) => (Etos)   }
{07} %constinteger      IREM =   7     { remainder from                }
                                       {  (Etos-1) / (Etos)=> (Etos)   }
!
{08} %constinteger      IAND =   8     { (Etos-1) & (Etos) => (Etos)   }
{09} %constinteger       IOR =   9     { (Etos-1) ! (Etos) => (Etos)   }
{0A} %constinteger      INOT =  10     {          ~ (Etos) => (Etos)   }
{0B} %constinteger      IXOR =  11     { (Etos-1) !! (Etos) => (Etos)  }
{0C} %constinteger     ISHLL =  12     { (Etos-1) << (Etos) => (Etos)  }
{0D} %constinteger     ISHRL =  13     { (Etos-1) >> (Etos) => (Etos)  }
{0E} %constinteger     ISHLA =  14     { arithmetic left shift         }
{0F} %constinteger     ISHRA =  15     { arithmetic right shift        }
!
{10} %constinteger       IGT =  16     { if                            }
{11} %constinteger       ILT =  17     {    (Etos-1) <relop> (Etos)    }
{12} %constinteger       IEQ =  18     { then                          }
{13} %constinteger       INE =  19     {    true  (1) => (Etos)        }
{14} %constinteger       IGE =  20     { else                          }
{15} %constinteger       ILE =  21     {    false (0) => (Etos)        }
{16} %constinteger       BNOT=  22     {  (Etos) = BNOT (Etos) 0<->1   }
!
{18} %constinteger      JIGT =  24     { if                            }
{19} %constinteger      JILT =  25     {    (Etos-1) <relop> (Etos)    }
{1A} %constinteger      JIEQ =  26     { then                          }
{1B} %constinteger      JINE =  27     {    -> <label>                 }
{1C} %constinteger      JIGE =  28     { else                          }
{1D} %constinteger      JILE =  29     {    continue                   }
!
{1E} %constinteger    JINTGZ =  30     { if (Etos) > 0 %then -> <lab>  }
{1F} %constinteger    JINTLZ =  31     { if (Etos) < 0 %then -> <lab>  }
{20} %constinteger     JINTZ =  32     { if (Etos) = 0 %then -> <lab>  }
{21} %constinteger    JINTNZ =  33     { if (Etos) # 0 %then -> <lab>  }
{22} %constinteger   JINTGEZ =  34     { if (Etos) >=0 %then -> <lab>  }
{23} %constinteger   JINTLEZ =  35     { if (Etos) <=0 %then -> <lab>  }
! 
{24} %constinteger      ITWB =  36     { if (Etos) < 0 then -> <lab1>  } 
                                       {           = 0 then -> <lab2>  }
                                       {           > 0 then -> <lab3>  }
!
!--------------------------------------- miscellaneous operations------
!
{26} %constinteger      JUMP =  38     { -> <label>                    }
{29} %constinteger       SFA =  41     { SF => (Etos)                  }
{2A} %constinteger    RETURN =  42     { procedure exit                }
{2B} %constinteger      ASF  =  43     { SF = SF + (Etos)              }
!
{2C} %constinteger     IPUSH =  44     { (Etos) => (Mstack)            }
{2D} %constinteger      IPOP =  45     { (Mstack) => (Etos)            }
{2E} %constinteger      EXCH =  46     { (Etos-1) <=> (Etos)           }
{2F} %constinteger      DUPL =  47     { replicate (Etos)              }
{30} %constinteger   DISCARD =  48     { discard (Etos)                }
!
{33} %constinteger    INDEX1 =  51     { (@ Etos-1) + (Etos)           }
                                       {               => (@ Etos)     }
{34} %constinteger    INDEX2 =  52     { (@ Etos-1) + (Etos)*2         }
                                       {               => (@ Etos)     }
{35} %constinteger    INDEX4 =  53     { (@ Etos-1) + (Etos)*4         }
                                       {               => (@ Etos)     }
{36} %constinteger    INDEX8 =  54     { (@ Etos-1) + (Etos)*8         }
                                       {               => (@ Etos)     }
{37} %constinteger     INDEX =  55     { (@ Etos-2)                    }
                                       {     + (Etos-1)*(Etos)         }
                                       {               => (@ Etos)     }
!
{38} %constinteger       MVB =  56     { move (Etos) bytes             }
                                       {  ((@ Etos-2)) => ((@ Etos-1)) }
!
{39} %constinteger       CHK =  57     { check that                    }
                                       { (Etos-1)<=(Etos-2)<=(Etos)    }
                                       { (Etos-2) => (Etos)            }
!
{3A} %constinteger     TMASK =  58     { (Etos-1) & (Etos)             }
                                       { - to be followed by JI[N]Z    }
{3B} %constinteger       MVW =  59     { move (Etos) words - aligned   }
                                       {  ((@ Etos-2)) => ((@ Etos-1)) }
{3C} %constinteger     EZERO =  60     { (Etos) bytes at ((@ Etos-1))=0}
!
{3E} %constinteger     CPBGT =  62     { if (Etos) bytes               }
{3F} %constinteger     CPBLT =  63     {  ((Etos-2)) <relop> ((Etos-1))}
{40} %constinteger     CPBEQ =  64     { then                          }
{41} %constinteger     CPBNE =  65     {    true  (1) => (Etos)        }
{42} %constinteger     CPBGE =  66     { else                          }
{43} %constinteger     CPBLE =  67     {    false (0) => (Etos)        }
{44} %constinteger    EMAKED =  68     { (Etos) = (Etos)<<32 ! (Etos-1)}
                                       {  64bit    32bit        32bit  }
{45} %constinteger   ESPLITD =  69     { (Etos) => (Etos)   ,  (Etos-1)}
!
!-------------------------------------- generic unsigned operations ---
!
{4D} %constinteger     UMULT=  77      { unsigned mult                 }
{4E} %constinteger     UREM =  78      { remainder - unsigned op       }
{4F} %constinteger     UDIV =  79      { (Etos-1) / (Etos) => (Etos)   }
{50} %constinteger     UADD =  80      { (Etos-1) + (Etos) => (Etos)   }
{51} %constinteger     USUB =  81      { (Etos-1) - (Etos) => (Etos)   }

{52} %constinteger      UGT =  82      { if                            }
{53} %constinteger      ULT =  83      {    (Etos-1) <relop> (Etos)    }
{54} %constinteger      UEQ =  84      { then                          }
{55} %constinteger      UNE =  85      {    1 => (Etos)                }
{56} %constinteger      UGE =  86      { else                          }
{57} %constinteger      ULE =  87      {    0 => (Etos)                }
 
{58} %constinteger     JUGT =  88      { if                            }
{59} %constinteger     JULT =  89      {    (Etos-1) <relop> (Etos)    }
{5A} %constinteger     JUEQ =  90      { then                          }
{5B} %constinteger     JUNE =  91      {    -> <label>                 }
{5C} %constinteger     JUGE =  92      { else                          }
{5D} %constinteger     JULE =  93      {    continue                   }

{5E} %constinteger    JUGTZ =  94      { if (Etos) > 0 %then -> <lab>  }
{5F} %constinteger    JULTZ =  95      { if (Etos) < 0 %then -> <lab>  }
{60} %constinteger    JUEQZ =  96      { if (Etos) = 0 %then -> <lab>  }
{61} %constinteger    JUNEZ =  97      { if (Etos) # 0 %then -> <lab>  }
{62} %constinteger    JUGEZ =  98      { if (Etos) >=0 %then -> <lab>  }
{63} %constinteger    JULEZ =  99      { if (Etos) <=0 %then -> <lab>  }

{64} %constinteger   UCVTII = 100      { (int Etos-1) => int size(Etos)}
!
!---------------------------------- generic int operations to store----
!
{65} %constinteger    IADDST = 101    { ((Etos-1)) = (Etos-1)+(Etos)   }
{66} %constinteger    ISUBST = 102    { ((Etos-1)) = (Etos-1)-(Etos)   }
{67} %constinteger   IMULTST = 103    { ((Etos-1)) = (Etos-1)*(Etos)   }
{68} %constinteger    IDIVST = 104    { ((Etos-1)) = (Etos-1)/(Etos)   }
{69} %constinteger    INEGST = 105    { ((Etos))   = - (Etos)          }
!
{6A} %constinteger    UREMST = 106    { unsigned remainder to store    }
{6B} %constinteger    UDIVST = 107    { unsigned div to store          }
{6C} %constinteger    IANDST = 108    { ((Etos-1)) = (Etos-1)&(Etos)   }
{6D} %constinteger     IORST = 109    { ((Etos-1)) = (Etos-1)!(Etos)   }
{6E} %constinteger    INOTST = 110    { ((Etos))   = ~ (Etos)          }
{6F} %constinteger    IXORST = 111    { ((Etos-1)) = (Etos-1)!!(Etos)  }
{76} %constinteger    IREMST = 112    { signed remainder to store      }
!
!-------------------------------------- generic real operations -------
!
{71} %constinteger     RADD = 113     { (Etos-1) + (Etos) => (Etos)    }
{72} %constinteger     RSUB = 114     { (Etos-1) - (Etos) => (Etos)    }
{73} %constinteger    RMULT = 115     { (Etos-1) * (Etos) => (Etos)    }
{74} %constinteger     RDIV = 116     { (Etos-1) / (Etos) => (Etos)    }
{75} %constinteger     RNEG = 117     {        - (Etos) => (Etos)      }
{76} %constinteger     RABS = 118     {   abs( (Etos) ) => (Etos)      }
!
{82} %constinteger    TNCRU = 130     { (real Etos-1) =>uns size(Etos) }
{83} %constinteger   CVTSBI = 131     { (sbyte Etos-1)=>int size(Etos) }
{84} %constinteger    CVTUI = 132     { (uns Etos-1) => int size(Etos) }
{85} %constinteger    CVTUR = 133     { (uns Etos-1) => real size(Etos)}
{86} %constinteger    CVTIU = 134     { (int Etos-1) => uns size(Etos) }
{87} %constinteger    CVTRU = 135     { (real Etos-1) => uns size(Etos)}
{88} %constinteger    CVTII = 136     { (int Etos-1) => int size(Etos) }
{89} %constinteger    CVTIR = 137     { (int Etos-1) => real size(Etos)}
{8A} %constinteger    CVTRR = 138     { (real Etos-1)=> real size(Etos)}
{8B} %constinteger    TNCRI = 139     { (real Etos-1)=> int size(Etos) trunc toward 0}
{8C} %constinteger    RNDRI = 140     { (real Etos-1)=> int size(Etos) to nearest int}
{8D} %constinteger   EFLOOR = 141     { (real Etos-1)=> int size(Etos)  towards -inf }
{8E} %constinteger    TNCRR = 142     { (real Etos-1)=> real size(Etos) trunc toward 0}
{8F} %constinteger    RNDRR = 143     { (real Etos-1)=> real size(Etos) to nearest int}
!
{90} %constinteger       RGT = 144     { if                            }
{91} %constinteger       RLT = 145     {    (Etos-1) <relop> (Etos)    }
{92} %constinteger       REQ = 146     { then                          }
{93} %constinteger       RNE = 147     {    1 => (Etos)                }
{94} %constinteger       RGE = 148     { else                          }
{95} %constinteger       RLE = 149     {    0 => (Etos)                }
!
{96} %constinteger      JRGT = 150     { if                            }
{97} %constinteger      JRLT = 151     {    (Etos-1) <relop> (Etos)    }
{98} %constinteger      JREQ = 152     { then                          }
{99} %constinteger      JRNE = 153     {    -> <label>                 }
{9A} %constinteger      JRGE = 154     { else                          }
{9B} %constinteger      JRLE = 155     {    continue                   }
!
{9C} %constinteger      JRGZ = 156     { if (Etos) > 0 %then -> <lab>  }
{9D} %constinteger      JRLZ = 157     { if (Etos) < 0 %then -> <lab>  }
{9E} %constinteger       JRZ = 158     { if (Etos) = 0 %then -> <lab>  }
{9F} %constinteger      JRNZ = 159     { if (Etos) # 0 %then -> <lab>  }
{A0} %constinteger     JRGEZ = 160     { if (Etos) >=0 %then -> <lab>  }
{A1} %constinteger     JRLEZ = 161     { if (Etos) <=0 %then -> <lab>  }
!
{A2} %constinteger      RTWB = 162     { if (Etos) < 0 then -> <lab1>  }
                                       {           = 0 then -> <lab2>  }
                                       {           > 0 then -> <lab3>  }
{A3} %constinteger     JTRUE = 163     { if (Etos) true  then -> <lab  }
{A4} %constinteger    JFALSE = 164     { if (Etos) false then -> <lab> }
!
!----------------------------------------------------------------------
!
{B1} %constinteger    UCHECK = 177    { if (Etos) unassigned diagnose  }
{B8} %constinteger    ESTORE = 184    { ((Etos)) = (Etos-1)            }
{B9} %constinteger EDUPSTORE = 185    { ((Etos)) = (Etos-1)            }
                                      { retain (Etos-1) as new (Etos)  }
{BA} %constinteger   PUSHVAL = 186    { push (Etos) as value param     }
{BB} %constinteger  PUSHADDR = 187    { push (Etos) as ref param       }
{BC} %constinteger      EVAL = 188    { force load of (Etos)           }
{BD} %constinteger  EVALADDR = 189    { force load of @ at (Etos)      }
{BE} %constinteger  EADDRESS = 190    { address(Etos) is required      }
{BF} %constinteger   EINTRES = 191    { (Etos) is integer fn result    }
{C0} %constinteger  EREALRES = 192    { (Etos) is real fn result       }
{C1} %constinteger     ESIZE = 193    { size of (Etos-1) is (Etos)     }

{C2}%constinteger     EPOWER = 194    { (Etos-3) @ result if cx        }
                                      { (Etos-2) base (@ base if cx)   }
                                      { (Etos-1) power(@ power if cx)  }
                                      { (Etos)   procindex             }

{C3}%constinteger    EPOWERI = 195    { (Etos-2) base                  }
                                      { (Etos-1) power (int)           }
                                      { (Etos)   procindex (0-3)       }

                                      { procindex =  0  powii          }
                                      {              1  powri          }
                                      {              2  powdi          }
                                      {              3  powqi          }
                                      {              4  powci          }
                                      {              5  powzi          }
                                      {              6  powzzi         }
                                      {              9  powrr          }
                                      {             10  powdd          }
                                      {             11  powqq          }
                                      {             12  powcc          }
                                      {             13  powzz          }
                                      {             14  powzzz         }

{C4} %constinteger   ARGPROC = 196    { call formal procedure in (Etos)}
{C5} %constinteger PUSHBYTES = 197    { push (Etos) bytes from         }
                                      { (@etos-1) as value parameter   }
{C6} %constinteger    EAUXSF = 198    { AUXSF => (ETOS)                }
{C7} %constinteger   EAUXADD = 199    { AUXSF = AUXSF + (ETOS)         }
{C8} %constinteger   EAUXRES = 200    { AUXSF = (ETOS)                 }
{C9} %constinteger   EOLDLNB = 201    { stack LNB needed for diags     }
{CA} %constinteger     EFILL = 202    {fill (ETOS-1) bytes at (ETOS-2) with (ETOS) }
{CB} %constinteger     ECDUP = 203    {temp! next ..ST to restack val  }
{CD} %constinteger    EMCHIP = 205    { apply chip fn (ETOS) to arg (ETOS-1) }
!
{F4} %constinteger WHEREMASK = 244  { (Etos) is where mask expression}
{F5} %constinteger  WHERELSE = 245    { ELSEWHERE                      } 
{F6} %constinteger     VELOG = 246    { eval comparison to logical     } 
{F7} %constinteger   WHEREST = 247    { WHERE start  (ETOS) = mask     } 
{F8} %constinteger   WHEREND = 248    { WHERE end                      } 
{F9} %constinteger     VSEQR = 249    { SEQ real etos=start,etos-1=inc; sv inc!}
{FA} %constinteger     VSEQI = 250    { SEQ int etos=start,etos-1=inc; sv inc!}
{FB} %constinteger     VMASK = 251    { (ETOS) is logical mask }
{FC} %constinteger   VIMAGPT = 252    { (ETOS,complex) => (ETOS,imag part)}
{FD} %constinteger   VREALPT = 253    { (ETOS,complex) => (ETOS,real part)}
{FE} %constinteger    VSTART = 254    { start of vector loop           }
                                      { (Etos) = no. of elements       }
{FF} %constinteger    VEND   = 255    { end of vector loop             }
!
!***********************************************************************
!*                                                                     *
!*                       FORTRAN specific codes                        *
!*                                                                     *
!***********************************************************************
!
{Complex operations using Indirect Operands and Nominated Result Location}
! 
%constinteger CXADD       = 257       { ((Etos-3)) = ((Etos-2))        }
%constinteger CXSUB       = 258       {                      op        }
%constinteger CXMULT      = 259       {                      ((Etos-1))}
%constinteger CXDIV       = 260       { (Etos) = variant<<8 ! sizecode }

%constinteger CXNEG       = 261       { ((Etos-2)) = - ((Etos-1))      }
                                      { (Etos) = sizecode              }

%constinteger CXASGN      = 262       { ((Etos-2)) = ((Etos-1))        }
                                      { (Etos) = variant<<8            }
                                      {            ! sizecode(RHS)<<2  }
                                      {              ! sizecode(LHS)   }

%constinteger CXEQ        = 263       { (Etos) =  ((Etos-2))           }
%constinteger CXNE        = 264       {                  op ((Etos-1)) }
                                      { (Etos) = variant<<8 ! sizecode }

%constinteger ECMPLX1     = 286       { ((Etos-2))=((Etos-1),0)        }
%constinteger ECMPLX2     = 287       { ((Etos-3))=((Etos-2),(Etos-1)) }
                                      { (Etos) = sizecode              }

%constinteger ECONJG      = 279       { ((Etos-2) =  conjg((Etos-1))   }
                                      { (Etos) = sizecode              }

{Complex Operations using Direct Operations. Result on Stack}

%constinteger DCXADD      = 337       { (Etos-2) op (Etos-1) => Etos   }
%constinteger DCXSUB      = 338       {                                }
%constinteger DCXMULT     = 339       { Initial (Etos) is              }
%constinteger DCXDIV      = 340       {          variant<<8 ! sizecode }

%constinteger DCXNEG      = 341       {  - (Etos-1) => Etos            }
                                      { Initial (Etos) is sizecode     }

%constinteger DCXASGN     = 342       { (Etos-1) = (Etos-2)            }
                                      { (Etos) is                      }
                                      { variant<<8 ! sizecode(LHS)<<2  }
                                      {            ! sizecode(RHS)     }
%constinteger DCXCVT      = 343       { Convert (Etos-1) => Etos       }
                                      { (Etos) is                      }
                                      { variant<<8 ! newsizecode<<2    }
                                      {            ! sizecode(Etos-1)  }

%constinteger DCXEQ       = 344       { (Etos-2) op (Etos-1) => Etos   }
%constinteger DCXNE       = 345       { Initial (Etos) is              }
                                      {          variant<<8 ! sizecode }

%constinteger DECMPLX1    = 346       { ((Etos-1),0) => Etos           }
%constinteger DECMPLX2    = 347       { ((Etos-2),(Etos-1)) => Etos    }
                                      { Initial (Etos) is sizecode     }

%constinteger DECONJG     = 349       { conjg (Etos-1) => Etos         }
                                      { Initial (Etos) is sizecode     }

%constinteger DCXUCHECK   = 350       { perform unassigned check       }
                                      {      on (Etos-1)               }
                                      { Initial (Etos) is sizecode     }

                                      { variant  = 0    cx op cx       }
                                      {            1    cx op real     }
                                      {            2  real op cx       }
                                      { sizecode = 0    c*8   (r*4)    }
                                      {            1    c*16  (r*8)    }
                                      {            2    c*32  (r*16)   }

!%constinteger EANINT      = 266       { (Etos) = anint (Etos)          }
%constinteger EM1EXP      = 267       { (Etos) = (-1) ** (Etos) - int  }

%constinteger EISIGN      = 268       { (Etos) = sign(Etos)            }
%constinteger ESIGN       = 269       {                  * abs(Etos-1) }

%constinteger EIMOD       = 270       { (Etos) = int(Etos-1)/(Etos)    }
%constinteger ERMOD       = 271       {                       * (Etos) }

%constinteger EIDIM       = 272       { (Etos) = if (Etos-1) > (Etos)  }
%constinteger ERDIM       = 273       {          then (Etos-1)-(Etos)  }
                                      {          else 0

%constinteger EIMIN       = 274       { (Etos) = min( (Etos-1),        }
%constinteger ERMIN       = 275       {                (Etos) )        }

%constinteger EIMAX       = 276       { (Etos) = max( (Etos-1),        }
%constinteger ERMAX       = 277       {                (Etos) )        }

%constinteger EDMULT      = 278       { (Etos) = dble((Etos-1)*(Etos)) }

%constinteger ECHAR       = 280       {  ((Etos-1)) = char(Etos)       }
%constinteger EICHAR      = 281       {      (Etos) = ichar((Etos-1))  }

%constinteger EINDEXCHAR  = 282       {      (Etos) = index( C1,C2 )   }
                                      {  ((Etos-3)) = Charad(C1)       }
                                      {   (Etos-2)  = Charlen(C1)      }
                                      {  ((Etos-1)) = Charad(C2)       }
                                      {    (Etos)   = Charlen(C2)      }

%constinteger ECONCAT     = 283       {          C1 = concat list      }
                                      {  ((Etos-3)) = @ concat table   }
                                      {   (Etos-2)  = no. items        }
                                      {  ((Etos-1)) = Charad(C1)       }
                                      {    (Etos)   = Charlen(C1)      }

%constinteger EASGNCHAR   = 284       {          C1 = C2               }
                                      {  ((Etos-3)) = Charad(C1)       }
                                      {   (Etos-2)  = Charlen(C1)      }
                                      {  ((Etos-1)) = Charad(C2)       }
                                      {    (Etos)   = Charlen(C2)      }

%constinteger ECOMPCHAR   = 285       {     (Etos) = compare( C1,C2 )  }
                                      {  ((Etos-4)) = Charad(C1)       }
                                      {   (Etos-3)  = Charlen(C1)      }
                                      {  ((Etos-2)) = Charad(C2)       }
                                      {   (Etos-1)  = Charlen(C2)      }
                                      {    (Etos)   = relop            }
                                      {  relop  =  0 >   1 <   2 =     }
                                      {            3 #   4 >=  5 <=    }

%constinteger EISHFT      = 288       { (Etos) = (Etos-1) << (Etos)    }
%constinteger EIBITS      = 289       { (Etos) = (Etos) bits from      }
                                      {       bit (Etos-1) in (Etos-2) }
%constinteger EIBSET      = 290       { (Etos) = (Etos-1)&(1<<(Etos))  }
%constinteger EIBTEST     = 291       { (Etos) = (Etos-1)!(1<<(Etos))  }
%constinteger EIBCLR      = 292       { (Etos) = (Etos-1)&\(1<<(Etos)) }
%constinteger EISHFTC     = 293       { (Etos) = (Etos-1) <<c (Etos)   }

%constinteger PROCARG     = 294       { (Etos) = Procref(Etos)         }
!%constinteger IPROCARG    = 295       { not used                       }
!%constinteger CHARARG     = 296       { not used                       }
!%constinteger IPROCCALL   = 297       { not used                       }
%constinteger ARGPROCCALL = 298       {   (Etos)   = paramsize(bytes)  }
                                      {   (Etos-1) = arg               }

%constinteger CALLTPLATE  = 299       { not used                       }
%constinteger NOTEIORES   = 300       { preserve io fn result(no stack change) }
%constinteger STKIORES    = 301       { restack io fn result           }

!%constinteger EFCVT       = 302       { convert(Etos-1)                }
                                      { (Etos)      convert code       }
!%constinteger EFCVTASGN   = 303       { (Etos-1) =  convert(Etos-2)    }
                                      { (Etos)      convert code       }
                                      { convert code=oldmode<<3!newmode}
                                      { mode =[0  bit - futures]       }
                                      {        1  I1 (byte)            }
                                      {        2  I2                   }
                                      {        3  I4                   }
                                      {        4  I8                   }
                                      {        5  R4                   }
                                      {        6  R8                   }
                                      {        7  R16                  }

!%constinteger EARGLEN     = 304       { (Etos) is char arg len         }
                                      {   - on Amdahl load bottom half }

%constinteger EFDVACC     = 305       { dope vector special evaluation }
                                      { (Etos-1) => (Etos)             }
                                      { (Etos-2) + (Etos-1)*(Etos)     }
                                      {                => (Etos-1)     }

%constinteger EFNOTEVR    = 306       { (Etos) is the variable return  }
                                      { index                          }

%constinteger EFSETVR     = 307       { stack a descriptor for the     }
                                      { variable return index          }

%constinteger EINCR       = 308       { equiv to IADDST                }
%constinteger EDECR       = 309       { equiv to ISUBST                }
%constinteger ELOADB      = 310       { breg = (Etos)                  }
%constinteger ESTOREB     = 311       { (Etos) = breg                  }
%constinteger EINCRB      = 312       { breg = breg + (Etos)           }
%constinteger EDECRB      = 313       { breg = breg - (Etos)           }
!%constinteger EDINIT      = 314       { not used                       }
%constinteger ELSHIFT     = 315       { (Etos) = (Etos-1) << (Etos)    }
%constinteger ERSHIFT     = 316       { (Etos) = (Etos-1) >> (Etos)    }
%constinteger EADJL       = 317       { char((Etos-3),(Etos-2))        }
                                      {   = leftjustify                }
                                      {      (char((Etos-1),(Etos)))   }
%constinteger EADJR       = 318       { char((Etos-3),(Etos-2))        }
                                      {   = rightjustify               }
                                      {      (char((Etos-1),(Etos)))   }
%constinteger EVERIFY     = 319       { char1 = verify (char2,char3)   }
!%constinteger ECXRES      = 320       { NP special for cx results      }
%constinteger ERBIT       = 321       { (Etos) = bit (Etos-1) in (Etos) }
%constinteger EWBIT       = 322       { bit(Etos-1) in (Etos) = (Etos-2)}
%constinteger EMSTORE     = 323       { array = scalar                 }
                                      { (Etos) copies of (Etos-2)      }
                                      {               at (Etos-1)      }
%constinteger ALLTEMP     = 324       { allocate array temp on stack   }
                                      { (Etos) is size in bytes        }
                                      { ((Etos-1)) is dope vector(dv)  }
                                      {  (dv+4) = addr(temp)           }
                                      {    (dv) = (dv) + addr(temp)    }
%constinteger ALLRES      = 325       { allocate array temp on stack   }
                                      { (Etos) is size in bytes        }
                                      { ((Etos-1)) is dope vector(dv)  }
                                      {    (dv) = addr(temp)           }
                                      { (dv+12) = (dv+12) + addr(temp) }
%constinteger MANTEMPS    = 326       { (Etos) = 1  save stackfront    }
                                      {                  in (Etos-1)   }
                                      {        = 2  restore stackfront }
                                      {                from (Etos-1)   }
%constinteger ALLARR      = 327       { allocate user array on stack   }
                                      { (Etos) is size in bytes        }
                                      { ((Etos-1)) is dope vector(dv)  }
                                      {  (dv+4) = addr(temp)           }
                                      {    (dv) = (dv) + addr(temp)    }
%constinteger DEALLARR    = 328       { deallocate user array on stack }
                                      { (Etos) is dope vector          }
                                      { (dv)=0                         }
%constinteger EMSTOREA    = 329       { array = scalar                 }
                                      { (Etos) copies of (Etos-2) bytes}
                                      {               at (Etos-3)      }
                                      {               to (Etos-1)      }
%constinteger CXCVT       = 330       {    reg = ((Etos-1))            }
                                      { (Etos) = variant<<8            }
                                      {            ! sizecode(RHS)<<2  }
                                      {              ! sizecode(LHS)   }
%constinteger VVSUB       = 331       { (Etos)=vector valued subscript }
                                      { (Etos-1)= array                }
%constinteger VCSEDEF     = 332       { (Etos)=VCSEVAL describing cse  }
                                      { (Etos-1)=1 if cse is a vector  }
                                      {            var or 0 if it is a }
                                      {            vector expression   }
                                      { (Etos-2)=vector var/expression }
%constinteger FORCE       = 333       { Start of forced expr evaluation}
                                      { in register (Etos)             }
%constinteger ENDFORCE    = 334       { End of forced expr evaluation  }
                                      { in register (Etos)             }
%constinteger GATHER      = 335       { (Etos)=array                   }
                                      { (Etos-1)= vector valued subscr }
%constinteger PSEUDONOP   = 336       { No operands - mandatory nop's  }
!
!
!{************************************************************************}
!{***** 		   PASCAL specific codes                    ******}
!{************************************************************************}
!*
!* { integer operations }
!*
%constinteger INMOD  = 525            { (Etos-1) mod (Etos) => (Etos)  }
%constinteger UNMOD  = 526            { (Etos-1) mod (Etos) => (Etos)  }
%constinteger IMDIV  = 527  {MODULA}  { (Etos-1) DIV (Etos) => (Etos)  }
!*
!* { set operations }
!*
%constinteger SETI   = 530            {  (Etos-1) * (Etos) => (Etos)   }
%constinteger SETU   = 531            {  (Etos-1) + (Etos) => (Etos)   }
%constinteger SETD   = 532            {  (Etos-1) - (Etos) => (Etos)   }
!*
%constinteger SETLE  = 533            {  if                            }
%constinteger SETEQ  = 534            {     (Etos-1) <relop> (Etos)    }
%constinteger SETNE  = 535            {  then                          }
%constinteger SETIN  = 536            {     1 => (Etos)                }
                                      {  else                          }
                                      {     0 => (Etos)                }
!*
%constinteger SETSING   = 537         {  [(Etos)] => (Etos)            }
%constinteger SETRANGE  = 538         {  [(Etos-1)..(Etos)] => (Etos)  }
%constinteger SETINCL   = 539;        {DEBUG}
%constinteger SETEXCL   = 540;        {DEBUG}
%constinteger SETSD     = 541;        {  (Etos-1) / (Etos) => (Etos)   }
!*
 { Pascal-E / Modula string / array operations }

%constinteger STRTOCH   = 544         { (Etos) = (Etos-1)[1]           }
%constinteger STRPLUS   = 545         { str((Etos-3)) + str((Etos-2))  }
                                      {     => ((Etos-1))              }
%constinteger STRMOVE   = 546         { str((Etos-1)) <= str((Etos-2)) }
%constinteger PUSHSTR   = 547
 
   { boolean operations, size one results }

%constinteger BAND      = 552         { (Etos)  = (Etos-1) & (Etos)    }
%constinteger BOR       = 553         { (Etos)  = (Etos-1) ! (Etos)    }

   { bit field operations }

%constinteger UPBITII   = 560         {  unpack integer  to integer    }
%constinteger UPBITUU   = 561         {  unpack unsigned to unsigned   }
%constinteger UPBITIU   = 562         {  unpack integer  to unsigned   }
%constinteger UPBITUI   = 563         {  unpack unsigned to integer    }

%constinteger INDEXBITS = 564         {  construct packed field        }
                                      {  descriptor from               }
                                      {  (@ Etos-2)- array base        }
                                      {  (Etos-1)  - index value       }
                                      {  (Etos)    - elements per word }

%constinteger SAVEBITREF = 565        { save reference to bit-packed   }
                                      { record within bit-packed       }
                                      { structure.                     }
 
%constinteger RESTBITREF = 566        { restore reference to bit-packed}
                                      { record within bit-packed       }
                                      { structure.                     }
 
%constinteger BITADDR    = 567        { attempt to give byte address   }
                                      { of bit field                   }

!* { Standard integer procedures }
!*
%constinteger ISQR      = 601         {  fn(Etos)   => (Etos)          }
!*
!* { Standard real procedures }
!*
%constinteger RSQR      = 611         {  fn(Etos)   => (Etos)          }
!*
!* { error detection }
!*
%constinteger CHKRNG    = 622         {  if                            }
                                      {    (Etos-3) < (Etos-2) or      }
                                      {    (Etos-3) > (Etos-1)         }
                                      {  then                          }
                                      {    trap((Etos))                }
                                      {  else                          }
                                      {    [(Etos-3)] => [(Etos)]      }
%constinteger CHKXX     = 623         {  if (Etos-2) XX (Etos-1)       }
                                      {  then trap((Etos)>>3)          }
                                      {  XX = (Etos)&7                 }
%constinteger CHKSETRNG = 624         {  if                            }
                                      {    min([(Etos-3)]) < (Etos-2)  }
                                      {  or                            }
                                      {    max([Etos-3)]) > (Etos-1)   }
                                      {  then                          }
                                      {    trap((Etos))                }
                                      {  else                          }
                                      {    [(Etos-3)] => [(Etos)]      }
%constinteger RCHKRNG   = 626         {  if                            }
                                      {    (Etos-3) < (Etos-2) or      }
                                      {    (Etos-3) > (Etos-1)         }
                                      {  then                          }
                                      {    trap((Etos))                }
                                      {  else                          }
                                      {    [(Etos-3)] => [(Etos)]      }
%constinteger RCHKXX    = 627         {  if (Etos-2) XX (Etos-1)       }
                                      {  then trap((Etos)>>3)          }
                                      {  XX = (Etos)&7                 }

%constinteger UCHKRNG   = 628         {  if                            }
                                      {    (Etos-3) < (Etos-2) or      }
                                      {    (Etos-3) > (Etos-1)         }
                                      {  then                          }
                                      {    trap((Etos))                }
                                      {  else                          }
                                      {    [(Etos-3)] => [(Etos)]      }
%constinteger UCHKXX    = 629         {  if (Etos-2) XX (Etos-1)       }
                                      {  then trap((Etos)>>3)          }
                                      {  XX = (Etos)&7                 }

%constinteger CHKUOVF   = 634         {  if uns overflow(Etos) Trap    }
%constinteger CHKIOVF   = 635         {  if int overflow(Etos) Trap    }
%constinteger CHKROVF   = 636         {  if rl overflow(Etos) Trap     }
%constinteger TRAPOVF   = 639         {  enable arithmetic exceptions  }
!*
!* { global goto support }
!*
%constinteger SAVESTK   = 616;        {  StackTop => (Etos)            }
%constinteger RECOVERSTK= 617;        {  (Etos) => StackTop            }
!
!*************************************************************************
!*                      C and C++ specific opcodes                       *
!*************************************************************************
!
%constinteger     CMPSTR = 768        { Compare C Strings               }
%constinteger    CDUPADD = 769        { (Etos) = (Etos-2) + (Etos-1)    }
				      { and (Etos-2) => (Etos)          }
%constinteger    CDUPSUB = 770        { (Etos) = (Etos-2) - (Etos-1)    }
%constinteger    ECSTORE = 771        { struct((Etos))=struct((Etos-1)) }
%constinteger ECPROCCALL = 772        { call proc thro pointer (Etos)   }
%constinteger   EPUSHSTR = 773        { stack stct((Etos-1)),size(Etos) }
%constinteger    ELDBITS = 774        { (Etos) = bit field from (Etos-2)}
                                      { size   (Etos) bits              }
                                      { offset (Etos-1) bits            }
%constinteger    ESTBITS = 775        { bit field in (Etos) = (Etos-3)  }
                                      { size   (Etos-1) bits            }
                                      { offset (Etos-2) bits            }
%constinteger     UADDST = 776        { unsigned add to store           }
%constinteger     USUBST = 777        { unsigned sub from store         }
%constinteger    UMULTST = 778        { unsigned mult to store          }
%constinteger     RADDST = 780        { ((Etos-1)) = (Etos-1) + (Etos)  }
%constinteger     RSUBST = 781        { ((Etos-1)) = (Etos-1) - (Etos)  }
%constinteger    RMULTST = 782        { ((Etos-1)) = (Etos-1) * (Etos)  }
%constinteger     RDIVST = 783        { ((Etos-1)) = (Etos-1) / (Etos)  }
%constinteger     ISHLST = 784        { ((Etos-1)) = (Etos-1) << (Etos) }
%constinteger     ISHRST = 785        { ((Etos-1)) = (Etos-1) >> (Etos) }
%constinteger      CEVAL = 786        { force load of (Etos)            }
%constinteger     ECSAVE = 787        { replicate (Etos) and save copy  }
%constinteger  ECRESTORE = 788        { recover saved operand (FIFO)    }
%constinteger    ISHRAST = 789        { shift right arith to store      }
%constinteger    CJFALSE = 790        { JFALSE with freeregs            }
%constinteger     CJTRUE = 791        { JTRUE with freeregs             }
%constinteger    ESTRLEN = 792        { Returns length of string at addr}
%constinteger     LOGSTK = 793        { result of C++ logical}
%constinteger     LOGNEG = 794        { result of C++ logical negation}
%constinteger     LOGVAL = 795        { result of C++ conditional logical}

