Subject: PDP-8's in the schools

From: [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879)
Date: 4 May 1994 14:25:10 GMT

About two weeks ago, my son (age 11) said:  "Dad, we've got an all
school project coming up, and I'd like to take your PDP-8 and hook
it up with two terminals so people can talk to each other."  I
asked for more detail, and it turned out that the all school
project is on communications, all kinds, and each kid was supposed
to do a project for it, leading up to a communications fair on
this coming Thursday.  Back when I was debugging my KL8E boards, I
had toggled in a little program to read from either of two boards
and echo to both, and he remembered enjoying playing with it.

So, over the last two weeks, we've struggled.  Most of the work was
in helping him get the information he needed for his poster
describing the project.  His poster focuses on the ASCII code,
and how ASCII characters are sent over a serial line.

I stripped down my PDP-8/F, removing everything but the CPU, memory,
and 2 KL8E boards, and then, over and over, I had my son plug the
machine in, plug together the terminals and machine, and power the
thing up, start the program, and test it, then halt it, power down,
and unplug everything -- now he can do that without notes.

Finally, I wrote an better demo version of the program.  It reads from
either terminal and echos to both, but it also echos CR as CR-LF, it
echos BS as BS-SP-BS, and it echos RUB as RUB-BS-SP-BS.  As an added
bonus, I added a trap for ESC that echos the startup test message (that
begins with NULL), thus preventing people from accidentally setting
the terminals into funny states with accidental escape sequences.

The biggest pain was getting the program loaded in the PDP-8.  I bought
an RS-232 cable to connect my laptop UNIX system to the world, but I'd
never tried it yet (after all, until I tried downloading code into the
PDP-8, the internal modem and ethernet interfaces were all I needed).
Unfortunately, the laptop has an Apple style asynch plug on the back,
and the cable I bought omitted one line the box wanted.  It took me an
hour with a voltmeter, tweezers, and hair thin wire to diagnose and
kluge around that problem, and then I was able to spit RIM code down
the wire into the PDP-8.  I put two copies of the program in core, one
at address 200 and another at 400, so that there's a backup copy
available in case someone bounces on the deposit switch.

Today, I delivered the PDP-8, an ADM31 and an ADM5 to school -- while
other students were arriving with boxes of ants, string and tincan
telephones, posters on sanskrit or braille, and a wealth of other
projects demonstrating communication of one kind or another.  So, for
the next two days, my son will have a PDP-8 key in his pocket.

I hope other owners of antique computers can get them into the schools
for demonstrations!  I think machines with blinking lights, switches,
and other details we're missing on our modern computers can make a
real contribution to students understanding of where we are today and
how different things were only a short time ago.

			Doug Jones
			[email-masked]

