Bringing BASIC back: Microsoft’s 6502 BASIC is now Open Source

Started by Blacklord, September 06, 2025, 07:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Blacklord


This is BASIC M6502 8K VER 1.1, the 6502 BASIC lineage that powered an era of home computing and formed the foundation of Commodore BASIC in the PET, VIC-20, and the legendary Commodore 64. This very source tree also contains adaptations for the Apple II ("Applesoft BASIC"), built from the same core BASIC source. The original headers still read, "BASIC M6502 8K VER 1.1 BY MICRO-SOFT"—a time capsule from 1978.

The version we are releasing here—labeled "1.1"—contains 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. This is the version that shipped as the PET's "BASIC V2."

The announcement from Microsoft is here and the code is here.

Supported Computer Systems

The source code includes conditional compilation support for multiple pioneering computer systems:

Apple II (REALIO=4)
Commodore PET (REALIO=3)
Ohio Scientific (OSI) (REALIO=2)
MOS Technology KIM-1 (REALIO=1)
PDP-10 Simulation (REALIO=0)

Technical Specifications

Language: 6502 Assembly Language
Target Processor: MOS Technology 6502 8-bit microprocessor
Memory Footprint: 8KB ROM version
Features: Complete BASIC interpreter with floating-point arithmetic
Architecture: Designed for both ROM and RAM configurations
Key Features
Programming Language Support
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
Memory Management
Efficient memory utilization for 8-bit systems
String garbage collection
Dynamic variable storage
Stack-based expression evaluation
Hardware Abstraction
Configurable I/O routines for different computer systems
Terminal width adaptation
Character input/output abstraction
Optional disk storage support

Development History

The source code includes detailed revision history showing active development:

July 27, 1978: Fixed critical bugs in FOR loop variable handling and statement parsing
July 1, 1978: Memory optimization and garbage collection improvements
March 9, 1978: Enhanced string function capabilities
February 25, 1978: Input flag corrections and numeric precision improvements
February 11, 1978: Reserved word parsing enhancements
January 24, 1978: User-defined function improvements