      character*1 function uni2ascii (iarray,iwrd,ibyte)

C Function converts Univac 6-bit character to equivalent 8-bit ASCII character

      integer*4     iarray(1)    !array of Univac numbers and characters
      integer*4     ibyte        !byte number in the word which will be
                                 ! converted where bytes are counted 0,1,2,...
                                 ! and a byte has 6 bits
      integer*4     iwrd         !word number in the array where words are
                                 ! counted 0,1,2,... and a word is 36 bits

      integer*4     jwrd         !32-bit word pointer in iarray (1,2,3,...)
      integer*4     jbit         !bit position in iarray (31,30,...0)

      integer*4     jchar        !6-bit number representing Univac character

      integer*4     conv(64)     !conversion array from Univac numbers
                                 ! to ASCII equivalents

      integer*4     get_bits     !integer function

      data          conv /32,32,32,32,32,32,65,66,
     *                    67,68,69,70,71,72,73,74,
     *                    75,76,77,78,79,80,81,82,
     *                    83,84,85,86,87,88,89,90,
     *                    41,45,43,60,61,62,38,36,
     *                    42,40,37,58,63,33,44,92,
     *                    48,49,50,51,52,53,54,55,
     *                    56,57,39,59,47,46,32,32/


C Initializations

      jchar = 0


C Translate 36-bit pointer to 32-bit pointers

      jwrd = (iwrd*36 + ibyte*6)/32 + 1
      jbit = 31 - (iwrd*36 + ibyte*6 - 32*(jwrd-1))


C Extract 6 bits from Univac array; convert to ASCII

      jchar = get_bits(iarray,jwrd,jbit,6)

      uni2ascii = char(conv(jchar+1))


C Exit

      return
      end
