         Edinburgh IMP77 Compiler - Version 8.4

    1  %systemroutinespec print(%real x, %integer n,m)
    2  %systemroutine printfl(%real x, %integer n)
    3  %real y,round
    4  %integer count=-99,sign=0
    5    %if x # 0 %start
    6      x = -x %and sign = 1 %if x < 0
    7     !Adjust X so that 1.0 <= rounded(X) < 10.0
    8      count = 0;  round = 0.5\{^}n
    9      y = 1.0-round
   10      %if x < y %start;  !ie rounded(X) < 1.0
   11        count = count-1 %and x = x*10.0 %until x >= y
   12      %finish %else %start
   13        y = 10.0-round
   14        %while x >= y %cycle;  !ie rounded(X) > 10.0
   15          count = count+1;  x = x/10.0
   16        %repeat
   17      %finish
   18      x = -x %if sign # 0
   19    %finish
   20    print(x,1,n)
   21    printsymbol('@')
   22    write(count,0)
   23  %end;  !printfl
   24  
   25  %begin
   26  %end
   27  
   28  %endoffile

   27 Statements compiled
