Microsoft 6502 Basic released under MIT license

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Post Reply
jds
Posts: 196
Joined: 10 Mar 2016

Microsoft 6502 Basic released under MIT license

Post by jds »

Microsoft has released the source code to 6502 basic with build flags for Apple II, Commodore PET, OSI and KIM-1. The source is on GitHub. https://github.com/microsoft/BASIC-M6502

Information from Microsoft:
https://opensource.microsoft.com/blog/2 ... 502-basic/

And the existing pageable.com source listing has more useful information: https://www.pagetable.com/?p=774

This is now under the MIT license, free to use and even sell:

The MIT License (MIT)
Copyright © 2025 <copyright holders>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by barnacle »

Well there's a turn up for the books, given the famous 'open letter' by Bill Gates in 1976: https://upload.wikimedia.org/wikipedia/ ... cr.pdf.jpg

Neil
fachat
Posts: 1123
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by fachat »

Tjat's some awesome news!
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
User avatar
BigDumbDinosaur
Posts: 9425
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by BigDumbDinosaur »

barnacle wrote:
Well there's a turn up for the books, given the famous 'open letter' by Bill Gates in 1976: https://upload.wikimedia.org/wikipedia/ ... cr.pdf.jpg

The irony in that letter is the trustees of Dartmouth, who own the copyright to BASIC, never got a dime from Micro-soft.  There is no question in my mind that Gates and Allen were guilty of intellectual property theft, and if it had happened today, would have found themselves in hot water with infringement charges.

In retrospect, relatively little that has come out of Microsoft was invented by them.  More than a little of it was a copy of, or outright theft of, others’ work.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
User avatar
Broti
Posts: 28
Joined: 07 Sep 2023
Location: Moers, Germany

Re: Microsoft 6502 Basic released under MIT license

Post by Broti »

Thanks for the Information *thumb up*
ROR A? Where we're coding, we don't need A.
stefan1
Posts: 8
Joined: 30 Aug 2025

Re: Microsoft 6502 Basic released under MIT license

Post by stefan1 »

That code was written for the MACRO-10 assembler, a tool running on PDP-10.

It depends on a macro file not published.

6502 opcodes were implemented as macros. As far as I understand, instructions with multiple addressing modes have multiple names, for instance LDA (absolute?) and LDAI (immediate?).

There’s also a lot of conditional assembly.

Is there a tool that could translate the code to ca65 format? Or should one be made?
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by barnacle »

Grant Searle http://www.searle.wales/ (look for the minimum 6502 section; I can't point there directly) took the listings from Pagetable and edited them to work with ca65. I modified them slightly to work with the a65 assembler I prefer.

I have spoken to Grant in the past but haven't been able to contact him for years.

Neil

edit: https://www.pagetable.com/?p=774
stefan1
Posts: 8
Joined: 30 Aug 2025

Re: Microsoft 6502 Basic released under MIT license

Post by stefan1 »

barnacle wrote:
Grant Searle http://www.searle.wales/ (look for the minimum 6502 section; I can't point there directly) took the listings from Pagetable and edited them to work with ca65. I modified them slightly to work with the a65 assembler I prefer.

edit: https://www.pagetable.com/?p=774
I’m looking for a way to use the code published by Microsoft that is guaranteed to be open source.

Michael Steil did his work many years ago. In his articles on pagetable, he talks about patches and additions made by vendors, for instance Commodore. At least in theory companies like Cloanto (successor of Commodore) and Apple could still have copyright to that work.

I have never used the MACRO-10 assembler. The brute force solution is to make a parser based on the assembler manual. That involves implementing at least part of the assembler logic. The parsed code could then be translated to a format usable by current 6502 assemblers. More than a long weekend of coding…

The question is if there’s an easier solution.
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by barnacle »

And a very good question it is... I suspect one way might be to go through the MS supplied version in github and compare it against Michael's version where he documents the changes... https://www.pagetable.com/?p=46

Not a trivial task, I fear, but perhaps easier than building a MACRO-10 assembler from scratch.

Neil
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by drogon »

stefan1 wrote:
That code was written for the MACRO-10 assembler, a tool running on PDP-10.

It depends on a macro file not published.

6502 opcodes were implemented as macros. As far as I understand, instructions with multiple addressing modes have multiple names, for instance LDA (absolute?) and LDAI (immediate?).

There’s also a lot of conditional assembly.

Is there a tool that could translate the code to ca65 format? Or should one be made?
They've already been translated to ca65 format and from that I found it trivial to get it going on my own system:

https://projects.drogon.net/microsoft-basic/

and see the sources at: https://www.pagetable.com/?p=46

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
barnacle
Posts: 1831
Joined: 19 Jan 2004
Location: Potsdam, DE
Contact:

Re: Microsoft 6502 Basic released under MIT license

Post by barnacle »

Indeed. But Stefan's point is (if I understand correctly) that those pagetable build files contain possibly proprietary data - either bugfixes or localisations - from the companies who bought the original basic. And the question is, are those changes still under copyright, or are they in the code the MS has open sourced (in which case, there is no issue)? At least one of those companies is still going strong and has awfully deep pockets, and no obvious aversion to deepening them further.

Neil
plasmo
Posts: 1273
Joined: 21 Dec 2018
Location: Albuquerque NM USA

Re: Microsoft 6502 Basic released under MIT license

Post by plasmo »

barnacle wrote:
Well there's a turn up for the books, given the famous 'open letter' by Bill Gates in 1976: https://upload.wikimedia.org/wikipedia/ ... cr.pdf.jpg

Neil
The address Bill Gates provided was 1180 Alvarado SE #114. The apartment complex still exists today. I’ll drop by one day to see if #114 has a plaque saying “Bill Gates was here”.
Post Reply