BASICODE

from Wikipedia, the free encyclopedia
BASICODE 2 on a compact cassette
BASICODE record

" BASICODE " was an active computer project in the 1980s and 1990s with the aim of establishing a uniform language standard for the BASIC programming language . BASIC was widespread on many home computers popular at that time , but in countless mutually incompatible variants. The project was launched in 1980 by the Dutch broadcasting association Nederlandse Omroep Stichting (NOS) in the radio series Hobbyscoop and later also supported by the WDR Computer Club , the Radio of the GDR and the British Broadcasting Corporation (BBC for short).

The system was based on computer-specific additional programs that called up the subroutines defined by the BASICODE language standard for input and output of text, graphics and sound according to the technical capabilities of the respective computer. These programs, known as bascoders , also enabled programs and data to be exchanged between various home computer platforms and via broadcasting on the radio by defining a uniform data format for the compact cassettes, which were then commonly used as data carriers .

development

The starting point

From the late 1970s to the late 1980s, home computers based on 8-bit processors were very popular among private users. The best known were the TRS-80 from Tandy, the PET 2001 , VC20 , C64 or C128 as well as Plus / 4 from Commodore , the models from Atari ( 400 , 800, XL, XE), the various versions of the Apple II , the models of the Schneider CPC series , the computers from the manufacturer Sinclair Research ( ZX80 , ZX81 , ZX Spectrum ) and, in the GDR, the computers of the Z1013 , Z9001, KC85 / 1 and KC87 and KC85 / 2 to KC85 / 4 series from Robotron . What these computers had in common was that they were equipped with an 8-bit processor of the types MOS Technologies 6502 , Intel 8080 or Zilog Z80 , between 16 and 64 KByte RAM memory , a connection option for cassette recorders or a built-in cassette drive for data storage on compact cassettes (the TRS-80 already had slots for 5 1/4 inch floppy disks) as well as an interpreter that was often permanently installed in the ROM memory for the BASIC programming language, which was widespread at the time. The fact that the BASIC language, which was designed for beginners, was easy to learn, as well as its immediate availability on all of these computers, meant that many home computer owners programmed themselves and shared their programs with one another.

The problem with the exchange of programs and data between computers from different manufacturers was, on the one hand, that the BASIC variants used were completely incompatible with one another in many areas. So you used different BASIC commands for the same action (such as clearing the screen , drawing a point on the screen or outputting a sound ), so that, for example, a BASIC program written on a C64 can be written to the Usually did not work on an Atari XL and vice versa. Second, the computers differ in their technical equipment, for example the screen resolution, the number of possible colors or the options available for sound output. Thirdly, the data formats used on the various computers to save data and programs on compact cassettes were also incompatible with one another.

The first standard

Schneider CPC664
Schneider CPC6128
Sinclair ZX Spectrum

Around 1980 the Dutch broadcasting association NOS started broadcasting computer programs on the radio. Since programs and data were stored on the compact cassettes as tones, it was possible to record such radio broadcasts on a cassette recorder and then read in the broadcast programs with the computer. From the problems presented at the beginning, however, it emerged that a program almost always had to be specially adapted for all popular types of computer and then broadcast several times on the radio in appropriate versions. The very low data density when storing on compact cassettes compared to today's data carriers meant that the broadcast on the radio and thus also the recording took a correspondingly long time, and thus only a very limited number of programs could be broadcast in one broadcast. So broadcasting the same program in several different versions was a major disadvantage.

In 1982 those responsible at NOS came up with the idea of ​​developing a uniform data format. A specific program for each type of computer, the so-called bascoder , took over reading this format from the cassette or storing programs and data in this uniform format on the cassette. These programs were also broadcast by NOS via radio. They could also be acquired on compact cassettes from NOS and were also passed on between private computer users. The format, which is very robust with regard to interference during transmission, could be read and written by all home computers widely used at the time at the respective data input and output. The robustness of this standard also made it possible to broadcast on medium wave frequencies, which in turn increased the range and thus the number of possible receivers. The programs broadcast on Dutch radio by the NOS von Hilversum could, for example, also be received in large parts of the German Democratic Republic (GDR). In western Germany, if the reception was good, the BBC programs from Great Britain could be used, which also broadcast BASICODE programs. BASICODE is probably best known in the Federal Republic of Germany through the WDR Computer Club, which broadcast BASICODE programs over the TV audio signal on Sundays under the name "Hard-Bit-Rock". Since no further moderation was possible during the broadcast of the programs, BASICODE programs were later transmitted using video data . This system used the so-called blanking interval in the video signal of the television picture for silent data transmission.

