Comal

From C64-Wiki
Jump to navigationJump to search

This article is about the programming language COMAL in connection to Commodore computer systems.

COMAL (COMmon Algorithmic Language) is a computer programming language developed in Denmark by Benedict Løfstedt and Børge Christensen in 1973. The first version Comal F-73 ran, among other things, on SC Metric computers (Alpha LSI-2/20).

COMAL was a combination of the dominant programming languages of the time for educational purposes, BASIC and Pascal, and the intention was to introduce structured programming elements in an environment where BASIC was normally used.

The COMAL 80 PROGRAMMING LANGUAGE REPORT report contained the formal definition of the language

Code Example[edit | edit source]

0010 PROC set'cursor(x#,y#) CLOSED
0020   POKE 211,x#
0030   POKE 214,y#
0040   SYS 58640
0050 ENDPROC set'cursor
0060
0070 PROC set'color(REF color#) CLOSED
0080   POKE 53280,color#
0090   POKE 53281,color#
0100 ENDPROC set'color
0110
0120 PRINT CHR$(147), // Clear Screen
0130 PRINT "!!! Das C64-Wiki Sterne-Demo !!!"
0140 farbe#:=0
0150 set'color(farbe#)
0160
0170 // Endlosschleife.
0180 // Kann nur mit RUN/STOP abge-
0190 // brochen werden.
0200 WHILE TRUE DO
0210   farbe#:=RND(0,15)
0220   POKE 646,farbe# // Textfarbe
0230   set'cursor(RND(0,39),RND(0,24))
0240   PRINT "*",
0250   // 1/25 Chance, dass Hintergrund-
0260   // farbe geaendert wird.
0270   IF RND(1,25)=1 THEN
0280     set'color(farbe#)
0290   ENDIF
0300 ENDWHILE


Implementation[edit | edit source]

C64[edit | edit source]

C128[edit | edit source]

CBM[edit | edit source]

Literature[edit | edit source]

Teil 1: Nov. 1984, Seiten 44-47
Teil 2: Dez. 1984, Seiten 145-147
Teil 3: Feb. 1985, Seiten 130-132

Links[edit | edit source]

WP-W11.png Wikipedia: COMAL