Category:Rogalgol

(Redirected from Rogalgol)
Rogalgol is an implementation of ALGOL 60. Other implementations of ALGOL 60.

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 own BEGIN and END.

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 string s on dev.
  • skip(dev). Outputs a carriage return or linefeed to dev.
  • write(dev, ival). Prints the integer ival on dev. The call to the procedure is terminated by printing the default space character to separate the numbers.
  • rwrite(dev, val, a, b) or rwrite(dev, val). Prints the number val on dev. The integer a is total number of characters including sign and decimal point; b number of digits after the decimal point. If b is zero, val is printed as integer. If both a and b are zeros or they are omitted, then the output is in exponent format with 6 decimal digits. The procedure rwrite requires 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 statement rwrite(1, 4321, 5, 0) displays it in the form 4321 .

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.