The Unix Heritage Society mailing list
 help / color / Atom feed
* [TUHS] Unix V6: Assembler Listings
@ 2020-06-11 11:38 Paul Riley
  2020-06-11 12:55 ` Clem Cole
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Riley @ 2020-06-11 11:38 UTC (permalink / raw)
  To: tuhs


[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

Team,

I am now writing code in assembly for the PDP-11. I remember reading
somewhere that the output from "AS" (my caps) is a bit meagre. I can't find
an option to produce a text listing. Is it possible from AS, using command
options (I can't see one)  or perhaps from "LD"?

Paul

*Paul Riley*

[-- Attachment #2: Type: text/html, Size: 722 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [TUHS] Unix V6: Assembler Listings
  2020-06-11 11:38 [TUHS] Unix V6: Assembler Listings Paul Riley
@ 2020-06-11 12:55 ` Clem Cole
       [not found]   ` <9CCCBCA1-DD64-49EA-AD3E-8E2B9C548B99@icloud.com>
  0 siblings, 1 reply; 6+ messages in thread
From: Clem Cole @ 2020-06-11 12:55 UTC (permalink / raw)
  To: Paul Riley; +Cc: tuhs


[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

If you want something like this, there is a DEC Macro-11 compatible
assembler in C originally for V6 kicking around.   IIRC it was first on the
Harvard tape in about 1977-78.   Last winter there was a large discussion
about it and I believe a fairly current version that can be compiled with
modern compilers can be found here: https://github.com/Rhialto/macro11

On Thu, Jun 11, 2020 at 7:39 AM Paul Riley <paul@rileyriot.com> wrote:

> Team,
>
> I am now writing code in assembly for the PDP-11. I remember reading
> somewhere that the output from "AS" (my caps) is a bit meagre. I can't find
> an option to produce a text listing. Is it possible from AS, using command
> options (I can't see one)  or perhaps from "LD"?
>
> Paul
>
> *Paul Riley*
>
>

[-- Attachment #2: Type: text/html, Size: 1561 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [TUHS] Unix V6: Assembler Listings
       [not found]   ` <9CCCBCA1-DD64-49EA-AD3E-8E2B9C548B99@icloud.com>
@ 2020-06-11 13:40     ` Clem Cole
  2020-06-11 14:56       ` Warner Losh
  0 siblings, 1 reply; 6+ messages in thread
From: Clem Cole @ 2020-06-11 13:40 UTC (permalink / raw)
  To: Paul Riley; +Cc: tuhs


