Authentic GW-BASIC screen editor with 25x80 buffer, free cursor movement, enter-on-any-line, F1-F10 function keys, Insert/Overwrite toggle, KEY ON/OFF/LIST statement, and Ctrl+Break handling. HAL pointer swap routes all PRINT/LIST/error output through the TUI automatically. Piped mode unchanged (50/50 tests pass). Adds automated compatibility testing infrastructure: DOSBox-X headless config, PRINT-to-file transform script, and run_compat.sh with --generate and --compare modes for verifying output against real GWBASIC.EXE. Project renamed from gwbasic-c to GW-BASIC 2026.
1.3 KiB
1.3 KiB
Getting Started
Dependencies
- C11 compiler (GCC or Clang)
- CMake 3.10+
- PulseAudio development library (
libpulse-simple) — optional, forSOUND/BEEP/PLAY
On Debian/Ubuntu:
sudo apt-get install build-essential cmake libpulse-dev
On Fedora/RHEL:
sudo dnf install gcc cmake pulseaudio-libs-devel
Building
git clone https://github.com/evvaletov/gw-basic-2026.git
cd gw-basic-2026
mkdir -p build && cd build
cmake .. && make
The binary is build/gwbasic.
Usage
Interactive Mode
Running ./gwbasic with no arguments launches the full-screen editor:
$ ./gwbasic
GW-BASIC 2026 0.5.0
(C) Eremey Valetov 2026. MIT License.
Based on Microsoft GW-BASIC assembly source.
Ok
PRINT 2+2
4
Ok
FOR I=1 TO 5:PRINT I;:NEXT
1 2 3 4 5
Ok
Use arrow keys to move the cursor freely. Press Enter on any screen line to re-enter it. F1-F10 insert common commands (F2 runs the program).
Running a Program File
./gwbasic tests/programs/prime_sieve.bas
Piped Input
echo '10 FOR I=1 TO 10:PRINT I*I;:NEXT' | ./gwbasic
Direct Mode Expressions
Type expressions and statements at the Ok prompt:
PRINT SIN(3.14159/2)
1
A$="HELLO WORLD":MID$(A$,7,5)="BASIC":PRINT A$
HELLO BASIC