Bill Gates' 48-year-old Microsoft 6502 BASIC goes open source:
Microsoft has released 'BASIC for 6502 Microprocessor - Version 1.1' on Github, under the MIT license. Now anyone is free to go and download, modify, share, and even resell source code originally crafted by Bill Gates. This is a hugely significant code release, as close derivatives of this BASIC ended up at the heart of several iconic computers, including the best-selling computer of all time, the Commodore 64.
The Microsoft Blog provides a potted history of its BASIC, sharing some important facts. Microsoft BASIC was the firm's first product, and started out as a BASIC language interpreter for the Intel 8080, written by Bill Gates and Paul Allen for the Altair 8800, in 1975.
What we are seeing shared on Github under the MIT license is the BASIC interpreter code ported by Bill Gates and Ric Weiland to the MOS 6502 Microprocessor (hence the name). This was released in 1976.
Something fun to note is the commit date for the m6502.asm file and its related markdown documents. July 27, 1978. Well before Git was even created. An easily done task, all we need to do is amend the commit and pass the date.
Importantly for widespread adoption, and to fuel what would become Microsoft's signature business model, this MOS 6502 assembly code formed the foundation of BASIC interpreters that shipped with the Apple II, Commodore PET, VIC-20 and C64.
Notably, Commodore licensed this 6502 port of Microsoft BASIC for a flat fee of $25,000. On the surface this doesn't sound stellar in terms of Microsoft revenue generation but, as the firm says, the decision put Microsoft software in front of millions of new programmers, who would make their first tentative coding steps by typing:
10 PRINT "HELLO" 20 GOTO 10 RUN
The 1.1 release on GitHub specifically supports the Apple II, Commodore PET, Ohio Scientific (OSI), the MOS Technology KIM-1, and PDP-10 Simulation systems. Microsoft notes that 1.1 includes "fixes to the garbage collector identified by Commodore and jointly implemented in 1978 by Commodore engineer John Feagans and Bill Gates, when Feagans traveled to Microsoft's Bellevue offices."
In total, the release shares 6,955 lines of assembly language code for anyone who is interested to peruse and play with. Microsoft characterizes this BASIC interpreter as one of the most historically significant pieces of software from the early personal computer era.
Microsoft says its BASIC for 6502 Microprocessor - Version 1.1 source code release, which comes with a clear, modern license, builds on its earlier release of GW-BASIC which first shipped in the original IBM PC's ROM, evolved into QBASIC, and later into Visual Basic.
(Score: 3, Insightful) by looorg on Saturday September 06, @10:17PM (5 children)
That didn't translate well from the article. I actually checked so it wasn't just lazy AI journalism. But you do need the line breaks. Otherwise that won't run. At least not on the C64, I can't speak for the others. But I doubt it will run on any of the other 6502 platforms either if it was one lined like that.
You could one line the print and the goto with a : but the run will have to be on a line by itself. Or you could auto-run it on load but then it's not a type in.
(Score: 3, Interesting) by looorg on Saturday September 06, @10:32PM
Something like this should work if you want to be fancy with your one line of BASIC. You could make it slightly shorter but it's only for typing since the result would be the same and it would expand if you just listed the program. The goto doesn't need a line number since it's just one line. Might not be proper BASIC but it always worked.
works to if you want that full screen hello world effect :)
(Score: 4, Funny) by ikanreed on Sunday September 07, @05:00AM (2 children)
But this is Microsoft we're talking about so you probably need two line breaks.
(Remember when that was the stupidest technical decision MS made for business reasons?)
(Score: 2) by turgid on Friday September 12, @05:47PM (1 child)
To be fair "\r\n" is technically more correct since the first returns the carriage (print head) to the left of the page and then does a line feed to start printing on the next line. Anyone who had to wrestle with DIP switches will appreciate this, even if it did waste space on the cassette tape.
I refuse to engage in a battle of wits with an unarmed opponent [wikipedia.org].
(Score: 2) by ikanreed on Saturday September 13, @11:11PM
When Microsoft made DOS, printers modeled on typewriters were already on their way out. It was done purely as a way to fake compatibility with two competing standards for text files.
(Score: 3, Funny) by DannyB on Monday September 08, @03:30PM
More gooder first version . . .
10 PRINT "Hello Whirrled"
20 GOSUB 10
30 RETURN
40 END
The stack will unwind when it hits the RETURN statement on line 30.
Q. How much did Santa's sled cost?
A. Nothing. It was on the house.
(Score: 5, Informative) by Rich on Sunday September 07, @12:29AM (1 child)
I keep repeating myself, again no mention in TFA of Monte Davidoff who wrote the FP routines that allowed MS to be a contender at all.
But now, it can be seen nicely how his code is distinct from Gates' code: At https://github.com/microsoft/BASIC-M6502/blob/main/m6502.asm [github.com], Line 4847, there's a "RADIX 8". His constants are octal vs. decimal for the Gates/Allen stuff.
There's also an interview with him at https://floppydays.libsyn.com/floppy-days-113-monte-davidoff-developer-of-altair-basic-floating-point [libsyn.com], starting at 11:50, but I haven't worked through that yet.
To remind you, floating point math was black magic back then, and there was no Internet to look up how it works. Also, around that time, Woz had (apart from the legendary hardware) written a BASIC interpreter, a virtual 16-bit CPU, AND floating point routines. He was just weeks away from integrating them with his BASIC when Apple closed the deal with MS for what became Applesoft BASIC.
(Score: 3, Interesting) by Rich on Sunday September 07, @09:57PM
Replying to self with an update, I listened to the interview, it's a historic gold mine, with precise details
- How he learned floating point basics from disassembled PDP code
- How he overheard Gates & Allen talking about needing someone to do FP in a cafeteria and contacted them
- How he got the knowledge about transcendental function approximation from a FORTRAN manual
- Info about an Intel library with FP code for the 8008
- Several 8080 assembly tricks
- Detailed timeline
Really amazing, not just the amount of information, but also the detail with which he could recall all this 50 years later. Seems to be a really great guy.
(Score: 5, Funny) by driverless on Sunday September 07, @02:28AM (7 children)
Who, despite that, still went and bought other Microsoft products afterwards.
(Score: 2, Disagree) by Snotnose on Sunday September 07, @01:01PM (6 children)
Microsoft actually made good stuff until Windows. The BASIC on my TRS-80 was fine, as was the editor/assembler they made (MASM).
It wasn't until Windows that Microsoft got the reputation for bloated, buggy software.
Every time a Christian defends Trump an angel loses it's lunch.
(Score: 3, Insightful) by turgid on Sunday September 07, @03:34PM (5 children)
Their early attempts at office applications which ran on Windows were worse than embarrassing. I used to read PeeCee magazines back in the day and the reviews of the Microsoft applications were always disparaging. Word for Windows was terrible and Project wasn't even a joke. Excel was very feeble. It took years for it to become usable. Does anyone remember the database, Access? It got corrupted if you tried to make a table with more than 253 columns. This was when I was already running a flat 32-bit protected mode, multi-user, multi-tasking, free OS (Linux) on my PeeCee. They were still messing about with 8-bit integers. At work, we were using Lotus 1-2-3 and WordPerfect. I ran the Linux WordPerfect port when the boss wasn't looking.
I refuse to engage in a battle of wits with an unarmed opponent [wikipedia.org].
(Score: 3, Insightful) by aafcac on Sunday September 07, @04:38PM
A couple weeks ago I was wondering what people use Access for these days, and I typed it into Bing as that was the default search engine on what I was using, and Copilot helpfully started the answer by explaining that people still use Access. It's kind of troubling when your own AI feels the need to reassure people that the product that's being asked about is still in use.
Personally, I don't really get the point of Access these days as there's a bunch of other database options, many of which are free or are more appropriate for large databases.
(Score: 2) by looorg on Sunday September 07, @06:06PM
You think you have seen it all when it comes to people being "creative" with the Office suite. But then you always find something else out and it takes it to an entire new level. Access was always just a pain. It was never good. At any point in time I can recall. People used it cause they already paid for office and that whole SQL and db thing was a bit of a mystery. It was so easy with Access, everything in a file like they are used to. Click-Click. Familiar environment. Excel is the other one. It's not just for spreadsheet. It's a database, or it's turned into one. Entire projects worth of data gets saved in excel sheets. That said I prefer an Excel "database" over an Access db any day.
I assume this is also why Office eventually just crushed everything else. It was included. Getting WordPerfect, Lotus123, Novel Netware etc they where extra $$$. Eventually they just died by the roadside rolled over by the Redmond Juggernaut. Why pay for something else when you already paid for the things you needed, or Office. Good luck even trying to get people to run Libre or something. Free. It should be hard to compete with. But no. It's not Microsoft so it must be bad.
(Score: 3, Interesting) by canopic jug on Monday September 08, @04:00AM (1 child)
I used to read PeeCee magazines back in the day and the reviews of the Microsoft applications were always disparaging.
Something changed in regards to the reviews. There was a transition period around 1999 when the reviews continued to be honest for the non-M$ products. One product would usually stand out in a good way and get the magazine's recommendation. However, although the m$ products would still get panned in the text, they would also still end up with the magazine's recommendation if for no other reason than that "M$ Look and Feel". Remember this was around the time that MS FrontPage's EULA tried to prohibit using the product for sites which disparaged M$ or its products. Furthermore, the company's restrictive EULAs [eff.org] also prohibited publishing benchmark results or reviews without prior written approval. Editors toed the line rather than acknowledge that the EULAs were invalid.
Around that time, it looked like the advertising money from non-m$ products dried up or at least was overwhelmed by m$ and its partners. The magazines, looking at the short term, complied, thus killing off the possibility of future revenue. Almost all of them disappeared over the subsequent years.
Money is not free speech. Elections should not be auctions.
(Score: 2) by turgid on Monday September 08, @06:47AM
That explains a lot. Linux came along and within a year or two they were completely ignoring it.
I refuse to engage in a battle of wits with an unarmed opponent [wikipedia.org].
(Score: 2, Funny) by raindog308 on Monday September 08, @12:32PM
That is just an insanely wrong version of history. Excel came out to rave reviews. Borland blew up its huge DBase userbase by abusing its customers and Access was very well-received.
You should read "In Search of Stupidity" which covers this period of PC history very well. It explains how Microsoft's products were simply better than competitors', and how competing companies (Novell, Borland, WordPerfect, Ashton-Tate, MicroProse, etc.) repeatedly shot themselves in their feet with poor decisions and bad marketing.