CBASIC

from Wikipedia, the free encyclopedia
Process of compiler or interpreter

CBASIC is a compiler version of the BASIC programming language . It was written by Gordon Eubanks in 1976 and 1977 for the CP / M operating system . It was an improvement on BASIC-E that he had developed as a master's thesis.

history

Eubanks developed BASIC-E in the PL / M programming language at the State Naval Postgraduate School in Monterey , California. Since it was created at public expense, it was considered a " public domain " under American law and could not be sold commercially. Therefore, in his spare time, while he was still a naval officer, Eubanks programmed the improved CBASIC as a commercial product of his company Compiler Systems, initially for use on the IMSAI 8080 computer. But it could also run on other CP / M systems. In addition to the version for CP / M-80, CBASIC / 80, a version for CP / M-86, CBASIC / 86 was also created in 1981. 1981 Compiler Systems including CBASIC was acquired by Digital Research . The commercial success of CBASIC dried up relatively quickly as other development tools established themselves on the market.

properties

Except for numeric jump labels, CBASIC did not require any line numbers and not only allowed the use of subroutines with the basic command GOSUB, but also the use of self-defined functions. Another benefit was the use of 14-digit real numbers .

Initially, CBASIC - like BASIC-E - was compiled into an intermediate code ( p-code ), which was then executed by a runtime program. Later the compiler generated an intermediate code (REL object code ) in the first step , from which the executable program was created in a further step with the linker . In this way it was possible to write program parts in a different programming language, for example machine-level commands in assembler , and to link them into the executable program.

Sample program

The sieve of Eratosthenes, for example, looks something like this as a CBASIC program:

integer limit, count, prime, i, k
limit = 1000
dim flag%(limit)

print "*** ERATO in CBASIC / CB80 ***"
print " --- Start ---"
count = 0
for i = 0 to limit :flag%(i) = 1 :next
for i = 0 to limit
    if flag%(i) = 1 then \
        prime = i + i + 3 :\
        count = count + 1 :\
        k = i + prime :\
        while k <= limit :\
            flag%(k)=0 :\
            k = k + prime :\
        wend 
next
print count;"PRIMZAHLEN errechnet"

Sources / web links