Subject: Test programs you can toggle in

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

There seems to be a demand for test programs you can toggle in from
the front panel to test bare machines, so here are a few:

   1            / program to blink the lights in a binary counter sequence
   2
   3            *0000
   4 00000 7200         CLA
   5 00001 2005 LOOP,   ISZ     COUNT   /delay for 4K iterations
   6 00002 5001         JMP     LOOP
   7 00003 7001         IAC             /increment counter visible on lights
   8 00004 5001         JMP     LOOP
   9 00005 0000 COUNT,  0

There is a simpler program:

   1            *0000
   2 00000 7001 LOOP,   IAC
   3 00001 5000         JMP     LOOP

But the simple program counts so fast that all the bits toggle faster than
you can see with the human eye.  Single stepping the simple version is a
good basic test, but the first, and more complex version slows itself
down enough that you can watch the show.

   1            / program to blink the lights in a chase light sequence
   2            /   speed can be adjusted with switch register
   3            /   suggested initial value on switches = 7770
   4
   5            *0000
   6 00000 7301         CLA CLL IAC     /load initial shift pattern (0001)
   7 00001 3015 LOOP,   DCA     SHIFT   /set aside while delay is read in
   8 00002 7404         OSR
   9 00003 3016         DCA     COUNT   /save switch setting
  10 00004 1015         TAD     SHIFT   /get pattern on lights during delay
  11 00005 2017 DELLP,  ISZ     DELAY   /inner loop delays 4K cycles
  12 00006 5005         JMP     DELLP
  13 00007 2016         ISZ     COUNT   /outer loop delays indicated amount
  14 00010 5005         JMP     DELLP
  15 00011 7104         CLL RAL         /spin lights one place left
  16 00012 7430         SZL
  17 00013 7004         RAL             /fixup for lit bit falling off edge
  18 00014 5001         JMP     LOOP
  19
  20 00015 0000 SHIFT,  .-.             /pattern to shift
  21 00016 0000 COUNT,  .-.             /outer loop count
  22 00017 0000 DELAY,  0               /inner loop count

The following program tests the asynch I/O interface.  It ought to work
with any PDP-8/E I/O interface (but not older interfaces, since it uses
the newfangled KCF and TFL instructions.

   1            / program to echo TTY keyboard to printer
   2
   3            / device codes to merge with IOT instructions
   4            INDEV=  0030            / input device address
   5            OUTDEV= INDEV+10        / output device address
   6
   7            / iot definitions
   8            KCF=    6000+INDEV      / keyboard clear flag
   9            KSF=    6001+INDEV      / keyboard skip if flag
  10            KRB=    6006+INDEV      / keyboard input
  11            TFL=    6000+OUTDEV     / teleprinter set flag
  12            TSF=    6001+OUTDEV     / teleprinter skip if flag
  13            TLS=    6006+OUTDEV     / teleprinter output
  14
  15            / code
  16            *0000
  17 00000 6040         TFL             /setup for TTY output
  18 00001 6030         KCF             /setup for TTY input
  19 00002 6031 LOOP,   KSF             /await input ready
  20 00003 5002         JMP     .-1
  21 00004 6036         KRB             /get character
  22 00005 6041         TSF             /await output ready
  23 00006 5005         JMP     .-1
  24 00007 6046         TLS             /output character
  25 00010 5002         JMP     LOOP    /start over

The above is perhaps a bit of overkill, but if you have devices other
than 03/04 that you want to test, this can be customized to test them.

To make the above program run on any old PDP-8, note that the KCS
instruction isn't really needed (the master clear button on the front
panel does this).  The problem is to get the teleprinter to set its
flag so that the first attempt to output will be enabled.  The
conventional fix is to output a null at the start of the program,
so you'd replace lines 17 and 18 of the above with:

  17 00000 7200         CLA             /spit out a null
  18 00001 6046         TLS             /to the TTY

Finally, once you get a console device working, you can load the RIM
loader on your console device and then download code from a support
computer that can spit RIM code out its serial output port.

(But if your normal I/O device is a TTY, you may need to make a BC01V
cable to go from your KL8E interface card to an RS232 plug, and then
you may need to add a null modem.  Info on those bits appears
elsewhere!)

