Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
GW-BASIC
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Dialect of the BASIC programming language}} {{Infobox programming language |name = GW-BASIC |logo = [[File:GW-BASIC 3.23.png|300px]] |paradigm = |year = {{Start date and age|1983}} |designer = |developer = [[Microsoft]] |latest release version = 3.23 |latest release date = {{Start date and age|1988}} |typing = |implementations = |dialects = |influenced by = [[IBM Cassette BASIC]], [[IBM Disk BASIC]], [[IBM BASICA]] |influenced = [[QBasic]], [[QuickBasic]], [[MSX BASIC]] |operating system = [[DOS]] |license = [[Proprietary software|Proprietary]]<br />[[MIT License]] (v1.0)<ref name="opensource"/> |website = }} '''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 system]]s on [[IBM PC–compatible]]s 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]]s to learn the fundamentals of [[computer programming]].<ref>{{cite web|url=http://www.geocities.com/KindlyRat/GWBASIC.html|title=GW-BASIC|access-date=2009-11-10|author=KindlyRat|archive-url=https://web.archive.org/web/20050726081451/http://www.geocities.com/KindlyRat/GWBASIC.html |archive-date=2005-07-26}}</ref><ref>{{cite web|url=http://peyre.sqweebs.com/GWBASIC/index.htm|title=GWBASIC Games & Other Programs|access-date=2009-11-10|author=Leon|archive-url=https://web.archive.org/web/20091026133328/http://peyre.sqweebs.com/GWBASIC/index.htm |archive-date=2009-10-26}}</ref> 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 ''[[List_of_Latin_phrases_(N)#ne_plus_ultra|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."<ref name="endlessloop">{{cite book |last1=Lorenzo |first1=Mark |title=Endless Loop: The History of the BASIC Programming Language |date=2017 |publisher=SE Books |location=Philadelphia |isbn=978-1974-27707-0 |page=122}}</ref> 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.<ref>{{cite web|url=http://www.emsps.com/oldtools/msbasv.htm#qbasic|title=Microsoft BASIC version information|access-date=2008-06-12}}</ref> On May 21, 2020, Microsoft released the [[x86 assembly language|8088 assembler]] source code for GW-BASIC 1.0 on [[GitHub]] under the [[MIT License]].<ref name="opensource">{{cite news|url=https://devblogs.microsoft.com/commandline/microsoft-open-sources-gw-basic/|title=Microsoft Open-Sources GW-BASIC|publisher=Microsoft|work=Windows Command Line|first=Rich|last=Turner|access-date=May 22, 2020}}</ref> == 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: * <code>WHILE...WEND</code> loops * Variable names of up to 40 characters * <code>OPTION BASE</code> statement to set the starting index of array variables as either 0 or 1 * Dynamic string space allocation * <code>LINE INPUT</code>, which allowed field-separator characters like comma to be ignored * <code>CALL</code> statement for executing machine-language routines * <code>CHAIN</code> and <code>MERGE</code> 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 <code>PEEK</code>/<code>POKE</code> 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 <code>RND</code> function with no parameters and the ability to also save programs in a "protected" format, preventing them from being <code>LIST</code>ed. BASICA also allows double-precision numbers to be used with mathematical and trigonometric functions such as <code>COS</code>, <code>SIN</code>, and <code>ATN</code>, which wasn't allowed in 8-bit versions of BASIC. This feature was normally not enabled and required the optional parameter <code>/D</code> at startup, i.e., <code>GWBASIC /D</code>. 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 [[Enhanced Graphics Adapter|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 Card]]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 [[Color Graphics Adapter|CGA]] emulation, such as SIMCGA. GW-BASIC has a [[Command-line interface|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 [[Lexical analysis#Token|tokens]] replacing keywords, with an option to save in [[ASCII]] text form.<ref name="DocUtil">{{cite web|url=http://www.xs4all.nl/~hwiegman/gwbasic.html |title=GW-BASIC Documentation and Utilities |archive-url = https://web.archive.org/web/20071217161146/http://www.xs4all.nl/~hwiegman/gwbasic.html |archive-date = 2007-12-17}}</ref> The GW-BASIC command-line environment has commands to <code>RUN</code>, <code>LOAD</code>, <code>SAVE</code>, <code>LIST</code> the current program, or quit to the operating <code>SYSTEM</code>; these commands can also be used as program statements. There is little support for [[structured programming]] in GW-BASIC. All <code>IF</code>/<code>THEN</code>/<code>ELSE</code> [[Conditional (computer programming)|conditional statements]] must be written on one line, although <code>WHILE</code>/<code>WEND</code> statements may group multiple lines. [[Subroutine|Functions]] can only be defined using the single line <code>[[User-defined function#BASIC language|DEF FN]]f(x)={{var|<mathematical function of x>}}</code> statement (e.g., {{code|1=DEF FNLOG(base,number)=LOG(number)/LOG(base)|2=basic}}). The data type of [[Variable (computer science)|variables]] can be specified with a character at the end of the variable name: <code>A$</code> is a [[string (computer science)|string]] of characters, <code>A%</code> 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 <code>DEFINT</code>, <code>DEFSTR</code>, etc., statements. The default type for undeclared variables not identified by such typing statements is single-precision [[Floating-point arithmetic|floating-point]] ([[Microsoft Binary Format#32-bit MBF|32-bit MBF]]).<ref name="Guide">{{cite web|url=http://www.xs4all.nl/~hwiegman/gw-man/index.html|title=GW-BASIC User's Guide|year=1987|access-date=2008-06-28}}</ref> GW-BASIC allows use of [[joystick]] and [[light pen]] input devices. GW-BASIC can read from and write to files and [[serial port|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 <code>PLAY</code> statement, needing a string of notes represented in a [[music macro language]], e.g., <code>PLAY "edcdeeL2edfedL4c"</code>. More [[High- and low-level|low-level]] control is possible with the <code>SOUND</code> 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 <code>SOUND</code> and <code>PLAY</code> commands.<ref name="Guide"/> == 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.<ref name="Whitten">{{cite web|url=http://www.classiccmp.org/pipermail/cctech/2005-April/042999.html|title=GW-BASIC|date=2005-04-13|access-date=2008-06-29|author=Gregory Whitten|url-status=dead|archive-url=https://web.archive.org/web/20080920032110/http://classiccmp.org/pipermail/cctech/2005-April/042999.html|archive-date=2008-09-20}}</ref> The ''Microsoft User Manual'' from [[Microsoft Press]] also refers to it by the ''Gee-Whiz'' BASIC name.{{Citation needed|date=June 2008}} It may have also been [[nickname]]d ''Gee-Whiz'' because of its numerous [[2D computer graphics|graphics]] commands.<ref name="Whitten"/> Other common theories as to the initials' origins include "Graphics and Windows", "[[Bill Gates|Gates, William]]" (Microsoft's president at the time), or "Gates–Whitten" (the two main designers of the program).<ref>{{cite web|url=http://www.tldp.org/LDP/Linux-Dictionary/html/g.html|title=Linux Dictionary:G|access-date=2008-06-28}}</ref><ref>{{cite web |url=http://classiccmp.org/pipermail/cctech/2005-April/042967.html |title=GW-BASIC |date=2005-04-13 |access-date=2008-06-28 |url-status=dead |archive-url=https://web.archive.org/web/20080629053601/http://classiccmp.org/pipermail/cctech/2005-April/042967.html |archive-date=2008-06-29 }}</ref> == See also == {{Portal|Free and open-source software}} *[[Microsoft Binary Format]] (MBF) == References == {{Reflist}} == External links == * [https://github.com/microsoft/GW-BASIC GW-BASIC source code on GitHub] * {{webarchive |url=https://web.archive.org/web/20091027112638/http://geocities.com/KindlyRat/GWBASIC.html |date=October 27, 2009 |title=GW-BASIC interpreter program and files download site }} * [http://hwiegman.home.xs4all.nl/gw-man/index.html GW-BASIC User's Manual] * [http://www.garybeene.com/qbasic/qb-hist.htm Gary Beene's Information Center] {{Webarchive|url=https://web.archive.org/web/20140706021053/http://www.garybeene.com/qbasic/qb-hist.htm |date=2014-07-06 }} regarding BASIC, with timeline dates for DOS, Windows and BASIC dialects * [https://gw-basic.netlify.app GW-BASIC] — A resource for GW-BASIC, gathered from various sources. {{BASIC}} {{Microsoft FOSS}} {{Authority control}} {{DEFAULTSORT:Gw-Basic}} [[Category:Discontinued Microsoft BASICs]] [[Category:Programming languages created in 1983]] [[Category:BASIC interpreters]] [[Category:BASIC programming language family]] [[Category:Software using the MIT license]] [[Category:Assembly language software]] [[Category:Formerly proprietary software]] [[Category:Microsoft free software]] [[Category:Microsoft programming languages]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Authority control
(
edit
)
Template:BASIC
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite news
(
edit
)
Template:Cite web
(
edit
)
Template:Code
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Microsoft FOSS
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Var
(
edit
)
Template:Webarchive
(
edit
)