Burroughs MCP: BASIC and Fortran 66 Programming
Previously we looked at Algol 60 on Burroughs MCP time-sharing; today we'll use both Fortran 66 and BASIC to implement the TPK algorithm.
BASIC
No documentation for this seems to have been preserved, but it appears to be close in features to Dartmouth's 4th edition (1968) BASIC, which does have a manual on bitsavers. Keywords like GOSUB and ON … GOTO are supported, but variables are still only floating point. INPUT is fully supported.
The code is very similar to the version we ran on DTSS, with the only
change being the exponentiation operator being **.
100 REM TPK ALGORITHM IN BASIC
110 REM
120 DEF FNT(X) = SQR(ABS(X)) + 5*X**3
130 REM
140 REM MAIN PROGRAM
150 DIM A(11)
160 LET N=11
170 PRINT "PLEASE ENTER", N, "NUMBERS"
180 FOR I = 1 TO N
190 INPUT A(I)
200 NEXT I
210 PRINT "RESULTS ARE"
220 FOR J = 1 TO N
230 LET K = N - J + 1
240 LET R = FNT(A(K))
250 IF R > 400 THEN 280
260 PRINT R
270 GOTO 290
280 PRINT "TOO LARGE"
290 NEXT J
300 END
Note than line 250 has a ? where you'd expect a >. Although this
was keyed in as > it was stored as ? due to the limited number of
characters supported by MCP.
Source and a transcript of its execution can be found on Github.
Fortran 66
MCP supports Fortran 66, which brings some improvements over Fortran II:
- The three-way-if
IF (RESULT-400.0) 2,2,1can now be expressed as a logical test:IF (RESULT .LE. 400) GOTO 2 - Function names no longer need to end with the letter
F.
The Burroughs implementation adds some more conveniences:
- Strings can be represented in quoted form
"HELLO"rather than Hollerith form5HHELLO. - Generic input/output can be done with
PRINT/READrather than specifying a unit number. - More than one statement is allowed per line, if separated by
;.
The time-sharing version relaxes the fixed column layout to make it
easier to enter programs on a terminal. Comments do need to start with
C- in columns 1-2, however.
Full information can be found in the 1971 Fortran Manual on bitsavers.
The program now looks like this. The left hand numbers are the line
numbers used for entering programs on CANDE. The middle numbers like
101 are Fortran labels.
1000 C- TPK ALGORITH IN FORTRAN 66
1100 FTPK(X) = SQRT(ABS(X)) + 5.0*X**3
1200 C- MAIN PROGRAM
1300 DIMENSION A(11)
1400 N=11
1500 PRINT 100
1600 100 FORMAT("PLEASE ENTER 11 NUMBERS")
1700 READ 101,A
1800 101 FORMAT(F9.4)
1900 PRINT 102
2000 102 FORMAT("RESULTS ARE")
2100 DO 3 J = 1, N
2200 K = N - J + 1
2300 RESULT = FTPK(A(K))
2400 IF (RESULT .LE. 400) GOTO 2
2500 1 PRINT 103
2600 103 FORMAT("TOO LARGE")
2700 GOTO 3
2800 2 PRINT 101,RESULT
2900 3 CONTINUE
3000 STOP
3100 ENDSource and a transcript of its execution can be found on Github.
Questions, corrections, comments
I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.