BASICODE 2

Sinclair ZX81
RFT KC 85/3
Robotron KC 87
Apple II
Color Genie EG2000

The standard created with BASICODE solved one of the problems presented at the beginning, namely that of the mutually incompatible data formats. However, programs still had to be adapted to the respective BASIC dialect and the specific technical conditions on each individual computer type. A possible restriction to those elements of the BASIC language, which were common to all dialects, meant unsatisfactory restrictions with regard to the functionality of the programs, for example the renunciation of graphics and sound and only inconvenient possibilities for data input via the keyboard and for controlling data output on the screen . For this reason, the BASICODE 2 standard was created in 1984. The bascoders based on this standard not only contained the routines for inputting and outputting programs and data on compact cassettes. In addition to a set of approx. 50 BASIC commands, functions and operators, which were identical in all BASIC dialects, the BASICODE 2 language standard also defined for the first time a library of subroutines which can be called the same functionality on all computers provided.

For this purpose, it was specified that the area of ​​the program lines below line number 1000 was reserved for the bascoder and programs written in BASICODE could therefore only start from line number 1000. The subroutines of the Bascoder in the line numbers below 1000 were then called by the GOSUB instruction. The necessary arguments were passed by assigning the appropriate values ​​to certain variables reserved for the bascoder before the call. The BASICODE language standard also contained a few other specifications that arose from the restrictions of some computer types. For example, in contrast to the BASIC dialects of almost all other computers, a program line on the ZX81 could only contain a single BASIC command, or a program line in the BASIC dialect of the KC series could not be longer than 60 characters. Since the Bascoder was processed together with the BASICODE program by the computer-specific BASIC interpreter, such restrictions had to apply to all BASICODE programs in order to achieve full platform independence.

The bascoders were loaded onto their respective computers as normal programs and then provided the additional routines for the common language standard and for input and output on cassettes. The programs written in BASICODE could only be used after loading and starting the Bascoder. On some computers, however, the BASICODE programs could be saved together with the language part of the Bascoder in the type-specific data format. As a result, it was no longer possible to use this recording on other types of computers. However, the type-specific data formats almost always had a significantly higher data density, so that the same program could be loaded significantly faster than in the BASICODE format. In addition, without the need to load the complete Bascoder before executing the BASICODE program, significantly more memory was available during program runtime.

Bascoder for the BASICODE-2 standard existed for the computer types Exidy Sorcerer, DAI , Color Genie , Commodore PET , VIC-20 , C64 , Amiga , Sinclair ZX81 , Sinclair ZX Spectrum , Sinclair QL , Philips P2000T, Acorn Atom , BBC , Electron, Tandy TRS-80, MSX , Oric Atmos , Grundy NewBrain , Amstrad CPC 464 , IBM PC , Apple II , Texas Instruments TI-99 / 4A , Mattel Aquarius and others. Experienced computer owners were also able to develop their own bascoder for their particular system, since the language standard and the data format were open and well documented. The language standard defined by BASICODE 2 already enabled the development of system-independent programs with options that were relatively advanced for the time. BASICODE was also used to send information such as news from the computer scene on the radio in the form of so-called journals and to pass it on between computer users. An extensive course on programming in BASICODE and other documentation were also distributed this way.

BASICODE 3 / 3C

In 1986 the new BASICODE 3 standard was developed. The main innovations were routines for simple monochrome graphics output, reading and saving data from programs and for outputting sound. With BASICODE 3, BASICODE became known especially in the GDR computer scene, and BASICODE programs were also broadcast on radio in the GDR from 1989 onwards . The Dutch broadcaster TROS (Televisie en Radio Omroep Stichting) also broadcast BASICODE 3 programs. A book was also published in the GDR, which was accompanied by a small record with the bascoders for all types of computers used in the GDR. The last revised BASICODE version, which included color screen output as an innovation, was published in 1991 as BASICODE 3C.

