News: 1756970170

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Microsoft open-sources the 6502 BASIC coded by Bill Gates himself

(2025/09/04)


Microsoft has open-sourced the version of BASIC it created in 1976 for the MOS 6502 processor used in many early microcomputers.

As the software colossus explained in a Wednesday [1]post , Microsoft founders Bill Gates and Paul Allen wrote the company’s first product, [2]BASIC for the Altair 8800 microcomputer and the Intel 8080 processor that powered it, in 1975.

A year later Gates and Ric Weiland, Microsoft’s second employee, ported Microsoft BASIC to the 6502 processor.

[3]

In 1977, Commodore Computer licensed it for $25,000 and used Microsoft BASIC in its PET, VIC-20, and Commodore 64 machines. Commodore sold millions of the latter two machines, which helped bring computing to a mass market.

[4]

[5]

The code Microsoft has released is version 1.1, which apparently contains fixes to the garbage collector identified by Commodore and jointly implemented in 1978 by Commodore engineer John Feagans and Bill Gates. Commodore PET users would know it as BASIC V2.

The release is assembly language source code – 6,955 lines of it – and Microsoft placed it [6]on GitHub , under the MIT License that allows free unrestricted use, and even resale.

[7]

In a nice touch, time stamps for commits in the repo record its creation as having taken place “48 years ago”.

The code includes what Microsoft describes as “conditional compilation support for multiple pioneering computer systems,” including the Apple II, Commodore PET, Ohio Scientific, and the MOS Technology KIM-1.

[8]Microsoft drops a little surprise thank-you gift for sitting through Build: The source for GW-BASIC

[9]Classic Psion fan releases proof-of-concept language server for OPL

[10]Microsoft developer ported vector database coded in SAP’s ABAP to the ZX Spectrum

[11]BASICally still alive: Classic language celebrates 60 years with new code and old quirks

If you get it running, Microsoft advertises the code’s main features as:

Full BASIC language implementation

Floating-point arithmetic

String handling and manipulation

Array support (both integer and string arrays)

Mathematical functions and operators

Input/output operations

You’ll also have the chance to enjoy “Efficient memory utilization for 8-bit systems” plus “String garbage collection” and “Dynamic variable storage.”

The repo includes some notes on Microsoft history, stating that BASIC established the company “as a dominant force in personal computer software before MS-DOS or Windows” and “the licensing of this BASIC interpreter to multiple computer manufacturers was crucial to Microsoft's early business model.”

That rather glosses over how Microsoft later, ahem, drew inspiration from CP/M when creating MS-DOS, and bullied OEMs with Windows licenses designed to snuff IBM’s OS/2.

[12]

But for now let’s celebrate the release of undoubtedly important code, and that this is Microsoft’s second such effort after the 2020 release of source code for [13]GW-BASIC . ®

Get our [14]Tech Resources



[1] https://opensource.microsoft.com/blog/2025/09/03/microsoft-open-source-historic-6502-basic/

[2] https://www.theregister.com/2025/07/24/50y_of_gates_allen_mits_basic/

[3] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2aLljOL6Z1kHBdbAQgqxReQAAAM4&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0

[4] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aLljOL6Z1kHBdbAQgqxReQAAAM4&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[5] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aLljOL6Z1kHBdbAQgqxReQAAAM4&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[6] https://github.com/microsoft/BASIC-M6502

[7] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44aLljOL6Z1kHBdbAQgqxReQAAAM4&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0

[8] https://www.theregister.com/2020/05/22/gw_basic/

[9] https://www.theregister.com/2025/08/27/vintage_computing_boffin_resurrects_opl/

[10] https://www.theregister.com/2025/07/08/sap_abap_db_spectrum_port/

[11] https://www.theregister.com/2024/05/03/basic_60th_birthday_releases/

[12] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/front&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=3&c=33aLljOL6Z1kHBdbAQgqxReQAAAM4&t=ct%3Dns%26unitnum%3D3%26raptor%3Deagle%26pos%3Dmid%26test%3D0

