• Please review our updated Terms and Rules here

Fortran IV programming on a PDP8E

Mike_Z

Veteran Member
Joined
Dec 1, 2013
Messages
1,713
Location
Near Milwaukee Wisconsin
I've been experimenting with DEC Fortran IV programming. A long time ago, actually 1965, I was using Fortran IV on a Burroughs 5500. In fact I still have my old Guide to Fortran IV by Daniel McCracken. Anyway I am re-familizing myself with Fortran, this time on my PDP8E computer. I want to do some work with Direct Access file control. Seems that my 1965 copy of McCracken's Fortran is silent on this. Recently I found the second edition of Guide to Fortran IV and it talks about direct access. I don't remember much of what I learned 50 years ago and have to rely on these old books to make things work. I believe I understand how to use DEFINE FILE and all the Fortran stuff to work with files, but I do not understand how to associate a file or dataset number to a real file on disk. I did find some information about doing this in a section on DEC Time Sharing. This talks about the CREATE statement that seems to work. I can create an empty filename with this. In fact I've used CREATE as a start to making a Fortran source program in the editor. BUT.... then in this Time Sharing section, there are other commands like OPEN. This is supposed to associate an internal file number to a file name, but when I try it OS8 comes back with OPEN? as if it doesn't know what to do. I suspect this could be something to do with time share. I probably do not have time share. So my question is how can I associate an Internal file number to a file name on disk?

For example, if I write,

DEFINE FILE 14(200,10,E,KPOINT)

This has the dataset or file # of 14. There are 200 records of 10 characters each. The E means the record is formatted and the KPOINT is the associated variable, or next record number.

Then;

