Skip to content

MBASIC-2025 Documentation

Welcome to the complete documentation for MBASIC-2025, a Python implementation of MBASIC-80 for CP/M.

What is MBASIC-2025?

MBASIC 5.21 is a classic BASIC dialect from the CP/M era (late 1970s - early 1980s). MBASIC-2025 provides 100% compatibility with MBASIC 5.21 programs while offering modern user interfaces and cross-platform support.

  • Getting Started


    Install MBASIC and write your first program in minutes

    Installation Guide

  • Language Reference


    Complete BASIC-80 language documentation with all 63 statements and 40 functions

    Language Reference

  • User Interfaces


    Choose your interface: Curses (terminal), CLI (command-line), Tkinter (GUI), or Web (browser)

    UI Guides

  • Implementation Details


    Learn about the interpreter architecture, features, and compatibility

    MBASIC Docs

  • Compilers


    Compile BASIC to CP/M executables OR JavaScript - TWO backends, 100% feature complete!

    Compiler Guide

  • Games Library


    Browse 113 classic BASIC games from the CP/M era - ready to run!

    Games Library

  • Source Code


    View the source, report issues, and contribute on GitHub

    GitHub Repository

Key Features

  • ✅ THREE Complete Implementations - Interactive interpreter AND two compiler backends (Z80/8080 + JavaScript)
  • ✅ 100% MBASIC 5.21 Compatibility - Run authentic MBASIC programs unchanged
  • ✅ Generates CP/M Executables - Compile to native .COM files for 8080 or Z80 processors
  • ✅ Generates JavaScript - Compile to standalone JavaScript for browsers and Node.js
  • ✅ Multiple User Interfaces - CLI, Curses terminal, Tkinter GUI, or Web browser
  • ✅ Cross-Platform - Linux, macOS, Windows
  • ✅ Zero Dependencies - Pure Python, no external libraries required for interpreter
  • ✅ Hardware Access - Full PEEK/POKE/INP/OUT support in Z80/8080 compiled code
  • ✅ Complete Documentation - Comprehensive help for every feature

Documentation Structure

This documentation is organized into four tiers:

1. User Interfaces (📘)

Interface-specific documentation for each UI:

2. MBASIC Interpreter (📗)

Implementation-specific documentation:

3. MBASIC Compilers (🔧)

Compiler documentation for both backends:

4. BASIC-80 Language (📕)

Complete language reference:

Quick Start

Installation

# Clone the repository
git clone https://github.com/avwohl/mbasic.git
cd mbasic

# Create virtual environment (recommended)
python3 -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

# Install optional dependencies
pip install -r requirements.txt

Your First Program

Start the Curses UI:

mbasic

Type your program:

10 PRINT "Hello, World!"
20 END

Press Ctrl+R to run!

Example Programs

Classic "Hello, World!"

10 PRINT "Hello, World!"
20 END

FOR Loop

10 FOR I = 1 TO 10
20   PRINT I; "squared is"; I * I
30 NEXT I
40 END

User Input

10 INPUT "What is your name"; N$
20 PRINT "Hello, "; N$; "!"
30 END

File I/O

10 OPEN "O", #1, "output.txt"
20 PRINT #1, "This is a test"
30 CLOSE #1
40 PRINT "File written!"
50 END

Platform Support

  • Linux - Ubuntu, Debian, Fedora, Arch
  • macOS - 10.14+
  • Windows - 10, 11, WSL
  • Python - 3.8+ (3.10+ recommended)

Contributing

MBASIC is open source! Contributions are welcome:

  • Report issues on GitHub
  • Submit pull requests
  • Improve documentation
  • Share example programs

License

See the project repository for license information.


Ready to get started? Head to the Installation Guide or browse the Language Reference!