microcoding a PC into a PDP-11 (was: RE: Classic Computers vs. Classic Computing)

From: Jonathan Engdahl <engdahl_at_cle.ab.com>
Date: Wed Sep 19 08:34:00 2001

> -----Original Message-----
> [mailto:owner-classiccmp_at_classiccmp.org]On Behalf Of Bob Shannon
> Sent: Tuesday, September 18, 2001 10:38 PM
> Does anyone on this thread even understand microprogramming?
> Apparently not.

Yes I do. Although I never actually implemented a microcoded machine, my
co-workers at Allen-Bradley were building them in the late 70's and early
80's. I studied micro-programmed architectures extensively at that time, did
several paper designs, and wrote the microcode for them. Unfortunately,
building the hardware at the time was prohibitively costly and difficult to
do on my own time/nickel. By the time I got the company to put one of my
machines into production, it was a two stage pipelined RISC, with jump slots
and all that, like a MIPS. No microcode at all. Every instruction was
hard-wired, and executed in a single cycle.

The Allen-Bradley PLC-3, and the later PLC-2 were both AMD 29xx based
microcoded architectures. The early PLC-2, the mini-PLC 2, and the PLC-5
were microcoded machines also. The early PLC-2 used an 8080, and the mini
PLC-2 used a Z-80 as the micro-engine. Weird techniques were used: mapping
ROMs, hardware assists for the boolean opcodes, etc. On the mini there was
no hardware assist except for the mapping ROM. In micro-engine mode, the
stack pointer was used as the PC of the emulated machine. An opcode fetch
was something like a POP HL followed by a couple LDs and a JP (HL). During
the pop the opcode byte passed through the mapping ROM to turn it into the
address of the execution routine for that opcode. When an interrupt occurred
the Z-80 operated more traditionally.

A Pentium microprocessor is just as good a microengine as an AMD 2901/2910,
or a 3000 series bit slice. The techniques I intend to use are the same as
those used in the microcoded machines of the 70's, except there is no
specialized hardware assist for decoding instructions, such as the mapping
ROM, or address mode decoders. These can be replaced by large, fully
expanded tables in RAM, now that RAM is so dirt cheap.

> Pentium CPU's can't be microprogrammed, unless your Intel. Even microcode
> updates cannot replace the basic instruction set.

That's not what I'm saying. The Pentium is probably not microprogrammed
anyhow, at least for the majority of instructions. They probably have a
microcoded front end for the messy stuff, like context switching.

I'm adding one more level of abstraction -- microcoding on the microcoded
machine, so to speak. Like the Mini PLC-2.

> If you write a program in Pentium assembly code to run PDP-11
> instructions, you
> have just written an 'emulator', even if it does not run under windows.

Yes, a microcoded machine is one kind of emulator. Every microcoded
architecture is an emulation. The underlying micromachine bears little
resemblance to the machine that the user sees. It's a nice distinction, and
not razor sharp. I would say that an "emulator" runs under an OS on a
machine that is still running windows, NT, Linux, or whatever. A microcoded
machine runs barefooted on the hardware, over which it has exclusive
control. Whether that hardware itself is microcoded makes no difference.

> But an writing such an emulator is not 'microprogramming'.

It is so. I don't know of any rule that says that the micromachine has to
have a particular type of architecture, or that it can't be an off-the-shelf
machine, rather than a collection of AMD 29xx parts.

You can argue that hardware is software, or that software is hardware. It's
all logic. The distinction is pretty academic.

What I am saying is that it would be possible to re-create almost any
classic architecture using much the same techniques used back in the 70's to
create the original machines. Instead of designing a custom micromachine,
you just go down to the corner store, buy a Pentium IV machine, erase the
hard drive, and throw away the disks. Now, on another machine, sit down and
write the "microcode" in x86 assembly language, load it on a floppy, and
boot the Pentium IV, which now becomes a PDP-11, 1130, CDC, or whatever. If
you copy a disk image of the target OS to the IDE hard drive, it will boot
and run just like the original machine.

Jonathan Engdahl???????????????? Rockwell Automation
Principal Research Engineer????? 24800 Tungsten Road
Advanced Technology????????????? Euclid, OH 44117, USA
Euclid Labs????????????????????? engdahl_at_cle.ab.com  216-266-6409
Received on Wed Sep 19 2001 - 08:34:00 BST

This archive was generated by hypermail 2.3.0 : Fri Oct 10 2014 - 23:34:25 BST