C C X R E F C C CROSS REFERENCE C C This routine accepts an INDEX into the user symbol table C as well as the listing line number, and also an indication C as to whether the symbol was defined here or referenced here. C C The calling sequence is: C C CALL XREF(INDEX,LINCNT,INDIC) C C Where INDEX - is the USER SYMBOL TABLE index C LINCNT- is the line number in the listing C INDIC - is an indication of definition (-1) or C reference ( 1) C SUBROUTINE XREF(INDEX,LINCNT,INDIC) INCLUDE 'IODEVS.CMN' INCLUDE 'USRSYM.CMN' INCLUDE 'PRGDAT.CMN' INTEGER*4 FWDPNT,RECNO,LINENO,KEEP C IF (PASNUM.NE.2) RETURN ! ONLY ON PASS 2 IF (XRFUNT.LE.0) RETURN ! NO XRF RECNO = INDEX LINENO = LINCNT C IF (INDIC.GT.0) GO TO 5 ! DEF or REF READ (XRFUNT'RECNO) KEEP,FWDPNT ! DEF (first entry in list) WRITE (XRFUNT'RECNO) LINENO,FWDPNT RETURN C 5 READ (XRFUNT'RECNO) KEEP,FWDPNT ! then extend the link to the IF (FWDPNT.EQ.0) GO TO 10 ! end of the file with the RECNO = FWDPNT ! proper forward pointer GO TO 5 C 10 WRITE (XRFUNT'RECNO) KEEP,NEXTRC WRITE (XRFUNT'NEXTRC) LINENO,0 NEXTRC = NEXTRC+1 RETURN END