GW-BASIC

from Wikipedia, the free encyclopedia

GW-BASIC
Basic data

developer Microsoft Corporation
Publishing year 1983
Current  version 3.23
(1988)
operating system MS-DOS
category BASIC interpreter and development environment
License proprietary ( 8088 : MIT license )
German speaking No

GW-BASIC is an interpreter for the BASIC programming language from Microsoft . It was developed for the first IBM-compatible , but not directly manufactured by IBM PCs . Between 1983 and 1991 it was sold as part of the MS-DOS operating system up to version 4.02, after which it was replaced by QBasic and the more complex program package QuickBASIC .

The Assembler - source codes of 8088 -Portierung for MS-DOS from 1983, on 22 May 2020, taking the MIT license published. The source code , which can be viewed on GitHub, is intended for educational purposes and to provide historical insights.

history

BASIC was the first programming language for the IBM PC released in 1981. This had (like many home computers at that time) a BASIC interpreter in the ROM called BASICA . The BASIC was started if no operating system was found when the computer was booted . It was licensed exclusively for the IBM company. The operating system MS-DOS originally had the command BASICA (for BASIC Advanced), with which this BASIC could be started with some extensions while MS-DOS was already running. BASICA was a direct port of Microsoft's MBASIC (also known as BASIC-80) with IBM-PC-specific additional functionality. (MBASIC was written for 8080 / Z80 machines and was already included with most distributions of CP / M. ) Later, IBM PC-compatible computers from other manufacturers came onto the market that also used MS-DOS as the operating system. For licensing reasons, they did not have the built-in BASIC interpreter of the IBM PC. As a result, Microsoft sold GW-BASIC, which is not based on the BASIC interpreter in ROM, on floppy disk. GW-BASIC is a considerably expanded BASIC version that is compatible with BASICA.

The availability as part of MS-DOS at no additional cost promoted the development of diverse programs in GW-BASIC in small companies - up to “full-blown” database systems, similar to how smaller applications are written in Visual Basic for Applications today. From 1985 it was replaced in its meaning by Turbo Pascal from Borland .

Naming

The origin of the name "GW-BASIC" is unclear. The initials "GW" could be chosen after Greg Whitten, an early Microsoft employee who was also responsible for standards for Microsoft BASIC compilers. Whitten attributes the choice of name to Microsoft founder Bill Gates and gives the English exclamation gee whiz! (in German about "Potz Blitz!"). This explanation allegedly also appears in the Microsoft User Manual of Microsoft Press. Another common explanation is that the initials GW are an abbreviation for Graphics and Windows , as GW-BASIC brought new commands for graphics routines and basic window support. Others suspect that the name GW-Basic comes from the (exchanged) initials of Bill Gates' full name William "Bill" Gates , who programmed Microsoft's first BASIC interpreter himself.

Development environment

Like the original BASIC from Dartmouth College, GW-BASIC has a command-based development environment . Program lines must begin with line numbers. Entries without a line number are carried out directly. Means LOADand SAVEcan BASIC programs are loaded and stored. A bytecode as well as the ASCII format can be used as file formats . LISTshows the current program, NEWdeletes the current program memory. RENUMallows the reassignment of program lines. To search for errors, you can set breakpointsSTOP in the program , whereby the execution can be continued with. The commands and can be used for tracing purposes. terminates the interpreter and returns to the operating system. Many of these programming and troubleshooting instructions can be accessed using the F1 through F10 function keys. A new assignment of these keys is possible with the instruction . CONTTRONTROFFSYSTEMKEY

As an interpreter, GW-BASIC does not generate independently executable program files. Programs written in this language must be started together with the interpreter. Therefore, Microsoft later offered the BASIC compiler BASCOM .

Language structure

In GW-BASIC, as in many BASIC dialects, the data type of variables is determined by type characters that are appended to the variable name. A$is a character string , A%is an integer , A!and A#are floating point numbers with single and double precision. If the type character is missing, a single precision floating point number is assumed. Instructions DEFINT, DEFSTRetc. can be used to specify that all variables whose name begins with a certain character have a certain variable type so that the type character can be dispensed with.

GW-BASIC does not enforce structured programming . The program sequence can be determined using the jump instruction GOTO . Subroutines can be GOSUB/RETURNcalled using. The conditional statements IF/THEN/ELSE must be written on one line. The instructions WHILE/WEND and FOR/NEXTcan go over several program lines. Functions can be DEF FNdefined with the statement , whereby the definition must fit in a single line, e.g. B. DEF FNLOG(basis,nummer)=LOG(nummer)/LOG(basis).

features

GW-BASIC can read and write files, parallel interfaces and serial interfaces . In addition to the keyboard, analog joysticks and light pens are also supported as input devices, but not mice , as these were not widely used on IBM-compatible PCs at the time of the development of GW-BASIC and often used incompatible drivers. For machine-oriented programming can be used in machine code written subroutines are involved, by CALLbe called. The entire address space available under MS-DOS can be read as well as written; the access can be used both byte-wise (using PEEKand POKE) and one page (using BLOADand BSAVE) take place. Internal interfaces are accessed using INPand OUT.

By means of the construction ON ... GOTO/GOSUBGW-BASIC offers an option for interrupt- controlled program execution. Interruptions can be, for. B. be triggered by pressing a button, a signal from the serial interface or the expiry of a specified period of time.

The programming language supports CGA as well as EGA graphics. Higher graphic instructions such as LINE, PAINTor CIRCLEare also available. Individual points can be PSETcolored with and the color value POINTread out again with. Bitmaps can be read and written using GETand PUT.

With the PLAYinstruction, the PC loudspeaker can play monophonic melodies, whereby notes are specified as a character string (e.g. PLAY "edcdeee2dfedc4"). A lower level access is SOUNDpossible with the instruction. The frequency is specified in Hertz and the length in 'clock ticks' for the system loudspeaker .

Limits

One obstacle to using GW-BASIC for larger applications is that the available memory is limited to 64 KB. Data as well as program code must be accommodated in this memory space. This restriction can only be compensated to a limited extent by the overlay technology that is made available by means of the instructions CHAINand MERGE. The only rudimentary support for structured programming makes the maintenance of larger programs more difficult, which is why the language is not very suitable for larger applications. Since neither mouse nor modern graphics or sound cards are supported, the programming of visually contemporary applications is hardly possible.

Web links

Individual evidence

  1. ^ A b Rich Turner: Microsoft Open Sources GW-BASIC. In: Microsoft Developer Blogs - Windows Command Line. Microsoft, May 21, 2020, accessed on May 22, 2020 (English): "These sources, as clearly stated in the repo's readme, are the 8088 assembly language sources from 10th Feb 1983, and are being open-sourced for historical reference and educational purposes. ... Many have asked if we can also open-source implementations for processors other than the 808x. Alas, we're unable to provide sources for these ports and / or customizations. "
  2. ^ A b Alexander Neumann: Microsoft reveals sources for GW-BASIC interpreter. In: Heise online . May 22, 2020 . Retrieved May 22, 2020.