• Please review our updated Terms and Rules here

What did I do to my PDP-8 today.

Wait until the snow... It’s just too hot outside...

It is quite interesting what you have done. The implication being that the constant itself may be stored as text until it is actually required?

This would be unusual for a compiler...

I would expect that the compiler should have performed some form of semantic check on the source rather than just a syntax check so that an out-of-bounds check on a constant should have been flagged by the compiler rather than leave it to the runtime library.

Darn it, you’ve got me hooked now. Unfortunately, I have had to shut the machine down as we have now got a storm hit us!

Too hot, followed by thunder, lightening and rain...

Dave

Actually, it's not stored in text, but it is complicated. First of all, integers are 24 bit. (Obvious, if you look at the range.)
Second, it's actually done in sortof FPP mode. The parsing/processing of integers goes through mostly the same code path as floating points. The FPP essentially just expects the exponent to be 0 when doing DP, and does actually detect overflows.

And no, there is no overflow checking in the input stage of the compiler. It just collects the data. However, since this actually goes the same way as FP, it also does not wrap, as you could possibly otherwise have expected.

I haven't touched any of this code in close to 30 years. Gah! Anyway, the sources can be seen at ftp://ftp.update.uu.se/pub/pdp8/os8/fiv. The relevant bits and pieces can be seen in F412K.PA or F416K.PA, depending you your preferences. The 16K version was done by me, since I didn't really see much of a point of having it tailored to fit in a 12K machine. Once it went above 8K, I figured I might as well assume 16K.

(And I only did various hacking on it, I was not at all involved in the original development. In addition to the expansion to 16K to allow for a larger symbol table, I also hacked in so that .AND. and so on could also be applied to integers, and not only logicals. I was trying at the time to port DUNGEON to the PDP-8, but I gave up at some point... :) ).

Oh yeah, http://www.bitsavers.org/pdf/dec/pdp8/os8/DEC-S8-LFSSA-A-D_F4swSupp.pdf is also very useful to look at.
 
Last edited:
I've been working on a fun little research project over the last few weeks. It is a continuation of a project I last worked on about 5 and half years ago. That project is a set of subroutines that allow somewhat efficient use of the PDP-8 as a stack machine. Of course we all know that the PDP-8 does not have a stack (except for the 6120 CPU which has two). I decided to document my work and go over it all again. I have a google doc which I will post a link to here at some point. What I did today was revisit the idea of using one of the auto-index registers (10 through 17 octal) as the stack pointer. My conclusion 5 years ago was that I couldn't see any way to make it an advantage. Although the pop type operations are faster the push ops are slower. You can think of all stack operations as symmetrical in that for every call there is a return and for every push there is a pop. So it becomes easy to compare the execution times of the pairs of operations. I will show the call and return functions here for both with and without auto index register.

CALL=JMS I ZCALL
RET=JMP I ZRET

*20
SP, 7600 /INITIAL STACK POINTER
ZCALL, ICALL /POINTER TO THE CALL SUBROUTINE.
ZRET, IRET /POINTER TO THE RETURN CODE

*200 /CURSORY TEST
CLA
LP, CALL; INCAC /CALL THE SUBROUTINE TO INCREMENT THE AC
HLT
JMP LP

/KIND OF A LAME EXAMPLE IF I SAY SO MYSELF.
INCAC, IAC /INCREMENT THE AC
RET /AND RETURN TO CALLER


*2000 /PUT CODE SOMEWHERE.
ICALL, .-.
DCA SAVAC /SAVE THE AC
CLA CMA /SP <- SP-1
TAD SP
DCA SP
CLA IAC /AC <- 1
TAD ICALL /AC <- REAL RETURN ADDRESS
DCA I SP /PUT ON STACK
TAD I ICALL /GET CALLED ROUTINE ADDRESS
DCA ICALL /SAVE SO WE CAN JMP TO THE ACTUAL ADDR??
TAD SAVAC /RESTORE AC
JMP I ICALL /TRANSFER TO THE REAL SUBROUTINE

IRET, DCA SAVAC /SAVE THE AC
TAD I SP /GET THE RETURN ADDRESS
ISZ SP /SP <- SP+1
DCA ICALL /USE THE CALL ENTRY POINT AS A TEMP
TAD SAVAC /RESTORE THE AC
JMP I ICALL /TRANSFER CONTROL BACK TO THE CALLER

