! Integer Perm for Mercury Autocode

       subroutine sp
       write (6,'(A1)',advance='NO') ' '
       end subroutine

       subroutine nl
       write (6,*)
       end subroutine

       subroutine pc(c)
       character*1 c
       write (6,'(A1)',advance='NO') c
       end

       subroutine ca
       common tx
       character*70 tx
       write (6,*) tx
       end

       function Fisquare (n)
C Test function. All fns return real values
       Fisquare = n*n
       end 
 

       subroutine pr(x, n, m)
C 1st argument must always be real
C n+m<9 at present
       character*1 d, w, itoc
       character*8 form
       if (m==0) then 
        w = itoc(n)
        form = '(I' // w // ')'
        i = ifix(x)
        write (6,form,advance='NO') i
        return
       else
        d = itoc(m)
        w = itoc(m+n+1)
        form = '(F' // w // '.' // d // ')'
        write (6,form,advance='NO') x
       end if
       end subroutine


       character*1 function itoc (n)
       character*10 d 
       d = '0123456789'
       itoc = '?'
       if (c<0) return
       if (c>9) return
       itoc = d(n+1:n+1)
       end

       subroutine itos2 (n, s, l)
       character*(*) s
       character*1 itoc
       integer n, l, i
       if (n<10) then
        l=1
        s(1:1) = itoc (n)
        return
       end if
        m1 = n/10
        m0 = n-10*m
        s(2:2) = itoc(m0)
        s(1:1) = itoc(m1)
        l=2
       end