PS.  Here's an assembly listing of the program (from my UNIX-based
PDP-8 cross assembler):

   1            / Instruction mnemonics for input output
   2            TFL=	6040
   3            TFL1=	6410
   4            KCF=	6030
   5            KCF1=	6400
   6            KSF=	6031
   7            KSF1=	6401
   8            KRB=	6036
   9            KRB1=	6406
  10            TLS=	6046
  11            TLS1=	6416
  12            TSF=	6041
  13            TSF1=	6411
  14            
  15            / ASCII characters
  16            BS=	0210		/ backspace
  17            LF=	0212		/ linefeed
  18            CR=	0215		/ carriage return
  19            SP=	0240		/ space
  20            ESC=	0233		/ escape
  21            RUB=	0377		/ rubout
  22            
  23            *0200
  24            /	Special startup actions
  25 00200 6040 START,	TFL		/ Reset output to terminal 0
  26 00201 6410 	TFL1		/ Reset output to terminal 1
  27 00202 6030 	KCF		/ Reset input from terminal 0
  28 00203 6400 	KCF1		/ Reset input from terminal 1
  29            
  30 00204 7200 MSGOUT,	CLA		/ Setup to output a message
  31 00205 1377 	TAD	(MSG-1)	/ Get the address of the message
  32 00206 3010 	DCA	10	/   put it in an index register
  33 00207 1410 MSGLP,	TAD I	10	/ Get a character of the message
  34 00210 7450 	SNA		/   if nonzero, skip
  35 00211 5215 	JMP	WAITIN	/   if zero, go wait for input
  36 00212 4257 	JMS	OUTPUT	/   if nonzero, output character
  37 00213 7200 	CLA		/ Clear it up
  38 00214 5207 	JMP	MSGLP	/   and process the next char
  39            	
  40            /	Code to read from one or the other keyboard
  41 00215 6031 WAITIN,	KSF		/ Is there input from term 0?
  42 00216 7410 	SKP		/   if not, skip
  43 00217 5224 	JMP	IN0	/   if so, go get it
  44 00220 6401 	KSF1		/ Is there input from term 1?
  45 00221 5215 	JMP	WAITIN	/   if not, go wait for input
  46            			/   if so, go get it
  47            
  48 00222 6406 IN1,	KRB1		/ Read the input from term 1
  49 00223 5225 	JMP	OUT	/   then go output it
  50            
  51 00224 6036 IN0,	KRB		/ Read the input from term 0
  52            			/   then go output it
  53            
  54            /	Code to output to both displays
  55 00225 4257 OUT,	JMS	OUTPUT	/ Output the character
  56 00226 1376 	TAD	(-CR)	/ Is it CR (carriage return)?
  57 00227 7450 	SNA		/   if not, skip next line
  58 00230 5244 	JMP	CRFIX	/   if so, special action
  59 00231 1375 	TAD	(CR-BS)	/ Is it BS (backspace)?
  60 00232 7450 	SNA		/   if not, skip next line
  61 00233 5247 	JMP	BSFIX	/   if so, special action
  62 00234 1374 	TAD	(BS-RUB)/ Is it RUB (rubout)?
  63 00235 7450 	SNA		/   if not, skip next line
  64 00236 5254 	JMP	RUBFIX	/   if so, special action
  65 00237 1373 	TAD	(RUB-ESC)/Is it ESC (escape)?
  66 00240 7450 	SNA		/   if not, skip next line
  67 00241 5204 	JMP	MSGOUT	/   if so, special action
  68 00242 1372 	TAD	(ESC)	/ Undo funny effects of tests
  69 00243 5215 	JMP	WAITIN	/   then go get more input
  70            
  71            /	Code for special actions after some codes
  72 00244 4267 CRFIX,	JMS	OUTCON	/ For CR
  73 00245 0212 	LF		/   follow it with LF
  74 00246 5215 	JMP	WAITIN	/   then go get more input
  75            
  76 00247 4267 BSFIX,	JMS	OUTCON	/ For BS
  77 00250 0240 	SP	 	/   follow it with SP
  78 00251 4267 	JMS	OUTCON	/   and
  79 00252 0210 	BS		/   follow that with BS
  80 00253 5215 	JMP	WAITIN	/   then go get more input
  81            
  82 00254 4267 RUBFIX,	JMS	OUTCON	/ For RUB
  83 00255 0210 	BS		/   follow it with BS
  84 00256 5247 	JMP	BSFIX	/   finish up same as BS
  85            	
  86            /	Routine to output a character to both terminals
  87 00257 0000 OUTPUT,	.-.
  88 00260 6041 	TSF		/ Is term 0 ready to output?
  89 00261 5260 	JMP	.-1	/   if not, wait
  90 00262 6046 	TLS		/   if so, output to term 0
  91 00263 6411 	TSF1		/ Is term 1 ready to output?
  92 00264 5263 	JMP	.-1	/   if not, wait
  93 00265 6416 	TLS1		/   if so, output to term 1
  94 00266 5657 	JMP I	OUTPUT	/ Return
  95            
  96            /	Alternate entry to output a character constant
  97 00267 0000 OUTCON,	.-.
  98 00270 7200 	CLA		/ Clear
  99 00271 1667 	TAD I	OUTCON	/   and get the constant
 100 00272 4257 	JMS	OUTPUT	/   then put it out
 101 00273 2267 	ISZ	OUTCON	/   and advance the return address
 102 00274 5667 	JMP I	OUTCON	/ Return
 103            
 104            /	The output message, on startup or ESC
 105 00275 0200 MSG,	0200	/ null
 106 00276 0215 	CR
 107 00277 0212 	LF
 108 00300 0212 	LF
 109 00301 0320 	0320	/ P
 110 00302 0304 	0304	/ D
 111 00303 0320 	0320	/ P
 112 00304 0255 	0255	/ -
 113 00305 0270 	0270	/ 8
 114 00306 0240 	SP
 115 00307 0303 	0303	/ C
 116 00310 0357 	0357	/ o
 117 00311 0355 	0355	/ m
 118 00312 0355 	0355	/ m
 119 00313 0365 	0365	/ u
 120 00314 0356 	0356	/ n
 121 00315 0351 	0351	/ i
 122 00316 0343 	0343	/ c
 123 00317 0341 	0341	/ a
 124 00320 0364 	0364	/ t
 125 00321 0351 	0351	/ i
 126 00322 0357 	0357	/ o
 127 00323 0356 	0356	/ n
 128 00324 0240 	SP
 129 00325 0320 	0320	/ P
 130 00326 0362 	0362	/ r
 131 00327 0357 	0357	/ o
 132 00330 0347 	0347	/ g
 133 00331 0362 	0362	/ r
 134 00332 0341 	0341	/ a
 135 00333 0355 	0355	/ m
 136 00334 0215 	CR
 137 00335 0212 	LF
 138 00336 0212 	LF
 139 00337 0000 	0
 140 00372 0233 $
     00373 0144 
     00374 7611 
     00375 0005 
     00376 7563 
     00377 0274

---

From: [email-masked] (PDP11 Hacker .....)
Date: Wed, 4 May 1994 17:19:00 GMT

In article <[email-masked]>, [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879) writes...

[Great story deleted]

>how different things were only a short time ago.

This is almost the founding statement of the P850 User Group, a group of
Madmen, mostly in the UK, who are trying to preserve as much of the history of
computing as possible. Museums do a great job preserving the realy significant
machines, like ENIAC, EDSAC, etc, but there are many other macines that sold
well in their day, but are likely to be lost for ever if someone doesn't
preserve them - machines like the PDP8, PDP11, PERQ, P850, Intellec, and later
machines like the first PETs, TRS80s, Apples, Exidy Sorcerors, etc.
Hence they keep as much of that stuff running, so that a new generation will
have a chance to see a real computer.

>PS.  Here's an assembly listing of the program (from my UNIX-based

Is that assembler available for public consumption anywhere?

-tony

Bristol University takes no responsibility for the views expressed in this
posting. They are the personal views of the user concerned.

---

From: [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879)
Date: 4 May 1994 18:45:21 GMT

>From article <[email-masked]>,
> Is that assembler available for public consumption anywhere?

Ask and ye shall recieve.  I sent a copy by E-mail.

				Doug Jones
				[email-masked]

---

From: [email-masked] (Charles Lasner)
Date: 5 May 1994 09:45:16 GMT

Doug Jones' school project is excellent and I laud him for doing it!

However, I wish to point out a few notions about the actual program:

1) It's good form to have the output routine clear the AC afterwards. 
This makes it independent of the hardware.  (There are alternate devices
besides serial ports; in the course of outputting to them, the AC
preservation may not be reliable or will at least amount to overhead. 
Since there is at least one place in the program where the AC has to be
cleared of the old data, this doesn't serve anything useful.)

2) I don't understand why the RUB character wants to be outputted, and I
hope the reason was thought through as other than an after-the-fact
documentation of the "it's not a bug, it's a feature" variety.  Note that
reorganizing the program to use the output routine with final clearing
will make this decision a bit easier. 