[13] https://www.theregister.com/2020/05/22/gw_basic/

[14] https://whitepapers.theregister.com/



Does it mention...

Neil Barnes

Gates' famous 'open letter' from 1976, complaining about people ripping off his basic for the 8080?

Re: Does it mention...

Sandtitz

No mention of it.

Do you disagree with the letter?

Re: Does it mention...

jake

Do I disagree with it? Yes, at the time I did[0]. Almost everybody in the industry laughed at that letter. And promptly ignored it.

Remember, at that time virtually every program came with the source code. If it didn't, you could get it. The way the law was written (at least here in the US), binaries weren't copywriteable, so code had to ship with source. It wasn't until 1983 that Apple managed to change that (see Apple v. Franklin. ), thus bringing the landsharks into the world of software.

Apple, Inc ... Stifling innovation, since 1983.

[0] I probably still do, but I haven't read it since '76 ... my view on the subject has undoubtedly changed since then, but probably not enough to make a difference.

Well now.

BartyFartsLast

I know what I'm doing this weekend

Obligatory Microsoft Cynic Comment

a_foley

I am sorry to say, but the cynic inside me tells me that this is Yet Another attempt from Microsoft to redeem itself within the FOSS community, so that they can continue with their perennial favourite of Embracing, Extending, and Extinguishing.

Shame everything else didn't subsequently receive the same courtesy accorded "VALTYP"

Anonymous Coward

3173 CHKVAL: BIT VALTYP ; WILL NOT F UP "VALTYP".

"Microsoft later, ahem, drew inspiration from CP/M"

kmorwath

Just like Torvalds & C. utterly copied Unix later?

Re: "Microsoft later, ahem, drew inspiration from CP/M"

jake

No. Microsoft never rewrote anything from scratch.

And all Linus could come up with was the dominant OS on the internet!

m4r35n357

Oh, and also the dominant source control system. Still . . .

At that time ...

jake

... I was hacking on the proto-BSD in C and assembler. When I read about MS-BASIC in one of the trade rags (probably computerworld ... infoworld came about a year or two later), I remember thinking "Oh, goody. Yet another dialect of BASIC. Just what the world needs ... ".

I never did see a use for it.

Re: At that time ...

m4r35n357

I think Mr Gates believed he was demonstrating mad programming skillz, hence the laughably arrogant "letter".

https://en.wikipedia.org/wiki/An_Open_Letter_to_Hobbyists

Never trust a Microsoft timestamp.

0xF09F8687

Curious how .gitignore, README.md, and SECURITY.md are all dated "48 years ago"...

Ol'Peculier

On another note, the school I went to had the CBM Pet that was the image in my feed reader for this article, the decals on the keyboard had all worn off so you needed to be able to touch type to use it.

I was the only person that used it in all the time I was there...

jake

"glosses over how Microsoft later, ahem, drew inspiration from CP/M when creating MS-DOS"

Seattle Computer Products' 86-DOS possibly infringed on Kildall's CP/M, but MS had nothing to do with that.

According to Kildall, what happened was an artifact of the times.

86-DOS wasn't a port of CP/M. It was a re-write that used the same API. Gary told me several years later that he didn't think it was a direct rip-off, just an unauthorized use of the published API. Back then, such use wasn't codified into law, wasn't illegal, and in fact it was completely normal. SCP was legally allowed to do what they did, and MS was legally allowed to purchase it and re-license it to a third party. Just as MS did later with AT&T Version 7 UNIX, which MS distributed as Xenix ... and everybody+dog did porting of BASIC to all and sundry.

Trying to vilify somebody for actions back then based on today's law (or even worse, perceptions) just makes one look silly.

RIP Gary, you cantankerous old fart. Thanks for the memories. Cheers.

When in doubt, tell the truth.
-- Mark Twain