Getting Started with MBASIC¶
Welcome to MBASIC 5.21! This is a complete Python implementation of MBASIC-80 for CP/M.
What is MBASIC?¶
MBASIC 5.21 is a classic BASIC dialect from the CP/M era (late 1970s - early 1980s). This interpreter provides:
- 100% MBASIC 5.21 compatibility - Runs authentic MBASIC programs
- Modern interface - Choice of CLI, Curses, Tkinter, or Web UI
- Cross-platform - Works on Linux, macOS, Windows
- No dependencies - Pure Python implementation
Installation¶
Requirements¶
- Python 3.8 or later
- Optional:
urwidfor Curses UI (installed viapip install urwid)
Quick Install¶
# 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
# Run MBASIC
mbasic
Your First Program¶
Method 1: Interactive Mode (Curses UI)¶
Start MBASIC without arguments for the full-screen editor:
Type your program:
Press {{kbd:run:curses}} to run.
Method 2: File Mode¶
Create a file hello.bas:
Run it:
Method 3: CLI Mode¶
Start MBASIC in CLI mode:
Type your program at the Ok prompt:
Choosing a User Interface¶
MBASIC supports four interfaces:
Curses UI (Default)¶
Full-screen terminal interface with split editor/output:
Best for: Interactive program development, debugging
CLI Mode¶
Classic MBASIC command-line interface:
Best for: Scripting, automation, authentic MBASIC experience
Tkinter GUI¶
Graphical interface with menu bar and toolbar:
Best for: Users who prefer graphical interfaces
Web UI¶
Browser-based interface with modern IDE features:
Best for: Remote access, collaborative development, modern web-based workflow
Next Steps¶
- Learn the language: See Language Reference
- Choose your UI: CLI, Curses, Tk, or Web
- Explore features: MBASIC Features
- Check compatibility: Compatibility Guide
- Understand the architecture: Architecture
Quick Reference¶
Running programs:
Common keyboard shortcuts (Curses UI):
- {{kbd:run:curses}} - Run program
- {{kbd:save:curses}} - Save program
- {{kbd:open:curses}} - Open program
- {{kbd:help:curses}} - Help
- {{kbd:quit:curses}} - Quit
Common commands (CLI mode):
- RUN - Execute program
- LIST - Show program
- SAVE "file.bas" - Save to disk
- LOAD "file.bas" - Load from disk
- NEW - Clear program
- SYSTEM - Exit MBASIC
Getting Help¶
- Press {{kbd:help:curses}} in any UI for built-in help
- See Language Reference for statement syntax
- Visit UI-specific guides for interface help