         Edinburgh IMP77 Compiler - Version 8.4

    1  %begin
    2  
    3  %routine MOUSES WRITE(%integer n, p)
    4  
    5  %string(72)%fn ITOS(%integer n, p)
    6     %byte %array s(0:72)
    7     %integer x, sign
    8     x = 73
    9     sign = 0
   10     %if p > 0 %start
   11        sign = ' '
   12        p = 72-p
   13     %else
   14        p = p+73
   15     %finish
   16     p = 1 %if p <= 0
   17     %if n < 0 %start
   18        sign = '-'
   19        n = -n
   20        %if n < 0 %start;      !max int
   21           n = n//(-10)
   22           x = x-1
   23           s(x) = '8'
   24        %finish
   25     %finish
   26     %cycle
   27        x=x-1
   28        s(x) = rem(n,10)+'0'
   29        n = n//10
   30     %repeat %until n = 0
   31     %if sign # 0 %start
   32        x = x-1;  s(x) = sign
   33     %finish
   34     %while x > p %cycle
   35        x = x-1;  s(x) = ' '
   36     %repeat
   37     x = x-1
   38     s(x) = 72-x
   39     %result = string(addr(s(x)))
   40  %end
   41  
   42     printstring(itos(n, p))
   43  %end
   44  
   45  %endofprogram
?MOUSESWRITE unused

   43 Statements compiled