The end of the popularity of BASICODE

With the beginning of the 1990s, the popularity of BASICODE decreased very quickly due to the increasing spread of 16- and 32-bit computers and, in particular, new versions of the IBM PC and compatible devices. Even if bascoders were mostly still developed for these computers, BASICODE was too limited to adequately utilize the technical possibilities of this generation of computers. In addition, due to the extensive concentration on a few computer architectures in the 16- and 32-bit area, the main reason for the creation and use of BASICODE was eliminated. Due to the increasing complexity of the hardware and software of the new systems, many people were no longer interested in or able to program themselves. The increasing popularity of graphical user interfaces also contributed to the rapid decline in the spread of 8-bit computers and thus also of BASICODE.

The substance that results from the GDR radio Germany transmitter culture, later with other transmitters to Germany Radio merged, exuded until about 1992 BASICODE programs. A standard BASICODE 4, which was still planned, was never officially implemented, as the NOS gave up its support for the project shortly after the publication of BASICODE 3C. BASICODE is still used today by some enthusiasts, especially 8-bit computer fans, mainly out of nostalgic interest, but is no longer of practical relevance.

Historical meaning

BASICODE was one of the early attempts in the home user sector to create a common standard for the exchange of programs and data on various incompatible computer architectures. It was created around the same time as the MSX system developed by Microsoft , whose standardization included a uniform BASIC language standard as well as a defined hardware specification. Corresponding computers were sold by various companies and were in competition with other popular home computers. To a greater extent, MSX was almost exclusively successful in the manufacturers' home markets, such as Japan and South Korea , the Netherlands and Brazil . In contrast to MSX, BASICODE did not define a hardware specification, but a language standard for the BASIC programming language, which is almost universally available on home computers, and a data format for compact cassettes that could be read and written on all computers equipped with BASICODE. The implementation of BASICODE was carried out exclusively through additional software and was therefore not limited to computers from certain hardware manufacturers. The spread of BASICODE is difficult to assess because both the bascoders and the programs developed in BASICODE were freely available and were passed on. However, Bascoders were available for almost every home computer ever sold in this computer era. Due to its free distribution, BASICODE was of no commercial relevance.

Due to the concept, it was not possible with BASICODE to fully utilize the specific technical possibilities of a certain type of computer. The language standard defined by BASICODE was almost completely limited to the lowest common denominator of all relevant computer systems. This concept was only partially abandoned with BASICODE 3 / 3C, as some computer types or variants such as the ZX80 / ZX81 computers and the KC87 did not allow any real graphics or color output and thus the corresponding newly introduced functions of BASICODE 3 / 3C on these computers were no longer usable. In particular for time-critical applications and in the area of ​​graphics and sound output, for example in the development of computer games , BASICODE was clearly inferior to programming in the system-specific BASIC dialect or directly in the machine code . The strengths of BASICODE were therefore more in the areas of application development, software for education and data exchange. The BASICODE data format was also used to transfer programs in the Pascal programming language , which was significantly better standardized than BASIC in terms of its language definition. Pascal compilers were only available on some types of home computers.

The basic concept of BASICODE, namely the definition of a language standard for platform-independent software development and the implementation of this standard through system-specific programs (Bascoder), was later also implemented in the Java programming language , in the form of the operating system-specific Java Virtual Machines for executing the Java Programs. The transfer of data and information in the BASICODE data format as journals is also reminiscent of the platform-independent document formats used today, such as the Portable Document Format (PDF) and the system-specific PDF reader programs required for this.

The BASICODE data format

In the BASICODE format, programs are recorded in the same way as data. When programs are recorded, the individual BASIC commands are not saved and read in, as is usually the case, in the form of 1- byte units (tokens), but character by character.

