In a recent post, Microsoft announced the release of the source code for its 6502 BASIC, which is now available on GitHub (here and here). You can now review, analyze, and learn from the Microsoft BASIC for the MOS 6502 microprocessor (Version 1.1). If you want or need to, you can also modify the code, perhaps to add support for your own homebrew computer project that uses the 6505.

This move is a significant step toward preserving vintage software and demonstrates Microsoft’s recognition of the importance of the retro-computing movement. The 6502 version of BASIC was originally a port of the Altair BASIC (8080), which was released in 1975. It was developed by Bill Gates and Ric Weiland and later maintained and upgraded with Commodore engineer John Feagans in 1978.

By utilizing this code, you could save considerable costs, compared to Commodore, which paid a flat licensing fee of $25,000 in 1977 to incorporate BASIC into its PET, VIC-20, and later the Commodore 64. Enjoy!
Bill Gates has commented that the Commodore deal was the worst Microsoft ever made. With over 12.5 million C64s sold Microsoft ended up getting less than 1/5th of a cent per copy.