$STORAGE: 4
      SUBROUTINE RESHD(X)
      IMPLICIT INTEGER (A-Z)
      DIMENSION HLINE(120),OLINE(120)
	COMMON/HLNNN/HLINE,OLINE,M
	CHARACTER*1 IICH,IJCH
	DIMENSION IICH(32),IJCH(32)
      DIMENSION ICH(32),JCH(32)
	INTEGER*4 RQ,BL
	CHARACTER*4 CRQ,CBL
	EQUIVALENCE(CRQ,RQ),(CBL,BL)
      DATA CRQ/'   Q'/
      DATA CBL/'    '/
      DATA IICH/' ','1','2','3','4','5','6','7','8','9','A','B',
     1   'C','D','E','F','G','H','I','J','K','L','M','N','O','P',
     1   'Q','R','S','T','U','*'/
      DATA IJCH/'+','=',' ','=',' ','*',' ',' ',' ','X',' ',' ',' ',
     1   ' ','A',' ','B',' ',' ',' ','E',' ',' ',' ','H',' ','Q',
     1   ' ','Z','I','O','0'/
	DATA INIT/0/
	IF(INIT.NE.0)GOTO 7009
	INIT=1
	DO 7109 N=1,32
	ICH(N)=ICHAR(IICH(N))
	JCH(N)=ICHAR(IJCH(N))
	BL=32
7109	CONTINUE
7009	CONTINUE
      IF (X.NE.RQ) RETURN
      M=M-1
      DO 155 I=1,M
      DO 15 J=1,32
      IF (HLINE(I).EQ.ICH(J)) GO TO 155
   15 CONTINUE
      J=1
  155 HLINE(I)=J
      DO 1600 I=1,32
      IF (JCH(I).EQ.BL) GO TO 1600
      IP=0
      DO 1560 J=1,M
      OLINE(J)=BL
      IF (HLINE(J).LE.I) GO TO 1560
      OLINE(J)=JCH(I)
      IP=1
 1560 CONTINUE
      IF (IP.EQ.0) RETURN
      WRITE (6,1605) (OLINE(J),J=1,M)
 1600 CONTINUE
 1605 FORMAT ('+',15X,120A1)
      RETURN
      END