SAVAC, .-. /TEMP STORAGE FOR AC
$
Had to fix up the formatting by hand, hope I didn't mess anything up. The above code is the version of call/return which does not place the SP in an auto-index register. The Stack Pointer points at the top of the stack and grows downward.

CALL=JMS I ZCALL
RET=JMP I ZRET

*17
SP, 7600-2 /INITIAL STACK POINTER
ZCALL, ICALL /POINTER TO THE CALL SUBROUTINE.
ZRET, IRET /POINTER TO THE RETURN CODE

*200 /CURSORY TEST
CLA
LP, CALL; INCAC /CALL THE SUBROUTINE TO INCREMENT THE AC
HLT
JMP LP

INCAC, IAC /INCREMENT THE AC
RET /AND RETURN TO CALLER


*2000 /PUT CODE SOMEWHERE.
ICALL, .-. DCA SAVAC /SAVE THE AC
TAD SP /MAKE A COPY OF SP. IT ALREADY POINTS
DCA TSP /AT THE PUSH ADDRESS
CLA IAC /AC <- 1 (DOES NOT AFFECT THE LINK)
TAD ICALL /AC <- REAL RET ADDR
DCA I TSP /PUT ON STACK
CLA CMA /SP <- SP-1
TAD SP
DCA SP
TAD I ICALL /GET CALLED ROUTINE ADDRESS
DCA ICALL /SAVE CALL OR RET ADDR FOR IND JMP
TAD SAVAC /RESTORE AC
JMP I ICALL /GO TO CORRECT PLACE

RET, DCA SAVAC /SAVE THE AC
TAD I SP /GET THE RETURN ADDRESS
DCA ICALL /USE THE CALL ENTRY POINT AS A TEMP
TAD SAVAC /RESTORE THE AC
JMP I ICALL /TRANSFER CONTROL BACK TO THE CALLER

SAVAC, .-. /TEMP STORAGE FOR AC
TSP, .-. /COPY OF SP TO AVOID THE AUTO INDEX
$



The version that does not use the auto index register takes 25 cycles for the call and 15 cycles for the return for a total of 40 cycles. The version that uses the auto index register takes 29 cycles for the call and 13 cycles for the return for a total of 42 cycles. This is a 2 cycle improvement over my best from 5 years ago. And that 2 cycle difference is found in all the paired operations. Except it gets a little more complicated when I realized that there are now operations that do not need to be implemented by a JMS subroutine but can be placed inline as a single instruction. For example you can perform an AND against the top of the stack and get the pop for free by using AND I SP if the SP is in an auto index register. This takes only three cycles where the conventional routine looks like this:

STKAND, .-.
AND I SP /AC <- AC & TOS
ISZ SP /SP <- SP+1
JMP I STKAND /RETURN

This will be 9 cycles if called indirectly. POP and ADD are very similar being 6 cycles faster most of the time. I don't know if this is enough to make using the auto index register a plus but it makes the answer a lot less certain.

Still sun bleaching the VR210 case. The rate of change appears to have slowed but since I have to wait for the CRT glass to separate I can afford to keep putting it out.

Ok, There is clearly something I don't understand about this editor. The formatting looked fine until I posted it. Sorry it looks so broken

Doug
 
Last edited:
bqt,

Thanks for the background information. Very interesting insights.

I used to write compilers and assemblers for a job, so I find it interesting to see how it was done before the days that I got involved with computers...

I will take a look.

Dave
 
The cataract ridden VR201 CRT for the DECmate has been soaking in water for a week. And the answer is that this is not going to do it. I know that PVA will dissolve in water but this stuff doesn't seem to have softened at all. Doesn't look like it dissolves in acetone in spite of the fact that all the videos on this topic seem to use it. I understand why many of them complain about that part of the process. I will try isopropyl and denatured alcohols next. I would rather not use a lot of heat. Anyone know how they were assembled originally?

Doug
 
I found that the max integer for the DEC PDP8E Fortran IV is +/- 8,388,608. So I tried 10,000,000 for I and assembled it. The compiler did not report anything wrong, nor did the assembler or loader. Then when I ran it via FRTS, the program ran, but the out put was I=******. Anyway this is the kind of stuff I want to do with my PDP8E, but it will have to wait until the snow flies/ Mike

