Burroughs MCP: COBOL Programming

It's time for the final language supported by Burroughs MCP under time-sharing: COBOL. As always we will implement the TPK algorithm. However, this turned out to be quite a challenge.

Two view of COBOL

COBOL - the COmmon Business-Orientated Language - is probably the most successful language originating in the 1950s. Designed by a committee to standardise business processing, it was adopted by several computer manufacturers and powered many systems in the finance, retail and government space. Although not used for much new development today, it is still widely in use: the Wikipedia article mentions that as of 2020 "COBOL ran background processes 95% of the time a credit or debit card was swiped". It has an English-like syntax intended to make it easy to read, and has powerful I/O facilities.

On the other hand - it had a reputation for being verbose and over-complicated, with many keywords and quirks in how it processes code. It is rarely taught or studied in academia, and Jean Sammet, historian and one of the language's designers, said:

little attempt was made to cater to the professional programmer, in fact people whose main interest is programming tend to be very unhappy with COBOL

Personally I have never used COBOL nor know anyone who has. I am intrigued to learn more, but the size of the language makes it rather daunting. But before we continue, there is another question to answer.

Is this a suitable language to implement TPK?

TPK is a mathematical algorithm: it does floating point calculations and relies on functions such as sqrt and exponentiation. This is rather outside of COBOL's business-orientated domain:

  • COBOL uses integer and fixed precision numbers, with floating point support only standardised in the 1980s.
  • Mathematical functions like sqrt were also not a standard part of the language until then.

We also do not have contemporary documentation for COBOL on the B5500; the closest is the B7000/B6000 Series COBOL Reference Manual from 1977. This reserved word table starting on p404 notes comparability with the B5700, saying that SQRT was available but floating point numbers (using the COMP-4 type) were not, which seems to be confirmed by my testing.

The plan

So to make this a little more tractable, I will do the following:

  • Given the lack of floating point numbers, only allow positive integers of two digits as input, and display output as integers.
  • Use a LLM to help set up the initial code as a way to get to grips with the language.

(A note on AI: I do not use AI for writing this blog. I will experiment sometimes with using AI to write code, but will clearly mark when it is used).

Unsurprisingly, the LLM said it could not write COBOL for that specific machine, but would write generic COBOL for that era. It knew that sqrt was supported, though.

The code it produced had some formatting and syntax errors when I tried it on CANDE. By consulting the 1977 manual, and reading existing Burroughs batch COBOL programs from the CUBE tape I was able to get it working - but with no guarantees on the quality of the code.

TPK in COBOL

1000 * TPK PROGRAM IN COBOL FOR BURROUGHS MCP
1100 IDENTIFICATION DIVISION.
1200     PROGRAM-ID. TPK
1300     AUTHOR.     RUPERT LANE AND GEMINI
1400 ENVIRONMENT DIVISION.
1500 CONFIGURATION SECTION.
1600     SOURCE-COMPUTER. B-5500.
1700     OBJECT-COMPUTER. B-5500.
1800 INPUT-OUTPUT SECTION.
1900 FILE-CONTROL.
2000     SELECT PRINT-FILE ASSIGN TO PRINTER.
2100 DATA DIVISION.
2200 FILE SECTION.
2300     FD PRINT-FILE;
2400         DATA RECORDS ARE PRT1.
2500     01 PRT1.
2600          05  PRT2         PIC X(120).
2700 WORKING-STORAGE SECTION.
2800     01 NUMBER-TABLE.
2900         05 INPUT-NUMBER   PIC 99.
3000         05 NUMBER-X       PIC 99 OCCURS 11 TIMES.
3100     01 SUBSCRIPTS.
3200         05 NDX            PIC 99.
3300     01 CALCULATION-FIELDS.
3400         05 CURRENT-NUM    PIC 99.
3500         05 RESULT         PIC 9999999.
3600     01 DISPLAY-FIELDS.
3700         05 DISPLAY-RESULT PIC 999.
3800 PROCEDURE DIVISION.
3900 MAIN SECTION.
4000 000-MAIN-LOGIC.
4100     DISPLAY "PLEASE ENTER 11 NUMBERS"
4200     PERFORM 100-ACCEPT-NUMBERS
4300         VARYING NDX FROM 1 BY 1
4400         UNTIL NDX GREATER THAN 11.
4500     DISPLAY "RESULTS ARE".
4600     PERFORM 200-PROCESS-NUMBERS
4700         VARYING NDX FROM 11 BY -1
4800         UNTIL NDX LESS THAN 1.
4900     STOP RUN.
5000 100-ACCEPT-NUMBERS.
5100     ACCEPT INPUT-NUMBER.
5200     MOVE INPUT-NUMBER TO NUMBER-X(NDX).
5300 200-PROCESS-NUMBERS.
5400     MOVE NUMBER-X(NDX) TO CURRENT-NUM.
5500     COMPUTE RESULT = SQRT(ABS(CURRENT-NUM))
5600         + (5 * (CURRENT-NUM ** 3)).
5700     IF RESULT GREATER THAN 400
5800         DISPLAY "TOO LARGE"
5900     ELSE
6000         MOVE RESULT TO DISPLAY-RESULT
6100         DISPLAY DISPLAY-RESULT
6200     END-IF.
6300 END-OF-JOB.

So this is indeed quite verbose - about double the size of the other implementations of TPK I have done. But even without any knowledge of COBOL it is fairly readable.

As in the Algol and Fortran examples, the line numbers are used for entry to CANDE only and are not used by the program itself.

The code is made up of five main divisions - identification, environment, data and procedure. Each contains one or more sections,

The line format is slightly relaxed compared to batch COBOL, with division and section definitions along with labels having to appear on column 1 but other lines can be free format.

The identification division contains structured comments about the propose and authorship of the code.

The environment division is where machine specific details are supposed to be put, such as computer type and selection of peripheral devices. The file-control part sets up the printer as an output device: although I don't use this explicitly, the compiler refuses to work without something being defined here.

The data division contains file and working-storage sections. The file section defines the output format for the printer and is again unused but required. The working-storage section defines variables - these are all global. Variables can be grouped into structures, so NUMBER-TABLE contains INPUT-NUMBER and NUMBER-X. The former is a single variable, the latter is an array introduced by the OCCURS keyword.

The PIC - or picture - keyword defines the variable type. 9 denotes a single digit 0-9, so INPUT-NUMBER PIC 99 means this variable can accept 00-99. RESULT contains the output of the TPK formula so needs to have a capacity of 7 digits to support TPK(99). DISPLAY-RESULT is only 3 digits as we results greater than 400 will not be printed.

The program code is in the procedure division, with control starting at the top. This prompts the user with DISPLAY and then executes two loops with PERFORM, each of which takes a label as the code to execute.

100-ACCEPT-NUMBERS uses ACCEPT to get numbers (must be two digits) and store them. ACCEPT NUMBER-X(NDX) would seem to be the obvious way to get and store in the array, but this gives a syntax error so I have to use the simple variable INPUT-NUMBER and then MOVE it into the array.

200-PROCESS-NUMBERS. calculates TPK and prints the result. Functions are not really part of COBOL so we use the COMPUTE statement, with SQRT, ABS and the exponentiation operator ** being non-standard Burroughs extensions.

Compiling and running the program

One interesting observation is that the COBOL compiler takes longer to run compared to the other languages - on retro-b5500, which runs close to the original hardware speed, it takes 20s for COBOL to compile and 10s for Algol. (simh runs as fast as possible but the difference is still noticeable). This probably comes from the size and complexity of the language, and may partially explain why interactive COBOL was never a great success on time-sharing systems.

The compiler also seems less polished than the Algol one, with several crashes occurring as I worked on the program. For example, if you delete the END-OF-JOB. statement and compile it seems to start reading uninitialised memory:

**ERROR @??????: SEQUENCE NUMBER TRUNCATION -??-
**ERROR @??????: CARD TRUNCATION ??????

-EOF NO LABEL 1S002 RUPERT , S = 27, A = 164

Source and a transcript of its execution can be found on Github.

Further information

Apart from the B7000/B6000 Series COBOL Reference Manual mentioned above there is also Efficient B6700 COBOL from 1981 at the Charles Babbage Institute collection.

There is surprising little material about learning COBOL on the Internet - possibly because of a lack of interest from hobbyists. the University of Limerick had a COBOL course online once but this is now only available on archive.org

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.


Burroughs MCP: Getting data in and out

Today we'll look at how to get data in and out of MCP running under emulation. This is useful if you want to upload programs or download listings and data.

Using the CANDE terminal window, you can copy and paste small amounts of data but this does not work for large amounts (especially for input where the buffer is small). Instead we can reuse some of the facilities provided by the original hardware in a digital form under emulation.

Printer output

On retro-b5500 the printer has a window where you can view output directly and copy information to the clipboard.

On simh, printer output is to a text file - the quickstart uses units/printer.txt.

CANDE provides direct output to the printer via a couple of verbs. LIST FILES TO PRINTER will print a directory listing. COPY file TO PRINTER will print the contents of file, which could be source code or output captured to a file, such as done by the relocation facilities described in a previous article. Here's what a program listing looks like on retro-b5500:

/images/mcp/b5500-printer.png The B5500 printer window on retro-b5500. Source: Rupert Lane. License: CC0.

Card punch output

Using the card punch allows you to get an exact copy of code or data to a text file, without the pagination and spacing imposed by the line printer. This could then be edited on your host machine and the changed file uploaded via the card reader.

To punch from CANDE, use the COPY TO command:

COPY HELLO TO PUNCH
 WAIT.4 RECORDS COPIED (LAST RECORD COPIED=40)


 END COPY .0 SEC.

To actually get output, the operator needs to take some action, as on a real machine they would have to load blank cards for each job. Switch to the operator console and run the appropriately named job HARD/CANDE via the ? command.

This is what it looks like on simh, with input lines preceded by I and output by R. On retro-b5500 there is no prefix.

I ? EXECUTE HARD/CANDE; END
R 
R  5:HARD/CANDE/SITE= 2 BOJ 1059
R  FILE NAMES?
R #HARD/CANDE= 2: ACCEPT

The job is asking you a question about whether to list file names before processing them by prompting FILE NAMES. The next line #HARD/CANDE= 2: ACCEPT means it is waiting for input. Use the AX command to answer no, preceding the command by the mix number (process ID) for the job - this may vary from run to run, but you can see it from the = 2 on the BOJ line, showing on this run it is 2.

I 2 AX NO
R  WHATS NEXT?
R #HARD/CANDE= 2: ACCEPT

To the question WHATS NEXT answer ALL:

I 2 AX ALL
R  PUD0010 OUT PNCH:HARD/CANDE= 2
R  3HELLO/GUEST REMOVED
R  HELLO COPIED TO PUNCH

Now locate the card punch. On retro-b5500 this will be a browser window where you can copy text from. On the simh quickstart it is in units/card-punch.txt. In either case, it will look something like this:

FILE: HELLO/GUEST        PUNCHED: 10/11/25
 
FOR I = 1 TO 5                                           00000010
PRINT "HELLO, WORLD"                                     00000020
NEXT I                                                   00000030
END                                                      00000040

(The above was edited slightly to trim whitespace.)

Note that the line numbers are now on the right side of each line, which is standard for punched cards.

You could also do COPY HELLO TO TAPE and use HARD/CANDE to create a tape file if you wished.

Card reader input

So now we want to do the inverse of the above, provide a text file from your host system to the card reader which will be read and stored to a disk file on the guest. However, there seems to be no built in facility on MCP to do this. Fortunately, Richard Cornwell has written a program called OBJECT/READER that can do this. This program is included in the simh distribution; on retro-b5500 follow these steps to install it.

  • Download https://sky-visions.com/burroughs/reader.card
  • Go to the card reader window, select reader.card via the browser file picker and press START.
  • The operator console will show the job running and the line printer will show the compiler output.
  • Confirm the binary was created by going to the operator window, pressing Escape then typing PD OBJECT/READER.

Now on both systems to use OBJECT/READER, prepare a ASCII file representing a batch job that executes it, giving the parameters COMMON=3 and FILE NEWTAPE to be a disk file name. For example, to create a file called BYE on the CANDE account GUEST you could make a file called goodbye.card on your host machine that looks like:

?EXECUTE OBJECT/READER
?COMMON = 3
?FILE NEWTAPE = BYE/GUEST DISK SERIAL
?DATA CARD
FOR I = 1 TO 5                                                          00000100
PRINT "GOODBYE, WORLD"                                                  00000200
NEXT I                                                                  00000300
END                                                                     00000400
?END

On simh, press Control-E on the console to attach the deck and continue;

sim> attach cr0 units/goodbye.card
%SIM-INFO: CR0: 9 card Deck Loaded from units/goodbye.card
sim> continue

On retro-b5500, load the file into the card reader window and press START.

You will see lines printed on the operator console indicating it is running:

R  5:OBJECT/READER= 2 BOJ 1120
R  CRA IN CARD 1:OBJECT/READER= 2
...

and output on the line printer confirming the file contents.

When finished, if you then do LIST FILES on CANDE you will see the file, but with a type of UNKNOWN as this metadata is not part of the file:

LIST FILES
10/11/25 GUEST          11:22 AM
NAME    TYPE     RECS SEGS   CREATED   ACCESSED  W/R  W/B  S-F LOCKD BY
BYE     UNKNOWN     4 1000  10/11/25 * 10/11/25   10  150   99

To fix this, type CHANGE BYE TYPE TO BASIC. You can then LOAD or RUN the program as normal.

More information

HARD/CANDE is documented in the Time-sharing System User's Guide on bitsavers.

OBJECT/READER has other options eg to copy a disk file to the line printer: see the documentation on Richard Cornwell's site for more details.

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.


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,1 can 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 form 5HHELLO.
  • Generic input/output can be done with PRINT / READ rather 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      END

Source 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.


Burroughs MCP: Batch and the Operator Console

Although our main focus is on time-sharing, it's good to know a bit on how the batch facility works on MCP. In this post I will give a brief introduction, along with details on how to use the operator console.

/images/mcp/b5500-spo.png The B5500 operator console on retro-b5500. Source: Rupert Lane. License: CC0.

Batch

The MCP batch facility allows you to compile and run programs, and manage files on disk. Interestingly it uses a different syntax from CANDE.

Batch instructions are indicated by an invalid character in column 1, by convention a ?. Multiple instructions per line are allowed if separated by ;. The end of the batch job is indicated by a END instruction.

Batch jobs can be submitted via punched cards, tapes, keyed into the operator console or (if you are not running time-sharing) via the data terminals.

To compile a program you use COMPILE file WITH compiler where file is a file name for the compiled program and compiler is ALGOL, FORTRAN etc. The source can be an existing file on disk or you can take it from cards supplied after the compile directive.

Putting this together, here is how to submit a simple job using punched cards on the emulator. Create a plain text file that looks like this:

?COMPILE LIFE/DISK WITH ALGOL
?DATA CARD
BEGIN
    FILE OUT PRINTER 4 (2, 15);
    INTEGER J;
    J := 42;
    WRITE(PRINTER, /, J);
END.
?END

The first line is a batch directive to create LIFE/DISK using the Algol compiler. The second line indicates that this file should come from the following cards. Next is the Algol program which terminates with END.. Finally, the batch directive ?END finishes the job.

On retro-b6600, switch to the card reader, load this file and press the REMOTE button. On simh, break into command mode on the main simh window by pressing Control-E then typing attach cd0 /path/to/file and then continue.

MCP will sense that there are cards to read automatically. On the operator console you will see work being done as the program is compiled, executed and the results printed.

5:ALGOL/LIFE= 2 BOJ 1020
PBD0004 OUT LINE:ALGOL/LIFE= 2
0:PRNPBT/DISK/SITE= 3 BOJ 1020
ALGOL/LIFE= 2,PST= 1 EOJ
4:LIFE/DISK= 2 BOJ 1020
PBD/0004001 REMOVED
PBD/0004001/0000000= 18 SEGS--CREATED 10/05/25 AT 10:20:16:35
PBD0005 OUT PRINTER:LIFE/DISK= 2
PRNPBT FOR ALGOL/LIFE, PST= 1, IOT= 1; EOJ AT 10:20
PRNPBT/DISK/SITE= 3,PST= 1 EOJ
LIFE/DISK= 2,PST= 1 EOJ
0:PRNPBT/DISK/SITE= 2 BOJ 1020
PBD/0005001 REMOVED
PBD/0005001/0000000= 3 SEGS--CREATED 10/05/25 AT 10:20:18:14
PRNPBT FOR LIFE/DISK, PST= 1, IOT= 1; EOJ AT 10:20
PRNPBT/DISK/SITE= 2,PST= 1 EOJ

Switch over to the printer window on retro-b6600 or the printer file (units/printer.txt) on simh and you will see the compiler output and finally the program running and printing 42. Below is how it looks, slightly edited to remove whitespace:

 LABEL  000000000LINE   00125278?COMPILE LIFE/DISK WITH ALGOL   ALGOL  /LIFE
 LABEL  000000000LINE   00125278?COMPILE LIFE/DISK WITH ALGOL   ALGOL  /LIFE
    BURROUGHS B-5700 ALGOL COMPILER MARK XIII.0     MONDAY, 10/05/25,  10:20 AM.

                BEGIN                             0000
                    FILE OUT PRINTER 4 (2, 15);   0000
                    INTEGER J;                    0003
                    J := 42;                      0003
                    WRITE(PRINTER, /, J);         0004
                END.                              0011
                                                   2 IS   14 LONG, NEXT SEG    1

PRT(31) = OUTPUT(W) INTRINSIC, SEGMENT NUMBER =    3.
PRT(5) = BLOCK CONTROL INTRINSIC, SEGMENT NUMBER =    4.
PRT(14) = ALGOL WRITE   INTRINSIC, SEGMENT NUMBER =    5.
PRT(15) = ALGOL READ    INTRINSIC, SEGMENT NUMBER =    6.
PRT(16) = ALGOL SELECT  INTRINSIC, SEGMENT NUMBER =    7.
                             1 IS    2 LONG, NEXT SEG    0
                             8 IS   69 LONG, NEXT SEG    0

NUMBER OF ERRORS DETECTED =   0.  COMPILATION TIME =    1 SECONDS.
PRT SIZE =  26; TOTAL SEGMENT SIZE =    85 WORDS;
                 DISK SIZE =   9 SEGS; NO. PGM. SEGS =   8
ESTIMATED CORE STORAGE REQUIRED =   696 WORDS.
ESTIMATED AUXILIARY MEMORY REQUIRED =     0 WORDS.

 LABEL  000000000LINE   00125278?COMPILE LIFE/DISK WITH ALGOL
           ALGOL  /LIFE
 LABEL  000000000PRINTER00125278?COMPILE LIFE/DISK WITH ALGOL
           LIFE   /DISK
42,
 LABEL  000000000PRINTER00125278?COMPILE LIFE/DISK WITH ALGOL
           LIFE   /DISK

The above will do a 'load and go' compile, not storing the executable on the disk permanently. If you wish to do this, change the compile command to be:

COMPILE LIFE/DISK WITH ALGOL FOR LIBRARY

and the binary can then later be run with:

EXECUTE LIFE/DISK

Other batch commands are:

REMOVE file Delete file from disk
DUMP TO tape file Save files to a tape in library format
UNLOAD TO tape file As above, but deletes file on disk after tape write
LOAD FROM tape file Loads file from specified library tape
ADD FROM tape file As above, but only loads to disk if not already there
CHANGE file1 TO file2 Renames file1 to file2

file in the above can use the = wildcard: for example, to remove all files under the time-sharing user guest you could do REMOVE =/GUEST.

The Operator Console

The operator console, or SPO, allows the operator to monitor tasks and manipulate the running system. It is half-duplex, so it can either be printing or accepting input. To start giving input, press Esc and type the command, terminated by Enter. To abandon the command, press Esc again. simh precedes input with an I and output with an R when printing to the console.

Commands are two letters, like MX. They take optional parameters which are in most cases given after the command. One special case is when you need to provide a 'mix number' or process id: in this case you give the number before the command.

Let's look at some commands that are useful on emulation.

MX will show what jobs are currently running. For example, if I typed this while the above batch job was running I would see:

MX
 0:CANDE/TSHARER= 1
 4:LIFE/DISK= 2
END MX

If I wanted to kill the job, I would find its mix number - here 2 - and 'deep six' the job with the DS command:

2 DS

-OPRTR DS-ED:LIFE/DISK= 2, S= 2, A= 11
 LIFE/DISK= 2,PST= 1 DS-ED

If I had compiled the file to save on disk, I could run the binary via the CC or ? command which takes batch instructions:

? EXECUTE LIFE/DISK; END

 4:LIFE/DISK/SITE= 2 BOJ 1135
 PBD0009 OUT PRINTER:LIFE/DISK= 2

PD will show a listing of files on disk, allowing the = wildcard. To see a list of files starting with FORTRAN:

PD FORTRAN/=
 FORTRAN/TRANS
 FORTRAN/DISK

The image at the top of this post shows the start of a directory listing of all files on the disk via PD =/=.

Here is a full list of operator commands; many of these are only of use when running on real hardware. m means mix number.

Command Usage
m AX data Send data to program that is waiting for input
BK Send break
BS tu/buf Make tu/buf a SPO
CC control info Supply control information, eg run a program
? control info Supply control information, eg run a program
CD Type info on pseudo decks on disk
CE Start CANDE
CI file Change intrinsics file
CL unit Stop the job using unit
m CT proc io Set limits for processor or I/O for a job
m DS Terminate a job
DT mm/dd/yy Set the date
ED deck Eliminate pseudo card deck
EI Was intended to stop all processes, but now prints EIO
ES job spec Eliminate scheduled job
m FM unit Reply to a FM RQD message
m FR Tell a job that was the last tape reel
m IL unit Designate what unit to find a non-labelled file on
m IN index = int Insert a value in the PRT at index
LD dk/mt Load CONTROL/DECK from disk or tape
LN Start a new log file
LR Run LOGOUTR/DISK
MX List programs in the mix
m OP Specify that a COBOL file is optional
m OK Resume processing of a job
OL unit Print status of units
m OT index Print value of index in memory for job
m OU unit Send output to unit
PB unit Load a printer backup tape
PD file spec List files on disk
PG unit Purge a magnetic tape
m PR = level Set priority of a job
m QT Skip a printer backup file
RD #int Remove a pseudo card deck
m RM Remove file flagged by job as duplicate
RN n Specify number of pseudo card decks
RS unit Restart a job
RW unit Rewind and lock a tape
RY unit Mark a tape as ready
RO,SO,TO Reset, set and list options
SF factor Set multiprocessing factor
SS SPO or ALL Send message to remote SPOs
m ST Suspend a job
SV unit Mark a tape as not ready
TF Show multiprocessing factor
m TI Show how much time a job has used
TR hhmm Set time
TS List tasks in the scheduler
m UL unit Designate unit as source for file
WD Print current date
WM Print system version
WT Print current time
WU Print who is logged in where
m WY Print why a job has been suspended
XI file Swap intrinsics file
XS job Force job to be executed from scheduler

Further Information

On bitsavers, the Operations Manual section 4, "Control Information" starting on PDF page 63, details the batch language and options. The B5500 Handbook section "Keyboard Input Messages" on PDF page 37 defines the operator console commands (except a few time-sharing related ones like CE).

Richard Cornwell also has a good summary of batch commands.

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.


Burroughs MCP: Algol 60 Programming

Let's look at programming using the Algol 60 implementation under time-sharing on Burroughs MCP.

/images/mcp/mcp-algol-syntax-chart.png Algol 60 Syntactical Chart. Burroughs Corporation, 1961. Source: softwarepreservation.org.

MCP had several Algol implementations: the main one which we will consider here is called Extended Algol and according to the manual:

In addition to implementing virtually all of ALGOL 60, Extended ALGOL provides for communication between the processor and input/output devices, enabling editing of data, and facilitates program debugging.

There was also Compatible Algol which

represents a subset of B 6500 Extended ALGOL and should be useful for facilitating conversion to a B 6500 System. This language is intended to be used where character mode manipulation is required without jeopardising the integrity of the operating system or other multiprocessing programs

which makes Extended Algol sound dangerous, but I think this refers to stream processors which were rather difficult to use; see the article The Agony and the Ecstasy of Stream Procedures on the retro-b5500 project blog.

Beyond that there was ESPOL - Executive System Problem Orientated language - for programming MCP itself, and TSPOL which had some extensions for building time-sharing code. We will only look at Extended Algol here, but it would be an interesting project to find all the differences.

To show how to use Extended Algol we will as always work on an implementation of the TPK algorithm.

TPK in Extended Algol

100 BEGIN
110     COMMENT TPK ALGORITHM IN ALGOL 60;
120 
130     REAL PROCEDURE FN(X);
140     VALUE X;
150     REAL X;
160     BEGIN
170         FN := SQRT(ABS(X)) + 5 TIMES X * 3
180     END;
190 
200     COMMENT MAIN PROGRAM;
210     INTEGER N, J;
220     REAL ARRAY A[1:11];
230     FILE OUT DCO 19 (1, 10);
240     FILE IN DCI 19 (1, 10);
250     FORMAT NUM(R11.4);
260     FORMAT PROMPT("PLEASE ENTER 11 NUMBERS");
270     FORMAT RESULTS("RESULTS ARE");
280     WRITE(DCO, PROMPT);
290     N := 11;
300     FOR J := 1 STEP 1 UNTIL N DO
310         READ(DCI, NUM, A[J]);
320     WRITE(DCO, RESULTS);
330     FOR J := N STEP -1 UNTIL 1 DO
340     BEGIN
350         REAL RESULT;
360         FORMAT TOOLARGE("TOO LARGE");
370         RESULT := FN(A[J]);
380         IF RESULT GTR 400.0 THEN
390             WRITE(DCO, TOOLARGE)
400         ELSE
410             WRITE(DCO, NUM, RESULT);
420     END;
430 END.

The line numbers are for entry on CANDE and are not used by the program itself. Keywords like INTEGER are reserved and do not need to be quoted.

On line 170, FN := SQRT(ABS(X)) + 5 TIMES X * 3, note that the multiplication operator is the Algol glyph × but we can't type that so we use the text equivalent TIMES. * here is the exponentiation operator. Similarly on line 380 we use GTR to stand in for >.

I/O is not a part of Algol so each implementation does its own thing. Burroughs did it as follows:

  • FILE introduces an I/O channel. The 19 refers to the device, here the data terminal. Other devices are listed on p105 of the manual. The (1,10) refers to the buffer size used. Note that input and output each needs a separate FILE variable. FILE declarations are block-scoped, so here the devices are closed automatically at the program END.
  • FORMAT works like in Fortran to define how input should be parsed and output presented. We use it here for real numbers (NUM) and some string constants (eg PROMPT).
  • READ and WRITE do the actual I/O, taking the file, format and data as their parameters.

On line 390, I originally had WRITE(DCO, TOOLARGE); ie with a semi-colon on the end. This was correctly raised as a syntax error by the compiler as this is not an end of statement situation as the IF clause extends to the ELSE on the next line. The Dartmouth Algol compiler allowed this.

Apart from this, the rest of the implementation works the same way as standard Algol.

When executing this you need to enter numbers in floating point, eg 1.0 instead of 1.

The code and execution transcript for this can be found on Github.

Other extensions to Algol

The manual is rather terse, as it is intended as a reference rather than a tutorial, and also does not list in a single place what extensions have been added. However, the text follows the format of the Revised Report on the Algorithmic Language Algol and when each part of the language is introduced in Backus-Naur form it prefaces each of them with a tag:

  • 1 means this is the same as the standard
  • 2 means this has differences
  • 3 means this is new syntax

So this is not a comprehensive list, but some of the interesting extensions I noted while reading the manual:

  • Conditional expressions: K := (IF J = 0 THEN 0 ELSE 1 / J);.
  • Fill an array: REAL ARRAY A[1:11]; FILL A WITH 42;
  • ZIP to run an external program in the background: ZIP("HELLO ", "RUPERT "); would run the hello world example we did earlier.
  • TIME(0) gets the current date.
  • WHEN(5) pause for 5s
  • Can recover from errors eg divide-by-zero via testing flags
  • A CASE statement

Further information

See the reference manual from 1969 on bitsavers. The other Algol material noted on the Dartmouth DTSS article may also be useful.

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.


Next →