3) When outputting multiple characters, it's best to avoid "library"-type
solutions (ask Johnny Billquist about this!) in the sense that each
problem begs a slightly different variety of solution type.  Here
straight-forward multiple single calls were used with the character code
passed in-line.  The passing in-line portion is fine per se.  In fact, it
lends itself to an optimization technique because then the constants are
available as literals (and likely needed!). 

   However, it can be more efficient to institute special-purpose features
to match the requirements.  For example, since there will likely be a
sequence of the form <output a char><output a char>JMP for some indefinite
number of characters, an alternate way to do this is to pass *multiple*
in-line literal arguments, each to be outputted in turn until a sentinal
argument is found. 

   Regarding that specific, the PDP-8 offers a nice additional trick: By
insisting that such a call is always followed by a JMP, which in octal
happens to be a negative number (5xxx), you can return to the first place
after the literals that isn't positive.  This gets implemented with no
overhead, since it just means that the order of argument checking changes;
if the passed argument is negative, do a return JMP immediately.  Else,
retrieve the argument again, process it and then ISZ past the argument and
JMP back to the argument-parser, etc. (Note: if for some reason, the
requirement of a JMP instruction following the caller's literal arguments
cannot be met, it always can be accomplished with some form of potential
overhead such as a NOP or CLA or JMP .+1.  Perhaps the negative value can
itself have applicability elsewhere; as long as the fact that it also
executes can be tolerated, then perhaps it can be done without an overhead
per se.)

4) The program should avoid the use of the text-book-type interrupt
skip-chain form.  In practice this is never used except for a few
contrived cases (such as in RTS-8 where the address is being patched in
from elsewhere).  In this programs flag-checking routines (which are akin
to interrupt handling) are taking no advantage of the fact that the IOT's
for checking skip when set, since they were used to cancel SKP
instructions which negate JMP instructions, etc.  In PDP-8 terms, this
amounts to a limited form of what CS people want to call "spaghetti code". 
A fixed-task interrupt handler (the vast majority of situations) should be
written using the IOT skipping to negate the JMP to the next device test. 

So, overall project rating: A
PDP-8 coding efficiency rating: B-

Keep up the good work; next year the state finals!

cjl

---

From: [email-masked] (Charles Lasner)
Date: 5 May 1994 09:49:48 GMT

In article <[email-masked]>,

>Is that assembler available for public consumption anywhere?

Doug's Assembler hasn't passed muster with all of the PDP-8 hackers yet.  
An alternate way to develop stuff that *will* definitely be compatible is 
to use an emulator.  Viable ones are already among us.

cjl

---

From: [email-masked] (PDP11 Hacker .....)
Date: Thu, 5 May 1994 13:54:00 GMT

In article <[email-masked]>, [email-masked] (Charles Lasner) writes...
>Doug's Assembler hasn't passed muster with all of the PDP-8 hackers yet.  

What does it fail on? It's surely OK for cross-assembling little test programs,
and at least I get the source.

>to use an emulator.  Viable ones are already among us.

Surely that means I need an assembler than runs on a PDP8 (if it is to run on
an emulator). In that case, I could run the assembler on my PDP8. Is such an
assemblerr available anywhere. I'm afraid I don't really know what PDP8
software is out there - I've just got the machine and so far I've only run one
program and that was from the maintenance manual, just to check that most of
the hardware was working.

I have this ingrained objection to emulators, and prefer to run the real
hardware. SOmething to do with being a hardware hacker I guess...

-tony

---

From: [email-masked] (Charles Lasner)
Date: 6 May 1994 07:49:16 GMT

In article <[email-masked]>,
>and at least I get the source.

Full-blown PDP-8 assemblers are few and far between.  Most people who 
have written viable PDP-8 cross assemblers haven't gotten it quite right, 
or are just missing important features, etc.  Unlike some other lame 
assemblers, the PDP-8 assembler depends on certain quirks that have been 
around for decades, and the programs that exist depend on the nuances, etc.

I assume Doug will "stay the course" and eventually produce a 
full-fledged assembler that will produce both a compatible listing and 
correct binary for all possible files we can throw at him.  Right now, 
this isn't true, etc.

The source of virtually anything PDP-8 is available, although we are 
mired in wasting some time dis-assembling some noteworthy exceptions.  
But in general, if you used something on the -8, the source was 
available.  Closing an architecture is something somebody dreamt up later!

Of course, what good is it to you to have the source of the assembler 
written in itself without a system to run it on?  (And if you have the 
system itself, you have no immediate need for the assembler's own source, 
unless you want to study/modify the assembler itself!)

(Remember, most PDP-8 software is written in assembler!)

>the hardware was working.

No, you don't have a machine yet.  You have a CPU only.  The dominant 
software isn't for a CPU with a little memory.  You need a disk device 
and a terminal, and preferably a line-printer.  Add an extra serial line 
and you can run Kermit, etc.  In any case, all but the extra serial line 
is needed to run the assembler; delete the LPT: only if you don't want 
paper listings, etc.

So, start with an emulator.  When you get a whole machine together, you 
can run the same software on both the real hardware and on the emulator.  
Perhaps you'll even outgrow the need to have an emulator at all!

>hardware. SOmething to do with being a hardware hacker I guess...

Understand, but the emulator isn't the goal, just a point on the journey.

In any case, to avoid compatibility problems, run real assemblers whether 
on real or virtual hardware!

Note: we have defined various viable mechanisms to transfer binary 
between machines.  Assuming a cross-assembler gets written that really is 
compatible, and this certainly *can* be done, then it's fine.  It's just 
that so far, no one's quite done it.

cjl

---

From: [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879)
Date: 5 May 1994 15:03:17 GMT