Each byte is transmitted in the form of "1 start bit - 8 data bits - 2 stop bits". The resulting redundancy is primarily used for security during transmission. Bit 7 is always transmitted negated, which is particularly useful when transmitting ASCII characters. These always contain a 0 bit at bit 7, so that three stop bits result from the negated transmission of ASCII characters. The beginning of a transmission is marked by the character 02 (STX, Start of Text), the end by the character 03 (ETX, End of Text). After ETX another check byte is sent, which is calculated from the previous bytes including STX and ETX by bit-wise binary addition (XOR). The characters 0DH or 13D indicate the end of a line during transmission. Data files generated by programs can use all characters as data so that they do not contain any control characters. Rather, they are read and written in 1,024-byte blocks.

Square waves in the form of a 1200 Hz wave for a 0-bit and two 2400 Hz waves for a 1-bit with a length of 1/1200 seconds for each bit signal are used as audio signals . A pause of more than 1/1800 seconds between two edges marks the beginning of the transmission of a byte, the following oscillation thus represents a start bit. After the start bit and before the transmission of the eight data bits, there is another pause of at least 1/1800 seconds . A 2400 Hz signal lasting five seconds marks the beginning of a transmission and is used to synchronize the reading program. At the end of a transmission, a 2400 Hz signal lasting one second is sent.

The theoretical data rate of this format is 1200 bits per second (bit / s). Due to the transmission of three additional bits per data byte and the pauses before and after a start bit, this results in a real data rate of about 102 bytes per second, i.e. about six KBytes per minute.

The BASICODE language standard

BASICODE 2

BASIC commands, functions and operators permitted in BASICODE 2

The elements of the BASIC programming language named below are available in the BASIC dialects of all supported computer types with identical functionality. They are therefore also part of the BASICODE language standard.

  • Commands:
DATA    DIM     END     FOR     GOSUB   GOTO    IF      INPUT   NEXT    ON
PRINT   READ    REM     RESTORE RETURN  RUN     STEP    STOP    THEN    TAB
TO
  • Functions:
ABS     ASC     ATN     COS     EXP     INT     LEN     LOG     SGN     SIN
SQR     TAN     VAL

CHR$    LEFT$   MID$    RIGHT$

AND     OR      NOT
  • Arithmetic operators:
^ Potenzieren
* Multiplikation
/ Division
+ Addition und Verkettung von Stringvariablen
- Subtraktion
  • Comparison operators:
=       <>      <       >       <=      >= 

Routines provided by the Bascoder in BASICODE 2

The following routines contained in the Bascoder are implemented in the individual BASIC dialects using various commands or functions that are incompatible in their syntax. The GOSUB calls ensure that these options are available as part of the BASICODE language standard on all relevant computers.

GOSUB 100 Löschen des Bildschirms
GOSUB 110 Setzen des Cursors an eine bestimmte Position
          Übergabe der Position in den Variablen HO und VE
GOSUB 120 Ermittlung der Position des Cursors
          Rückgabe der Position in den Variablen HO und VE

GOSUB 200 Auslesen eines Tastendrucks
          Rückgabe des Zeichens in der Variablen IN$
          Rückgabe einer leeren Variablen IN$, wenn keine Taste gedrückt wurde
GOSUB 210 Warten auf einen Tastendruck
          Rückgabe des Zeichens in der Variablen IN$
GOSUB 250 Ausgabe eines einfachen kurzen Tons ("Beep")
GOSUB 260 Ermittlung einer Zufallszahl zwischen 0 und 1
          Rückgabe der Zahl in der Variablen RV
GOSUB 270 Ermittlung der Größe des freien Speichers
          Rückgabe des Wertes in der Variablen FR

GOSUB 300 Umwandlung eines numerischen Wertes in einen String
          Übergabe des numerischen Wertes in der Variablen SR
          Rückgabe des Strings in der Variablen SR$
GOSUB 310 Analog zu GOSUB 300, zusätzliche Angaben:
          Übergabe einer festen Stringlänge in der Variablen CT
          Übergabe der Position des Dezimalpunkts in der Variablen CN
GOSUB 350 Ausgabe eines Strings auf dem Drucker
          Übergabe des Strings in der Variablen SR$
GOSUB 360 Ausgabe eines Zeilenumbruchs auf dem Drucker

Further general specifications

