      SUBROUTINE GET16 (KBUF,INDEX,IDATA)
C
C     NAME: GET16
C
C    LANGUAGE:  FORTRAN
C
C    OPERATING SYSTEM:  UNIVERSAL
C
C    ORDER NUMBER:  5428-SE
C
C    PART NUMBER:  000-026366  NOVEMBER 1985
C
C    PRODUCT:  UNIVERSAL VERSAPLOT COLOR RANDOM 2.0
C
C    VERSATEC, INC., SANTA CLARA, CALIFORNIA 95051
C    A XEROX COMPANY
C
C    Copyright (C) 1985 by Xerox Corporation.  All rights reserved.
C
C    "NOTICE. THIS PROGRAM IS THE EXCLUSIVE PROPERTY OF VERSATEC,
C    INC. AND IS ISSUED IN STRICT CONFIDENCE UNDER A PREARRANGED
C    LICENSE AGREEMENT AND IS NOT TO BE DISCLOSED IN ANY MANNER TO
C    PERSONS OUTSIDE THE LICENSED ORGANIZATION AND SHALL NOT BE
C    REPRODUCED OR DISSEMINATED, IN WHOLE OR PART, TO ANYONE OUTSIDE
C    THE LICENSED ORGANIZATION WITHOUT THE PRIOR WRITTEN APPROVAL OF
C    VERSATEC, INC. UNLESS OTHERWISE PROVIDED FOR BY SUCH LICENSE
C    AGREEMENT.  THIS WORK IS PROTECTED AS AN UNPUBLISHED WORK UNDER
C    THE COPYRIGHT ACT OF 1976."
C
C     GET16 - GET A 16-BIT CHUNK FROM INPUT BUFFER
C
C     LOCAL VARIABLES USED:
C            MSK16  - MASK USED TO OBTAIN LOWER 16 BITS OF WORD
C            NCHUNK - NUMBER OF 16-BIT CHUNKS PER "KBUF" WORD
C
C
C
      DIMENSION KBUF(1)
C
      DATA MSK16/65535/,NCHUNK/2/
C
C
      KWORD = INDEX/NCHUNK + 1
      KCHUNK = MOD (INDEX,NCHUNK) + 1
C
      ITEMP = KBUF(KWORD)
      GO TO (100,200),KCHUNK
C
  100 IDATA = IRAM (ITEMP,16,MSK16)
      RETURN
C
  200 IDATA = AND (ITEMP,MSK16)
      RETURN
C
      END
