HOME

TheInfoList



OR:

GW-BASIC is a dialect of the
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
developed by
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
from
IBM BASICA The IBM Personal Computer BASIC, commonly shortened to IBM BASIC, is a programming language first released by IBM with the IBM Personal Computer, IBM Personal Computer, Model 5150 (IBM PC) in 1981. IBM released four different versions of the Micr ...
. Functionally identical to BASICA, its
BASIC interpreter A BASIC interpreter is an Interpreter (computing), interpreter that enables users to enter and run programs in the BASIC programming language, language and was, for the first part of the microcomputer era, the default Application software, applica ...
is a fully self-contained executable and does not need the
Cassette BASIC 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 (IBM PC) in 1981. IBM released four different versions of the Microsoft BASIC interpre ...
ROM found in the original. It was bundled with
MS-DOS MS-DOS ( ; acronym for Microsoft Disk Operating System, also known as Microsoft DOS) is an operating system for x86-based personal computers mostly developed by Microsoft. Collectively, MS-DOS, its rebranding as IBM PC DOS, and a few op ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s on IBM PC–compatibles by Microsoft. 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
programmer A programmer, computer programmer or coder is an author of computer source code someone with skill in computer programming. The professional titles Software development, ''software developer'' and Software engineering, ''software engineer' ...
s to learn the fundamentals of
computer programming Computer programming or coding is the composition of sequences of instructions, called computer program, programs, that computers can follow to perform tasks. It involves designing and implementing algorithms, step-by-step specifications of proc ...
. Microsoft also sold a BASIC
compiler In computing, a compiler is a computer program that Translator (computing), translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primaril ...
, 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 Altair BASIC is a discontinued interpreter for the BASIC programming language that ran on the MITS Altair 8800 and subsequent S-100 bus computers. It was Microsoft's first product (as Micro-Soft), distributed by MITS under a contract. Altair B ...
 — and perhaps even of line-numbered BASIC in general." With the release of MS-DOS 5.0, GW-BASIC's place was taken by
QBasic QBasic is an integrated development environment (IDE) and BASIC interpreter, interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled into an intermediate representation (IR), and this ...
, a slightly abridged version of the interpreter part of the separately available
QuickBASIC Microsoft QuickBASIC (also QB) is an Integrated Development Environment (or IDE) 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 c ...
interpreter and compiler package. On May 21, 2020, Microsoft released the 8088 assembler source code for GW-BASIC 1.0 on
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
under the
MIT License The MIT License is a permissive software license originating at the Massachusetts Institute of Technology (MIT) in the late 1980s. As a permissive license, it puts very few restrictions on reuse and therefore has high license compatibility. Unl ...
.


Features