A line of a BASICODE program can be up to 60 characters long, including the line number and spaces, and should only contain one statement. The argument for the trigonometric functions must be given in radians. The logical operators AND and OR must not be used in BASICODE to link numbers bit by bit. When using string functions, attention should be paid to any differences in the character set between different computer types. Variable names can be up to two characters long (one or two capital letters or one capital letter and one digit). Each variable must be assigned a value before it is used for the first time in commands or functions, since implicit initialization does not work on all types of computers. Numeric variables are single precision (six valid digits). String variables can be a maximum of 255 characters long. Every BASICODE program begins in line 1000. From line number 30000 onwards there are comments on the program, from line 32000 onwards there are formal facts such as the name of the author or version information.

BASICODE 3 / 3C

BASIC commands, functions and operators allowed in BASICODE 3 / 3C

With regard to the elements of the BASIC language allowed in BASICODE, BASICODE 3 / 3C differs only slightly from BASICODE 2. The most important difference is the addition of DEF FN to define your own functions.

  • Commands:
DATA    DEF FN  DIM     FOR     GOSUB   GOTO    IF      INPUT   LET     NEXT
ON      PRINT   READ    REM     RESTORE RETURN  STEP    TAB     THEN    TO

Unterschiede zu BASICODE 2:

Neu hinzugekommen     : DEF FN  LET

Entfernt              : END     RUN     STOP
  • Functions:
ABS     ASC     ATN     COS     EXP     INT     LEN     LOG     SGN     SIN
SQR     TAN     VAL

CHR$    LEFT$   MID$    RIGHT$

AND     OR      NOT
  • Arithmetic operators:
^ Potenzieren
* Multiplikation
/ Division
+ Addition und Verkettung von Stringvariablen
- Subtraktion
  • Comparison operators:
=       <>      <       >       <=      >= 

Routines provided by the Bascoder in BASICODE 3 / 3C

The scope of the Bascoder subroutines has been significantly expanded with BASICODE 3 / 3C compared to its predecessor. In particular, the newly added options for sound output (400), for working with external files (500–580) and for graphic display (600–650) considerably expanded the capabilities of BASICODE.

GOTO   20 Programmstart, System-Reset, Löschen aller Variablen

GOSUB 100 Initialisieren des Textmodus, Löschen des Bildschirms
GOSUB 110 Setzen des Cursors an eine bestimmte Position
          Übergabe der Position in den Variablen HO und VE
GOSUB 120 Ermittlung der Position des Cursors
          Rückgabe der Position in den Variablen HO und VE
GOSUB 150 Auffälliges Anzeigen eines Strings auf dem Bildschirm
          (links und rechts drei Leerzeichen)
          Übergabe des Strings in der Variablen SR$

GOSUB 200 Auslesen eines Tastendrucks
          Rückgabe des Zeichens in der Variablen IN$
          Rückgabe einer leeren Variable IN$, wenn keine Taste gedrückt wurde
GOSUB 210 Warten auf einen Tastendruck
          Rückgabe des Zeichens in der Variablen IN$
GOSUB 220 Auslesen eines Zeichens vom Bildschirm
          Übergeben der Bildschirmposition in den Variablen HO und VE
          Rückgeben des Zeichens als numerischer Wert in der Variablen IN
GOSUB 250 Ausgabe eines einfachen kurzen Tons ("Beep")
GOSUB 260 Ermittlung einer Zufallszahl zwischen 0 und 1
          Rückgabe der Zahl in der Variablen RV
GOSUB 270 Ermittlung der Größe des freien Speichers
          Rückgabe des Wertes in der Variablen FR
GOSUB 280 Aus- bzw. Einschalten der STOP/BREAK-Taste
          Übergabe des gewünschten Status in der Variablen FR (FR=0 bzw. FR=1)

GOSUB 300 Umwandlung eines numerischen Wertes in einen String
          Übergabe des numerischen Wertes in der Variablen SR
          Rückgabe des Strings in der Variablen SR$
GOSUB 310 Analog zu GOSUB 300, zusätzliche Angaben:
          Übergabe einer festen Stringlänge in der Variablen CT
          Übergabe der Position des Dezimalpunkts in der Variablen CN