The integers are 24 bit signed two's complement numbers. Strictly speaking the range should be -8388608 through +8388607. If the arithmetic is done in a 24 bit space then adding 1 to 8388607 will give -8388608. The reason it printed the asterisks was because you specified the field width as I3. I would have expected the actual output to be MAX= *** from the program example given. You would need I7 to print a max width positive number and I8 to print the negative.

It has been a long time since I wrote anything in Fortran.

Doug
 
I would rather not use a lot of heat.

I think a thin braided steel cable (like those used to keep stuff from dissappearing in stores) could perhaps be used as a blade to saw through the goo? Might rough it up enough to get some solvent in there, too.

Vince
 
Yes RIP Julian, I have a few of his CDs:(
Dragging a wire between like a cheesecutter sounds very workable. Perhaps a piece of fine piano wire with a bit of current through it to warm it up a bit?
Or, a strand of Kevlar (everyone should have some of this wonder material in their workshop) or maybe even a few strands of dental floss twisted together. Whatever sort of strand it is, a bodged-up frame from steel or plywood to hold it taut would really help.
 
I took a break from the unpleasantness that is CRT cataracts. Thanks for the suggestions everyone. I do have a hot wire setup I use for cutting foam wing cores for RC aircraft modeling. I don't like the idea of the metal wire potentially scratching the curved glass face of the CRT. Something else to consider.

Instead I read through the reverse assembled source code that Charles Lasner made available for the DECmate II. I learned that even though they had stacks available on the 6120 CPU they didn't use them. When the 6120 wakes up it starts executing at 7777 and the DECmate wakes up executing in the ROM. The first thing it does is to copy the ROM to RAM and then jump into the RAM copy. That was their solution to JMS not working when executing in ROM.

I watched a bunch more YouTube videos showing CRT cataract repair. So far all of them use the heat lamp followed by heat gun method. Even on larger color TV CRT's.

I am still putting the VR201 case out in the sun. Not seeing much more visible improvement. It may have reached the limit of what sun bleaching will do. It is not quite as good as I was hoping for. Have to think about this some more. While I am not overly burdened with OCD I do suffer from it a little. Hopefully I can get to the good enough point.

Doug
 
Interesting...I should reassess one of these days, but I remember at one point in my -8 stack-machine project looking over the 6120 manual to see if it was worth the trouble to create a machine-specific version using those instructions, and it really didn't look like it was.
 
The cataract ridden VR201 CRT for the DECmate has been soaking in water for a week. And the answer is that this is not going to do it. I know that PVA will dissolve in water but this stuff doesn't seem to have softened at all. Doesn't look like it dissolves in acetone in spite of the fact that all the videos on this topic seem to use it. I understand why many of them complain about that part of the process. I will try isopropyl and denatured alcohols next. I would rather not use a lot of heat. Anyone know how they were assembled originally?

Doug

I have tried as well. I found a list wich stated that PVAc is soluble in various esters. I tried successfully with butylacetate. It smells bit but as far as I understood is not very unhealthy unless the concentration is quite high. It is actually used in nail polish remover for example.

Butylacetate works well. I used a syringe to inject butylacetate in between the crt and the shield. I injected more over a period of a week and eventually the glass was completely lose.

I don’t think water works. I tried putting a bit of the substance in water, Isopropanol and butylacetate. The only thing that really worked was the latter.

I heard bad stories about exploding CRT when using heat.
 
Interesting...I should reassess one of these days, but I remember at one point in my -8 stack-machine project looking over the 6120 manual to see if it was worth the trouble to create a machine-specific version using those instructions, and it really didn't look like it was.

I would be interested in seeing your project, assuming you got it to the point where you felt comfortable showing it to people.

Doug
 
I need to get back to it...I got most of the interpreter written (and re-written...) but I still need to finish it up (mostly, at this point, just doing alternate versions of some routines for straight-8 rather than 8/e) and test it, to say nothing of getting to the actual game program I intend to run on top of it. I have a thread going here, although I don't think the last code dump is all that current.
 
I have tried as well. I found a list wich stated that PVAc is soluble in various esters. I tried successfully with butylacetate. It smells bit but as far as I understood is not very unhealthy unless the concentration is quite high. It is actually used in nail polish remover for example.

Butylacetate works well. I used a syringe to inject butylacetate in between the crt and the shield. I injected more over a period of a week and eventually the glass was completely lose.

I don’t think water works. I tried putting a bit of the substance in water, Isopropanol and butylacetate. The only thing that really worked was the latter.

I heard bad stories about exploding CRT when using heat.

I saw that you mentioned Butylacetate in my other thread. What kind of business sells Butylacetate? Hardware store as some sort of paint thinner/remover?

Water should work if heated to between 60 and 80 C. I was soaking it at room temp. I could put it on my large 3D printer bed set to 80C and see how that goes.

With a tube this small the risk of careful heating should be fairly low. A 25 inch (635 mm) color picture tube would be a different matter entirely. I still would prefer not to do it by heating.

Doug
 
I saw that you mentioned Butylacetate in my other thread. What kind of business sells Butylacetate? Hardware store as some sort of paint thinner/remover?

Ordered a couple of bottles on Ebay.


Water should work if heated to between 60 and 80 C. I was soaking it at room temp. I could put it on my large 3D printer bed set to 80C and see how that goes.

This page says it is not soluble in water. Don't know about hot water. http://cameo.mfa.org/wiki/Polyvinyl_acetate
Perhaps it is the temperature alone that loosen it. It says it soften around 30-45 degrees C.

With a tube this small the risk of careful heating should be fairly low. A 25 inch (635 mm) color picture tube would be a different matter entirely. I still would prefer not to do it by heating.

Doug

I am not going to heat them regardless of size...
 
I need to get back to it...I got most of the interpreter written (and re-written...) but I still need to finish it up (mostly, at this point, just doing alternate versions of some routines for straight-8 rather than 8/e) and test it, to say nothing of getting to the actual game program I intend to run on top of it. I have a thread going here, although I don't think the last code dump is all that current.

I went back to the old thread and was surprised that I remembered participating in it. In answer to the question of what the Straight 8 does when you combine IAC and a rotate (RAL RAR RTL RTR) I fired up the Straight 8. Before I continue let me explain what this is about.

On the Straight 8 the combined operate micro instructions are executed in three time slices.
  1. CLA CLL occur in the first time slice.
  2. CMA CML occur in the second time slice.
  3. IAC RAL RAR RTL RTR occur in the third time slice.
This is a problem for IAC and the Rotates because there needs to be an order or the results will be ambiguous. The manual tells you that you can't combine these. It doesn't say what happens if you do. On the 8/s there are even more restrictions on combinations. On all the later processors they added a fourth time slice with the IAC occurring in the third and the Rotates occurring in the fourth.

After about 15 minutes the machine settled down enough that the front panel mostly was working and memory seemed to read and write and it could execute programs toggled in somewhat reliably. However it won't boot OS/8 from DECtape. I was able to run the 12 instructions I had composed to test out the unsupported combination or IAC and a rotate. The combos I tried were

Code:
        CLA CLL IAC RAL /which should give L=0 AC=0002
        CLA CLL IAC RAR /which should give L=1 AC=0000
        CLA CLL IAC RTL /which should give L=0 AC=0004
        CLA CLL IAC RTR /which should give L=0 AC=4000

All of these resulted in L=0 and AC=0. To verify my results I ran these as two instruction sequences like this:
Code:
        CLA CLL IAC     /which sets L=0 and AC=1
        RAL             /which  sets L=0 and AC=2
All four examples give the correct value when the IAC and rotates are separate instructions. This leads me to the conclusion that the increment is being blocked by the rotate. There could be more to it than this and other trial values of AC and Link might give odd interactions but that is for another day. My basement started heating up after just half an hour and today is going to be a hot one.

Normally you turn on the machine, thread the DECtape, set 7605 in the switch register, press Load ADDR and then press Start and you have OS/8 running in just a few seconds of tape spinning. Much less time than it takes to boot Windows or Linux even though the machines they run on are approximately 200000 times faster.

Further work on the Straight 8 will have to wait until I need the heat.

Doug
 
In the continuing VR201 cataract cleanup I went for broke and heated the finest piece of piano wire I have with rc batteries and a DC motor speed control as the power supply. I used vice grips to allow me to hold the wire. I have to say that of all the restoration work I have done this was the least pleasant. I did use a heat gun to gently warm the PVA and allow me to scrape it off with a razor blade after I got the safety glass off. I have the safety glass mostly clean of residue. Toluene is supposed to work on PVA but I don't have any of that. Ethanol is also supposed to work but I don't drink and I suspect I wouldn't waste any on this. Isopropyl alcohol may soften it a little. Acetone doesn't seem to do anything. Windex doesn't seem to affect it. Tomorrow I will try denatured alcohol as I do have some of that.

Before I did this I watched several more videos where people use heat. Then I watched a manufacturing film from the late 50's or early 60's and there really is no reason to worry about heat if you go about it gently.

I think I will write some 8 code now while I try to get the smell out of my system.

Doug
 
I am visiting Vince Slyngstad and we repaired his prototype omnibus spacewars board. This of course would need some explanation of why it was broken. Well, it is a prototype after all and when I was last visiting we were trying to eliminate some ripple in the analog power supply that feeds the DACs and the op amps. While moving scope probes around there was a small accident and some smoke came off the board. Anyway, that is in the past and the board is back to pre-incident behavior.

After that we tried booting some disks I had made for the DECmate using PUTR. Vince has two DECmate II and one DECmate III. The II's didn't want to boot but when we tried the III it came up. Copied the disk to the local floppy and that one will boot on at least one of the II's. Most likely an alignment issue with the drive I wrote them on with PUTR last Sunday morning. Anyway, we sort of have OS/278 running on a couple of DECmates. I say sort of because there is something wrong in that quite a few of the utilities give an IMG ERR when you try to run them. My images came from dbit and I would like to find more images from another source. Anyone know where I can find some images of untainted original distribution media?

Doug
 
I worked some more on the paper I am writing about implementing CALL/RETURN with a stack on the PDP-8. This is part one of two or three with the eventual goal of coding up a stack machine back end appropriate to supporting a C compiler that can compile itself. I will post a link to the CALL/RETURN paper RSN (Real Soon Now). I need to go through it a couple more times as there is embarrassment when you make a minor mistake and then there is EMBARRASSMENT when you make a major mistake.

Tomorrow I will be heading to Vince's for a PDP-8 play day. Not sure what we are going to work on. The proposals have been the omnibus spacewar board and his 8/i. Both are good projects and I suspect that even spending the whole day on one or the other we may not get either complete. But that won't matter. In either case there will be some progress and that will make for a good time.
 
As mentioned previously, I spent the day with vrs42 aka Vince. When I arrived the agenda had changed and the idea was to see if we could get a TU56 running on his 8/e with a TD8E controller. Since I had never used a TU56 or a TD8E this sounded like fun. We wired it up and held our tongues just right and powered it up. Saw no smoke, heard no sparks and consequently spoke no evil. But placing the drives in local did not enable the movement switches. The motors did seem to tension the tape about the right amount. Also, the controller did not appear able to select either drive. We undid all of that as we deemed it unlikely we could fix everything in the time remaining and decided to work on the Space wars board issue. The idea was to isolate the D/A converter analog supply to eliminate ripple. Upon reading the data sheet we estimated that the analog VRef would only draw around 22 micro amps at 5 volts. Due to a miscalculation we used too large of an isolation resistor which dropped the voltage too low. We didn't know that at the time so we decided to measure the current, initially on the meters milliamp scale where it read 0.470. Switched to microamps to see what that said and i believe it indicated 4.2 microamps or something like that which made no sense. We had to find another meter which we found did work and showed 20 microamps and 0.020 on the milliamp scale which is the same. Great!, time spent on an instrumentation issue! At this point I was running out of time and we spent the rest of our time talking about other ways to resolve this issue. There was also some shelf reorganization where I helped move an RK05 drive. Dang those are heavy! I should have known this as I have a couple of them but I haven't moved them in a while I guess.

The reason for the DECtape interest is a request to copy some tapes. My Straight 8 wouldn't boot from DECtape the last time I tried it so I will probably work on that sometime next week after doing some required home maintenance.

I probably won't post here again for a while since I will be traveling.

What are you doing with your PDP-8? I think we all would like to hear about it.
 
Back
Top