Page 1 of 1

Microsoft 6502 Basic released under MIT license

Posted: Wed Sep 03, 2025 6:19 pm
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.

Re: Microsoft 6502 Basic released under MIT license

Posted: Wed Sep 03, 2025 6:43 pm
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

Re: Microsoft 6502 Basic released under MIT license

Posted: Wed Sep 03, 2025 6:44 pm
by fachat
Tjat's some awesome news!

Re: Microsoft 6502 Basic released under MIT license

Posted: Wed Sep 03, 2025 8:00 pm
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.

Re: Microsoft 6502 Basic released under MIT license

Posted: Thu Sep 04, 2025 9:50 am
by Broti
Thanks for the Information *thumb up*

Re: Microsoft 6502 Basic released under MIT license

Posted: Thu Sep 04, 2025 1:53 pm
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?

Re: Microsoft 6502 Basic released under MIT license

Posted: Thu Sep 04, 2025 2:47 pm
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

Re: Microsoft 6502 Basic released under MIT license

Posted: Fri Sep 05, 2025 4:28 am
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.

Re: Microsoft 6502 Basic released under MIT license

Posted: Fri Sep 05, 2025 6:15 am
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

Re: Microsoft 6502 Basic released under MIT license

Posted: Fri Sep 05, 2025 7:47 am
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

Re: Microsoft 6502 Basic released under MIT license

Posted: Fri Sep 05, 2025 9:08 am
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

Re: Microsoft 6502 Basic released under MIT license

Posted: Sat Sep 06, 2025 10:43 pm
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”.