>From article <[email-masked]>, by [email-masked]
> 1) It's good form to have the output routine clear the AC afterwards. 

I wanted the ASCII characters to hang around in AC for as long as possible,
so that students typing on the terminals could see the ASCII codes for the
keys they hit.  As a result, I deliberately avoided clearing AC, and after
the string of comparisons for special stuff, I put things back the way they
were.

> 2) I don't understand why the RUB character wants to be outputted

After the fact kluge engineering -- processing of BS and CR came first,
and then, on the evening before the darned thing had to be delivered to
his school, I discovered my son trying to erase things with RUB.  It's
harmless to echo RUB, so I didn't bother reorganizing the program to
catch RUB before things were output.

> 3) ...  For example, since there will likely be a sequence of the form
> <output a char><output a char>JMP for some indefinite number of
> characters, an alternate way to do this is to pass *multiple* in-line
> literal arguments, each to be outputted in turn until a sentinal
> argument is > found.

Nice idea, and if there's ever cause to tune the program a step farther,
I'll probably do it -- but this program was developed in my spare time
between calls for help from my son as he worked on his poster
presentation and messing around with a cable that almost but not quite
supported the interface requirements of my laptop.  I didn't exactly
have time to tune the darned thing.

> after the literals that isn't positive.

A cute trick!

> 4) ... In this programs flag-checking routines (which are akin
> instructions which negate JMP instructions, etc.

You're right about that.  That's a clunky bit of code I wrote a year ago
and toggled in by hand, then never bothered to rethink.  Your idea of
having each section begin with

TRYDEV, IOT		/ skip if ready
	JMP	NXTDEV
	stuff		/ process for this device

is clearly superior.
					Doug Jones
					[email-masked]

---

From: [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879)
Date: 6 May 1994 15:06:37 GMT

>From article <[email-masked]>,
> correct binary for all possible files we can throw at him.  Right now, 

Have you read the disclaimer in the source for my assembler?  Here it is:

   disclaimer:  This assembler accepts a subset of the PAL 8 assembly
	language.  It was written as a quick hack in order to download
	software into my bare-bones PDP-8 system, and no effort has
	been made to apply sound software engineering techniques in
	its design.

For further clarification, the software comes with a warantee:

   warrantee:  If you don't like it the way it works or if it doesn't work,
        that's tough.  You're welcome to fix it yourself.  That's what you
        get for using free software.

I have little interest in staying the course!  The thing is available,
it's quite useful for supporting (and debugging) a bare bones machine,
and it avoids the hassles of running an emulator.  It is compatable enough
that source files you develop under it are likely to assemble with no
problems on real PAL assemblers, but my purpose was never to produce a
fully compatable assembler.
				Doug Jones
				[email-masked]

---

From: [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879)
Date: 6 May 1994 15:15:02 GMT

By the way, the PDP-8 demo at my son's school went off without a hitch,
and it was, by any standard, a wild success.  We delivered the hardware
in pieces -- just stripped down PDP-8/F with memory, cpu and terminal
interfaces, plus two terminals.  My son managed to find wall outlets,
string wires to the terminals, and fire it up (the program was already
in core), and it worked like a charm for an hour or two during the day
and another hour or two yesterday evening.

The 8/F ran with the top off (actually, I don't have a lid for it), and
my son made signs saying "CPU" "Memory" and "I/O Interfaces" for those
parts.  More than a few parents peered into it and asked "where's the
disk" or other questions that illustrated great knowledge.

It was competing against tin-can telephones, morse code stuff, posters
about the internet, video tapes and more, and for most of the time it
was running, it had crowds of kids around the two terminals typing
messages (for the kids old enough to type) or just typing gibberish
(younger kids) to each other.  There were running PCs and Macs sitting
around too, but most of them didn't attract crowds.

So, in conclusion, do it!  Get those old machines out in public!
The right dinky little program (and the code I posted a few days ago
is hardly disserving of any higher acclaim) can really be as fun to
play with as something that runs in 3 megabytes and requires a WIMP
user interface!

				Doug Jones
				[email-masked]

---

From: [email-masked] (Tom Karlsson)
Date: 07 May 1994 11:31:19 GMT

> play with as something that runs in 3 megabytes and requires a WIMP

A year and a half ago, we (Update) experienced the same thing when showing
some of our machines at the computer science and mathematical campus
in Uppsala (when the campus was officially opened).
Besides some newer and smaller machines (DEC Rainbows, Professionals and
a small microVAX II), we had a PDP-8i, a PDP-11/24 (or was it 34 ?) and
a PDP-11/70.
All of the machines were running and we even had a Votrax connected to
the PDP-11/x4, just to be able to "talk" to the spectators :-)

The temporary computer room we used was well visited. We got
some complaints from others in the building, that we draw too much
attention from the other attractions... (I wonder why? :-)

/Tom
--
|  Tom Karlsson           email: [email-masked]      phone: +46 18 260097  |
|  Student of Computer Science @ Uppsala University, Sweden.               |
|  Secretary of Update.   email: [email-masked]                         |
|           "Intelligence is to do stupid things in a smart way"           |

---

From: [email-masked] (Peter R Cook)
Date: Fri, 6 May 1994 18:01:12 GMT

When I was in high school it was a PDP-8 with the early
	version of star trek on it that got me hooked. After that
	I took BASIC, then off to college for a BSCS.

-- 
Peter R. Cook - Unix, Ultrix,     |  Black Dragon Entertainment is a full 
& VMS Software Engineering.       |  service Management, Music (BMI/ASCAP), 
[email-masked]                 |  Record, & Production company. Inquire! 
  The opinions expressed above are held by the entire known universe.

---

From: [email-masked] (Charles Lasner)
Date: 8 May 1994 12:41:31 GMT

In article <[email-masked]>,

>the string of comparisons for special stuff, I put things back the way they

Still cleaner to put the char into the AC while waiting for a new one if 
you insist.  Alternatively, instead of doing a final CLA, do an MQL.  
Then the latest typed char is in the MQ.

>catch RUB before things were output.

I know this was a quick and dirty job.  My purpose is to advance the 
skills after the fact, etc.

>have time to tune the darned thing.

I know.  The point is that there are many ways to tweak code.  The -8 is 
a place it's been done.  Other machines tend to standardize on mediocre 
methods and are never revisited.  This encourages abstraction and 
expediency while wasting compute resources.  While some people seem to 
operate on the notion that resources are infinite, sometimes they get 
hoisted accordingly.  Better to have an appreciation of what can be done 
with less, not assume more is always possible!

>A cute trick!

Not original.  Look at the way you call the FPP package.  A bunch of 
in-line arguments with a special-purpose terminator.  Some FPP's actually 
execute the 0000 that exits knowing that it's a harmless AND instruction!

>is clearly superior.

But hardly original.  That's just the way all of the reasonable code was 
ever written!  It appears that the only source of the demented code is 
the manual!  I guess they didn't want to call interrupt handling a JMP 
chain :-).

Also, I fully appreciate the problem of hand-loading of code.  A lot of 
the benefits of these ideas only came about because we were users of 
whole systems, not just CPU's and a terminal.  In your case two 
terminals, but still not a whole system!

Perhaps you needed to bring in an RX drive as well to dazzle the school 
people :-).

cjl

---

From: [email-masked] (Bob Smith)
Date: Sun, 8 May 1994 14:39:37 GMT

In CJL's last post on this article (at the time of my post), he does his
best to say: All of your stuff has been done before, there are better
ways, none of this is original, and CJL can do better.

While all of his comments MAY BE true, I say that it is time to
focus on what this effort is all about: FUN.  The fun of seeing something
work.  The fun of seeing how you (the individual) can do something,
the fun of learning how to do it even if someone else has already done
it a similar way or even a better way.

There is a bit of life left in the old 8's.  There is still more
fun left in them if we can give each other credit for trying, gently 
coach and mentor with ways of doing things differently, and ENCOURAGE
EVERYONE to try.

The logical thinking process that gets a program to work or a piece of
hardware to work is only part of it.  The individual stamp, the artistry
if you will, should not be squelched by any of us.  If advice is sought,
it should be freely given.  If some one is letting us know that 
they have accomplished something of note to them personally, we all
should enjoy, not just for them or with them but for our selves as
we remember or premeber how will did or will do something similar.

There are way to impart information that do not detract from an
individual's effort.  There are destructive ways of attempting to
do the same thing.  Let's make this fun.
bob

---

From: [email-masked] (PDP11 Hacker .....)
Date: Sun, 8 May 1994 14:37:00 GMT

In article <[email-masked]>, [email-masked] (Charles Lasner) writes...
>PDP11 Hacker ..... <[email-masked]> wrote:

[Doug's C cross-assembler]
>around for decades, and the programs that exist depend on the nuances, etc.

Could you please post some examples of these quirks. It would be interesting to
see what the programmers got up to.

>unless you want to study/modify the assembler itself!)

Actually, I would be interested in studying the assembler. The reason I run all
the old machines that I do is to learn about computers, how they work (both
hardware and software), and also to learn from the mistakes. Reading software
source code is a great way to do this.

>is needed to run the assembler; delete the LPT: only if you don't want 

Hmmm. I have a little more that just the CPU and memory. I _think_ my current
list of options is : 
PDP8/e CPU
Timeshare/extended address board
32K core (4 off 8K 3-board sets)
Line-frequency Clock 
3 serial ports (M8655?)
1 LS8E (Is that a printer port)
1 RK8 (No drives yet, but I can 'borrow' an RK05 off my PDP11 if necessary).

I also have (non-working I think) a further serial port and a second RK8E.

The only thing I am missing is the EAE board set, but presumably some software
will run without that installed.

I am still testing things up at the moment, but I will get it all working...

>Perhaps you'll even outgrow the need to have an emulator at all!

I'd much rather fix up the hardware and run the programs on the 'right'
machine. Somehow, a PDP8 without a front panel doesn't seem right :-)

-tony

---

From: [email-masked] (Charles Lasner)
Date: 9 May 1994 13:37:01 GMT

>ways, none of this is original, and CJL can do better.

This is simply not true!  I think it's great that a science fair project 
in 1994 involves the -8!  I hope there's a whole lot more of things like 
this!

As to the comments on programming technique, all I am encouraging is 
constructive criticism.  Doug is a self-proclaimed -8 programming 
novice.  I thought it was a good opportunity to show how his code could 
be tweaked in various ways for his benefit., as well as anyone else who 
cares to see the distinctions, etc.

Of course I can do it better, so what?  Is this a contest?  Others can 
also do it better, so what?  There are others who can do it better than 
me, so what?  Hopefully with some additional experience, Doug himself 
will do it better.  That's a goal for my posting, etc.

>it a similar way or even a better way.

I totally agree.  How do you think the tricks of the -8 were developed in 
the first place?  Personally, I think there are still many more to be 
learned for all of us.

When I learned programming, the authoritarian types spouted party-line 
nonsense such as the old saw that to check if a number is in a range, you 
have to do a double-compare, first to see if it's greater than a lower 
bound, and then less than an upper bound.

Since I initially didn't know any better, I followed their false notion.  
One day I was staring at someone else's code and saw that this is wrong: 
on the -8, if you setup the link before you check a range, it flips/does 
not flip according to if the number is in range!  And as a useful side 
effect, you get the relative list position in the ac as a bonus.  This 
revelation blew me away!  I really learned an important concept from 
another person.  It would have been real helpful if that person was 
available to me and was telling it to me.  I would have been writing far 
better code far sooner if enough of that sort of guidance had been 
available, etc.

>coach and mentor with ways of doing things differently, and ENCOURAGE

Which is exactly what I am attempting to do!

>we remember or premeber how will did or will do something similar.

Doug posted his code here for all of us to see.  He isn't doing so to win 
prizes for best of -8 code awards :-).

>do the same thing.  Let's make this fun.

I totally agree.  But I think you are alone in the way you mistook this.  
I think Doug's reactions differ.  And since he was the "prime target" I 
think we should let him decide.  In any case, this is a fun thing, and it 
should be that way, etc. :-)

cjl

---

From: [email-masked] (Charles Lasner)
Date: 9 May 1994 14:17:04 GMT

In article <[email-masked]>,

>see what the programmers got up to.

I could dig up some relevant examples, but I suspect you would do better 
to just look at some example programs.  In any case, a "complete" -8 
assembler depends on a whole bunch of inter-dependent characteristics 
that make the difference between a toy and something more useful than for 
just getting a little binary from a little source.  Some of this is 
documented in the relevant manuals, but even they leave some things out, etc.

>source code is a great way to do this.

I agree.  But without a complete -8 assembler to read, what little is 
gained from an incomplete attempt at an -8 assembler will only show 
another point of view on how not to write one!  Also, remember that this 
is a language processor.  You are not only dealing with syntax issues, 
but also the assembler itself is interfaced to an operating system, and 
of course the whole thing is PDP-8-specific code to implement the thing.

>will run without that installed.

Sorry, but as the phrase goes, close, but no cigar!  Clearly you are 
heading in the correct direction, but until you are there, you are no 
closer than just CPU and memory as far as a development environment goes.

>I am still testing things up at the moment, but I will get it all working...

I hope so!  At that point you have enough to start using real code 
without an emulator.

>machine. Somehow, a PDP8 without a front panel doesn't seem right :-)

I agree.  But I already have lotsa in-place hardware already doing it.  
Yet curiously I find myself primarily typing on DECmates for development 
as a more "personal" environment.  Then I use Kermit to finalize the 
program on the -8.  However, on the -8 I have plenty of development tools 
available as well, so often the version that comes back to the DECmate is 
itself edited and sent back, etc.

My -8 has more than just lights and switches, it also has a hardware 
breakpoint module.  For some problems, this is invaluable and has bailed 
me out more than once!

>>cjl

You will be needing a way to get OS/8 to your machine if you haven't done 
that already.  It would help if you can at least borrow an RX01/02 for 
that purpose so someone can mail you a starter system.  Beyond that, the 
net can get you what you need, etc.  Unfortunately, we don't have 
presently any software to download an O/S at an -8 that is "empty" :-(.  
(Note: Kermit-12 includes a facility to get *it* up on a "bare" OS/8 system!)

cjl

---

From: [email-masked] (PDP11 Hacker .....)
Date: Mon, 9 May 1994 16:52:00 GMT

In article <[email-masked]>, [email-masked] (Charles Lasner) writes...

[Quirks in PAL8 code]

>documented in the relevant manuals, but even they leave some things out, etc.

OK. Please point me at the example programs. Are they on an ftp site anywhere?
I would like to see one such characteristic, preferably undocumented, that
could cause problems.

[Is the source to an assembler useful]
>I agree.  But without a complete -8 assembler to read, what little is 

There seems to be 2 issues here
a) Doug's assembler came with source, so that I could trivially compile it on a
PC and use it to assemble little test programs to sort out my 8/e's hardware
b) I would be interested in seeing the source to a 'real' PDP8 assembler, so
that I can see how it was written, and how it works, and what quirks it
expresses.

>but also the assembler itself is interfaced to an operating system, and 

Surely an assembler translates assembly code into machine code. The OS it runs
on to do this (if in fact there is an underlying OS - standalone assemblers
have existed) is irrelevant. Why does a PDP8 assembler have to run on a PDP8?
Why can't a proper, compatible, one run on UNIX, VMS, MS-DOS, or whatever other
OS you care to name.

>of course the whole thing is PDP-8-specific code to implement the thing.

Again, I fail to see why it has to be PDP8 code.

[My PDP8e - >> line are mine]
>closer than just CPU and memory as far as a development environment goes.

I have the maintenance manual, printsets, and enough test equipment to turn
some members of this group the colour of a PDP12 :-). Every component in the
system I can either get or have in my junk box. I repair PDP11's, PERQs, and
P850s, no problems. There is no question as to whether I will get the rest of
the hardware running. In the meantime I was going to try and find out what
software was available, and how to get it, for the time when I finally got it
all together.
However, if I do run into problems, please remind me not to post to this group
as I shall probably get a flame for not having a GenRad board tester, like DEC
used to use.

[Emulators]
>I hope so!  At that point you have enough to start using real code 
Just out of curiousity, what sort of machine do I need to run a PDP8 emulator,
and where can I get the emulator from? 

[Real hardware vs emulators]
My aim in all this has been simple : To fix up the PDP8/e, get a terminal and
disk drive on it, and then to run some software. I'm not particularly
interested in running PDP8 code on anything else. So, when I saw that a PDP8
cross assembler was available, I thought it might be a way of saving a lot of
hand assembling for little test programs. Simple as that.

>breakpoint module.  For some problems, this is invaluable and has bailed 

I could probably do something similar by clearing the run f/f with the trigger
output from my logic analyser.

>that already.  IT would help if you can at least borrow an RX01/02 for 

No, I have no operating systems. I have plenty of RX01's and RX02's, but only
UNIBUS and QBUS controllers. Unfortunately, the schematics (or theroy of
operation) of the RX8 and RX28 where not in the pile of PDP8 and PDP12 manuals
that came with my machine.

>(Note: Kermit-12 includes a facility to get *it* up on a "bare" OS/8 system!)

