C  THIS ROUTINE STRIPS A CHARACTER OUT OF A CHARACTER
C  STRING IC.  N IS THE POSITION OF THE CHARACTER IN
C  THE STRING (CHAR NO. 1 ON UP).  THE ONLY BASIC NON-ANSI
C  FORTRAN IS THE LOGICAL MASKING OPERATIONS.  THE ONLY
C  OTHER REQUIREMENT IS THAT 2S COMPLIMENT + 1 NEGATION
C  IS EMPLOYED ON THE COMPUTER HARDWARE.
C
C**********************************************************
C	THE VAX 11/780 HAS CHARACTER BYTES STORED AS FOLLOWS:
C             4   -    3    -    2    -    1
C
C	THIS ROUTINE WAS ORGINALLY WRITTEN FOR MACHINES THAT
C	STORE THEM IN THE REVERSE ORDER.  THE VARIABLE "L" 
C	IS ADJUSTED TO COMPENSATE FOR THIS DIFFERENCE.
C	CINDY COOPER, JULY 31, 1981.
C**********************************************************
C
      INTEGER FUNCTION PXZ04(IC,N)
C
      CHARACTER IC(1)
C     DIMENSION IC(1),IK(3)
C
C  NOTE.. THIS SPECIFIC VERSION IS SET FOR THE VAX 11/780
C  SYSTEM WITH 8 BIT CHARACTERS, 4 CHARACTERS PER WORD.
C
c      DATA NCPW,NCPW1,MAS,MASN/4,3,256,255/
C     DATA IK/256,65536,16777216/
C
C  NCPW=NO. CHARACTERS PER IC WORD.
C  NCPW1=NCPW-1
C  MAS=2**(NO. BITS PER CHARACTER)
C  MASN=MAS-1
C
CC    L=(N+NCPW1)/NCPW
CC    IW=IC(L)
C
CC    L=L*NCPW-N
C	L MODIFIED TO POINT TO THE CORRECT BYTE.   CLC
	L = 3-L
CC    IF (L) 30,30,10
C  10 K=1
C
C  WHETHER FOLLOWING LOOP  IS FASTER THAN MAS**L
C   IS OPEN TO DEBATE....
C  C  DO 20 I=1,L
C  CC   K=K*MAS
C  20C  CONTINUE
C  C  IW=IAND(IW,(-K))/K
C  10 IW=IW/IK(L)
C  30 PXZ04=IAND(IW,MASN)
   30 PXZ04=ICHAR(IC(N))
C
      RETURN
C
      END

