      FUNCTION IHEXBN(IHEX)
C FUNCTION SUBROUTINE TO CONVERT ASCII HEX TO BINARY
C WHERE:
C      IHEX=   A WORD WITH 2 ASCII HEX DIGITS, 1ST IN LSB, 2ND IN MSB.
C      IHEXBN= BINARY BYTE RETURNED.
C
C FILED BY GLENN BEVER--28-JUN-79.
C          NASA DFRC
C          P.O. BOX 273
C          EDWARDS, CA   93523
C
C COMPILE AS FOLLOWS:
C
C  .R FORTRA
C  *IHEXBN=IHEXBN/U
C
      DIMENSION IBIN(2)
C 'DO 40' LOOP FIGURES BINARY VALUE FROM 2 HEX-ASCII DIGITS.
      DO 40 J=1,2
C GET DIGIT.
      IBIN(J)=IAND(IHEX,"177)
C IF ASCII 0-9.
      IF(IBIN(J).LE."71) IBIN(J)=IBIN(J)-"60
C IF ASCII A-F.
      IF(IBIN(J).GE."101) IBIN(J)=IBIN(J)-"67
C SWAP BYTES.
      IHEX=IRAM(IHEX,8,"177777)
   40 CONTINUE
C FORM BINARY NUMBER.
      IHEXBN=IBIN(2)+16*IBIN(1)
      RETURN
      END
