Down the rabbit hole!

403 views
Skip to first unread message

Ian Schofield

unread,
Jun 29, 2018, 12:08:38 PM6/29/18
to [PiDP-11]
Dear PiDP11 users,

 See screenshot. To clarify, both xterm windows are telnet sessions directly to my wonderful PiDP11 logged in as user. I am running BSD 2.11 with all the networking switched on etc. 
 However, the lower right window is Kyle Owen's HP-35 calculator emulator for the PDP-8. This is running under a very old and very small version of a PDP-8 simulator which is built under BSD.
 This was a bit of a challenge as it runs under a small memory model with 64K for everything. (Do you remember this ... more senior people!). Haven't cracked the setup for a split I/D space yet.
 So, this is an HP-35 emulation running under OS/8 in a PDP-8 emulation running under BSD2.11 on a PDP 11/70 emulation (with flickery lights) and wearing out the ARM (Raspbian) in my little Pi3!
 When will it stop???

Regards, Ian.

 
 
RabbitHole.png

steve...@gmail.com

unread,
Jun 29, 2018, 12:56:21 PM6/29/18
to [PiDP-11]

Find an HP-65 emulator because those are programmable. . . 

Ian Schofield

unread,
Jun 29, 2018, 1:27:32 PM6/29/18
to [PiDP-11]
Dear Steve,

 Just when I thought it could not get any deeper!

Regards, Ian.

Ed Spittles

unread,
Jun 29, 2018, 5:15:32 PM6/29/18
to Ian Schofield, [PiDP-11]
I'd like to know more about this very small pdp8 simulator!

(The HP-25 was also programmable, and I think much simpler than the 65.)

Cheers
Ed

Louis Mamakos

unread,
Jun 29, 2018, 8:02:08 PM6/29/18
to [PiDP-11]
When you link your program, pass the  -i  option to ld to create a split-I/D executable.   See https://www.unix.com/man-page/bsd/1/ld/ or  man ld on your 2.11 BSD system.

Neil Higgins

unread,
Jun 29, 2018, 9:23:19 PM6/29/18
to [PiDP-11]
Maybe a PDP-11 simulator on a HP calculator?

Ian Schofield

unread,
Jun 30, 2018, 6:18:50 AM6/30/18
to [PiDP-11]
Dear Neil,

 After your lyrical comment:
 Programers can - with or without gotos (they have the knack); others can’t (they don’t). Then there are those who earn a living by programming, even if they can’t. The evidence suggests that there are millions of them. On balance, providing ways to program with less gotos probably makes the world a safer place. I did find thought provoking Dijkstra’s distinction between linear text and linear time.
 I will have to take your suggestion seriously!!

 But, I would note that c just hides the goto bit. Eg, a switch statement contains a series of label statement prefixed by 'case' ... not too different from if (XXX) goto YYY;
Louis;

 Thanks for the -i suggestion. I think I cracked this last night simply by adding this to the cc ... line. I suspect I have not got the ld line quite right and hence some bus errors etc. But, -i is passed to the loader as below.
 This allows for 20k of core such that I can run my toytown pdp8 c compiler ... works as well!
 I have attached a zip with the simulator and 2 disk images ... OS/8 and 4K DMS.
 under BSD build with:
 cc pdp8.c -lcurses -ltermcap -i -o pdp8

NB This app assumes 16bit int. If you wish to try on 32/64 bit linux distro, the typeof(mem) should be unsigned short or uint16 or whatever and the pointer p in iot(...) should be short as well. Also, it is very old and very bad c .. don't use -Wall as it will burnout your terminal.

 At the simulator '>' command prompt:
 type b for boot
 then r 30 for OS/8 or r 200 for 4K DMS.

type ^a to interrupt the simulation and x to exit.

Sorry for the lack of documentation as in 'good programmers don't do documentation or use goto's'

HP-calc is on the OS/8 disk as HPC.BN. Don't bother trying to assemble HPC.PA ... it works but takes forever.

Have fun, regards, Ian.
Tiny-Pdp8.zip

Neil Higgins

unread,
Jun 30, 2018, 8:55:55 AM6/30/18
to [PiDP-11]
The REAL challenge would be to get the PDP-11 running on the SAME calculator that it’s emulating.

Now THAT would be a rabbit hole (or maybe a black hole).

If anyone ever works out how to bootstrap such a thing then please, do let us know - and we’ll whole heartedly support your nomination for a Nobel prize.

Thomas Lake

unread,
Jun 30, 2018, 11:30:00 AM6/30/18
to [PiDP-11]

 But, I would note that c just hides the goto bit. Eg, a switch statement contains a series of label statement prefixed by 'case' ... not too different from if (XXX) goto YYY;
Louis;

