      SUBROUTINE SETBIT( BUFFER, OFFSET, LENGTH )
C
C SET LENGTH BITS TO ONE STARTING AT OFFSET IN BUFFER
C
      INTEGER BUFFER(1), OFFSET, LENGTH
C
      INDEX = 1
      IOFF = OFFSET
      DO WHILE ( IOFF .GE. 32 )
       IOFF = IOFF - 32
       INDEX = INDEX + 1
      ENDDO
C
      NBITS = LENGTH
      DO WHILE ( NBITS .GT. 0 )
       BUFFER(INDEX) = IBSET( BUFFER(INDEX), IOFF )
       NBITS = NBITS - 1
       IOFF = MOD( IOFF+1, 32 )
       IF ( IOFF .EQ. 0 ) INDEX = INDEX + 1
      ENDDO
C
      RETURN
      END
