INTEGER A$BUF(200) INTEGER AP,TERMO0,INITO0,MAINO0 INTEGER GETARG,MAPDN,PARSCL,LENGTH,INDEX INTEGER FD INTEGER MKTEMP INTEGER ARG(102),OUTPU0(102),FILE(102) INTEGER SEGME0(102) INTEGER DEFAU0(3) INTEGER SEGMF0(5) INTEGER DEFAV0(5) INTEGER COMMO0(5) INTEGER DEFAW0(5) INTEGER DEFAX0(5) INTEGER SWTCM0(11) INTEGER SWTTP0(12) INTEGER AAAAA0 INTEGER AAAAB0 INTEGER AAAAC0 INTEGER AAAAD0 INTEGER AAAAE0 INTEGER AAAAF0(91) INTEGER AAAAG0(7) INTEGER AAAAH0(29) INTEGER AAAAI0(3) INTEGER AAAAJ0(3) INTEGER CTOC INTEGER AAAAK0 INTEGER AAAAL0(7) INTEGER AAAAM0(3) INTEGER AAAAN0(3) INTEGER AAAAO0 INTEGER AAAAP0(3) INTEGER AAAAQ0(3) INTEGER AAAAR0(32),AAAAS0(32) INTEGER EXPAND INTEGER AAAAT0(11) INTEGER AAAAU0(9) INTEGER AAAAV0(9) INTEGER AAAAW0(29) INTEGER AAAAX0(7) INTEGER AAAAY0(11) INTEGER AAAAZ0(7) INTEGER AAABA0(8) INTEGER AAABB0(18) INTEGER AAABC0(9) INTEGER AAABD0(8) INTEGER AAABE0(18) INTEGER AAABF0(7) INTEGER AAABG0(8) INTEGER AAABH0(18) INTEGER AAABI0(11) INTEGER AAABJ0(21) INTEGER AAABK0(7) DATA DEFAU0/174,174,0/ DATA SEGMF0/180,176,176,176,0/ DATA DEFAV0/180,176,176,176,0/ DATA COMMO0/180,176,176,177,0/ DATA DEFAW0/180,176,176,177,0/ DATA DEFAX0/180,176,176,176,0/ DATA SWTCM0/180,176,180,176,160,177,176,176,176,176,0/ DATA SWTTP0/178,176,179,176,160,177,178,176,176,176,176,0/ DATA TERMO0/0/,INITO0/0/,MAINO0/0/,FD/-3/ DATA AAAAF0/219,173,225,226,228,230,232,238,240,245,246,247,221,16 *0,219,173,239,188,242,229,241,160,243,244,242,190,221,160,173,243, *188,233,231,238,190,160,173,237,188,233,231,238,190,160,173,236,18 *8,233,231,238,190,173,233,188,233,231,238,190,160,173,244,188,233, *231,238,190,160,173,231,188,233,231,238,190,160,173,229,188,233,23 *1,238,190,160,173,227,188,233,231,238,190,0/ DATA AAAAG0/246,236,160,163,170,238,0/ DATA AAAAH0/227,239,240,249,160,170,243,180,176,176,176,160,170,24 *3,160,173,228,229,236,229,244,229,160,173,238,241,170,238,0/ DATA AAAAI0/174,226,0/ DATA AAAAJ0/174,239,0/ DATA AAAAL0/246,243,247,244,236,226,0/ DATA AAAAM0/174,239,0/ DATA AAAAN0/174,237,0/ DATA AAAAP0/174,239,0/ DATA AAAAQ0/174,237,0/ DATA AAAAT0/227,239,160,225,226,160,170,243,170,238,0/ DATA AAAAU0/189,227,237,223,236,239,227,189,0/ DATA AAAAV0/189,244,240,223,236,239,227,189,0/ DATA AAAAW0/243,249,160,243,247,244,164,227,237,160,170,243,170,23 *8,243,249,160,243,247,244,164,244,240,160,170,243,170,238,0/ DATA AAAAX0/227,164,237,225,233,238,0/ DATA AAAAY0/227,227,237,225,233,238,174,226,233,238,0/ DATA AAAAZ0/227,233,239,236,233,226,0/ DATA AAABA0/236,239,160,170,243,170,238,0/ DATA AAABB0/243,175,236,239,160,170,243,160,176,160,170,243,160,17 *0,243,170,238,0/ DATA AAABC0/246,243,247,244,237,225,244,232,0/ DATA AAABD0/236,239,160,170,243,170,238,0/ DATA AAABE0/243,175,236,239,160,170,243,160,176,160,170,243,160,17 *0,243,170,238,0/ DATA AAABF0/246,243,232,236,233,226,0/ DATA AAABG0/236,239,160,170,243,170,238,0/ DATA AAABH0/243,175,236,239,160,170,243,160,176,160,170,243,160,17 *0,243,170,238,0/ DATA AAABI0/236,233,160,227,227,236,233,226,170,238,0/ DATA AAABJ0/243,175,236,233,160,227,227,236,233,226,160,176,160,17 *0,243,160,170,243,170,238,0/ DATA AAABK0/246,243,247,244,236,226,0/ IF((PARSCL(AAAAF0,A$BUF).NE.-3))GOTO 10005 AAAAA0=1 GOTO 10000 10006 CONTINUE 10005 IF((A$BUF(240-225+1).NE.0))GOTO 10008 IF((A$BUF(225-225+1).NE.0))GOTO 10008 GOTO 10007 10008 CALL SCOPY(DEFAX0,1,DEFAW0,1) CALL SCOPY(DEFAX0,1,COMMO0,1) 10007 CALL CTOC(DEFAU0,SEGME0,102) FD=MKTEMP(3) IF((FD.NE.-3))GOTO 10009 CALL ERROR('can''t open temporary file.') 10009 AAAAE0=1 GOTO 10004 10010 CALL REWIND(FD) CALL PRINT(-11,'swtseg*n.') IF((A$BUF(228-225+1).EQ.0))GOTO 10011 CALL PRINT(-11,'vl *s*n.',OUTPU0) CALL FCOPY(FD,-11) CALL PRINT(-11,'q*n.') GOTO 10012 10011 CALL PRINT(-11,AAAAG0) CALL FCOPY(FD,-11) CALL PRINT(-11,'re*nsh*n*s*ndelete*nq*n.',SEGME0) IF((INDEX(OUTPU0,190).NE.0))GOTO 10013 CALL PRINT(-11,'cname *s4000 *s*n.',SEGME0,OUTPU0) GOTO 10014 10013 CALL PRINT(-11,AAAAH0,SEGME0,OUTPU0) 10014 CONTINUE 10012 CALL RMTEMP(FD) CALL REMOVE(A$BUF(A$BUF(239-225+27))) CALL SWT 10004 IF((A$BUF(238-225+1).NE.0))GOTO 10015 AAAAB0=1 GOTO 10001 10016 CONTINUE 10015 AP=1 GOTO 10019 10017 AP=AP+(1) 10019 IF((GETARG(AP,ARG,102).EQ.-1))GOTO 10018 IF((ARG(1).EQ.173))GOTO 10020 IF((A$BUF(A$BUF(239-225+27)).NE.0))GOTO 10021 CALL SUFFIX(ARG,AAAAI0,FILE,AAAAJ0) IF((A$BUF(239-225+1).EQ.2))GOTO 10022 A$BUF(239-225+27)=A$BUF(53) A$BUF(53)=A$BUF(53)+(1+CTOC(FILE,A$BUF(A$BUF(53)),200)) 10022 CONTINUE 10021 AAAAC0=1 GOTO 10002 10023 CALL MKTREE(ARG,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10024 CALL PRINT(FD,'lo *s*n.',FILE) GOTO 10025 10024 CALL PRINT(FD,'s/lo *s 0 *s *s*n.',FILE,SEGMF0,SEGMF0) 10025 GOTO 10026 10020 IF((ARG(3).EQ.0))GOTO 10027 AAAAA0=2 GOTO 10000 10028 GOTO 10029 10027 AAAAK0=MAPDN(ARG(2)) GOTO 10030 10031 IF((GETARG(AP+1,ARG,102).EQ.-1))GOTO 10033 IF((ARG(1).EQ.173))GOTO 10033 GOTO 10032 10033 AAAAA0=3 GOTO 10000 10034 CONTINUE 10032 AP=AP+(1) CALL PRINT(FD,'*s*n.',ARG) GOTO 10035 10036 IF((GETARG(AP+1,ARG,102).EQ.-1))GOTO 10038 IF((ARG(1).EQ.173))GOTO 10038 GOTO 10037 10038 CALL SCOPY(AAAAL0,1,ARG,1) GOTO 10039 10037 AP=AP+(1) 10039 AAAAC0=2 GOTO 10002 10040 CALL MAKEL0(ARG,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10041 CALL PRINT(FD,'lo *s*n.',FILE) GOTO 10042 10041 CALL PRINT(FD,'s/lo *s 0 *s *s*n.',FILE,SEGMF0,SEGMF0) 10042 GOTO 10035 10043 IF((GETARG(AP+1,ARG,102).EQ.-1))GOTO 10045 IF((ARG(1).EQ.173))GOTO 10045 GOTO 10044 10045 ARG(1)=0 GOTO 10046 10044 AP=AP+(1) 10046 IF((ARG(1).NE.0))GOTO 10047 CALL SUFFIX(A$BUF(A$BUF(239-225+27)),AAAAM0,FILE,AAAAN0) CALL MKTREE(FILE,FILE) GOTO 10048 10047 CALL MKTREE(ARG,FILE) 10048 CALL PRINT(FD,'ma *s*n.',FILE) GOTO 10035 10049 AAAAB0=2 GOTO 10001 10050 GOTO 10035 10051 AAAAD0=1 GOTO 10003 10052 GOTO 10035 10053 IF((GETARG(AP+1,ARG,102).EQ.-1))GOTO 10055 IF((ARG(1).EQ.173))GOTO 10055 GOTO 10054 10055 ARG(1)=0 GOTO 10056 10054 AP=AP+(1) 10056 IF((ARG(1).NE.0))GOTO 10057 CALL CTOC(DEFAU0,SEGME0,102) GOTO 10058 10057 IF((LENGTH(ARG).LE.28))GOTO 10059 CALL RMTEMP(FD) CALL ERROR('string following -g must be 28 chars long *or less.') GOTO 10060 10059 CALL CTOC(ARG,SEGME0,102) 10060 CONTINUE 10058 GOTO 10035 10061 IF((GETARG(AP+1,ARG,102).EQ.-1))GOTO 10063 IF((ARG(1).EQ.173))GOTO 10063 GOTO 10062 10063 ARG(1)=0 GOTO 10064 10062 AP=AP+(1) 10064 IF((ARG(1).NE.0))GOTO 10065 CALL CTOC(DEFAV0,SEGMF0,5) GOTO 10066 10065 CALL CTOC(ARG,SEGMF0,5) 10066 GOTO 10035 10067 IF((GETARG(AP+1,ARG,102).EQ.-1))GOTO 10069 IF((ARG(1).EQ.173))GOTO 10069 GOTO 10068 10069 ARG(1)=0 GOTO 10070 10068 AP=AP+(1) 10070 IF((ARG(1).NE.0))GOTO 10071 CALL CTOC(DEFAW0,COMMO0,5) GOTO 10072 10071 CALL CTOC(ARG,COMMO0,5) 10072 CALL PRINT(FD,'co ab *s*n.',COMMO0) GOTO 10035 10030 AAAAO0=AAAAK0-226 GOTO(10067,10073,10061,10073,10053,10073,10049,10073,10073,1 *0036,10043,10073,10073,10073,10073,10073,10031,10051),AAAAO0 10073 AAAAA0=4 GOTO 10000 10074 CONTINUE 10035 CONTINUE 10029 CONTINUE 10026 GOTO 10017 10018 IF((A$BUF(238-225+1).NE.0))GOTO 10075 AAAAD0=2 GOTO 10003 10076 CONTINUE 10075 IF((A$BUF(245-225+1).EQ.0))GOTO 10077 CALL PRINT(FD,'ma 6*n.') 10077 IF((A$BUF(230-225+1).EQ.0))GOTO 10078 CALL SUFFIX(A$BUF(A$BUF(239-225+27)),AAAAP0,FILE,AAAAQ0) CALL MKTREE(FILE,FILE) CALL PRINT(FD,'ma *s*n.',FILE) 10078 CALL MKTREE(A$BUF(A$BUF(239-225+27)),OUTPU0) GOTO 10079 10001 IF((A$BUF(228-225+1).NE.0))GOTO 10080 CALL PRINT(FD,AAAAT0,COMMO0) 10080 IF((EXPAND(AAAAU0,AAAAR0,32).NE.-3))GOTO 10081 CALL SCOPY(SWTCM0,1,AAAAR0,1) 10081 IF((EXPAND(AAAAV0,AAAAS0,32).NE.-3))GOTO 10082 CALL SCOPY(SWTTP0,1,AAAAS0,1) 10082 CALL PRINT(FD,AAAAW0,AAAAR0,AAAAS0) IF((A$BUF(232-225+1).NE.0))GOTO 10083 CALL PRINT(FD,'mi*n.') 10083 GOTO 10084 10002 IF((A$BUF(226-225+1).EQ.0))GOTO 10085 IF((MAINO0.NE.0))GOTO 10085 CALL MAKEL0(AAAAX0,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10086 CALL PRINT(FD,'lo *s*n.',FILE) GOTO 10087 10086 CALL PRINT(FD,'s/lo *s 0 *s *s*n.',FILE,SEGMF0,SEGMF0) 10087 MAINO0=1 10085 IF((A$BUF(247-225+1).EQ.0))GOTO 10088 IF((MAINO0.NE.0))GOTO 10088 CALL MAKEL0(AAAAY0,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10089 CALL PRINT(FD,'lo *s*n.',FILE) GOTO 10090 10089 CALL PRINT(FD,'s/lo *s 0 *s *s*n.',FILE,SEGMF0,SEGMF0) 10090 MAINO0=1 10088 GOTO 10091 10003 IF((TERMO0.NE.0))GOTO 10092 IF((A$BUF(240-225+1).EQ.0))GOTO 10093 IF((A$BUF(228-225+1).EQ.0))GOTO 10094 CALL PRINT(FD,'li pl1glb*n.') GOTO 10095 10094 CALL PRINT(FD,'s/li pl1glb 0 *s *s*n.',SEGMF0,SEGMF0) 10095 CONTINUE 10093 IF((A$BUF(225-225+1).EQ.0))GOTO 10096 IF((A$BUF(228-225+1).EQ.0))GOTO 10097 CALL PRINT(FD,'li paslib*n.') GOTO 10098 10097 CALL PRINT(FD,'s/li paslib 0 *s *s*n.',SEGMF0,SEGMF0) 10098 CONTINUE 10096 IF((A$BUF(226-225+1).EQ.0))GOTO 10099 CALL MAKEL0(AAAAZ0,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10100 CALL PRINT(FD,AAABA0,FILE) GOTO 10101 10100 CALL PRINT(FD,AAABB0,FILE,SEGMF0,SEGMF0) 10101 CALL MAKEL0(AAABC0,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10102 CALL PRINT(FD,AAABD0,FILE) GOTO 10103 10102 CALL PRINT(FD,AAABE0,FILE,SEGMF0,SEGMF0) 10103 CALL MAKEL0(AAABF0,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10104 CALL PRINT(FD,AAABG0,FILE) GOTO 10105 10104 CALL PRINT(FD,AAABH0,FILE,SEGMF0,SEGMF0) 10105 CONTINUE 10099 IF((A$BUF(247-225+1).EQ.0))GOTO 10106 IF((A$BUF(228-225+1).EQ.0))GOTO 10107 CALL PRINT(FD,AAABI0,FILE) GOTO 10108 10107 CALL PRINT(FD,AAABJ0,FILE,SEGMF0,SEGMF0) 10108 CONTINUE 10106 CALL MAKEL0(AAABK0,FILE) IF((A$BUF(228-225+1).EQ.0))GOTO 10109 CALL PRINT(FD,'lo *s*nli*n.',FILE) GOTO 10110 10109 CALL PRINT(FD,'s/lo *s 0 *s *s*ns/li 0 *s *s*n.',FILE,SEGMF0,S *EGMF0,SEGMF0,SEGMF0) 10110 CONTINUE 10092 TERMO0=1 GOTO 10111 10000 IF((FD.EQ.-3))GOTO 10112 CALL RMTEMP(FD) 10112 CALL REMARK('Usage: ld -{a|b|d|f|h|n|p|u|w} [-o ].') CALL REMARK(' { | -m [] | -s .') CALL REMARK(' | -l [] | -i | -t | -g .') CALL REMARK(' | -e | -c }.') CALL SETERR(1000) CALL SWT 10091 GOTO(10023,10040),AAAAC0 GOTO 10091 10113 GOTO(10006,10028,10034,10074),AAAAA0 GOTO 10113 10084 GOTO(10016,10050),AAAAB0 GOTO 10084 10079 GOTO 10010 10111 GOTO(10052,10076),AAAAD0 GOTO 10111 END SUBROUTINE MKTREE(STR,OUT) INTEGER STR(1),OUT(1) INTEGER I INTEGER MKTR$,INDEX INTEGER IN(102) CALL EXPAND(STR,IN,102) IF((INDEX(IN,175).NE.0))GOTO 10114 IF((INDEX(IN,220).NE.0))GOTO 10114 CALL SCOPY(IN,1,OUT,1) RETURN 10114 OUT(1)=167 I=MKTR$(IN,OUT(2))+2 OUT(I)=167 OUT(I+1)=0 RETURN END SUBROUTINE MAKEL0(NAME,FILE) INTEGER NAME(1),FILE(1) INTEGER STR(102) INTEGER AAABL0(12) DATA AAABL0/189,238,229,247,236,233,226,189,175,170,243,0/ CALL ENCODE(STR,102,AAABL0,NAME) CALL MKTREE(STR,FILE) RETURN END SUBROUTINE SUFFIX(SRC,SSUFF,DEST,DSUFF) INTEGER SRC(1),SSUFF(1),DEST(1),DSUFF(1) INTEGER SUFF(102) INTEGER LENGTH,EQUAL CALL STAKE(SRC,SUFF,-LENGTH(SSUFF)) IF((EQUAL(SUFF,SSUFF).NE.1))GOTO 10115 CALL SDROP(SRC,DEST,-LENGTH(SUFF)) GOTO 10116 10115 CALL SCOPY(SRC,1,DEST,1) 10116 CALL SCOPY(DSUFF,1,DEST,LENGTH(DEST)+1) RETURN END C ---- Long Name Map ---- C segmentname segme0 C termout termo0 C defaultsegmentname defau0 C swtcmloc swtcm0 C putloadmain putlo0 C makelibname makel0 C commonsegment commo0 C defaultcommonsegment defaw0 C outputfile outpu0 C segmentno segmf0 C defaultsegmentno defav0 C putinitcommands putin0 C createloadercommands creat0 C defaultpl1commonsegment defax0 C mainout maino0 C swttploc swttp0 C puttermcommands putte0 C initout inito0