         Edinburgh IMP77 Compiler - Version 8.4

    1  %begin
    2  
    3    %routine printarray(%integerarray(2)%name A, %integer a0low, a0high, a1low, a1high)
    4      %integer A0, A1
    5      ! Imp needs some perm code to determine upper and lower bounds of arrays
    6      %for A0 = a0low, 1, a0high %cycle
    7        %for A1 = a1low, 1, a1high %cycle
    8          write(A(A0, A1), 3); print string(", ")
    9        %repeat
   10        newline
   11      %repeat
   12      newline
   13    %end
   14  
   15    %integername element
   16    %integer i
   17  
   18    ! imp77 doesn't allow initialised multi-dimensional arrays.  (Imp80 would!)
   19    ! So I'll initialise these explicitly:
   20    %integerarray fred(0:1, 0:2)       { simple case }
   21    %integerarray jim(11:13, 100:103)  { non-zero lower bounds }
   22    element == fred(0,0); element = i %and element == element++1 %for i = 0, 1, 5
   23    element == jim(11,100); element = i %and element == element++1 %for i = 0, 1, 11
   24  
   25    printarray(fred, 0,1, 0,2)
   26    printarray(jim, 11,13, 100,103)
   27    
   28  %endofprogram

   23 Statements compiled