Here's a TTY version of the RIM loader, easily customized for whatever
asynch port you want to load from.  Once you get this toggled into
memory, you may never have to toggle in any other code because you can
download RIM format object code from your support machine, or download
the BIN loader in object form and use it to load the software of your
choice:

   1            /       RIM loader for asynch input
   2
   3            / Input I/O device code
   4            INDEV=  0030
   5
   6            / IOT instructions used
   7            KSF=    6001+INDEV      / keyboard skip if flag
   8            KCC=    6002+INDEV      / clear AC and reader flag
   9            KRS=    6004+INDEV      / or input with AC
  10            KRB=    KCC KRS         / read input to AC
  11
  12            *7756
  13 07756 6032 BEG,    KCC             / Initialize reader
  14 07757 6031 TTYC,   KSF             / Await input
  15 07760 5357         JMP     .-1
  16 07761 6036         KRB             / Get a character
  17 07762 7106         CLL RTL
  18 07763 7006         RTL
  19 07764 7510         SPA             / Skip if high bit of char reset
  20 07765 5357         JMP     TTYC    / Else loop (skipping leader)
  21 07766 7006         RTL             / AC[0-5] is 6 bit, LINK=bit 7
  22 07767 6031         KSF             / Await input
  23 07770 5367         JMP     .-1
  24 07771 6034         KRS             / Or 6 bit char into AC[6-12]
  25 07772 7420         SNL             / Skip next if bit 7 of first set
  26 07773 3776         DCA I   TEMP    / Store data
  27 07774 3376 HSRC,   DCA     TEMP    / Set address of next data word
  28 07775 5356         JMP     BEG     / Get next data word
  29 07776 0000 TEMP,   .-.             / Address of next data word

---

From: [email-masked] ("Stephen Walters")
Date: Thu, 12 May 1994 07:08:06 GMT

MORE! MORE!

Bravo!

Can someone take me through the steps of entering these programs?

[email-masked]

---

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

>From article <[email-masked]>,
> Can someone take me through the steps of entering these programs?

OK.  Here's the core of one little program:
   
   4 00000 7200 	CLA
   5 00001 2005 LOOP,	ISZ	COUNT
   6 00002 5001 	JMP	LOOP
   7 00003 7001 	IAC
   8 00004 5001 	JMP	LOOP
   9 00005 0000 COUNT,	0

To load this, do the following:

     00000	 - put this on the switches, then press LOAD ADDR
           7200  - put this on the switches, then lift DEP
           2005  - put this on the switches, then lift DEP
           5001  - put this on the switches, then lift DEP
           7001  - put this on the switches, then lift DEP
           5001  - put this on the switches, then lift DEP
           0000  - put this on the switches, then lift DEP

All numbers are in octal, and you've got to convert them to binary to
load them on the switches.  Switch handle up means on, down means off.
While you are loading, the address lights show the address you are about
to load into, and once you've loaded a value, the MEM DATA dislay shows
the most recently loaded value (what is displayed is controlled by a
rotary switch on the 8/E and 8/F).

Now, if you didn't make mistakes, your program is in memory.  You can
run it as follows:

     00000	 - put this on the switches, then press LOAD ADDR
                 - make sure the HALT switch is in the up position.
                 - then press CLEAR, then press CONT.

The program increments the accumulator, so you'll get your best
display of its operation by rotating the data display switch so it
displays the accumulator.

You can inspect memory by:

     00000	 - put this on the switches, then press LOAD ADDR
                 - press EXAM

Each time you press EXAM, the MEM DATA display shows the most recently
examined memory location and the address lights show the next address,
the address you can inspect by pressing EXAM again.

Hope this helps!
				Doug Jones
				[email-masked]

---

From: [email-masked] (Johnny Billquist)
Date: 12 May 1994 23:00:59 +0200

>Can someone take me through the steps of entering these programs?

Someone just did, which I noticed.

I shall give a few comments here anyway, on the subject of
small test programs to fire up your machine.

First, don't put your small programs at address 0.
Your program very quickly gets to address 10, which sometimes,
depending on what your program does, might give you weird
results.

As a rule, use 200-377 for small programs on the front panel.
This means you have page zero if you want to do something
special fancy as well, and 200-377 is just as easy as address
0-177.

Then, for small test programs:

The increment AC test is a very good starter, no comments about
that one.

The test I usually do after the AC test is TTY output test,
and this one can be much shorter than the one posted.

00200	7001
00201	6046
00202	6041
00203	5202
00204	5200

This will output all characters to the console, it's easy to
insert from the front panel, and easy to single step, if you
want to.

The next test after that is just an extension. Read from the
console, and echo it.

00200	6031
00201	5200
00202	6036
00203	6046
00204	6041
00205	5204
00206	5200

You can also check the last character entered by looking at the AC
on the front.

