Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>TRS-80 Model 100/200 BASICNew to Visual Studio Code? Get it now.
TRS-80 Model 100/200 BASIC

TRS-80 Model 100/200 BASIC

George M. Rimakis

|
15 installs
| (0) | Free
Language support for TRS-80 Model 100/200 BASIC programming
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

TRS-80 Model 100/200 BASIC

Bring the classic TRS-80 Model 100/200 portable computers to the modern IDE. This extension delivers a full authoring experience for TRS-80 BASIC so you can explore, port, or maintain retro programs inside Visual Studio Code.

Screenshot of TRS-80 BASIC highlighting and IntelliSense

Highlights

  • Authentic syntax highlighting for keywords, functions, typed variables, comments, and line numbers found in Model 100/200 BASIC listings.
  • Productive editor tooling including bracket matching, auto-closing pairs, smart indentation, and contextual completions that insert the right spacing or parentheses for the selected keyword.
  • Retro-aware IntelliSense with hover docs, parameter hints, and signature help so you always know what each command expects and returns.
  • Tokenizer that converts ASCII .DO files into binary .BA format ready to transfer to Model 100/102 or Tandy 200 hardware.
  • Tokenized .BA detokenizer that opens binary program dumps as clean, read-only listings directly inside VS Code.
  • 8085 DATA disassembly so decimal-only DATA blocks open in a read-only pane with annotated Intel 8085 assembly (complete with .8085 syntax highlighting and assembler-friendly formatting).
  • Built-in diagnostics that catch common BASIC pitfalls: invalid assignments to functions, variable name collisions, out-of-order line numbers, argument mismatches, and unreachable code before you run on real hardware or emulators.

Quick Start

  1. Install the extension from the Visual Studio Marketplace (search for "TRS-80 Model 100/200 BASIC") or run code --install-extension trs80-basic.
  2. Open any .DO file or use the Command Palette (M100 BASIC: Open Tokenized .BA (detokenized, read-only)) to convert a .BA program into a readable listing.
  3. Type statements such as FOR, GOSUB, or CALL and watch IntelliSense insert helpful boilerplate while highlighting syntax exactly like the original machines.
  4. Hover over keywords or functions to read inline documentation, and use Ctrl+Space to discover additional commands and functions.

Command-Line Tools

All major features are available as CLI commands through the m100 tool:

In VS Code terminals:

  • The m100 command is automatically available in all VS Code terminal sessions
  • No setup required - just open a terminal and type m100

For system-wide access:

  • See CLI_USAGE.md for installation options

Available commands:

m100 tokenize program.DO --out program.BA     # Convert .DO to .BA
m100 detokenize program.BA --out program.DO   # Convert .BA to .DO
m100 remove-comments program.DO               # Strip all REM/comments
m100 squash program.DO                        # Remove whitespace
m100 renumber program.DO --start 100          # Renumber lines
m100 pack program.DO --max 80                 # Merge lines with colons

All commands support stdin/stdout piping for build pipelines:

cat program.DO | m100 squash | m100 pack | m100 tokenize > program.BA

Supported File Types

  • .DO - Standard TRS-80 Model 100/200 BASIC program listings (including line-numbered source).
  • .BA - Tokenized program dumps from Model 100/200 storage devices (opened read-only through the detokenizer command).
  • .8085 - Virtual assembly listings generated from DATA statements (read-only, assembler-friendly syntax).

Requirements

  • Visual Studio Code 1.75.0 or newer (latest stable recommended).

Tips & Tools

  • Diagnostics run as you type and catch common mistakes including:
    • Assignment to built-in functions (e.g., CHR$="foo")
    • Invalid variable names (must start with letter, only first 2 chars significant)
    • Variable name collisions (PIE and PIT both map to PI)
    • Out-of-order line numbers (BASIC executes by number, not file order)
    • Type mismatches, argument errors, and unreachable code
    • See Complete Diagnostic Reference for detailed explanations and examples
  • Tokenizer: M100 BASIC: Tokenize Program to .BA converts your ASCII .DO file into binary .BA format ready for Model 100/102 (base 0x8001) or Tandy 200 (base 0xA001). Perfect for transferring programs to real hardware or emulators.
  • Keyboard-first editing: Use Tab/Shift+Tab to align code blocks. Auto-indentation respects TRS-80 line style so you can copy or paste listings between VS Code and your portable with minimal cleanup.
  • Portable-friendly output: The extension avoids inserting Unicode characters so resulting files remain compatible with the Model 100/200 character set.
  • BA detokenizer: Use the Command Palette entry M100 BASIC: Open Tokenized .BA (detokenized, read-only) to view tokenized files without altering the original binary; the decoded listing opens in a separate read-only editor tab.
  • DATA disassembly: When DATA statements contain only decimal bytes, a CodeLens and context menu entry appear so you can open the block as formatted 8085 assembly in a new, read-only tab with .8085 syntax highlighting; the file names follow NNNN_asm.8085 so you can copy them directly into an assembler.
  • Line renumbering: M100 BASIC: Renumber Program renumbers an entire listing with custom start/increment and updates every jump target (including GOTO, GOSUB, THEN, ELSE, RUN, RESUME, and RESTORE), while the lightbulb action or M100 BASIC: Renumber Current Line lets you renumber a single line, fixes references, and reorders the source automatically.
  • Squash formatter: M100 BASIC: Squash BASIC Lines removes whitespace outside strings, optional trailing quotes, and redundant semicolons in PRINT statements across the whole program so you can pack listings tightly (and the command asks for confirmation before it runs).
  • Pack lines: M100 BASIC: Pack Program Lines squashes multiple statements onto one line until a target width is reached, mirroring the Cleuseau .PACK utility to save bytes while preserving control-flow safety.
  • Comment stripper: M100 BASIC: Remove Comments deletes every REM/apostrophe remark from the program so you're left with pure executable statements.

Current Capabilities

  • Core TextMate grammar tuned for TRS-80 Model 100/200 BASIC listings.
  • VS Code language configuration with bracket matching, auto-close pairs, and indentation.
  • IntelliSense with contextual completions, hover info, and signature help.
  • Comprehensive diagnostic engine that validates:
    • Variable naming rules (must start with letter, only first 2 chars significant)
    • Variable name collisions (warns when different names map to same effective name)
    • Assignment type safety (cannot assign to built-in functions)
    • Line number ordering (warns when execution order differs from file order)
    • Function arguments (type and count validation)
    • Unreachable code detection
  • Built-in .BA tokenizer that converts ASCII .DO files to binary format for Model 100/102 or Tandy 200.
  • Built-in .BA detokenizer for Model 100/200 tokenized binaries (read-only view).
  • Inline DATA-to-8085 disassembly with CodeLens, context menu support, .8085 syntax highlighting, and a virtual document viewer.
  • Program and single-line renumbering helpers that update all control-flow targets (GOTO, GOSUB, THEN, ELSE, RUN, RESUME, RESTORE) and maintain sorted listings.
  • Squash utility to strip blanks outside string literals, drop optional end quotes, and compress redundant PRINT semicolons for the entire file; Pack utility to fold multiple statements onto one line while honoring max column limits.
  • Remove-comments utility that wipes all REM/' remarks for maximum code density (remember to keep backups).

Feedback & Support

Have a question, feature idea, or bug report? Use the "Repository" or "Issues" links in the Marketplace listing, or open an issue on GitHub. Pull requests are welcome, especially for new snippets, docs, and diagnostics.

License

MIT License - free for personal and commercial use.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft