GW-BASIC

Last updated
GW-BASIC
GW-BASIC 3.23.png
Developer Microsoft
First appeared1983;41 years ago (1983)
Stable release
3.23 / 1988;36 years ago (1988)
OS DOS
License Proprietary
MIT License (v1.0) [1]
Influenced by
IBM Cassette BASIC, IBM Disk BASIC, IBM BASICA
Influenced
QBasic, QuickBasic, MSX BASIC

GW-BASIC is a dialect of the BASIC programming language developed by Microsoft from IBM BASICA. Functionally identical to BASICA, its BASIC interpreter is a fully self-contained executable and does not need the Cassette BASIC ROM found in the original. It was bundled with MS-DOS operating systems on IBM PC–compatibles by Microsoft.

Contents

The language is suitable for simple games, business programs and the like. Since it was included with most versions of MS-DOS, it was also a low-cost way for many aspiring programmers to learn the fundamentals of computer programming. [2] [3] Microsoft also sold a BASIC compiler, BASCOM, compatible with GW-BASIC, for programs needing more speed.

According to Mark Jones Lorenzo, given the scope of the language, "GW-BASIC is arguably the ne plus ultra of Microsoft's family of line-numbered BASICs stretching back to Altair BASIC  — and perhaps even of line-numbered BASIC in general." [4]

With the release of MS-DOS 5.0, GW-BASIC's place was taken by QBasic, a slightly abridged version of the interpreter part of the separately available QuickBASIC interpreter and compiler package. [5]

On May 21, 2020, Microsoft released the 8088 assembler source code for GW-BASIC 1.0 on GitHub under the MIT License. [1]

Features

IBM BASICA and GW-BASIC are largely ports of MBASIC version 5.x, but with added features specifically for the IBM PC hardware. Common features of BASIC-80 5.x and BASICA/GW-BASIC include:

The ability to "crunch" program lines by omitting spaces, a common feature of earlier Microsoft BASIC implementations, was removed from BASIC-80 5.x and BASICA/GWBASIC.

BASIC-80 programs not using PEEK/POKE statements run under GW-BASIC. BASICA adds many features for the IBM PC such as sound, graphics, and memory commands. Features not present in BASIC-80 include the ability to execute the RND function with no parameters and the ability to also save programs in a "protected" format, preventing them from being LISTed. BASICA also allows double-precision numbers to be used with mathematical and trigonometric functions such as COS, SIN, and ATN, which wasn't allowed in 8-bit versions of BASIC. This feature was normally not enabled and required the optional parameter /D at startup, i.e., GWBASIC /D. BASIC's memory footprint was slightly increased if it was used.

Microsoft did not offer a generic version of MS-DOS until v3.20 in 1986; before then, all variants of the operating system were OEM versions. Depending on the OEM, BASIC was distributed as either BASICA.EXE or GWBASIC.EXE. The former should not be confused with IBM BASICA, which always came as a COM file. Some variants of BASIC has extra features to support a particular machine. For example, the AT&T and Tandy versions of DOS include a special GW-BASIC that supports their enhanced sound and graphics capabilities.

The initial version of GW-BASIC is the one included with Compaq DOS 1.13, released with the Compaq Portable in 1983, and was analogous to IBM BASICA 1.10. It uses the CP/M-derived file control blocks for disk access and does not support subdirectories. Later versions support subdirectories, improved graphics, and other capabilities.

GW-BASIC 3.20 (1986) adds EGA graphics support (no version of BASICA or GW-BASIC had VGA support) and is the last major new version released before it was superseded by QBasic.

Buyers of Hercules Graphics Cards received a special version of GW-BASIC on the card's utility disk that is called HBASIC, which adds support for its 720×348 monochrome graphics. Other versions of BASICA/GW-BASIC do not support Hercules graphics and can only display graphics on that card through the use of third-party CGA emulation, such as SIMCGA.

GW-BASIC has a command-line-based integrated development environment (IDE) based on Dartmouth BASIC. Using the cursor movement keys, any line displayed on the screen can be edited. It also includes function key shortcuts at the bottom of the screen. Like other early microcomputer versions of BASIC, GW-BASIC lacks many of the structures needed for structured programming, such as local variables. GW-BASIC programs executed relatively slowly because it was an interpreted language. All program lines must be numbered; all non-numbered lines are considered to be commands in direct mode to be executed immediately. Program source files are normally saved in binary compressed format with tokens replacing keywords, with an option to save in ASCII text form. [6]

