Having re-open-sourced MS-DOS on GitHub in 2018, Microsoft has now released the source code for GW-BASIC, Microsoft’s 1983 BASIC interpreter.
GW-BASIC can trace its roots back to Bill Gates’ and Paul Allen’s implementation of Microsoft’s first product, the BASIC interpreter for the Altair 8800 computer.
As explained by Rich Turner, a senior program manager for Windows Console & Command-Line, GW-BASIC was derived from IBM’s Advanced BASIC – itself a port of Microsoft BASIC – that shipped with the IBM Model 5150 PC in 1981. BASIC would eventually become the basis for today’s Microsoft Visual Basic .NET.
The sources for Microsoft GW-BASIC are the assembly language for the Intel-designed 8088 microprocessor from February 10, 1983. Microsoft has released the GW-BASIC source code because having open-sourced MS-DOS people wanted it to do the same with Microsoft BASIC.
While becoming open-sourced, Microsoft has posted it on GitHub as an archive and therefore is not accepting any request to modify the source. It’s there for historical reference and educational purposes. Also, the source doesn’t contain the tools to generate executable binaries.
Turner reminisces that in 1983, age 13 years, he was writing BASIC and assembly code on the BBC Micro, the spiritual predecessor of the Raspberry Pi, which had just 32KB of RAM and a 2MHz processor.
1983 was a big year for tech, Turner recalls. Danish computer scientist Bjarne Stroustrup was busy working on the first version of C++ – a key programming language that Microsoft has used to build Windows – and US Defense’s Advanced Research Projects Agency Network (ARPANET) standardized the TCP/IP internet protocol.
Also, Borland announced Turbo Pascal, which was created by Anders Helsjberg, who went on to create C# and TypeScript at Microsoft.
And back then Apple’s hardware was even less affordable than it is today and totally out of reach for Turner.
“In 1983, Apple launched the 1MHz 6502-powered Apple IIe for US$1,395 (> $3,500 in 2020). Apple also launched the first commercially available computer with a GUI – the Apple Lisa,” he writes.
“The Lisa contained a staggering 1MB RAM, and ran the awesome Motorola 68000 processor at an astounding 5MHz, but it cost $9,995 (> $25,000 in 2020 dollars), so all I could do was peer at it through the window of the one computer store in our town authorized to sell Apple’s products … and dream.”
But it was also the year that Microsoft released MS-DOS 2.0 and GW-BASIC for the IBM PC XT, which was quite possibly ZDNet Microsoft authority May-Jo Foley’s first PC.
Turner says the source code for GW-BASIC is 100% assembly language, meaning it’s a low-level language built for a specific chip architecture.
Turner notes that developers writing code for mainframes at the time could use higher-level languages like FORTRAN, LISP, and COBOL, but compilers for these languages were expensive, inefficient, and too big for PCs back then.
“When writing software for early PCs, every single byte and every single instruction mattered, so developers often wrote code entirely in assembly language simply to be able to physically fit their software into the available memory, and to be able to access the computer’s resources and internal workings,” he notes.
“Thus, all the source code for GW-BASIC is pure assembly code, translated on a per-processor/per-machine basis from core/master sources.”