Subject: Timeshare question resolved

From: [email-masked] (Bob Supnik)
Date: 18 DEC 93 18:41:58

Thanks to Max Burnet (curator of the Nostalgic Obsolete Products SIG in
Australia), the question of timesharing option behavior is resolved.

1. If in user mode, with interrupts enabled, an IOT or OSR or HLT is
   executed, the PC points at the following instruction.

2. If the trapped instruction is an operate, then ALL parts of the
   operate except for OSR or HLT have been executed before the user
   mode interrupt occurs.  This includes SKPs and CLA, if programmed.

Examples (in user mode, interrupts enabled)

	n/	IOT
	n+1/	...

Location 0 will contain n+1

	n/	CLA SKP HLT
	n+1/	...
	n+2/	...

Location 0 will contain n+2, and the AC will be clear.

Both cases are explicitly tested in the memory extension and timeshare
option diagnostic.

On to the EAE...

Bob Supnik	>[email-masked]
		>All opinions expressed are those of a hardline microcoder
		>and do not reflect those of Digital Equipment Corporation

---

From: [email-masked] (Megan)
Date: Sun, 19 Dec 1993 04:23:27 GMT

So far, all the work I've seen relating to emulators of "mature"
archiectures (ripe?) consist of seeing what kind of speed increase
over the original machine an emulator running on newer techology
might attain.

It occurred to me the other day that this could be carried to an
extreme...

Imagine, a pdp-8 emulator (built to run on an -11), running on a
pdp-11 emulator (built to run on an alpha), running on an alpha
emulator (?!), running on whatever ... Hey, we might even approach
the operating speed of the ORIGINAL pdp-8 architecture :-)

					Megan Gentry

---

From: [email-masked] (Bob Supnik)
Date: 19 DEC 93 00:55:36

In article <[email-masked]>, [email-masked] (Megan) writes...
>the operating speed of the ORIGINAL pdp-8 architecture :-)

It's certainly possible to do the nesting, but I have my doubts about
the resulting performance.

For example, there was a major simulation system on the DEC-10 (MIMIC),
which simulated 8's, 11's, Nova's, etc.  With Ken Harrenstein's (sp?)
DEC-10 simulator, one could resurrect MIMIC, simulating 8's on 10's
on the UNIX system of your choice.

Carrying that one step further, various people (including me in a previous
life) wrote 8 simulators on 11's.  So one could simulate 8's on 11's on
10's on the UNIX system of your choice.

Standing in the way are a few small practical problems:

1. MIMIC has disappeared, at least in source form (and oh! would I like
   to find it).
2. Although the 10 simulator, on an Alpha, will run faster than "real time"
   on a KL, MIMIC delivered simulation ratios of 15:1 (Nova) to 45:1 (PDP11
   with memory manglement).  So the nested simulators won't run fast enough.

Plus, I wonder how all the nested simulators would fight over which level
got to handle ^C...:-)

---

From: [email-masked] (Jeff Makey)
Date: 18 Dec 93 23:33:26 PST

>the operating speed of the ORIGINAL pdp-8 architecture :-)

The Alpha had better be pretty fast, because the PDP-8 emulator I
wrote in 1978 in BASIC+2 on a RSTS/E PDP-11/70 was considerably slower
than the real thing.  For instance, with PDP-8 BASIC loaded it took
maybe 10 seconds to parse a blank line of input (from a typed carriage
return) and print the appropriate line feed.  The layering went
something like this:

	PDP-8 BASIC on top of
	a PDP-8 emulator executing in
	the BASIC+2 runtime system on top of
	the RSTS/E (version 6c, I think) operating system running on
	a PDP-11/70.

As I recall, there was a bug in my emulator (that I never tracked
down) that kept BASIC's LIST command from working, although everything
else seemed fine.

                            :: Jeff Makey

Department of Tautological Pleonasms and Superfluous Redundancies Department
    Domain: [email-masked]    UUCP: nosc!crash!jeff

---

