%begin
%string(10) s,t
%constintegername fred = x'244444' {This should fail in SM IMP}
                              {Changing = to == would make it fail in EMAS IMP}
%externalinteger jjfred=7
%ownintegerarray opcode(0:20) =  {opcode values; the next line is blank - N.B.}

         16_5800,    16_4800,    16_5000,    16_4000,
{           L           LH          ST          STH}
         16_5A00,    16_5B00,    16_5C00,    16_5D00,
{           A           S           M           D}
         16_1A00,    16_1B00,    16_1C00,    16_1D00,
{           AR          SR          MR          DR}
         -1(*)                                         {all the rest}
%string(9)%name sref
%integer i,j,k
%ownintegerarray twod(1:2,1:3) = 1,2,3,4,5,6
%real d
i=10; j = 3; k=1
! This is a comment; this is part of it
i{this is an embedded comment; I hope it { works} = j\\k
%for i=1,1,2 %cycle
   %for j=1,1,3 %cycle
      %if twod(i,j) # (j-1)*2 + i %start
         write(i,1); write(j,1)
         printstring(" th element of TWOD has value")
         write(twod(i,j),2)
         newline
      %finish
   %repeat
%repeat
k = k'6632'
k = i!!j
! Various uses of \, ~ etc.
%if \i=j %then k=0
%if i\=j %then k=0
%if \i\=j %then k=0
%if \i\=\j %then k=0
%if ~i=j %then k=0
%if ~i=\j %then k=0
%if ~i<>\j %then k=0
d = 23.
k=2; i = j\\k
sref == s {This should fail in SM IMP - sref and s have different lengths}
s = "1234567890"
t = substring(s,3,2) {This should succeed in SM IMP but fail in EMAS IMP}
printstring("TEST OK (if no other output)")
%endofprogram
