*
* $Id$
*
* $Log$
* Revision 1.1  1996/03/08 15:21:50  mclareni
* Initial revision
*
*
#include "epio/pilot.h"
#if defined(CERNLIB_IBM)
      SUBROUTINE STOASC(SOURCE,N1,TARGET,N2,NCH)
C.+++++++ IBM VERSION ++++++++++
C. CONVERTS A HOLLERITH STRING FROM EBCDIC (IBM INTERNAL) TO ASCII
C.
C.  PARAMETERS
C.
C.  SOURCE     ARRAY CONTAINING THE EBCDIC STRING
C.  N1         FIRST CHARACTER IN SOURCE TO CONVERT
C.  TARGET     ARRAY RECEIVING THE ASCII STRING
C.  N2         FIRST CHARACTER POSITION OF CONVERTED STRING IN TARGET
C.  NCH        NUMBER OF CHARACTERS TO CONVERT
C.
C. THE ROUTINE ALLOWS THE SIMULTANEOUS CONVERSION AND CONCATENATION
C. OF A STRING. ON VAX, IBM ( NOT CDC ! ), SOURCE AND TARGET MAY OVERLAP
C. AS LONG AS N2.LE.N1  .
C.
      LOGICAL*1 SOURCE(NCH),TARGET(NCH)
#include "epio/asciiibm.inc"
      LOGICAL*1 ITASC1(256)
      EQUIVALENCE (ITASC1(1),ITASC4(1))
      LOGICAL*1 LK(4)
      EQUIVALENCE (K,LK(1))
      DATA IFI /0/, K/0/
      IF(IFI.NE.0)  GOTO 10
C--- INITIALIZE
      CALL CFRASC(IFI,0)
      IFI=1
   10 CONTINUE
      IF(NCH.LE.0)  GOTO 77777
      NS1=N1-1
      NS2=N2-1
      DO 20  I=1,NCH
      LK(4)= SOURCE(NS1+I)
      K=MAX0(K,1)
   20 TARGET(NS2+I)=ITASC1(K)
77777 RETURN
      END
#endif
