# microsoft/basic-m6502

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/microsoft-basic-m6502).**

4,490 stars · 507 forks · Assembly · MIT · archived

## Links

- GitHub: https://github.com/microsoft/BASIC-M6502
- awesome-repositories: https://awesome-repositories.com/repository/microsoft-basic-m6502.md

## Topics

`6502-assembly`

## Description

BASIC-M6502 is a BASIC language implementation for 8-bit microprocessors. It provides an execution environment that allows programs written in a high-level, English-like language to run on 6502 hardware, featuring support for mathematical functions and floating-point arithmetic.

The project is designed for cross-platform hardware porting, using conditional compilation and macros to adapt a single codebase across different retrocomputing systems. It utilizes hardware abstraction layers to manage character-based input and output routines.

The system includes embedded memory management with dynamic allocation and mark-and-sweep garbage collection for strings and variables. It also provides primitives for string and array manipulation and employs software emulation for floating-point operations.

## Tags

### Programming Languages & Runtimes

- [6502 Hardware Programming](https://awesome-repositories.com/f/programming-languages-runtimes/high-level-hardware-programming/6502-hardware-programming.md) — Provides a high-level language environment to write and execute programs on 6502 microprocessor hardware.
- [BASIC Language Implementations](https://awesome-repositories.com/f/programming-languages-runtimes/basic-language-implementations.md) — Implements a functional BASIC interpreter supporting mathematical functions and floating-point arithmetic on 8-bit systems.
- [Bytecode Interpreters](https://awesome-repositories.com/f/programming-languages-runtimes/bytecode-compiled-languages/source-to-bytecode-compilers/bytecode-interpreters.md) — Implements a bytecode interpreter to reduce memory footprint and increase execution speed on 8-bit hardware.
- [Single Codebase Targets](https://awesome-repositories.com/f/programming-languages-runtimes/cross-platform-compilers/single-codebase-targets.md) — Maintains a single codebase that can be adapted for different 6502-based computer systems through conditional compilation. ([source](https://github.com/microsoft/basic-m6502#readme))
- [BASIC Runtimes](https://awesome-repositories.com/f/programming-languages-runtimes/programming-language-varieties/programming-languages/basic-runtimes.md) — Runs programs written in an English-like BASIC language, including support for floating-point math on 8-bit microprocessors. ([source](https://github.com/microsoft/basic-m6502#readme))
- [Macro-Based Generation](https://awesome-repositories.com/f/programming-languages-runtimes/common-intermediate-languages/assembly-generation/macro-based-generation.md) — Generates hardware-specific machine code by expanding high-level macros into optimized assembly instructions.
- [Mark-and-Sweep Garbage Collectors](https://awesome-repositories.com/f/programming-languages-runtimes/mark-and-sweep-garbage-collectors.md) — Reclaims memory by identifying unreachable string objects and consolidating fragmented free space using a mark-and-sweep algorithm.

### Development Tools & Productivity

- [Conditional Compilation Directives](https://awesome-repositories.com/f/development-tools-productivity/native-compilation/cross-platform/conditional-compilation-directives.md) — Uses preprocessor directives to include or exclude code blocks based on the target hardware platform configuration.

### Game Development

- [Hardware Porting](https://awesome-repositories.com/f/game-development/hardware-porting.md) — Adapts a single codebase to run on various 6502-based computer systems through conditional compilation and macros.

### Operating Systems & Systems Programming

- [Dynamic Memory Allocation](https://awesome-repositories.com/f/operating-systems-systems-programming/dynamic-memory-allocation.md) — Allocates storage for variables and performs garbage collection on strings to maintain efficient memory utilization. ([source](https://github.com/microsoft/basic-m6502#readme))
- [Embedded Memory Management](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies/dynamic-memory-allocation/custom-memory-allocators/embedded-memory-management.md) — Handles dynamic memory allocation and garbage collection for strings and variables within low-resource embedded environments.
- [Hardware I/O Abstractions](https://awesome-repositories.com/f/operating-systems-systems-programming/hardware-i-o-abstractions.md) — Abstracts character input and output through interchangeable subroutines tailored to specific hardware communication ports.
- [Dynamic Memory Allocation](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/memory-management/allocation-strategies/dynamic-memory-allocation.md) — Implements mechanisms for allocating and reallocating memory dynamically and performing real-time garbage collection in constrained systems. ([source](https://github.com/microsoft/basic-m6502#readme))
- [Pure Computation I/O Abstractions](https://awesome-repositories.com/f/operating-systems-systems-programming/unified-platform-i-o/pure-computation-i-o-abstractions.md) — Provides abstraction layers that separate the BASIC interpreter's computation from hardware-specific character I/O routines. ([source](https://github.com/microsoft/basic-m6502#readme))

### Scientific & Mathematical Computing

- [Floating Point Emulators](https://awesome-repositories.com/f/scientific-mathematical-computing/floating-point-emulators.md) — Implements complex mathematical operations and decimal arithmetic via software routines for processors lacking native FPU hardware.

### Part of an Awesome List

- [Retrocomputing](https://awesome-repositories.com/f/awesome-lists/devtools/retrocomputing.md) — Provides a development environment for building and running legacy-style software on early home computers and 8-bit hardware.

### Software Engineering & Architecture

- [Low-Level Machine Code Optimizations](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/code-optimization/low-level-machine-code-optimizations.md) — Produces efficient assembly code tailored for specific hardware platforms using a macro system and conditional compilation. ([source](https://github.com/microsoft/basic-m6502#readme))