From: [email-masked] (Timothy D. Shoppa x4256)
Date: 18 Dec 1993 20:42 PST

>the operating speed of the ORIGINAL pdp-8 architecture :-)

This is almost an urban legend (the source is a 'friend of a friend'),
but I've heard that WPS for the PDP-8 was developed on a emulator (or
simulator, I can never remember which is which) running on a PDP-11/60.
The emulator supposedly used the 11/60's Writeable Control Store to
implement many of the 8's instructions.  At the time (I would guess late 70's,
given what I know about the 11/60) it was the fastest way to execute
PDP-8 software; I heard it was 2-3 times as fast as any of the real PDP-8
hardware.  Anyone know more details of this emulation?  Were any of these
machines ever used outside DEC?

Instead of emulating the machine code of an architecture, why not emulate the
microcode?  Hell, I've got field maintenance print sets for the 11/60; we could
feed the gate interconnections into a logic simulator running on some platform.
Then we could load emulating microcode into the WCS. I truly doubt we would
approach anywhere near the speed of the ORIGINAL pdp-8 architecture after all
these levels of emulation, but it'd be quite a sight!

				Tim ([email-masked])

P.S.  Anyone know of 11/60 installations still running?  I can point
out several examples of 11/70's still going strong, but I've never seen
a real working 11/60.  Looking over computer architecture books of the 1970's
and even early 1980's, the 11/60 seems to have been the "textbook" example
of a general-purpose microcoded processor.  I suppose it may have been
so general-purpose that it was beat out by more economically viable but less
general-purpose mini's.  (How does a 11/60 stack up against, say, a 11/55?)

---

From: [email-masked] (Charles Lasner)
Date: 21 Dec 1993 01:28:38 GMT

In article <[email-masked]>,
>machines ever used outside DEC?

To debunk things a little:

WPS is a complete O/S unto itself.  Implementing "many" PDP-8 instructions
means it wouldn't work; implementing *all* of the CPU instructions of the
-8/e and a proper interrupt behavior isn't quite enough: you also have to
implement the console peripheral, comm ports and LPT port, and also a
system device that would likely be an RX01/02.  Moreover, while such an
emulated or actual machine would be enough to RUN a system like WPS, it's
entirely another matter that it would be developed on something that feeble.
I know from in-house experience that the minimal machines used to develop WPS
generally had RK or RL disks on them, and an RX01/02 to try it out on.

I also heard the tale of the emulated faster -8 on the WCS 11/60.  And that it
could run anything that an -8/e (with the same peripherals) could.  But not
that it was ever used for anything beyond a hack in-house demo.  You can't
build WPS from the sources, unless you have an additional more powerful disk
device on the machine.  But since there aren't any other truly compatible
peripherals between 11/60 and Omnibus, and the WPS developers weren't
particularly inclined to move all the files on many RX01/02's (assuming the
11/60 had an emulated pdp-8 disk on it and someone had managed to somehow
get a bootable OS/8 system to the emulated disk, etc.), any form of
"development" on the 11/60 seems pretty unlikely.

cjl

---

From: [email-masked] (Bob Supnik)
Date: 20 DEC 93 20:38:05

In article <[email-masked]>, [email-masked] (Timothy D. Shoppa x4256) writes...
> [text deleted]

Not a legend at all: the emulator was written by Richie Lary, PDP-8 wizard
extraordinaire, and author of the famous maxim: "Any 129 word PDP-8 program
can be rewritten in 128 words (also true recursively)."  It was indeed the
fastest PDP-8 of its time.  Today, a streamlined simulator on a decently
fast RISC processor would be faster.

---

From: [email-masked] (Charles Lasner)
Date: 21 Dec 1993 15:13:07 GMT

In article <[email-masked]>,
>fast RISC processor would be faster.

Yes, my friend Richie wrote the emulator; to that extent this isn't a legend.
However, like any extraordinary fact, it can turn into a legend.  Thus, the
rest of it is exaggerated.  BTW, I heard that the VAX was developed on the
WCS of 11/60; any truth to that?