Wasn't there a way to load OS-8 from paper tape. I have a real ASR33 if that's
the way to go...

-tony

---

From: [email-masked] (Douglas W. Jones,201H MLH,3193350740,3193382879)
Date: 9 May 1994 19:14:37 GMT

>From article <[email-masked]>,
by [email-masked] (PDP11 Hacker .....):
>
> ... for not having a GenRad board tester, like DEC used to use.

You want one?  I happen to know where most of one is sitting right now,
begging for a new owner.  I bought the high speed reader and punch from
it, but the GenRad backplane is still there.

(My tongue is in cheek, I'll admit.  I actually believe I have a stack
of far more useful boards I got from the U of Iowa Psych Department,
opto-isolated 36 bit out, 24 bit in parallel I/O boards.  These look
like they'd make great test interfaces!)

I'm tempted by the old GenRad hardware just as a source of muffin fans,
5 volt power supply, and misc socketed chips (since all its chips are
socketed).
				Doug Jones
				[email-masked]

---

From: [email-masked] (Charles Lasner)
Date: 9 May 1994 22:28:39 GMT

In article <[email-masked]>,
>I would like to see one such characteristic, preferably undocumented, that

Ask Doug for a smattering of these.  He had to re-implement his 
assembler's reckoning of some of the common problem situations until it 
worked correctly.  Otherwise, what you are asking for is a spec on how to 
implement the language, which I guess I'm the tapped person to write it, 
etc.  I will get to it, but it's gonna take some time for a complete spec 
and wish-list.  But I will say for now, that it will be quite picky on 
points often ignored in other machines.

In any case, I'll try to give an example of what the assembler gets used 
for that perhaps breaks most attempts.  By the end of this, the only 
assembler left standing will be P?S/8's.

Problem: We are going to write an overlay.  It needs to use current page 
literals for itself (in each of its pages) and also has the right to use 
page zero literals of what page zero looks like at the time this gets 
loaded off of a disk block back into absolute memory locations as defined 
at assembly time.  Additionally, both the relevant page-zero literal 
table and the overlay itself are not where they would be loaded later, as 
this program we are writing is actually the generator of the overlay 
etc., and thus this "real" program is running in a normal binary space 
and has its own aspects to be concerned about just to get the overlay 
written to the disk.  Thus, this program needs to know the loading 
address of the overlay as it exists in memory right now, "next to" the 
program that will do the writing.  Yet, the assembler has to correctly 
assemble the overlay itself as if being executed in the place where the 
overlay later gets loaded back in when called up, etc.

To accomplish all of this, the assembler has to support RELOC so that the 
source origin deliberately is not the same as the binary one.  The 
relocation has to be cumulative so that the page zero literals can be 
offset differently from the current page code.

Additionally, the literal generation method has to keep track of the 
extent of literals on each current page, as well as page zero.  According 
to standard rules, when you leave a page, the extents of both the code 
and literal dump are remembered, so that re-enterring the page can be 
accomplished with full checking of literal table/code collision, etc.  
(Of course the literals themselves are dumped, so that redundant literal 
generation could occur!)  However, we need to be able to disable this 
remembrance altogether for this program, since the program space seems to 
be redundant to the overlay space or vice-versa.  As a concession to the 
assembler, we are willing to not re-enter pages once leaving them.

PAL8 can accomplish all of the above, as long as they are all in the same 
field.  Only P?S/8 PAL can do it should the data be loaded into two 
different fields.  Considering that this is an overlay, that's entirely 
possible!  (One uses overlays because all of the available space is 
filled, and swapping in is feasible.  Thus, the binary definition of 
where to load the overlay for write-out/generation purposes to get it to 
the disk would easily require the use of memory space outside of the 4K 
field where the program that gets overlayed would have to be created, etc.)

The reason P?S/8 PAL can accomplish this is because beyond PAL8's 
capability, P?S/8 PAL includes a dynamic option to prevent the page-zero 
literal table from being dumped during a field change.  Thus, up to 7 
additional entire fields of overlays can be created over a 4K base 
program in a 32K development environment, all stages sharing the 
page-zero literal area in an equitable way.

I actually had to do this once to create an application that was a 
real-time system which swapped in some analysis tools.  The rest of 
memory was occupied either by data or code in 32K, so overlaying was the 
only option.  Since the disk calls were P?S/8-specific, it could only be 
done there for execution purposes also.  However, by using OS/8 
conventions, it could have easily been made runnable from OS/8 only, yet 
OS/8 couldn't assemble it.

I once had a similar application of these principles, but for a totally 
different application.  Additionally, it had to be run from OS/8.  So, 
after it was completed, we had to go back and identify by hand all 
page-zero literals in both the overlays and the base code, and delete 
them by effectively doing kludges like

	Z100=	[0100]
	Z20=	[0020]

Then changing all of the references from something like:

	AND	[100]

to

	AND	Z100/[100]

Note the commented-out attempt at a literal to remind us of what we would 
have liked to do, but couldn't!

So, in effect, we removed all of the literals from page zero!  As the 
base code is dumped, so is the page zero literal table.  Then the 
overlays are on their own to reference the Z-constants.  So, instead of 
the assembler working for us, we worked for the assembler!

Code that is relocated affects the way the assembler listing is created.  
There is an asterisk next to any relocated address, since it's showing 
the source reckoning, not the binary reckoning.

BTW, (John Wilson, are you listening?) some utilities look at sequences of
deliberate origin settings in files to validate them.  (I think this
includes TSS8.) Thus, it's necessary that origins be under the control of
the programmer.  There is even an option to enable/disable the automatic
*200 that comes just after a field setting.  Also, there are the NOPUNCH
and ENPUNCH pseudo-ops used to establish overall controll.  This can be
useful to be a poor man's RELOC as long as literals aren't being used, or
to create dummy sections in a program merely to create definitions, but no
actual binary. 

>Why can't a proper, compatible, one run on UNIX, VMS, MS-DOS, or whatever other

Some of the features can't apply to a non-O/S version, such as PAUSE 
which means to force local EOF.  P?S/8 includes an option to force a 
separate binary file for output to be started at an arbitrary point, 
which is also useful towards the endeavor of overlays, etc.

But other than that, of course you are correct.  Using the medium of 
exchange of the 8-bit frame paper-tape binary output encoded in some 
suitable manner, cross-assemblers are fine, as long as they really do 
obey all of the quirks of assembly, etc.  It's just that so far, no one 
has ever quite got it right!

>Again, I fail to see why it has to be PDP8 code.

Same as above, no reason other than history.

>some members of this group the colour of a PDP12 :-).