These both programs should work with both modern and older types
of interfaces, at all speeds, and at all machines. (cjl will
correct me if I'm wrong)

While they arguably are not optimal, they are minimal, which
I think is of more concern in these cases, and also, they
don't do any fancy, hardware dependant stuff at all.

For you who don't write pdp8 code from head, and know the
whole instruction set by heart, you can disassembly these
short programs. I always find it fun to look at binaries...

One last program, then... This one shows in the AC the
current settings of the switch register...

00200	7604
00201	5200

One more thing about programming from the front panel on the 8/e
and alike (this don't apply to the 8/i atleast).
If you enter something into memory, and it's wrong, you
must reload the address, since the address is always incremented
after each deposit. It's also always incremented after each examine,
so if you are checking your code, and find an error, you need
to backup one address before depositing the correction.

If you are familiar with operating an pdp-11 front panel, you
will tend to do things wrong. :-)

Happy hacking!

	Johnny
-- 
Johnny Billquist                  || "I'm on a bus
CS student at Uppsala University  ||  on a psychedelic trip
email: [email-masked]       ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol

---

From: [email-masked] (Charles Lasner)
Date: 13 May 1994 04:08:53 GMT

In article <[email-masked]>,

>of interfaces, at all speeds, and at all machines. (cjl will

No code problems per se.  However, if the console is a VT-100 or some 
other terminal that really needs ^S/^Q support, the output may not really 
be useful.  Also, it will output a strange escape sequence (and also a 
CSI string) which could screw up some similar consoles, etc.  Best to use 
a slow vanilla terminal so the output makes sense as an ASCII spiral, etc.

>to backup one address before depositing the correction.

Try a PDP-12 console.  You use Fill and Fill Step or Exam and Exam Step 
to advance through memory perhaps filling.  If you want to change a 
location, just use Fill and keep going with Exam Step.  Thus, only if you 
commit to Fill Step is it advanced.

Of course you're right on an -8/e-type panel, where it's also confusing 
to see the address of anything going through the same lights.  Sometimes 
it's the updated address of the program counter telling you the next 
location that will be fetched subsequently, and at other times it's the 
address of the operand data (or pointer if an indirect).  At least on the 
older panels the address displays are separate.

Another tip about test programs.  Use the MQ if you have one.  On the 
-8/e it's standard.  Also, remember that the MQ .OR.'s with the AC when 
reading it back into the AC with MQA.  Since you can pre-clear the AC, it 
effectively becomes a load, but perhaps the OR is useful.  Regardless, it 
makes a useful set of lights to store data in little programs.

And don't forget the MQ debugging null job.  In an interrupt-driven 
system where EAE isn't really used, use the MQ to display the contents of 
the address specified on the switches:

LOOP,	LAS			/GET THE SWITCHES
	DCA	0		/STASH AS POINTER
	TAD I	0		/GET THE CONTENTS
	MQL			/DISPLAY IN MQ LIGHTS
	JMP	LOOP		/KEEP GOING

And speaking of lights, there is the LINC-8, the best of them all.  As 
long as the LINC or tape isn't running, you can display anything in all 
of those lights of the LINC A and B registers, program counter, and to 
a limited extent the C register, not to mention the relays, and a whole lot 
of loose bits on the simulated LINC front panel.  A light-chaser's delight!

cjl (in honor of the Stand: M-O-O-N spells PDP-8)

---

From: [email-masked]
Date: 13 May 94 13:40:21 MDT

> older panels the address displays are separate.

Could be worse. I imagine the PDP-5 spent about half its time displaying the
address of the PC; you know, zeros. Haven't used one, though, so I'm just
imagining; I'd appreciate it if any PDP-5 users out there can pipe up.
-- 
----------------+------------------------------------------------------
Roger Ivie      | Don't think of it as a 'new' computer, think of it as
[email-masked] |     'obsolete-ready'

---

From: [email-masked] ("Stephen Walters")
Date: Wed, 18 May 1994 23:17:53 GMT

I would like to thank all those people who have given me test prog to 
toggle in. I have a BBC film crew coming round on thursday evening and 
....

...One of the thinks in my vast computer collection they want to see is 
my PDP8e. So many thanks

73's

If anybody is disposing of a PDP8e/s or VT78 please let me know...

---

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

>From article <[email-masked]>,
by [email-masked] ("Stephen Walters"):

> .....

If your machine has core memory, you can preload everything for the visit
days in advance, and speed your demo when the film crew is there.  Just
toggle in the demo (or demos) you want, then halt the machine and power
it down.  The demo will stay in core.  Power the machine up with the
halt switch down, then flip halt up, load the starting address, clear the
machine, and continue, and your demo will be running.  The sequence, from
a cold machine to blinking lights, should look good on film, alot better
than a frustrated programmer trying to toggle something in and getting
it wrong on camera.
				Doug Jones
				[email-masked]