GOSUB 330 Umwandlung alle Kleinbuchstaben in einem String in Großbuchstaben
          Übergabe und Rückgabe des Strings in der Variablen SR$
GOSUB 350 Ausgabe eines Strings auf dem Drucker
          Übergabe des Strings in der Variablen SR$
GOSUB 360 Ausgabe eines Zeilenumbruchs auf dem Drucker

GOSUB 400 Ausgabe eines Tons
          Übergabe der Lautstärke, Dauer und Tonhöhe in den Variablen SV, SD und SP
GOSUB 450 Warten einer bestimmten Zeit auf einen Tastendruck
          Übergabe der Dauer in der Variablen SD (in 100-Millisekunden-Einheiten)

GOSUB 500 Öffnen einer Datei
          Übergabe des Namens in der Variablen NF$
          Festlegung eines Datei-Identifiers in der Variablen NF
GOSUB 540 Lesen eines Strings aus einer Datei
          Übergabe des Identifiers in der Variablen NF
          Rückgabe des Strings in der Variablen IN$
GOSUB 560 Schreiben eines Strings in eine Datei
          Übergabe des Identifiers in der Variablen NF
          Übergabe des Strings in der Variablen SR$
GOSUB 580 Schließen einer Datei
          Übergabe des Identifiers in der Variablen NF

GOSUB 600 Initialisieren des Grafikmodus, Löschen des Bildschirms
GOSUB 620 Setzen eines Punktes
          Übergabe der Position in den Variablen HO und VE
          Übergabe der Farbe in der Variablen CN
GOSUB 630 Zeichnen einer Linie ausgehend von der aktuellen Grafikposition
          Übergabe des Endpunktes in den Variablen HO und VE
          Übergabe der Farbe in der Variablen CN
          Festlegen der Grafikposition gegebenenfalls vorher durch das Setzen eines Punktes
GOSUB 650 Ausgabe eines Strings im Grafikmodus
          Übergabe der Position in den Variablen HO und VE
          Übergabe des Strings in der Variablen SR$

GOTO  950 Beenden des BASICODE-Programms

Unterschiede zu BASICODE 2:

Neu hinzugekommen : 20, 150, 220, 280, 330, 400-450, 500-580, 600-650, 950

Abweichend        : 100

The transfer and return of position information in text mode takes place in absolute values. In the graphics mode, however, the variables HO and VE are assigned relative values. This means that the coordinates HO = 0.5 and VE = 0.5 must be transferred for setting a point in the middle of the screen, HO = 0 and VE = 0 for the upper left corner and HO for the lower right corner = 1 and VE = 1. This is intended to achieve a comparable output regardless of the specific available screen resolution.

Further general specifications (in addition to the BASICODE 2 standard)

The names of self-defined functions, like variable names, can be up to two characters long. The definition of your own string functions is not possible in BASICODE. The program ends with "GOTO 950" because the commands RUN, END and STOP are prohibited.

The following variable names are not available in BASICODE for use in the program:

- alle Variablen, die mit dem Buchstaben O beginnen
- AS, AT, DI, DI$, DS, DS$, EI, EI$, EL, ER, FN, GO, GR, IF, LN, SQ, SQ$, ST, TI, TI$, TO
- PI

The following variables are used by the bascoder, for example when passing arguments to the bascoder subroutines or when returning values:

- A, CN, CT, FR, HG, HO, IN, IN$, NF, NF$, RV, SD, SP, SR, SR$, SV, VE, VG

literature

  • Michael Wiegand, Manfred Fillinger: BASICODE. With program cassette. Ravensburger Buchverlag, Ravensburg 1986, ISBN 3-473-44010-8 .
  • Hermine Bakker, Jacques Haubrich (authors), Stichting BASICODE (ed.): Het BASICODE-3 boek. 3. Edition. Kluwer Technische Boeken BV, Deventer / Antwerp 1988, ISBN 90-201-2111-1 .
  • Horst Völz: Basicode with programs on record for home computers. Verlag Technik, Berlin 1990, ISBN 3-341-00895-0 .

Web links

Remarks

  1. Pictures of the record at the bottom
This version was added to the list of excellent articles on June 21, 2005 .