When you think about it, ALL computer languages must be translated or compiled into machine language and the CPU will use jump instructions to run the program (at least with all the CPUs with which I'm familiar: IBM 1120, 360, 370, 390, Z-System. all the Intel line from the 4004 to the latest Core i7, Z-80, Motorola 6800, up to the 68K, etc.) 

Tony

unread,
Jun 30, 2018, 11:39:17 AM6/30/18
to [PiDP-11]
The issue is not that the actual hardware uses jump instructions.  It's that the structure or flow of source code that uses a lot of GOTO instructions tends to be hard to read and therefore hard to understand, verify, and debug. 

Drew Rogge

unread,
Jun 30, 2018, 1:21:50 PM6/30/18
to [PiDP-11]
I always found it ironic that almost(?) all of the example programs in Niklaus Wirth's "Pascal User Manual and Report" had a goto 99 statement in them. Seemed to be the standard way of dealing with error conditions.

Drew

Roger Smith

unread,
Jul 1, 2018, 9:51:21 AM7/1/18
to [PiDP-11]
Or how about compiling simh under bsd. Now that would be a REAL rabbit hole.
Roger

Johnny Billquist

unread,
Jul 1, 2018, 10:37:27 AM7/1/18
to pid...@googlegroups.com
With "bsd" I assume you mean 2BSD. While everything is possible, this
one is ugly, and would require a lot of rewrites, or a very extensive
emulation framework around it, as simh is just not written in a way that
easily will allow it to build on a 16-bit system...

Johnny
> --
> You received this message because you are subscribed to the Google
> Groups "[PiDP-11]" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pidp-11+u...@googlegroups.com
> <mailto:pidp-11+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pidp-11/71ac14cf-195e-4833-8a1b-8d089d550203%40googlegroups.com
> <https://groups.google.com/d/msgid/pidp-11/71ac14cf-195e-4833-8a1b-8d089d550203%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

--
Johnny Billquist || "I'm on a bus
|| on a psychedelic trip
email: b...@softjar.se || Reading murder books
pdp is alive! || tryin' to stay hip" - B. Idol

Manfred Koethe

unread,
Jul 1, 2018, 12:21:01 PM7/1/18
to [PiDP-11]
I attached two fairly old articles I always enjoyed very much, which solve the Pascal and GOTO problems.....

:-) Please enjoy !!

Manfred 
rpdup.pdf
GOTO-less FORTRAN.pdf

Ian Schofield

unread,
Jul 8, 2018, 11:32:52 AM7/8/18
to [PiDP-11]
Dear All,

 Nice to see that the goto thing has prompted a bit of discussion. This is on the edge of what is an age old and increasing problem of programme complexity with the view to understanding the logic. Best we have at the moment for general applications is C++ ... love it or hate it ... C# person myself I'm afraid. However, no matter how you slice it, explicit or implicit goto's are still required. There was and probably still is a vogue for including all linear code in a function so that a simple 'if' can be used to skip it. Brings me on to threaded (as in many function calls) as opposed to linear. Threaded can improve readability provided the function names aren't too obscure.
 
Given that I was going to entirely agree with Johnny about Simh under BSD2.11 ... this really is a non-starter. But, it may be possible under Ultrix as the screen shot shows Doug Jones' very old PDP8 simulator with an XLib display via an X server talking to a Simh VAX ... really very close to modern Unix/Linux. And, I think there is a version of gcc for this OS.

Finally, we might consider splitting this thread for a further discussion of languages and I will stop before I have a Java rant!

Best wishes, Ian.
Ultrix.png

Neil Higgins

unread,
Jul 9, 2018, 1:06:48 AM7/9/18
to [PiDP-11]

Finally, we might consider splitting this thread for a further discussion of languages and I will stop before I have a Java rant!


Better still, let's just drop the GOTO debate. It started in the PiDP-8 forum anyway (how it got here, I'm not sure), and it's a "hoary old goat" that has, no doubt, been done to death in a million other forums. For the likes of most of use, it's equivalent to "How many angels can dance on a the head of a pin?"

Ian Schofield

unread,
Jul 9, 2018, 1:34:32 PM7/9/18
to [PiDP-11]
Dear Neil,

 Couldn't agree more. And ... 'it depends on the tune' (very dark source for this quote). 

Regards, Ian.

Neil Higgins

unread,
Jul 10, 2018, 6:47:03 AM7/10/18
to [PiDP-11]
Do tell ... I did some Googleing but nothing obvious showed up.

Ian Schofield

unread,
Jul 10, 2018, 4:19:31 PM7/10/18
to [PiDP-11]
Dear Neil,

 The Crow by James O'Barr, the main character asks this question to one of his victims before killing them, answering himself, "Depends on the tune".

Regards, Ian.
Reply all
Reply to author
Forward
0 new messages