The Unix Heritage Society mailing list
 help / Atom feed
* [TUHS] 8bc -- a B compiler for the PDP-8
@ 2019-09-20 22:53 Robert Clausecker
  2019-09-23 17:25 ` Clem Cole
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Clausecker @ 2019-09-20 22:53 UTC (permalink / raw)
  To: tuhs

Greetings!

As a project for our university's seminar on the PDP-8 I wrote a
compiler for the B language targeting it.  It's a bit rough around
the edges and the runtime code needs some work (division and
remainder are missing), but it does compile B code correctly,
generating acceptable code (for my taste, though the function call
sequence could be better).

I hope some of you enjoy this compiler for an important historical
language for an important historical computer (makes me wonder why
the two weren't married before).

https://github.com/fuzxxl/8bc

Yours,
Robert Clausecker

-- 
()  ascii ribbon campaign - for an 8-bit clean world 
/\  - against html email  - against proprietary attachments

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

* Re: [TUHS] 8bc -- a B compiler for the PDP-8
  2019-09-20 22:53 [TUHS] 8bc -- a B compiler for the PDP-8 Robert Clausecker
@ 2019-09-23 17:25 ` Clem Cole
  2019-09-23 18:01   ` Henry Bent
  0 siblings, 1 reply; 3+ messages in thread
From: Clem Cole @ 2019-09-23 17:25 UTC (permalink / raw)
  To: Robert Clausecker; +Cc: TUHS main list

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

below...

On Fri, Sep 20, 2019 at 7:08 PM Robert Clausecker <fuz@fuz.su> wrote:

> Greetings!
>
> As a project for our university's seminar on the PDP-8 I wrote a
> compiler for the B language targeting it.


Very cool.

>   It's a bit rough around
> the edges and the runtime code needs some work (division and
> remainder are missing), but it does compile B code correctly,
> generating acceptable code (for my taste, though the function call
> sequence could be better).
>
A suggestion,   Load TSS/8 on to your simh system with its Algol compiler
and look at how it generated code.  I would suspect you can use Algol's
calling conventions and probably some of its runtime.   Google is your
friend.  I had it running a while back, but do not have it active at the
moment - the key is all the pieces should be findable in the wild,.


>
> I hope some of you enjoy this compiler for an important historical
> language for an important historical computer (makes me wonder why
> the two weren't married before).
>
Might have been, although when Ken created B for the PDP-7, BCPL was his
model and there were already implementations of BCPL around for a number of
processors.  I would not be surprised if there was a BCPL/8.  I would check
in the DECUS library, much of which I think can be found online these days
??bit savers??.

FWIW: IIRC, the Grenoble Algol, a DEC Fortran and DEC Focal (plus
assembler) were the languages I remember on TSS/8.  I came late and short
lived to the PDP-8 world and did not do much with it.  So there could have
been/unlikely were more.   The 8 Gordon Bell and his students had used to
write it, was in the EE Dept at the time and most unused because we hard
started to collect PDP-11s.

But I do have a fondness for the TSS/8, because on a bet, one summer
weekend in about 1976 I think, a couple of us hacked on it to make it swap
to paper tape - you got about 2-4K of storage max (the read is destructive
and much more than that the tape ripped/got tangled).  But it worked enough
we got the beers and pizza and we claimed success for proving it could be
done.   Sadly I have long ago lost that code for that hack.   The PDP-8 we
used was a very early 8 that CMU had and at one point was in donated to
Boston Computer Museum/was on display until the museum closed.

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

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

* Re: [TUHS] 8bc -- a B compiler for the PDP-8
  2019-09-23 17:25 ` Clem Cole
@ 2019-09-23 18:01   ` Henry Bent
  0 siblings, 0 replies; 3+ messages in thread
From: Henry Bent @ 2019-09-23 18:01 UTC (permalink / raw)
  To: Clem Cole; +Cc: TUHS main list

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

On Mon, 23 Sep 2019 at 13:27, Clem Cole <clemc@ccc.com> wrote:

> below...
>
> On Fri, Sep 20, 2019 at 7:08 PM Robert Clausecker <fuz@fuz.su> wrote:
>
>>   It's a bit rough around
>> the edges and the runtime code needs some work (division and
>> remainder are missing), but it does compile B code correctly,
>> generating acceptable code (for my taste, though the function call
>> sequence could be better).
>>
> A suggestion,   Load TSS/8 on to your simh system with its Algol compiler
> and look at how it generated code.  I would suspect you can use Algol's
> calling conventions and probably some of its runtime.   Google is your
> friend.  I had it running a while back, but do not have it active at the
> moment - the key is all the pieces should be findable in the wild,.
>
>
>>
>> I hope some of you enjoy this compiler for an important historical
>> language for an important historical computer (makes me wonder why
>> the two weren't married before).
>>
> Might have been, although when Ken created B for the PDP-7, BCPL was his
> model and there were already implementations of BCPL around for a number of
> processors.  I would not be surprised if there was a BCPL/8.  I would check
> in the DECUS library, much of which I think can be found online these days
> ??bit savers??.
>

I checked here: http://so-much-stuff.com/pdp8/software/decus.php but did
not immediately see anything BCPL related.  8-330 is TSS/8 ALGOL.

-Henry

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

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 22:53 [TUHS] 8bc -- a B compiler for the PDP-8 Robert Clausecker
2019-09-23 17:25 ` Clem Cole
2019-09-23 18:01   ` Henry Bent

The Unix Heritage Society mailing list

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

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


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