• Please review our updated Terms and Rules here

Fortran Coding Sheet

The CDC Fortran IV compiler for the 6000/CYBER series (FTN) was written in about 170k lines of Compass. About 5k lines of Fortran IV code implemented part of the debug support.
The compiler was very well written and well commented.

I have zipped up version 4.6 of the Fortran IV compiler source printed out on an emulated CDC CYBER mainframe running NOS 2.8.1 and shared it via Google Drive:


The other 6000/CYBER series Fortran IV compiler called RUN was garbage but it compiled very quickly so it was only used at universities for student jobs. RUN dated back to early versions of the SCOPE operating system which was garbage too.

Enjoy
Tom
 
Last edited:
This is a much later version than the one (1.x) that I worked with. Apparently, it was cleaned up later. Hosted on SCOPE 3.3, although we ran it on a 3.1.6 derivative. SCOPE 3.4 was fairly new and eventually became NOS/BE while KRONOS (which came from MACE (Greg Mansfield/Dave Callender) became NOS.

It could also be that time has clouded my memory and my recollection of terrible code was from RUN and not FTN. After all, that was about 50 years ago.

The "official" name for FTN back then was "FORTRAN Extended". FTN was an optimizing compiler--RUN was not. Using the more aggressive optimization options on early FTN was somewhat chancy. I wonder if the posted version of FTN came after the shutdown of CPD in Sunnyvale.

Told you that I was old.... :)
 
Last edited:
I'm trying to recall the "stinker" PSR with FTN and RUN. It had to do with delimited Hollerith constants leading to ambiguous statements. Instead of saying "6HSAMPLE", one could also say "H*SAMPLE*" or "HXSAMPLEX". The PSR dealt with using "FORMAT" as a variable name (perfectly legal in FORTRAN IV). It was possible to write a statement such that it was impossible to figure out if a statement was a FORMAT statement or an assignment. The kludge to fix this was to see if the statement label appeared in an I/O reference (e.g. WRITE). It wasn't bulletproof because there's nothing in the rules that says that a FORMAT statement has to be referenced by an I/O statement.

I think I dug up the example a couple of years ago and posted it on cctalk or vcfed. I'm too lazy to go dig it up again.

F77 and subsequent forced vendors to either flag or error non-ANSI vendor extensions. Before that, it was a free-for-all.

An exercise for the non-petrified is to figure out how to write, say, a cross-assembler in FORTRAN that could run on the widest range of systems; 8-bit or 6-bit characters, various character sets, addressing granularity of a word with no specific size, etc.
 
RUN was used to write a bunch of cheap-and-dirty utilities without resorting to assembly. For example, to issue a system request (call a PP program) in SCOPE, one wrote the request in user location 1 and waited for the location to clear. Location 1 of all user areas was polled by PP 0 (MTR) which then dispatched the request appropriately.
Since RUN didn't have any sanity checks and didn't do any run-time checking, you could use the LOCF function (return location of a word) to issue such a request. e.g.,
Code:
      INTEGER MEM(1), LMEM
      LMEM = LOCF(MEM(1))
      MEM(1-LMEM) = 3LRSJ  (reschedule job)
10    IF ( MEM(1-LMEM).NE.0) GOTO 10
 
All CDC 6000/CYBER series Fortran compilers (FTN and FTN5) let you make system calls via RA+1 using the LOCF function.

In general CDC developed very good compilers for the 6000/CYBER series with the exception of the quick-and-dirty RUN compiler.

The COBOL5 compiler was full featured and the code was remarkably fast for a 60-bit machine with no real concept of 8-bit bytes and characters. Some low-end machines where enhanced with "Compare Move Unit" (CMU) hardware to better deal with characters. Interestingly they didn't bother with a CMU on the high-end machines as the COBOL5 generated non-CMU instructions moved/compared character arrays faster in software than the CMU hardware could.

I guess by now we have drifted far enough from "Fortran coding sheets". :giggle:
 
Last edited:
Just a note on the CMU-equipped lower (72/73) Cybers. When we first encountered it, the reaction was "hot dog--we can actually figure out if we've got one at run time". Just code an IM Bj+K (464...) instruction with a jump coded in the lower 30 bits of the word. Cyber/6000s without a CMU would treat the IM as a 15-bit no-op (46000), so by selecting the contents of Bj and K, you wound up with an instruction that would take the jump after executing 2 no-ops; if you had a CMU, the lower 30 bits of the word was ignored.
Worked great until we started testing on the prototypes of the Cyber 170. It seems that it demanded that a no-op was 46000 only--anything else on a non-CMU system would cause an illegal instruction exception.
Don't be too hard on RUN--it was FORTRAN 66 and I believe was originally hosted on COS--and I think was the work of Garner McCrossen. It served CDC well for several years. Also remember that COS and SCOPE were originally designed for batch-mode operation primarily.
 
Thanks for the info. I sent the pdf (from above) to a printer and he made me 100 copies for about $13. They are in black and white, but they work just the same. Mike
 
I printed out the linked to IBM form in colour - and it makes a beautiful form (just like I remember)...

Dave
 
Back
Top