[net.sources] TEco, or was it macro linkr, anyway, here are some more informations

eric@tekadg.UUCP (eric) (01/30/85)

about using linkr and macro.  The following is a slightly edited version of the
words of tektronix!tekchips!toma, apparently the only intelligence associated
with macro and linkr.  You might as well continue to ask me questions about
this stuff so that tom doesn't get all pissed off about fourty people asking
him questions about something he did not decide to get involved in, unless of
course you have already realized that I am totally worthless and do nothing but
obscure things by standing in between.  Anyway,...

When I actually tried to run the binary produced by the commands I originally
gave, I discovered, (surprise!) that it crashed with an illegal instruction.
(Somebody told me this would happen before I decided I would have to try it
myself.)  Belatedly, (light bulb) "I wonder if that is what fixbin.c is for,
Duh?"  So, here with is also presented fixbin.c which you can cc and then
mv a.out fixbin and then fixbin teco.out and mv teco.out teco and finally
compat teco.  That actually did run so this time I actually tried it before I
claimed it.

So, here is tom's explaination of linkr and macro...., but I found that running
fixbin on the output of both "compat linkr teco tecoio" and
"compat linkr tecoio teco" produced a useable teco so his last statement is
not totally accurate.  (And neither was useable without fixbin!)

--------------------------------------------------------------------------------
macro and linkr are PDP-11 DEC compatible assembler/linker.
I don't have machine readable man pages nor do I have the sources, although
I have sources for linkr which allows overlays.
I have had problems with bad headers causing execution errors: In V7 UNIX on
the PDP11 the starting address field is ignored (!), and execution always
starts at zero.  In the compat "emulator" this field is obeyed!.

For macro, the following command line options are available:
-ls produce a listing file (extension .lst)
-cr produce cross reference (does not work)
-lp pipes listing through /bin/print
-no no .obj file is produced.
-xs:n allocates nK extra words of storage for symbol table (you may need this).
-ns no symbol output in objext modules (symbols used by ddt -- don't have)
-na:file  call object file by this name.

For linkr, the command line options are:

-ls produce load map (extension .map)
-cr 
-lp
-no
-xs:n
-p1 force non-sharable
-ns strip symbols from output
-na:file

That should get you going.  Remember that when you use the linker, tecoio
must be first since it has the entry point.  Therefore your executable will
be called tecoio.out unless you use the -na option.

Tom Almy
--------------------------------------------------------------------------------
|                              fixbin.c                                        |
--------------------------------------------------------------------------------
long lseek();

main(argc,argv)
int argc;
char *argv[];
{
	int fdes;
	int buffer=021046;
	if (argc!=2)
		{
		printf("Usage:%s filename",argv[0]);
		exit(0);
		}
	if ((fdes=open(argv[1],1))==-1)
		{
		printf("%s:Could not write file %s",argv[0],argv[1]);
		exit(0);
		}
	if (lseek(fdes,10L,0)!=10)
		{
		printf("%s:Could not find tenth byte in file %s",argv[0],
			argv[1]);
		exit(0);
		}
	if (write(fdes,&buffer,2)==-1) /* change starting address to zero */
		{
		perror(argv[0]);
		exit(0);
		}
	close(fdes);
}