GW-BASIC 2026¶
A portable C reimplementation of Microsoft GW-BASIC, using the original 8088 assembly source (released by Microsoft in 2020) as the authoritative reference.
The interpreter implements the language in C11 and aims to reproduce the original behavior. The POSIX build uses an ANSI terminal; the DOS build uses BIOS display services. Hardware emulation and device stubs are described in the language reference.
Start here¶
Install and download: release archives, Homebrew and the Jupyter kernel.
Getting started: build, run and compile your first program.
Demos: the FreeDOS editor, native compilation and notebook graphics.
Compiling GW-BASIC and drawing in Jupyter: a technical walkthrough with executed examples from v0.18.2.

These pages follow development on main. Release downloads contain the source
and features of their tagged version. The source repository
and issue tracker are on GitHub.
This documentation is published at retroprogramming.org/gwbasic
and mirrored on GitHub Pages.
See Retroprogramming for the project collection.
Highlights¶
Full-screen editor with a dynamically sized screen buffer (25×80 default, full terminal with
--full), free cursor movement, Enter-on-any-line, F1-F10 function keys, Insert/Overwrite toggleBinary and ASCII file formats:
SAVEwrites tokenized binary by default, andLOADauto-detects the formatINKEY$extended keys: arrow keys, F-keys, and navigation keys returnCHR$(0)+ scan code two-byte sequencesSixel graphics:
SCREEN 1/SCREEN 2rendering in compatible terminalsSound:
SOUND,BEEP,PLAY(MML) via PulseAudio, plus continuous tone viaOUT(8253 PIT / PPI speaker emulation)Hardware I/O:
OUT,INP,WAITport emulation for the speaker and CGA, with stubs for COM1 and the game portFile I/O: sequential, random-access, SAVE/LOAD/MERGE/CHAIN/COMMON
Printer output:
LPRINT/LLISTto file or real hardware via--lptClassic programs: Hamurabi, Lunar Lander, Gunner, and Diamond from David Ahl’s BASIC Computer Games (1978) are included in
tests/classic/Ahead-of-time compiler:
build/gwbasic-compile prog.bas -c --runtime .produces a native executable through generated C and GCCJupyter kernel: inline Sixel graphics, INPUT support, Pygments syntax highlighting;
pip install -e . && gwbasickernel-install --userRegression tests with expected-output files and a DOSBox-X harness for comparison with GWBASIC.EXE
MIT-licensed implementation; vendored BASIC Computer Games listings use the Unlicense
- Install and download
- Getting Started
- Reproducing the demos
- GW-BASIC 2026 for VS Code
- Language Reference
- Program line numbers
- Data Types
- Operators
- Numeric Functions
- String Functions
- File Functions
- Memory Functions
- Pseudo-variables
- FOR/NEXT and Subroutines
- Literals
- Statements
- Program I/O (SAVE / LOAD)
- INKEY$ Extended Keys
- Printer Output (LPRINT / LLIST)
- Graphics
- DEF SEG / PEEK / POKE
- BSAVE / BLOAD
- String Space and Garbage Collection
- Hardware I/O (OUT / INP / WAIT)
- Environment Variables
- Date/Time Assignment
- Device Stubs
- Sound
- Full-Screen Editor (TUI)
- Event Trapping
- References
- Debug runs
- Debug command/event contract v1
- Architecture
- Development
- Roadmap