IBM BASICA and GW-BASIC are largely ports of
MBASIC MBASIC is the Microsoft BASIC, 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 o ...
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: * WHILE...WEND loops * Variable names of up to 40 characters * OPTION BASE statement to set the starting index of array variables as either 0 or 1 * Dynamic string space allocation * LINE INPUT, which allowed field-separator characters like comma to be ignored * CALL statement for executing machine-language routines * CHAIN and MERGE commands * Ability to save programs in either tokenized binary format or ASCII text 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 Memory footprint refers to the amount of main memory that a program uses or references while running. The word footprint generally refers to the extent of physical dimensions that an object occupies, giving a sense of its size. In computing, t ...
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 A COM file is a type of simple executable file. On the Digital Equipment Corporation (DEC) VAX operating systems of the 1970s, .COM was used as a filename extension for text files containing commands to be issued to the operating system (sim ...
. 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 The Compaq Portable is an early portable computer which was one of the first IBM PC compatible systems. It was Compaq Computer Corporation's first product, to be followed by others in the Compaq Portable series and later Compaq Deskpro series. ...
in 1983, and was analogous to IBM BASICA 1.10. It uses the
CP/M CP/M, originally standing for Control Program/Monitor and later Control Program for Microcomputers, is a mass-market operating system created in 1974 for Intel 8080/Intel 8085, 85-based microcomputers by Gary Kildall of Digital Research, Dig ...
-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 Video Graphics Array (VGA) is a video display controller and accompanying de facto graphics standard, first introduced with the IBM PS/2 line of computers in 1987, which became ubiquitous in the IBM PC compatible industry within three years. T ...
support) and is the last major new version released before it was superseded by
QBasic QBasic is an integrated development environment (IDE) and BASIC interpreter, interpreter for a variety of dialects of BASIC which are based on QuickBASIC. Code entered into the IDE is compiled into an intermediate representation (IR), and this ...
. Buyers of
Hercules Graphics Card The Hercules Graphics Card (HGC) is a computer graphics controller formerly made by Hercules Computer Technology, Inc. that combines IBM's text-only MDA display standard with a bitmapped graphics mode, also offering a parallel printer port. ...
s 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 A command-line interface (CLI) is a means of interacting with software via commands each formatted as a line of text. Command-line interfaces emerged in the mid-1960s, on computer terminals, as an interactive and more user-friendly alternativ ...
-based
integrated development environment An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
(IDE) based on
Dartmouth BASIC Dartmouth BASIC is the original version of the BASIC programming language. It was designed by two professors at Dartmouth College, John G. Kemeny and Thomas E. Kurtz. With the underlying Dartmouth Time-Sharing System (DTSS), it offered an interac ...
. Using the cursor movement keys, any line displayed on the screen can be edited. It also includes
function key A function key is a key on a computer or computer terminal, terminal computer keyboard, keyboard that can be programmed to cause the operating system or an application program to perform certain actions, a form of soft key. On some keyboards/com ...
shortcuts at the bottom of the screen. Like other early
microcomputer A microcomputer is a small, relatively inexpensive computer having a central processing unit (CPU) made out of a microprocessor. The computer also includes memory and input/output (I/O) circuitry together mounted on a printed circuit board (P ...
versions of BASIC, GW-BASIC lacks many of the structures needed for
structured programming Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
, such as local variables. GW-BASIC programs executed relatively slowly because it was an
interpreted language In computer science, an interpreter is a computer program that directly executes instructions written in a programming or scripting language, without requiring them previously to have been compiled into a machine language program. An inter ...
. All program lines must be numbered; all non-numbered lines are considered to be commands in
direct mode In computing, direct or immediate mode in an interactive programming system is the immediate execution of commands, statements, or expressions. In many interactive systems, most of these can both be included in programs or executed directly in ...
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 ASCII ( ), an acronym for American Standard Code for Information Interchange, is a character encoding standard for representing a particular set of 95 (English language focused) printable character, printable and 33 control character, control c ...
text form. 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 Structured programming is a programming paradigm aimed at improving the clarity, quality, and development time of a computer program by making specific disciplined use of the structured control flow constructs of selection ( if/then/else) and repet ...
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)= statement (e.g., ). The data type of variables can be specified with a character at the end of the variable name: A$ is a
string String or strings may refer to: *String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects Arts, entertainment, and media Films * ''Strings'' (1991 film), a Canadian anim ...
of characters, A% is an
integer An integer is the number zero (0), a positive natural number (1, 2, 3, ...), or the negation of a positive natural number (−1, −2, −3, ...). The negations or additive inverses of the positive natural numbers are referred to as negative in ...
, 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 In computing, floating-point arithmetic (FP) is arithmetic on subsets of real numbers formed by a ''significand'' (a Sign (mathematics), signed sequence of a fixed number of digits in some Radix, base) multiplied by an integer power of that ba ...
(
32-bit MBF In computing, Microsoft Binary Format (MBF) is a format for floating-point numbers which was used in Microsoft's BASIC languages, including MBASIC, GW-BASIC and QuickBASIC prior to version 4.00. There are two main versions of the format. The or ...
). GW-BASIC allows use of
joystick A joystick, sometimes called a flight stick, is an input device consisting of a stick that pivots on a base and reports its angle or direction to the device it is controlling. Also known as the control column, it is the principal control devic ...
and
light pen A light pen is a computer input device in the form of a light-sensitive wand used in conjunction with a computer's cathode-ray tube (CRT) display. It allows the user to point to displayed objects or draw on the screen in a similar way to a to ...
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 Frequency is the number of occurrences of a repeating event per unit of time. Frequency is an important parameter used in science and engineering to specify the rate of oscillatory and vibratory phenomena, such as mechanical vibrations, audio ...
in
hertz The hertz (symbol: Hz) is the unit of frequency in the International System of Units (SI), often described as being equivalent to one event (or Cycle per second, cycle) per second. The hertz is an SI derived unit whose formal expression in ter ...
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.


Name

There are several theories on what the initials "GW" represent. Greg Whitten, an early
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
employee who developed the standards in the company's BASIC compiler line, says that
Bill Gates William Henry Gates III (born October 28, 1955) is an American businessman and philanthropist. A pioneer of the microcomputer revolution of the 1970s and 1980s, he co-founded the software company Microsoft in 1975 with his childhood friend ...
picked the name GW-BASIC. Whitten refers to it as ''Gee-Whiz'' BASIC and is unsure whether Gates named the program after him. The ''Microsoft User Manual'' from
Microsoft Press Microsoft Press is the publishing arm of Microsoft, usually releasing books dealing with various current Microsoft technologies. Microsoft Press' introduced books were ''The Apple Macintosh Book'' by Cary Lu and ''Exploring the IBM PCjr Home Comp ...
also refers to it by the ''Gee-Whiz'' BASIC name. It may have also been
nickname A nickname, in some circumstances also known as a sobriquet, or informally a "moniker", is an informal substitute for the proper name of a person, place, or thing, used to express affection, playfulness, contempt, or a particular character trait ...
d ''Gee-Whiz'' because of its numerous
graphics Graphics () are visual images or designs on some surface, such as a wall, canvas, screen, paper, or stone, to inform, illustrate, or entertain. In contemporary usage, it includes a pictorial representation of the data, as in design and manufa ...
commands. 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).


See also

*
Microsoft Binary Format In computing, Microsoft Binary Format (MBF) is a format for floating-point numbers which was used in Microsoft's BASIC languages, including MBASIC, GW-BASIC and QuickBASIC prior to version 4.00. There are two main versions of the format. The or ...
(MBF)


References


External links


GW-BASIC source code on GitHub
*



regarding BASIC, with timeline dates for DOS, Windows and BASIC dialects
GW-BASIC
nbsp;— A resource for GW-BASIC, gathered from various sources. {{DEFAULTSORT:Gw-Basic Discontinued Microsoft BASICs Programming languages created in 1983 BASIC interpreters BASIC programming language family Software using the MIT license Assembly language software Formerly proprietary software Microsoft free software Microsoft programming languages