Code:
    KPOINT=1
    DO 10 I=1, 200
    WRITE (14'KPOINT,10)KPOINT
10  FORMAT (10E6)
    END

This should fill the file with numbers 1 through 200. But somehow the dataset number 14 has to be associated with a filename. From what I have read so far it seems that this association is done in the OS8 operating system and not in the Fortran programming. Any suggestions? Thanks Mike
 
Any chance you can write the code to use OPEN instead of DEFINE? Usually makes disk access much simpler.

LOAD /G should allow one to assign a given file for I/O. Must be done at the command prompt. Check the documentation on this; it is most confusing and I won't try to paraphrase it.

I don't think you can have a unit designation of 14; PDP-8 only allows for 1 through 9.
 
I recall having to convert a program to run under OS8 (IIRC) and it was pretty ugly. FORTRAN unit 4 was "reserved" for user file I/O and one had to use IOPEN and OOPEN subroutine calls to perform the association. This was over 40 years ago, so my memory is probably corrupted.
 
Pretty sure that DEFINE FILE is the command of choice here. Not sure what you are referring to with LOAD /G. Are you talking about the CCL command? or the Fortran IV LOADER? Neither seems to be appropriate for this function, could be wrong thou. You are correct about the dataset number 14, too big, but it gave me the idea to enter a filename here instead of a number. This seemed to work, by that I mean there were no errors reported, yet the filename I used, did not seem to grow in size when I DIR'ed it. Then again, if I deleted the filename and tried the program, then I received an error of NO INPUT IMAGE, so it must be partially working. What I did was to subsitute 'ATC.TS' for the dataset number and in OS8 used CREATE ATC.TS to make an empty file. At the onset this file used one block of storage, but after supposedly adding 1200 records, the file still had only one block. So, I'm unsure anything was added.

Code:
DEFINE FILE ACT.TS(1200,10,E,KPOINT)

KPOINT=1
DO 10 I=1,1200
10  WRITE (ATC.TS'KPOINT,20) KPOINT
20  FORMAT (E6.2)
END

I also tried to use TYPE ATC.TS, figuring that it would display something if there was something in the file. Probably just stuff, but nothing was printed. I also wrote a short program to look at record 125 specifically, but nothing showed.

I am using Fortran IV and have been reading the OS8 Handbook, but apparently have not come across the pertinent parts, yet. I have the April 1974 book. Page 274 of my book talks about cassette and mag tape PIP. Looks like the document you referenced is a 1979 edition of OS78. I wonder whether or not that applies to my operating system. I will have to do some reading in this book. Still working, thanks Mike.
 
In the OS/8 Handbook, look at section 7.1.2.1 Specifying I/O Devices (page 266 in the PDF of the 1979 version). That explains how to use LOAD /G. g4ugm provides a link to page where it is available.

Most of my Fortran IV work was on a PDP-11 so I have glanced at the PDP-8 documentation for anything that differs between the two.
 
DEFINE FILE identifies the size and structure of the file - but doesn't/can't assign it to a physical file on a physical disk. This is done via the FRTS (Fortran Run-Time System). A maximum of 9 (1-9) logical unit numbers can be defined (so your LUN 14 is invalid). The first 4 are initially defined - but can be redefined if you like. The remaining 5 LUNs (5-9) can be defined on the command line when invoking FRTS (or 'higher' if you are doing a COMPILE/ASSEMBLE/LOADER/RUNTIME from the command line).

The OS/8 Language manual also describes this process.

Dave

PS: Since I received my 'envelope of luck' from you; I have managed to acquire 5 off OMNIBUS 8K core memory cards (I am building a PDP 8/e card by card...) and purchased a DEC PDP 11/45 for restoration.
 
Been busy reading the OS78 Handbook. It says it is for DECstation equipment, yet will work on PDP8 machines. I'm pretty sure I have the older OS8 operating system. There seems to be different, or at least additional, information in the OS78 book. I know that my copy of OS8 does not have COMPILER. I use F4-RALF-LOAD-FRTS sequence, instead of COMPILE-LOAD-FRTS, so I wonder if this will work on my system. Anxious to try it.
I did come across SET DVC, which says it sets device codes. But I have not found any examples of it's use. I hesitate to use it, because I have the tendency to screw things up without knowing how to back out. I don't know what the command format is.
Thinking about this, it brought to mind another question I've been wondering about, how does the machine associate the LUN's to the physical? For example, The machine code uses Octal code 603X for TTY read and 604X for TTY write. Yet in Fortran IV, the READ and WRITE use the LUN number 4 (on my machine). Actually I discovered the LUN of 4 by trying all of them. No documentation. Some where the machine must have a file or ??? that helps with this association of LUN and machine language. Have not found it though.
Dave, I hope the luck care package arrived undamaged. Glad to hear of your good fortune regarding the cards. How long will it be before it will be flipping bits? Good Luck --- Mike
 
Mike,

Everyone's been asking me the same question - it is a 'long term investment' so I don't want to rush it. Busy reading up on all things UNIBUS at the moment and trying to work out exactly what I have and whether there is enough to make a working system or not. Also, what do I want the system to do when it is 'finished'?

The LUN to DEVICE/FILE assignment is described in the OS/8 Language Reference Manual AA-H609A-TA on pages 1-22 through 1-24 of the FORTRAN IV section. The documentation for LUN 4 being the console terminal is defined on page 1-23 (FYI 1=Paper Tape Reader, 2=Paper Tape Punch, 3=Line Printer and 4= Console Terminal). LUNs 5-9 are unassigned and you can change 1-4 if you like.

LUNs and IOT addresses are not the same at all.

Dave
 
Well... that document AA-H609A-TA really is interesting and it seems to answer quite a few of my questions. Thanks for suggesting it. But it still leaves a question for me, unless I missed it. How does the machine know that LUN #4 is 603X and 604X, which is the machine language code to read and write a character to my console. AND if I would change the address straps on my M8650 uart card, how would the machine know it was changed. In fact my PDP8E has two M8650 cards one with machine codes of 603X/604X and the other with 640X/641X. What would the LUN for the second uart card be? Is this the job of the device handlers? Mike
 
The FORTRAN run-time system knows nothing about device addresses (not strictly true - as it has its own drivers for the first 4 LUNS - but I will ignore that for now).

The assignment of LUN to device is done using what is effectively a command line parameter. For example:

To set LUN 9 to the Paper Tape Punch use /9=2 [DER: 9 being the LUN and 2 being the internal LUN for the Paper Tape Punch].

If you then want to re-run your program - but send the output to the line printer instead of the paper tape punch you can use the command:

/9=3

And to the console:

/9=4

To send the output from your program to a tape file you could use:

DTA1:OUTPT.TM/9

Where DTA1: is a DECtape device amd OUTPT.TM is what you want to call it. From what I read in the manual, the file must already exist on the device. You can 'create' a file that doesn't already exist by entering:

DTA1:OUTPT.TM</9

There seems to be a load of limitations on what you can and can't do and how many files you can refer to on a particular device at any one time. If in doubt - read the manual. Incidentally don't us the OS78 manuals for OS/8. My suggestion is to identify and download all of the relevant manuals for your running Operating System as a reference. Even then, there is still no guarantee that the manuals absolutely line up with the specific revision of the O/S you are actually using. This is why resurrecting old computer hardware and software is so much fun (!!!)

EDIT: There is a really useful collection of OS/8 manuals here that appear to be extremely useful: http://vandermark.ch/pdp8/index.php?n=PDP8.Manuals.

Now to the question of IOT instructions...

This is all taken care of by the OS/8 device driver.

If you change the IOT address that you card responds to - it won't work any more unless you make a corresponding change to the OS/8 device driver or BUILD. If you get into PAL8 - you will find the SYSTEM GENERATION / BUILD command has instructions for creating your own device drivers - but I leave that as an exercise for later...

Dave
 
Last edited:
You know, everyday I seem to learn something new, and at the same time I believe I become more ignorant, because of all the new things that are opened up by the new item I have just learned.

When you say 'This is why resurrecting old computer hardware and software is so much fun (!!!)' Should not the word 'fun' be in italics' or some other font indicating fun in a different sort of way? I suppose it is fun or I wouldn't be doing it at this advanced age.

I've been collecting documentation for a few months. But as you indicate, there is a lot out there and I have read quite a few items that will not work with my machine, but it seems to enlighten me on how to better ask questions of myself and on the forum.

I am also assuming that your are using 'device driver' as a synonym for device handler? Good thing that summer is coming and the weather out side is warming up, should be 60's today. I can sit on the porch and read about all this stuff. Thanks a bunch for all the help.
 
I've been experimenting with DEC Fortran IV programming. A long time ago, actually 1965, I was using Fortran IV on a Burroughs 5500. In fact I still have my old Guide to Fortran IV by Daniel McCracken.

You could do a comparison between the Burroughs B5500 Fortran and PDP-8/E Fortran, https://github.com/pkimpel/retro-b5500/

There is a reference manual for the B5500 Fortran: http://bitsavers.trailing-edge.com/pdf/burroughs/B5000_5500_5700/1032083_B5500_FortranRef_Apr68.pdf
 
Back
Top