Trailing-Edge
-
PDP-10 Archives
-
ap-c800d-sb
-
symbol.mac
There are 7 other files named symbol.mac in the archive. Click here to see a list.
; UPD ID= 447 on 10/9/77 at 9:11 AM
TITLE SYMBOL FOR COBOL V12
SUBTTL SYMBOL TABLE DUMPER T. HESS (ALC)/ALB/CAM
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1974, 1979 BY DIGITAL EQUIPMENT CORPORATION
SEARCH P
%%P==:%%P
;EDITS
;V10*****************
;NAME DATE COMMENTS
;********************
TWOSEG
RELOC 400000
ENTRY DOSYM
;SET TO APPEND TO REL FILE IF AN OVERLAY FILE WAS WRITTEN, ELSE
;JUST CONTINUE WRITTING ON CURRENT BIN DEVICE.
DOSYM: MOVE PC,HILOC
MOVEM PC,END.PC
SKIPE BINDEV
SKIPE PRODSW ;IF THIS IS FOR PRODUCTION,
JRST DOSYM9 ; WE DON'T NEED TABLES
;INITIALIZE DATGRP AND GET SYMBOL PC
MOVEI TE,37
MOVEM TE,BLKTYP
PUSHJ PP,PDATI
MOVE PC,END.PC
MOVEM PC,DATGRP+2
MOVEM PC,NM.PC ;SAVE NAMTAB VALUE
PUSHJ PP,PUTZER ;WRITE ZERO IN FILE
PUSHJ PP,TABFIX ;FIX UP TABLES AND PUT OUT NAMTAB
MOVEM PC,DT.PC ;SAVE PNTR TO DATAB
PUSHJ PP,PUTZER ;ZEROTH WORD OF TABLE
PUSHJ PP,DODAT ;PUT OUT DATAB
MOVEM PC,PR.PC ;SAVE PNTR TO PROTAB
PUSHJ PP,PUTZER ;...
PUSHJ PP,DOPRO ;PUT OUT PROTAB
HRRI TA, -1(PC) ;SAVE ADDRESS OF THE LAST
HRLM TA, DT.PC ; ADDRESS IN THE USER'S PROGRAM.
MOVEM PC,%ES.PC
PUSHJ PP,CLRDAT
MOVEI TE,1
MOVEM TE,BLKTYP
JRST PDATI
DOSYM9: SETZM NM.PC##
SETZM DT.PC##
SETZM PR.PC##
POPJ PP,
;HERE TO PUT OUT DATAB
DODAT: MOVE DT,DATLOC
DODAT1: CAML DT,DATNXT
POPJ PP, ;NO MORE - RETURN
MOVEI TA,0
MOVE TB,1(DT) ;DUMP FIRST WORD
HRL TB,4(DT) ;PICK UP ADJUSTED NAMTAB LINK
HLLZS 4(DT) ;CLEAR RPWTAB LINK
PUSHJ PP,PUTDAT
HRRZI TA,1(DT) ;ITEM IN LINKAGE SECTION?
LDB TB,DA.LKS##
JUMPE TB,DODAT0 ;NO
LDB TC,DA.LVL## ;GET LEVEL #
MOVEI TA,2 ;YES, RELOCATE LEFT HALF (LINK PTR)
HLRZ TB,2(DT)
ADD TB,IMPPAR## ;BASE OF %PARAM
HRLZI TB,(TB)
CAIE TC,01 ;LEVEL 01 OR 77?
CAIN TC,77
MOVEM TB,CURHLD## ;YES, SAVE PTR
MOVE TB,CURHLD ;NO, GET PTR TO 01 LEVEL
HRR TB,2(DT) ;KEEP RH ABSOLUTE OFFSET
JRST DODAT5
DODAT0: MOVEI TA,1 ;RELOCATE 2ND WORD
MOVE TB,2(DT)
ADD TB,DATBAS
DODAT5: PUSHJ PP,PUTDAT
ADDI PC,2 ;ACCOUNT FOR THEM
MOVEI W1,5 ;ASSUME 5 WORDS ADDITIONAL
MOVEI TA,1(DT)
;SEE IF ITEM HAS PICTURE WORDS
LDB TD,DA.PWA
JUMPE TD,DODAT2
MOVEI W1,DA.EDW+4-2
LDB TE,DA.KEY ;ACCOUNT FOR ANY
ADD W1,TE ; KEYS
JRST DODAT3
;SEE IF ITEM IS SUBSCRIPTED
DODAT2: LDB TD,DA.SUB ;IS FIELD SUBSCRIPTED?
JUMPE TD,DODAT4 ;NO
ADDI W1,2 ;YES--ACCOUNT FOR 2 MORE WORDS
DODAT3: MOVEI TE,0
DPB TE,DA.DEP
DODAT4: ADD PC,W1 ;ACCOUNT FOR REST OF ENTRY
HRRZI TC,3(DT)
ADDI W1,1
HRLS W1
ADD DT,W1
MOVNI W1,-1(W1)
HRL TC,W1
MOVEI TA,0
MOVE TB,(TC)
PUSHJ PP,PUTDAT
AOBJN TC,.-2
AOBJN DT,DODAT1
;HERE TO PUT OUT PROTAB
DOPRO: MOVE DT,PROLOC
DOPRO1: CAML DT,PRONXT
POPJ PP, ;EXIT WHEN DONE
MOVEI TA,0 ;PUT OUT FIRST WORD
MOVE TB,1(DT)
HRL TB,4(DT)
PUSHJ PP,PUTDAT
MOVEI TA,1 ;PUT OUT SECOND WORD
MOVE TB,2(DT)
LDB TE,[POINT 7,3(DT),24]
JUMPN TE,DOPRO2
ADD TB,RESDNT
JRST DOPRO3
DOPRO2: ADD TB,NONRES
DOPRO3: PUSHJ PP,PUTDAT
MOVEI TA,0 ;PUT OUT THIRD WORD
MOVE TB,3(DT)
PUSHJ PP,PUTDAT
SETZB TA,TB ;PUT OUT ZERO FOR FOURTH WORD
PUSHJ PP,PUTDAT
IFN ANS74,<
SETZB TA,TB ;PUT OUT ZERO FOR FIFTH WORD
PUSHJ PP,PUTDAT
>
ADDI PC,SZ.PRO ;INCREMENT BY SIZE OF ENTRY
ADD DT,[SZ.PRO,,SZ.PRO]
JRST DOPRO1 ;LOOP
;HERE TO FIX UP NAMTAB PNTRS AND DUMP CONDENSED NAMTAB
TABFIX: MOVE OP,NM2LOC
MOVEI CT,1 ;INIT OFFSET IN NAMTAB
TABFX1: SKIPN TB,0(OP)
JRST TABFX7
ADD TB,NAMLOC
HRRZ TA,0(TB)
JUMPE TA,TABFX6 ;SKIP ENTRY IF NO POINTER
MOVE W1,TB ;SAVE PNTR TO ENTRY
PUSHJ PP,TABFX9 ;GET FIRST DATAB OR PROTAB LINK
JUMPE TA,TABFX6 ;IF NONE, FORGET IT
HRRM W2,0(W1) ;RESET LINK IN NAMTAB
TABFX2: HRRM CT,3(TA) ;SAVE NAMTAB LINK IN ITEM
HRRZ TA,0(TA) ;GET 'SAME NAME' LINK
JUMPE TA,TABFX5 ;IF NONE, WE ARE DONE WITH THIS NAME
PUSHJ PP,TABFX9 ;GO TO NEXT DATAB OR PROTAB ENTRY
JUMPN TA,TABFX2 ;LOOP IF ONE FOUND
TABFX5: HRRZ DT,NAMLOC
ADD DT,0(OP)
HRRZ TA,0(DT)
JUMPE TA,TABFX6 ;JUST SKIP IF NOTHING LEFT
HLLM DT,0(DT) ;STORE SIZE
HLRZ TA,DT
ADDI CT,1(TA) ;UPDATE NAMTAB OFFSET
MOVNI TA,1(TA)
HRL DT,TA ;FORM AOBJN WORD
MOVEI TA,0
MOVE TB,0(DT)
PUSHJ PP,PUTDAT
AOBJN DT,.-2
TABFX6: AOJA OP,TABFX1
HRL DT,TA ;FORM AOBJN WORD TO DATA ITEM
TABFX7: ADDI PC,-1(CT) ;UPDATE PC
PUTZER: SETZB TA,TB
PUSHJ PP,PUTDAT ;WRITE 0 IN FILE
ADDI PC,1
POPJ PP, ;RETURN
;FIND NEXT DATAB OR PROTAB ENTRY
TABFX9: MOVE W2,TA ;SAVE THE LINK
LDB TC,LNKCOD ;GET TABLE TYPE
JUMPE TC,TBFX9A ;IF ZERO, FORGET IT
PUSHJ PP,LNKSET ;CONVERT LINK TO ADDRESS
CAIE TC,TB.DAT ;IF DATAB
CAIN TC,TB.PRO ; OR PROTAB
POPJ PP, ; WE WIN
HRRZ TA,0(TA) ;IF 'SAME NAME' LINK IS NON-ZERO,
JUMPN TA,TABFX9 ; TRY THAT ONE,
POPJ PP, ; ELSE QUIT
TBFX9A: MOVEI TA,0
POPJ PP,
EXTERNAL PRODSW
EXTERNAL LNKSET,PUTDAT,CLRDAT,DATGRP,NAMLOC,PROLOC,DATLOC
EXTERNAL PRONXT,DATNXT,RESDNT,NONRES,DATBAS,BINHDR,BINBH
EXTERNAL SAVBIN,END.PC,%ES.PC,PDATI,HILOC
EXTERNAL BINDEV,BINBUF,BINPP,BLKTYP,NM2LOC,PUTBIN
EXTERNAL DA.PWA,DA.EDW,DA.SUB,DA.SNL,DA.VAL,DA.DEP,DA.KEY
EXTERNAL LNKCOD,TB.DAT,TB.PRO
END