[-- Attachment #1: Type: text/plain, Size: 2745 bytes --]

below...

On Thu, Jun 11, 2020 at 9:04 AM Paul Riley <pdr0663@icloud.com> wrote:

> Clem,
>
> Thanks for that. So this would compile on modern machines to a cross
> compiler for V6 also running on a modern machine? I note you say macro11,
> so not a Unix “as” style syntax, is that right?
>
Yes - the AT&T syntax was much simpler/less sugar than the DEC assembler.
 But the differences are pretty easy to see.  IIRC that assembler generates
DEC style linker objects and there is a companion linker that can create
DEC binary objects (*i.e.* 'obj' files) as well as traditional UNIX a.out
format.   The entire tool suite was created originally to move code from
RT-11 to UNIX at Harvard and passed around the nascent USENIX community.
 IIRC that version was forked from a BSD 2.x/NetBSD source repository and
folks were adding some fields/features in the DEC obj format that RSX
supported that RT-11 did not.

Go hunting and see what you find.  My memory was that with the BSD 2.x
project, somebody added a DEC obj to UNIX binary (a.out) converter tool, so
that you could use ld(1) instead of using the DEC style linker that had
been included in the original.

It has been >>years<< since I was really familiar with any of this stuff.
 A question about it came up last fall/winter on the simh mailing listing,
which is where I found the the URL.

FWIW: I offered the modern port, assuming you might want to run some of it
as a cross-systems on a newer OS with a modern compiler.   But if you are
content running this on V6, then you might just want to go back to the
original.  As I said, my memory is that's in the original USENIX Harvard
tape.   All that should be Warner's archives if not other places on the
Internet.

Just remember that a big problem with the original code is that it will be
written in pre-'White Book' C (that many of us learned years ago  - not
even ANSI of Second edition - this used Lesk's portable C library etc.).
 It sometimes looks a little strange to modern eyes.  Also if you go
looking,  IIRC, someone at Harvard ported the DEC Macro RT-11 library to
UNIX v6.  In the late 1970s, I remember tjk, Danny Klein, Tron McConnell
and I, plus some of the folks over in the bio-med group (whose names I have
forgotten) had to a number assembler codes that had been written for the
earlier RT-11 systems to Unix for one of the projects we had.  Some of it
got re-written in C, but I do remember we managed to use the Harvard
assembler somehow for parts of it.   If my memory is correct, early VMS and
messing with BLISS compatibility could have been mixed up in the project
somehow, but I've long forgotten the details of what we were doing at the
time.

Have fun.

[-- Attachment #2: Type: text/html, Size: 4091 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [TUHS] Unix V6: Assembler Listings
  2020-06-11 13:40     ` Clem Cole
@ 2020-06-11 14:56       ` Warner Losh
  0 siblings, 0 replies; 6+ messages in thread
From: Warner Losh @ 2020-06-11 14:56 UTC (permalink / raw)
  To: Clem Cole; +Cc: tuhs


[-- Attachment #1: Type: text/plain, Size: 4767 bytes --]

On Thu, Jun 11, 2020 at 7:41 AM Clem Cole <clemc@ccc.com> wrote:

> below...
>
> On Thu, Jun 11, 2020 at 9:04 AM Paul Riley <pdr0663@icloud.com> wrote:
>
>> Clem,
>>
>> Thanks for that. So this would compile on modern machines to a cross
>> compiler for V6 also running on a modern machine? I note you say macro11,
>> so not a Unix “as” style syntax, is that right?
>>
> Yes - the AT&T syntax was much simpler/less sugar than the DEC assembler.
>  But the differences are pretty easy to see.  IIRC that assembler generates
> DEC style linker objects and there is a companion linker that can create
> DEC binary objects (*i.e.* 'obj' files) as well as traditional UNIX a.out
> format.   The entire tool suite was created originally to move code from
> RT-11 to UNIX at Harvard and passed around the nascent USENIX community.
>  IIRC that version was forked from a BSD 2.x/NetBSD source repository and
> folks were adding some fields/features in the DEC obj format that RSX
> supported that RT-11 did not.
>
> Go hunting and see what you find.  My memory was that with the BSD 2.x
> project, somebody added a DEC obj to UNIX binary (a.out) converter tool, so
> that you could use ld(1) instead of using the DEC style linker that had
> been included in the original.
>

It's hard to trace. There's one on the UNSW distributions called
macro-linkr with file dates from 76 in
tuhs/Distributions/UNSW/7/source/macro-linkr (the last few elements in the
path are from an extracted tarball). The 2.9 and newer has a m11 command
that looks like a macro assembler. 2.79 (from 1980) has a number of lisp
source files that are in m11 with Harvard copyrights on them. There's a
file called 'macro' that is a binary and another called 'linkr'. The UBC
tapes posted here a while ago had rt11 emulators of various flavors (from
libraries to trap interception) and those were dated in the 76-80 time
frame. These dates seem to line up with the lisp that's on the 77 usenix
tape we have, but I've delved no further there since there's no sources.

There's also a macro/linker from stanford on the 81 tape... But it says
it's from Harvard:

>> This directory contains the sources for a version of MACRO assembly
language
>> for the PDP-11.  It produces Version 6 Unix executables that run under
.> the compatibility package on the vax.  They are essentially unmodified
from
>> those distributed on the 2nd Unix Users group distribution tape from
Harvard.
>> The only change was to make dates on listings work beyond 1979.

NetBSD, as cool as it is,  is about a decade and a half too recent :)

The 2.9BSD and newer have the m11 sources, but they are written in m11.
I've not seen if apout can be used to compile/assemble them on modern
hardware.

It has been >>years<< since I was really familiar with any of this stuff.
>  A question about it came up last fall/winter on the simh mailing listing,
> which is where I found the the URL.
>
> FWIW: I offered the modern port, assuming you might want to run some of it
> as a cross-systems on a newer OS with a modern compiler.   But if you are
> content running this on V6, then you might just want to go back to the
> original.  As I said, my memory is that's in the original USENIX Harvard
> tape.   All that should be Warner's archives if not other places on the
> Internet.
>

Yea, that's the stuff I talked about in my talks... The files I think are
somewhere in tuhs/Applications/Usenix_77, though I've not diving in too
deeply there this morning.


> Just remember that a big problem with the original code is that it will be
> written in pre-'White Book' C (that many of us learned years ago  - not
> even ANSI of Second edition - this used Lesk's portable C library etc.).
>  It sometimes looks a little strange to modern eyes.  Also if you go
> looking,  IIRC, someone at Harvard ported the DEC Macro RT-11 library to
> UNIX v6.  In the late 1970s, I remember tjk, Danny Klein, Tron McConnell
> and I, plus some of the folks over in the bio-med group (whose names I have
> forgotten) had to a number assembler codes that had been written for the
> earlier RT-11 systems to Unix for one of the projects we had.  Some of it
> got re-written in C, but I do remember we managed to use the Harvard
> assembler somehow for parts of it.   If my memory is correct, early VMS and
> messing with BLISS compatibility could have been mixed up in the project
> somehow, but I've long forgotten the details of what we were doing at the
> time.
>

The files are in the TUHS archive for the curious, but the github stuff
looks like the best place to start...


> Have fun.
>

Definitely. You could spend weeks exploring this area...

Warner

[-- Attachment #2: Type: text/html, Size: 6754 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [TUHS] Unix V6: Assembler Listings
  2020-06-11 15:26 Paul Ruizendaal
@ 2020-06-11 15:57 ` Warner Losh
  0 siblings, 0 replies; 6+ messages in thread
From: Warner Losh @ 2020-06-11 15:57 UTC (permalink / raw)
  To: Paul Ruizendaal; +Cc: TUHS main list


[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

On Thu, Jun 11, 2020 at 9:27 AM Paul Ruizendaal <pnr@planet.nl> wrote:

>
> > I am now writing code in assembly for the PDP-11. I remember reading
> > somewhere that the output from "AS" (my caps) is a bit meagre. I can't
> find
> > an option to produce a text listing. Is it possible from AS, using
> command
> > options (I can't see one)  or perhaps from "LD"?
> >
> > Paul
> >
> > *Paul Riley*
>
> I had the same problem. As I was porting to a different mini I had to
> write a new assembler. As you have undoubtedly seen, early ‘as’ was written
> in assembler and not so easy to use as a base. Hence I used Richard’s
> Miller’s AS for the Interdata as a base (available on Tuhs):
> https://www.tuhs.org/cgi-bin/utree.pl?file=Interdata732/usr/source/as
>
> Later I discovered that the TUHS archive has source code for the original
> ‘as’ rewritten in C, a work by Roger Jaeger:
> https://minnie.tuhs.org/Archive/Distributions/USDL/Mini-Unix/
>
> Maybe adding a listing module to this version of ‘as’ is another possible
> route.


There's also
https://minnie.tuhs.org/cgi-bin/utree.pl?file=2.11BSD/src/new/m11/macxrf.c
which
looks to be decent or better K&R code from a quick look, but I don't know
if it works, or if it would be easy to adopt to AT&T/Bell syntax which
decorates things less, making it a little harder to infer semantic meanings.

Also more digging shows the UNSW tapes / sources also are from Harvard. All
roads lead to Harvard for this it seems :)

Warner

[-- Attachment #2: Type: text/html, Size: 2290 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [TUHS] Unix V6: Assembler Listings
@ 2020-06-11 15:26 Paul Ruizendaal
  2020-06-11 15:57 ` Warner Losh
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Ruizendaal @ 2020-06-11 15:26 UTC (permalink / raw)
  To: TUHS main list, paul


> I am now writing code in assembly for the PDP-11. I remember reading
> somewhere that the output from "AS" (my caps) is a bit meagre. I can't find
> an option to produce a text listing. Is it possible from AS, using command
> options (I can't see one)  or perhaps from "LD"?
> 
> Paul
> 
> *Paul Riley*

I had the same problem. As I was porting to a different mini I had to write a new assembler. As you have undoubtedly seen, early ‘as’ was written in assembler and not so easy to use as a base. Hence I used Richard’s Miller’s AS for the Interdata as a base (available on Tuhs):
https://www.tuhs.org/cgi-bin/utree.pl?file=Interdata732/usr/source/as

Later I discovered that the TUHS archive has source code for the original ‘as’ rewritten in C, a work by Roger Jaeger:
https://minnie.tuhs.org/Archive/Distributions/USDL/Mini-Unix/

Maybe adding a listing module to this version of ‘as’ is another possible route.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-11 11:38 [TUHS] Unix V6: Assembler Listings Paul Riley
2020-06-11 12:55 ` Clem Cole
     [not found]   ` <9CCCBCA1-DD64-49EA-AD3E-8E2B9C548B99@icloud.com>
2020-06-11 13:40     ` Clem Cole
2020-06-11 14:56       ` Warner Losh
2020-06-11 15:26 Paul Ruizendaal
2020-06-11 15:57 ` Warner Losh

The Unix Heritage Society mailing list

Archives are clonable: git clone --mirror http://inbox.vuxu.org/tuhs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.tuhs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git