
Show HN: A simple bare-metal Forth for the PDP-10 - aap_
https://github.com/aap/tenth
======
DonHopkins
Brilliant! I love the name TENTH, which is 40% of FORTH.

If you're not playing with 36 bits, you're not playing with a full DEC.

I wonder if there's a way to use the PDP-10's repeated indirect bit effective
address calculation to efficiently thread Forth code, or implement higher
level words like <BUILDS and DOES> by bunny-hopping through the CFA (Code
Field Address)? [1]

[https://en.wikipedia.org/wiki/PDP-10#Instructions](https://en.wikipedia.org/wiki/PDP-10#Instructions)

~~~
aap_
I had the same thought at first but somehow all the indirections were
confusing me and I think it makes things more difficult than necessary. What I
plan to do however is to use direct threading instead since a JRST takes no
more space than the mere address of course. That would make NEXT a bit simpler
and save some space.

~~~
DonHopkins
Have you checked out the NOVIX Forth Chip? That has a lot of great ideas you
could apply, or at least find entertaining!

It had a horizontal bitslice architecture, and separate independent busses for
main memory, operand stack and return stack, so several forth words that did
some stack manipulation, used the alu, and returned from a call, could all be
collapsed into one instruction that accessed main memory, the operand stack,
and the return stack at the same time!

[http://www.forth.com/archive/jfar/vol3/no2/article38.pdf](http://www.forth.com/archive/jfar/vol3/no2/article38.pdf)

[https://users.ece.cmu.edu/~koopman/stack_computers/sec4_4.ht...](https://users.ece.cmu.edu/~koopman/stack_computers/sec4_4.html)

~~~
aap_
No, I'm not a forth expert btw. I find forth interesting and wanted to write
something to run on the PDP-10 but I've yet to write some non-trivial forth
code.

~~~
DonHopkins
Your direct threading approach sounds like a good technique for the PDP-10.

The NOVIX chip is way different that what you're doing, since it has its own
instruction set and a pretty fancy compiler. The set of FORTH words it chooses
as its instruction set is a good example of a minimal FORTH kernel.

~~~
kragen
Don, what do you think about the eForth Model and the F18 instruction sets?
I've been thinking a lot lately about minimal practical instruction sets. I'll
check out the NOVIX, which I had of course heard of but never dug into —
thanks for the recommendation!

~~~
DonHopkins
That's new to me, so I'll check it out -- this site looks informative:
[http://blogs.msdn.com/b/ashleyf/archive/2013/10/13/programmi...](http://blogs.msdn.com/b/ashleyf/archive/2013/10/13/programming-
the-f18.aspx)

------
andyjohnson0
This is seriously impressive work. And writing an assembler to build a
compiler is also in the long tradition of craftsmen/craftswomen making their
own tools for use in creating their ultimate objective.

~~~
aap_
My plan is to have my B compiler
([https://github.com/aap/abc](https://github.com/aap/abc)) spit out PDP-10
assembly eventually. It would be a perfect fit since B assumes word addressed
memory.

------
swalsh
I showed this to my boss who likes to talk about DEC, and how the PDP-10 was
his "first computer in college". First he smiled then "said ohhhh what a
useless exercise" then launched into a half hour of stories about programming
the thing.

------
cpr
Wow, -10 assembler. Now _that_ brought back a flood of memories of TOPS-20
systems hacking...

------
blahyawnblah
My dad used to work on these and older stuff as a field tech for DEC. There's
lots of good stuff on that github page I can show him. Good info!

