Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>BitMagic X16 BASICNew to Visual Studio Code? Get it now.
BitMagic X16 BASIC

BitMagic X16 BASIC

Yazwh0

|
1 install
| (0) | Free
Debug Commander X16 BASIC: breakpoints, stepping, GOSUB call stack, variables and arrays, watches, and stop on error. Built on the BitMagic X16 debugger.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

BitMagic X16 BASIC

Debug Commander X16 BASIC programs in VS Code, running on the BitMagic emulator.

  • Breakpoints on lines, with conditions (I=3), hit counts and log points (I is {I}).
  • Stepping a statement at a time: into, over (a GOSUB runs without stopping) and out (back to after the GOSUB).
  • Step into a SYS to stop on the first instruction of the machine code, in BitMagic's assembly view.
  • Call stack of GOSUBs, each showing the statement it came from.
  • Variables, arrays (expand to see each element), active FOR loops, and BASIC's own pointers and free memory.
  • Watches and hovers take BASIC expressions: A+B%, D(2), LEFT$(N$,3), PEEK($9F20).
  • Change variables while stopped, numbers and strings.
  • Stops on errors, with BASIC's message: ?DIVISION BY ZERO ERROR IN 20.
  • X16 BASIC Live in the Run and Debug view shows the line and variables while the program runs, and the line it's on is highlighted in the editor.
  • X16 Screen opens beside the code when debugging starts: the X16's display, updated while it runs and drawn in full at each stop. Click it and type, and the keys go to the X16. Turn off opening it with bitMagicX16Basic.openScreen, and open it again with "X16 BASIC: Show the X16 Screen".
  • If the program in memory isn't your file any more (changed at READY, or LOADed), it's shown as a listing of what's really there.

Editing: syntax colouring for all X16 keywords, problems shown as you type (missing line numbers, duplicates, lines out of order, GOTOs to lines that don't exist), hovers for keywords and for the line a GOTO goes to, and Go to Definition on a line number.

Use

To start from scratch, run "X16 BASIC: Create X16 BASIC Project" (or the button in the Explorer when no folder is open). It writes a short main.bas and a launch.json into the folder you pick, without overwriting anything already there, and opens it.

Open a .bas file written with line numbers and press F5, or use the Debug button on the editor's title bar. To set it up in launch.json:

{
    "type": "x16basic",
    "request": "launch",
    "name": "Debug BASIC",
    "program": "${workspaceFolder}/game.bas"
}
Setting
program The BASIC file.
project A BitMagic project.json to take the ROM, SD card and so on from.
charset upper (default) or mixed: whether letters in strings keep their case.
onProgramEnd ready (default) stays at READY so you can RUN again; terminate ends the session.
stopOnEntry Stop on the first statement.
run false to load the program and leave it at READY.
renderOnStop Draw the whole screen when stopping (the default), so a PRINT shows straight away.
romFile, symbols A different ROM, and its basic.sym if needed. Not normally needed: BASIC is found in the ROM.

Strings can hold control codes the petcat way: PRINT "{CLR}{RED}HELLO", or {$93} by number.

Needs

The BitMagic X16 Debugger extension, with an X16D that supports debug modes.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft