Computing: DOS, OS/2 & Windows Programming

Installing and running COMAL 80 on DOS.

"COMAL (Common Algorithmic Language) is a computer programming language developed in Denmark by Børge R. Christensen and Benedict Løfstedt and was originally released in 1975. It was created as a mixture of the prevalent educational programming languages of the time, BASIC, Pascal, and, at least in the Commodore and Compis versions, the turtle graphics of Logo. The language was meant to introduce structured programming elements in an environment where BASIC would normally be used.", you can read in Wikipedia.

This tutorial is about the installation of COMAL 80 v2.0 on MS-DOS 6.22. It should apply to FreeDOS and other DOS platforms, too.

COMAL 80 can be downloaded from the Vetusware website. The download archive contains the program’s folder structure. I extracted the files on my Windows 10 and copied the files to a floppy diskette. On my MS-DOS machine, I copied the whole to a new directory c:\comal. Here are the commands to do that:
    mkdir c:\comal
    cd comal
    a:
    copy *.* c:

The screenshot shows the content of c:\comal.

COMAL 80 on MS-DOS: Content of the installation directory

There are two real mode executables comal.com and comal87.com. The latter one takes advantage of the 8037 co-processor. Run this program using the batch file co87.bat, that you have to adapt to your system first, setting the COMALPKG environment variable to c:\comal\graph87. You probably also want to set the messages language to English (the original batch file sets it to Danish; a third possibility is Swedish). Here is the actual content of my co87.bat:
    set host=IBM PC
    set comalmsg=c:\comal\english.msg
    set comalpkg=c:\comal\graph87
    comal87

The COMAL 80 environment is an interpreter, i.e. the instructions are executed as they are entered. To create a program, line numbers have to be used. This is as it was with the very first BASIC interpreters. No full screen editor; to change the code you'll have to use the command edit <line-number>. The command list is used to display a given part of the source code. The command renum is used to renumber the source lines. To run the program actually loaded, use run. Finally, to quit the interpreter, use bye.

The screenshot below shows a simple "Hello World" program and its execution. Two big differences with the first BASIC interpreters: 1. you can extend the if statement over several lines; 2. the if statement requires a termination with endif. These are the basics of structured programming, that was not possible with the first versions of BASIC.

COMAL 80 on MS-DOS: Writing and running a simple 'Hello World' program

You can generate line-numbers automatically by entering the command auto. To switch this feature off, push the ENTER key twice.

To save your source, use the command save "<filename>" (including the quotes); the file extension used in this case should be .cml. There are two commands to load a .cml file into the interpreter: 1. use load "<filename>" to just load it; 2. use chain "<filename>" to load and immediately run it. Note, that the chain command may also be used as instruction within your program; thus, you can easily start a program from within another.

The screenshot below shows how I loaded the hello.cml program into the interpreter, and used the edit command to change a line of code. It is not what it seems: The indentation of the PRINT statement is well conserved (as you will see when listing the whole).

COMAL 80 on MS-DOS: Editing a line of a COMAL source file

To note, that .cml files are a coded version of the source, and can't be viewed in a text editor. To create an ASCII (i.e. plain text) file of your COMAL program, use the command list "<filename>"; use .lst (or, if you prefer .txt) as file extension for such files. Note, that you may use line-numbers with this command, giving you the possibility to only save a part of the file. Files stored as .lst can be loaded into the interpreter using the command enter "<filename>". This gives you the possibility to write the source in some full screen editor, load it into the COMAL interpreter, and then save it as .cml (.cml files are larger than .lst files, but execute faster).

The screenshot shows our "Hello World" program opened in the standard MS-DOS editor.

COMAL 80 on MS-DOS: COMAL source file opened in MS-DOS editor

Finally, here is a link to download a COMAL reference guide as PDF.


If you find this text helpful, please, support me and this website by signing my guestbook.