As to putting 129 words into 128 (and recursively yet!), this is the
premise of much of the code of P?S/8, which is specifically based on the
R-L monitor system.  (What do you think the "R" and "L" stand for?) 
(That's one of the reasons we changed R-L to MS/8 ("Mass Storage/8")
because no one would believe a system named after its author :-).)
Don't forget Jack Burness' corrolary to the maxim:  The amount of time it
takes to remove another word of code from the page is a function of how
many words already removed.

There are various techniques to shaving down -8 code.  We use all of
Richie's techniques and a few more some others invented on top of them. 
For example, any AND instruction should always be suspected of
inefficiency unless it's involved in being (at least one!) an
elsewhere-needed constant.  All operate instructions should be
investigated not only for the ability to form a needed AC,L value which
could save a constant, but additionally, the instruction itself could form
a needed constant.  (A subset of that is to form a needed constant that is
also a group II OPR when executed.  You investigate whether the
instruction will clear the AC, which is often useful, might skip, might
never skip, will definitely skip, will definitely not skip, as determined
by the context.  If the AC,L is predictable enough, you can upgrade might
to definite.  In any case, the appropriate placement of the constant into
the code might including a sacrificial line following to avoid problems. 
The second line is formed as necessary.  For example, a constant 7700
followed by a constant 7772 is placed in-line in the code where the AC is
required to get cleared, and is always predictably negative.  The 7772 is
thus always skipped (good thing!  it otherwise would make the program
halt!).  The AC gets cleared, and the constant 7700 doesn't need another
word of code.)

Sometimes you can create a constant out of an instruction that isn't quite
perfect, but is good enough.  Richie was the first to use the OR
functionality of KRS with "messy" constants like 1200 (formed by TAD
instruction to something positioned at the beginning of the current page)
which would OR in the parity bit (as well as the 1xxx) and then compare to
something else regarding the specific check (^C, etc.).  If the two's
complement of the match was otherwise available, you have eliminated two
constants.  (The conventional way is to use an AND (177) and compare to
(-3) but this is longer; depending on the bummability of the program, it
could be a tie though.)  (Assembly notation note: when I reference a line
to fudge a constant, perhaps one only good eough, but not perfect, I
create a commented-out literal that signifies the "pure" version of what I
am seeking.  Thus, if the code ever moves, I know what it requires to
restore functionality, etc.)

Sometimes, there is a complex relationship between words to make it fit. 
For example, by positioning a constant on page zero, it gets used on page
0200 as a page-zero literal, and also forms another constant on page 0200
which is an AND instruction to the page-zero literal itself. (So far, this
situation isn't that complex!)  However, on another page, there is a
similar situation involving another critically situated page-zero constant
saving another word, etc.  But there's an additional dependency:  the
instruction that requires that page's current-page literal is also used as
a pointer to the analogously-formed one on the 0200 page, since this page
also requires the very same constant.  (The second page of code doesn't
have any instructions that reference the specifically-placed literal
constant as does the first page, thus it can't form a "clone" of that
constant, etc.  However, it takes advantage of the fact that the first
page is 0200-0377, thus an AND instruction current page can be forced into
also being a pointer to where on page 0200 that needed constant is.  In
this case, it happens to itself be formed out of a current page reference
to an unrelated page-zero literal constant, thus the AND instruction that
references it is also a pointer to the other one on page 0200.) (Note: all
of these interlockings are "protected" against abuse by rigged conditional
assembly, which will cause assembly errors if the relationships are
broken.  At least this is the case in P?S/8 consistently and completely. 
Some of the OS/8 code that uses these techniques merely points out that
something needs to be carefully maintained; the actual words are often
quite cryptic.  The code is easily broken!)

On a machine with only 4096 defined instructions, none of this should be
surprising.  In any case, this is (part of) why any emulators have to
*exactly* follow the PDP-8 instruction set!

cjl