The GW-BASIC command-line environment has commands to RUN, LOAD, SAVE, LIST the current program, or quit to the operating SYSTEM; these commands can also be used as program statements. There is little support for structured programming in GW-BASIC. All IF/THEN/ELSE conditional statements must be written on one line, although WHILE/WEND statements may group multiple lines. Functions can only be defined using the single line DEF FNf(x)=<mathematical function of x> statement (e.g., DEF FNLOG(base,number)=LOG(number)/LOG(base)). The data type of variables can be specified with a character at the end of the variable name: A$ is a string of characters, A% is an integer, etc. Groups of variables can also be set to default types based on the initial letter of their name by use of the DEFINT, DEFSTR, etc., statements. The default type for undeclared variables not identified by such typing statements is single-precision floating-point (32-bit MBF). [7]

GW-BASIC allows use of joystick and light pen input devices. GW-BASIC can read from and write to files and COM ports; it can also do event trapping for ports. Since the cassette tape port interface of the original IBM PC was never implemented on compatibles, cassette operations are not supported. GW-BASIC can play simple music using the PLAY statement, needing a string of notes represented in a music macro language, e.g., PLAY "edcdeeL2edfedL4c". More low-level control is possible with the SOUND statement, which takes the arguments of a frequency in hertz and a length in clock ticks for the standard internal PC speaker in IBM machines. Consequently, sound is limited to single channel beeps and whistles as befits a "business" machine. GW-BASIC for the Tandy 1000 allows up to three channels of sound for the SOUND and PLAY commands. [7]

Name