Be careful about that!  Most of Mark Hyde's -12's are blue, not green.

> Every component in the

We have great confidence in your ability to eventualy get there!  My only 
point is that at the present time you aren't there yet.  And further, you 
have no software to run on it yet even if you were.  Additionally, you 
have no experience with the software, which will take you a little longer 
to get fluent with it sufficiently (but not much! :-)).

>and where can I get the emulator from? 

Ask Bill Haygood what the extet of his emulator is.  There are others 
that are PC-specific.  They have the advantage of being able to exchange 
live media with some DEC machines.  Bill's uses simulated devices 
exclusively.

>hand assembling for little test programs. Simple as that.

Absolutely.  When you get the real thing up, then use the real thing.

>output from my logic analyser.

This one's got some nice rotary wheels/dials to set the address of the 
fetch or exec stop.  Someone published these things in DECUS years ago 
for the Omnibus.

>that came with my machine.

Not a problem.  There is an RT-11 program that maintains OS/8 RX01 disks.
But you still need a way to read them on the -8 for boot purposes, so you 
need the M8357 card :-(.

Perhaps there is another way:

It's possible to write a two-page OS/8 system handler that uses the 
serial port as a device assuming a support device on the other end.  In 
essence, what you have to do is get a copy of OS/8 configured for this 
system in image form.  Then get it to the server machine of your choice 
so it translates disk read and write requests into the 8-bit format the 
comm board expects.  This is how "WPS-11" worked, which was really a 
bunch of VT-78's on an -11 server, etc.  

The -8 boot of such a system would be long by boot standards, but still 
short enough to toggle in.  Once up, you could then run BUILD to transfer 
it to an RK8E/RK05, etc.

>Wasn't there a way to load OS-8 from paper tape. I have a real ASR33 if that's

There is a way to run BUILD to create a system from paper-tapes.  I 
wouldn't think of using an ASR-33 though!  It was designed for use with a 
PC04 reader/punch, etc.

cjl

---

From: [email-masked] (John Wilson)
Date: 9 May 1994 23:29:05 GMT

In article <[email-masked]>,
>But you still need a way to read them on the -8 for boot purposes, so you 

Hey this won't do, let's turn that :-( into a :-) !!!

People always seem to be looking for M8357's without luck, but are you
aware that DEC still sells them new?  I just ordered one from DECdirect,
$118 for order # M8357-00.  Not exactly small change, but consider it's
from DEC you could do worse...

Happy hacking,    John Wilson

---

From: [email-masked]
Date: 10 May 94 08:58:21 MDT

> bunch of VT-78's on an -11 server, etc.  

For what it's worth, there's a publically available TU58 emulator for Unix.
I haven't tried it yet, bet I do have a copy. The TU58, as I'm sure we're all
aware, is a small (both physically and block-ally) cartridge tape that
communicates over RS232.

And since no one's tried to soothe tony's jangled nerves: there, there; we're
all in this together, some of us are just a bit more excitable than others...
-- 
----------------+------------------------------------------------------
Roger Ivie      | Don't think of it as a 'new' computer, think of it as
[email-masked] |     'obsolete-ready'

---

From: [email-masked] (Charles Lasner)
Date: 11 May 1994 15:26:49 GMT

>aware, is a small (both physically and block-ally) cartridge tape that

This could probably help someone get started on the server end, assuming 
that's the kind of code they want to use, etc.

However, there are a few problems with the specifics of the TU58:

1)	Only the KL8E was ever able to send a BREAK character which is a 
necessary portion of the TU58 protocol.  This severely limits its 
applicability.  (The break is possible because the KL8E is unbuffered for 
output; you can jam stuff into the output register while it's already 
being outputted, so you can extend the character, etc.)

2)	A better protocol should be given that allows the -8 to lag being 
the data being sent to it.  (Of course we expect the server to be 
responsive to the -8 sending data at it!)  This could include some form 
of acknowledge on every character received by the -8.

3)	We don't want to live by the small capacity of the TU58.  There 
is no reason why the server can't support a simulated hard disk structure 
worthy of MENU-8 partitioning it down to nice chunks for P?S/8 and OS/8 
to live under, etc.  I am assuming that for some people, this would be 
their only -8 disk.  Of course if it's merely a mechanism to transfer an 
O/S from, then it can be smaller.  However, the TU58 is *real* small!

>all in this together, some of us are just a bit more excitable than others...

I suspect that Tony's made of stronger stuff than that! :-)

cjl

---

From: [email-masked] (Jim Cook)
Date: 15 May 94 17:39:06 GMT

> 	I took BASIC, then off to college for a BSCS.

Tell us where you went to school!

I've seen a few of these messages before and they always leave me
wondering whether the individuals posting them used the same systems.
When I was in high school, I worked at a non-profit org. called
"Project Local", located in Westwood High School (Westwood, Mass.).
It ran the PDP-8's for a number of towns, including Westwood, Dedham,
Needham, Natick, Arlington, Wellesley, Lexington, and maybe Framingham.
Some of this was via leased phone lines to a central facility, while
others had their own machine.

Jim Cook
Class of '75