PDP-11 tube emulator in C?

discuss bbc micro and electron emulators (including mame) here!
Post Reply
User avatar
hjalfi
Posts: 136
Joined: Sat May 13, 2017 11:17 pm
Location: Zürich, Switzelrand
Contact:

PDP-11 tube emulator in C?

Post by hjalfi » Tue Sep 15, 2020 6:50 pm

This is probably a long shot, but... I'm looking for a just-the-Tube-environment emulator, for running compiler tests with. It's got to be in C, which unfortunately means that jgharston's PDPTube is ruled out. (Because I'm on an environment which doesn't have a BBC Basic interpreter.)

Does anyone know if such a beast already exists, or will I have to roll my own? This is probably not that hard, as the environment is fairly straightforward and the SIMH PDP-11 emulator core is nicely modular, but I really don't want to have to.
David Given
http://cowlark.com

RobC
Posts: 2963
Joined: Sat Sep 01, 2007 10:41 pm
Contact:

Re: PDP-11 tube emulator in C?

Post by RobC » Tue Sep 15, 2020 7:00 pm

PiTubeDirect has a PDP-11 core which gives a Tube environment and is written in C.

User avatar
hjalfi
Posts: 136
Joined: Sat May 13, 2017 11:17 pm
Location: Zürich, Switzelrand
Contact:

Re: PDP-11 tube emulator in C?

Post by hjalfi » Tue Sep 15, 2020 7:10 pm

Sorry, should have been clearer --- I'm looking for something with enough stub MOS support to support running simple programs from a command-line environment. I use one of these very successfully to run 6502 compiler tests: https://github.com/davidgiven/cowgol/bl ... /bbctube.c

However I'm much less fluent in PDP-11 stuff and was hoping that someone already had one.
David Given
http://cowlark.com

Coeus
Posts: 1759
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: PDP-11 tube emulator in C?

Post by Coeus » Tue Sep 15, 2020 7:25 pm

B-Em has the PDP11 as one of the 2nd processor options and the PDP11 is implemented in C as is the Tube ULA. B-Em itself is not a command line application but I don't think there is any GUI dependency in the tube processor implementations.

User avatar
BigEd
Posts: 3341
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: PDP-11 tube emulator in C?

Post by BigEd » Tue Sep 15, 2020 7:27 pm

I'm sort of reminded of run6502 and run65816 which both have some minimal Acorn MOS gadgetry. Sounds like you want a runpdp11, which is a fine thing to want.

RobC
Posts: 2963
Joined: Sat Sep 01, 2007 10:41 pm
Contact:

Re: PDP-11 tube emulator in C?

Post by RobC » Tue Sep 15, 2020 8:31 pm

hjalfi wrote:
Tue Sep 15, 2020 7:10 pm
Sorry, should have been clearer --- I'm looking for something with enough stub MOS support to support running simple programs from a command-line environment. I use one of these very successfully to run 6502 compiler tests: https://github.com/davidgiven/cowgol/bl ... /bbctube.c
It might be worth saying exactly what you are trying to do as PiTubeDirect will give you a PDP-11 co-pro command line prompt from which you can load and execute programs.

Coeus
Posts: 1759
Joined: Mon Jul 25, 2016 12:05 pm
Contact:

Re: PDP-11 tube emulator in C?

Post by Coeus » Tue Sep 15, 2020 10:14 pm

RobC wrote:
Tue Sep 15, 2020 7:00 pm
PiTubeDirect has a PDP-11 core which gives a Tube environment and is written in C.
And having commented that B-Em has this too, I think it is largely the same code. David (Hoglet) and I did try to make is easy for CPU cores to be shared between the two.

The example from the Cowgol GitHub looks as if it works by asking the CPU core to trap execution at certain addresses are redirect this to C code. That isn't quite what B-Em does and I suspect not PiTubeDirect either. In B-Em the tube processors run their normal Tube Client ROM and B-Em emulates the Tube ULA.

Now here's a chance to do something clever. If the test harness for these compiler tests was to include the TubeULA emulation too, i.e. the C code emulating the BBC MOS calls sits on the host side of that emulated Tube ULA, that would mean the same test harness could work with any of the PiTubeDirect CPU cores.

User avatar
hjalfi
Posts: 136
Joined: Sat May 13, 2017 11:17 pm
Location: Zürich, Switzelrand
Contact:

Re: PDP-11 tube emulator in C?

Post by hjalfi » Tue Sep 15, 2020 11:12 pm

That would actually be pretty feasible. I like the Tube systems for compiler tests because the binary interface is so simple, but can still run proper programs --- this makes the test harness very easy but I can use the same binary target to run full-sized programs on a real (emulated) Tube machine. Emulation at the Tube layer would give me all the core support for free.

The bad news is that many of the Tube ROMs aren't distributable, so they'd need a rewrite from scratch (although it's not like there's a lot there).
David Given
http://cowlark.com

Post Reply

Return to “8-bit acorn emulators”