There are several theories on what the initials "GW" represent. Greg Whitten, an early Microsoft employee who developed the standards in the company's BASIC compiler line, says that Bill Gates picked the name GW-BASIC. Whitten refers to it as Gee-Whiz BASIC and is unsure whether Gates named the program after him. [8] The Microsoft User Manual from Microsoft Press also refers to it by the Gee-Whiz BASIC name.[ citation needed ] It may have also been nicknamed Gee-Whiz because of its numerous graphics commands. [8] Other common theories as to the initials' origins include "Graphics and Windows", "Gates, William" (Microsoft's president at the time), or "Gates–Whitten" (the two main designers of the program). [9] [10]

See also

Related Research Articles

Applesoft BASIC is a dialect of Microsoft BASIC, developed by Marc McDonald and Ric Weiland, supplied with Apple II computers. It supersedes Integer BASIC and is the BASIC in ROM in all Apple II series computers after the original Apple II model. It is also referred to as FP BASIC because of the Apple DOS command FP used to invoke it, instead of INT for Integer BASIC.

<span class="mw-page-title-main">BASIC</span> Family of programming languages

BASIC is a family of general-purpose, high-level programming languages designed for ease of use. The original version was created by John G. Kemeny and Thomas E. Kurtz at Dartmouth College in 1963. They wanted to enable students in non-scientific fields to use computers. At the time, nearly all computers required writing custom software, which only scientists and mathematicians tended to learn.

<span class="mw-page-title-main">QuickBASIC</span> IDE for the BASIC programming language

Microsoft QuickBASIC is an Integrated Development Environment and compiler for the BASIC programming language that was developed by Microsoft. QuickBASIC runs mainly on DOS, though there was also a short-lived version for the classic Mac OS. It is loosely based on GW-BASIC but adds user-defined types, improved programming structures, better graphics and disk support and a compiler in addition to the interpreter. Microsoft marketed QuickBASIC as the introductory level for their BASIC Professional Development System. Microsoft marketed two other similar IDEs for C and Pascal, viz QuickC and QuickPascal.

<span class="mw-page-title-main">Atari BASIC</span> Dialect of the BASIC programming language

Atari BASIC is an interpreter for the BASIC programming language that shipped with Atari 8-bit computers. Unlike most American BASICs of the home computer era, Atari BASIC is not a derivative of Microsoft BASIC and differs in significant ways. It includes keywords for Atari-specific features and lacks support for string arrays.

Microsoft BASIC is the foundation software product of the Microsoft company and evolved into a line of BASIC interpreters and compiler(s) adapted for many different microcomputers. It first appeared in 1975 as Altair BASIC, which was the first version of BASIC published by Microsoft as well as the first high-level programming language available for the Altair 8800 microcomputer.

Commodore BASIC, also known as PET BASIC or CBM-BASIC, is the dialect of the BASIC programming language used in Commodore International's 8-bit home computer line, stretching from the PET (1977) to the Commodore 128 (1985).

<span class="mw-page-title-main">SmallBASIC</span> BASIC programming language dialect with interpreters released as free software

SmallBASIC is a BASIC programming language dialect with interpreters released as free software under the GNU General Public License version 3 for Microsoft Windows, Linux and Android.

In computing, CLS is a command used by the command-line interpreters COMMAND.COM and cmd.exe on DOS, Digital Research FlexOS, IBM OS/2, Microsoft Windows and ReactOS operating systems to clear the screen or console window of commands and any output generated by them. It does not clear the user's history of commands, however. The command is also available in the DEC RT-11 operating system, in the open-source MS-DOS emulator DOSBox and in the EFI shell. In other environments, such as Linux and Unix, the same functionality is provided by the clear command.

MBASIC is the Microsoft BASIC implementation of BASIC for the CP/M operating system. MBASIC is a descendant of the original Altair BASIC interpreters that were among Microsoft's first products. MBASIC was one of the two versions of BASIC bundled with the Osborne 1 computer. The name "MBASIC" is derived from the disk file name MBASIC.COM of the BASIC interpreter.

Donkey, often known by its filename DONKEY.BAS, is a video game written in 1981 and included with early versions of the IBM PC DOS operating system distributed with the original IBM PC. It is a top-down driving game in which the player must avoid hitting donkeys. The game was written by Microsoft co-founder Bill Gates and early employee Neil Konzen.

BSAVE and BLOAD are commands in many varieties of the BASIC programming language. BSAVE copies RAM to a binary file, and BLOAD copies the contents of the file to RAM. The term "BSAVE image" could mean any of various raw image formats of video display controllers, or more generally any file containing the raw contents of a section of memory.

A batch file is a script file in DOS, OS/2 and Microsoft Windows. It consists of a series of commands to be executed by the command-line interpreter, stored in a plain text file. A batch file may contain any command the interpreter accepts interactively and use constructs that enable conditional branching and looping within the batch file, such as IF, FOR, and GOTO labels. The term "batch" is from batch processing, meaning "non-interactive execution", though a batch file might not process a batch of multiple data.

Music Macro Language (MML) is a music description language used in sequencing music on computer and video game systems.

<span class="mw-page-title-main">DOS</span> Family of IBM PC-compatible operating systems

DOS is a family of disk-based operating systems for IBM PC compatible computers. The DOS family primarily consists of IBM PC DOS and a rebranded version, Microsoft's MS-DOS, both of which were introduced in 1981. Later compatible systems from other manufacturers include DR-DOS (1988), ROM-DOS (1989), PTS-DOS (1993), and FreeDOS (1998). MS-DOS dominated the IBM PC compatible market between 1981 and 1995.

<span class="mw-page-title-main">QBasic</span> IDE for the BASIC programming language

QBasic is an integrated development environment (IDE) and interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled to an intermediate representation (IR), and this IR is immediately executed on demand within the IDE.

<span class="mw-page-title-main">Command-line interface</span> Computer interface that uses text

A command-line interface (CLI) is a means of interacting with a computer program by inputting lines of text called command-lines. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternative to the non-interactive interface available with punched cards.

The IBM Personal Computer Basic, commonly shortened to IBM BASIC, is a programming language first released by IBM with the IBM Personal Computer, Model 5150 in 1981. IBM released four different versions of the Microsoft BASIC interpreter, licensed from Microsoft for the PC and PCjr. They are known as Cassette BASIC, Disk BASIC, Advanced BASIC (BASICA), and Cartridge BASIC. Versions of Disk BASIC and Advanced BASIC were included with IBM PC DOS up to PC DOS 4. In addition to the features of an ANSI standard BASIC, the IBM versions offered support for the graphics and sound hardware of the IBM PC line. Source code could be entered with a full-screen editor, and limited facilities were provided for rudimentary program debugging. IBM also released a version of the Microsoft BASIC compiler for the PC concurrently with the release of PC DOS 1.10 in 1982.

<span class="mw-page-title-main">BASIC interpreter</span> Interpreter that enables users to enter and run programs in the BASIC language

A BASIC interpreter is an interpreter that enables users to enter and run programs in the BASIC language and was, for the first part of the microcomputer era, the default application that computers would launch. Users were expected to use the BASIC interpreter to type in programs or to load programs from storage.

References

  1. 1 2 Turner, Rich. "Microsoft Open-Sources GW-BASIC". Windows Command Line. Microsoft. Retrieved May 22, 2020.
  2. KindlyRat. "GW-BASIC". Archived from the original on 2005-07-26. Retrieved 2009-11-10.
  3. Leon. "GWBASIC Games & Other Programs". Archived from the original on 2009-10-26. Retrieved 2009-11-10.
  4. Lorenzo, Mark (2017). Endless Loop: The History of the BASIC Programming Language. Philadelphia: SE Books. p. 122. ISBN   978-1974-27707-0.
  5. "Microsoft BASIC version information" . Retrieved 2008-06-12.
  6. "GW-BASIC Documentation and Utilities". Archived from the original on 2007-12-17.
  7. 1 2 "GW-BASIC User's Guide". 1987. Retrieved 2008-06-28.
  8. 1 2 Gregory Whitten (2005-04-13). "GW-BASIC". Archived from the original on 2008-09-20. Retrieved 2008-06-29.
  9. "Linux Dictionary:G" . Retrieved 2008-06-28.
  10. "GW-BASIC". 2005-04-13. Archived from the original on 2008-06-29. Retrieved 2008-06-28.