Category:Rogalgol
The RHA (Minisystems) Ltd Algol60 system, known as Rogalgol, is an implementation of the Algol 60 language designed especially for small computers.
Data types
A string consists of a sequence of characters enclosed within double quotes, e.g. text(1, "Hello world");.
The characters * and ^ have special significance and are always considered in conjunction with the character which immediately follows them. They serve to insert special characters to strings, and also to insert themselves:
**inserts**^inserts^*"inserts"
For example, the statement
text(1, "a ** x *^ 2");displays
a * x ^ 2
Control structures
Besides the control structures mentioned in the Report of Algol 60, Rogalgol has some additional ones.
- A while statement. The syntax like in Pascal.
- A repeat statement. The syntax like in Pascal.
- A case statement. Contrary to the equivalent structure in Pascal, it has not the closing
END. Of course, a block defined for any case has its ownBEGINandEND.
Input and output
There are several input/output procedures in Rogalgol. In all of the predeclared procedures the first parameter (dev) is the stream number. The stream assigned to the console has the number 1.
text(dev, s). Prints the stringsondev.skip(dev). Outputs a carriage return or linefeed todev.write(dev, ival). Prints the integerivalondev. The call to the procedure is terminated by printing the default space character to separate the numbers.rwrite(dev, val, a, b)orrwrite(dev, val). Prints the numbervalondev. The integerais total number of characters including sign and decimal point;bnumber of digits after the decimal point. Ifbis zero, val is printed as integer. If bothaandbare zeros or they are omitted, then the output is in exponent format with 6 decimal digits. The procedurerwriterequires one leading character for the sign of a number. The call to the procedure is terminated by printing the default space character to separate the numbers. For example, the number 4321 requires at least 5 characters; the statementrwrite(1, 4321, 5, 0)displays it in the form4321.
Compiling, linking, and running programs
Names of source files must have at most 8 characters.
Here is an example of compliling, linking, and running the program hello.alg in the simplest way.
C:\algol60>algol hello 8088/8086 ALGOL V5.5 MS-DOS Copyright (C) 1984 by RHA (Minisystems) Ltd. COMPILES OK SIZE 21 C:\algol60>alink hello=hello.obj 8088/8086 Rogalgol linker V5.4 MS-DOS Copyright (C) 1984 by RHA (Minisystems) Ltd Unresolved labels: Next load address 21 Output=input list : C:\algol60>arun hello 8088/8086 ALGOL V5.5 MS-DOS Copyright (C) 1984 by RHA (Minisystems) Ltd Hello, world ^ ^C C:\algol60>
After compilation, the file hello.obj is created. After linking, the file hello.asc is created.
External links
- Algol 60 Translators, including Rogalgol, on algol60.org
- ProgrammingQuodlibet - RogAlgol
- ROG ALGOL Compiler Manual on archive.org
Pages in category "Rogalgol"
The following 19 pages are in this category, out of 19 total.