      subroutine xfer_11_6(a,i,b,j,n)

C Subroutine moves 8-bit unsigned samples from  a  to  b,  where they
C  are stored as 16-bit samples.

C WARNING: routine does not check that pointers remain within bounds

      integer*4     a(1)   ! input array (8-bit samples)
      integer*4     b(1)   ! output array (16-bit samples)
      integer*4     i      ! pointer to first byte in  a  to be transferred (0,1,2,...)
      integer*4     ia     ! word location corresponding to  i  (1,2,3,...)
      integer*4     ib     ! bit location corresponding to  i  (msb is 31, lsb is 0)
      integer*4     i0     ! working version of  i
      integer*4     k      ! do loop index
      integer*4     j      ! pointer to first sample in  b  to be filled (0,1,2,...)
      integer*4     ja     ! word location corresponding to  j  (1,2,3,...)
      integer*4     jb     ! bit location corresponding to  j  (msb is 31, lsb is 0)
      integer*4     j0     ! working version of  j
      integer*4     n      ! number of samples to be transferred


      if (n .le. 0) go to 90

      i0 = i
      j0 = j

      do k = 1,n

        ia = i0/4 + 1
        ib = 24 - 8*mod(i0,4)

        ja = j0/2 + 1
        jb = 16 - 16*mod(j0,2)

        call mvbits(a(ia),ib,8,b(ja),jb)

        i0 = i0 + 1
        j0 = j0 + 1

      end do

 90   continue
      return
      end
