Building GW-BASIC from source in 2025

Date: 2025-10-02
categories: BASIC, retro, GW-BASIC;

I got my start programming as a kid using AppleSoft BASIC.

10 PRINT "HELLO WORLD"
20 GOTO 10

I've always had a nostalgic fondness for line-number BASIC dialects, in the same way that I have a fondness for the original D&D and programming in assembly language. As an adult, I went through a period where I hobby programmed a lot of GW-BASIC, which was the closest thing I could find to AppleSoft BASIC at the time. Those were the days where I still had a machine running Windows 98, and I could run it natively in the 16-bit emulation mode.

In 2020, Microsoft released the source code for GW-BASIC, and this week I decided to see if I could get it to build. This blog post documents that process.

First, this seems to be the best fork to use in 2025:

https://gitlab.com/tkchia/GW-BASIC

There are some instructions in the README, so you should definitely review those. I found that the MASM and LINK versions listed didn't give me a working build. My process there was to run dosbox and run the build, which produced a GWBASIC.EXE file. Unfortunately, it starts but freezes, and I have to kill dosbox.

Instead of pursuing that, I decided to use JWasm and JWlink instead.

(Note that Baron-von-Riedesel also has a JWlink repo but that's not the one to use for this.)

For JWasm I just needed to run (I'm on Linux Mint):

make -f GccUnix.mak

That results in jwasm in the build/GccUnixR directory.

For JWlink:

pushd dwarf/dw
make -f GccUnix.mak
popd

pushd orl
make -f GccUnix.mak
popd

make -f GccUnix.mak

make all doesn't seem to build the dependencies, so you just have to do those first. This results in jwlink in the GccUnixR directory.

Next, copy the jwasm and jwlink files over to your GW-BASIC source directory.

Then just run make. It's almost instant, and you get a GWBASIC.EXE. Fire up dosbox and run it:

dosbox
Z:\> mount C: .
Z:\> C:
C:\> GWBASIC.EXE

Running like new!