Syntax highlighting for XC=BASIC 3, a cross compiled BASIC for 8-bit Commodore machines.
- Rich Syntax Highlighting for XC=BASIC3 (including ASM blocks)
- IntelliSense & Code Completion - Auto-completion for keywords, built-in functions, and data types
- Hover Information - Detailed documentation on hover for keywords and functions
- Error Highlighting - Compilation errors are highlighted directly in the editor
- Automatic Toolchain Management - XC=BASIC3 compiler and DASM assembler are downloaded and managed automatically
- Integrated Build System - Compile, run, and debug with keyboard shortcuts
- External Tool Integration - Works with Vice emulator, Retro Debugger, Exomizer, and c1541
- Cross-Platform - Supports Windows, macOS, and Linux
No requirements for basic compilation, but these external tools are recommended for a complete development experience:
- Vice Emulator: https://vice-emu.sourceforge.io/
- Retro Debugger: https://github.com/slajerek/RetroDebugger
- Exomizer: https://csdb.dk/release/?id=238365
- Install the extension from the VS Code Marketplace
- Open a folder containing
.basfiles - The extension will automatically download and set up the XC=BASIC3 compiler and DASM assembler
On macOS, the first compilation attempt may fail with security warnings:
Fix: Open System Settings > Privacy & Security > General, then click "Open Anyway" next to the warning.
-
Create a new
.basfile:PRINT "Hello, World!"
-
Compile and run:
- Press
Shift+F5to compile - Press
Ctrl+F5(orCmd+F5on Mac) to compile and run in emulator
- Press
-
View compilation errors:
- Errors appear as red squiggly lines in the editor
- Check the Problems panel (View → Problems) for detailed error messages
- XC-Basic compiles in 2 phases. Second phase is Dasm compilation and errors in 2nd phase cannot be tracked back to the basic code.
Configure these settings in VS Code's settings (File → Preferences → Settings):
| Setting | Description | Example (macOS) | Example (Windows) |
|---|---|---|---|
xcbasic3.basefolder |
External XC=BASIC installation (optional) | /Applications/xc-basic3 |
C:\Program Files\xc-basic3 |
xcbasic3.emulator |
Vice emulator executable | /Applications/vice-x86-64-gtk3-3.8/bin/x64sc |
C:\Program Files\GTK3VICE-3.8-win64\bin\x64sc.exe |
xcbasic3.debugger |
Retro Debugger executable | /Applications/Retro Debugger.app/Contents/MacOS/Retro Debugger |
C:\Program Files\RetroDebugger\RetroDebugger.exe |
xcbasic3.builder |
c1541 disk builder | /Applications/vice-x86-64-gtk3-3.8/bin/c1541 |
C:\Program Files\GTK3VICE-3.8-win64\bin\c1541.exe |
xcbasic3.cruncher |
Exomizer executable | /Applications/exomizer-3.1.2/src/exomizer |
C:\Program Files\exomizer-3.1.2\src\exomizer.exe |
The extension automatically creates .vscode/tasks.json with predefined build tasks. You can customize these tasks or create new ones.
| Task | Shortcut | Description |
|---|---|---|
| XC=BASIC Compile File | Shift+F5 |
Compiles .bas to .prg |
| XC=BASIC Run File | Ctrl+F5 |
Compiles and runs in emulator |
| XC=BASIC Debug File | F5 |
Compiles and opens in debugger |
| XC=BASIC Crunch File | - | Compiles and compresses with Exomizer |
| XC=BASIC Build Disk | - | Compiles and creates disk image |
Add this to your .vscode/tasks.json to create a custom compilation task:
{
"label": "XC=BASIC Compile with Custom Args",
"type": "shell",
"command": "${env:XCBASIC3_COMPILER}",
"args": [
"--dasm=${env:DASM_PATH}",
"--target=c64",
"--optimize",
"${file}",
"${fileBasenameNoExtension}.prg"
],
"group": "build",
"problemMatcher": "$xcbasic3"
}-
Create a simple program (
hello.bas):PRINT "Hello from XC=BASIC!" FOR I = 1 TO 10 PRINT "Count: "; I NEXT I
-
Compile: Press
Shift+F5or use Command Palette → "Tasks: Run Task" → "XC=BASIC Compile File"
PRINT "Hello from XC=BASIC!"
ASM
loop
INC $D020 ; Change border color
JMP loop
END ASMIf you have an error in your code:
PRONT "This has a typo!" ; PRONT should be PRINTThe extension will:
- Show a red squiggly line under the error
- Display the error in the Problems panel
- Show the exact line and column of the error
- Configure the emulator path in settings
- Press
Ctrl+F5to compile and run - The program will automatically load in Vice
- Configure the debugger path in settings
- Press
F5to compile and debug - The program will load in Retro Debugger with symbols
Use the "XC=BASIC Build Disk" task to create a .d64 disk image:
- Run the task from Command Palette
- The compiled program will be added to a new disk image
- Load the disk in your emulator
Access these commands via Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
| Command | Description |
|---|---|
XC=BASIC Initialize tasks.json |
Creates/updates build tasks |
XC=BASIC Update Compiler |
Downloads latest XC=BASIC3 version |
XC=BASIC Run File |
Compile and run current file |
XC=BASIC Debug File |
Compile and debug current file |
XC=BASIC Compile File |
Compile current file |
If you prefer to use your own XC=BASIC installation:
- Set
xcbasic3.basefolderto your installation path - Update your tasks to use
${config:xcbasic3.basefolder}/bin/xcbasic3instead of${env:XCBASIC3_COMPILER}
Add compiler arguments in your task configuration:
{
"label": "XC=BASIC Compile Optimized",
"command": "${env:XCBASIC3_COMPILER}",
"args": [
"--dasm=${env:DASM_PATH}",
"--target=c64",
"--optimize",
"--verbose",
"${file}",
"${fileBasenameNoExtension}.prg"
]
}Q: Error highlighting doesn't appear
A: Make sure your task uses "problemMatcher": "$xcbasic3" in .vscode/tasks.json.
Q: External tools don't work A: Check that the tool paths in settings are correct and the executables exist.
Q: macOS security warnings A: Go to System Settings > Privacy & Security and click "Open Anyway" for blocked applications.
- Check the Problems panel (View → Problems) for detailed error messages
- Look at the Terminal output for compilation details
- Verify your settings in File → Preferences → Settings
- Report issues at: https://github.com/orlof/xcb3-vscode-ext/issues
The extension provides rich syntax highlighting for:
- XC=BASIC keywords and built-in functions
- String literals and numeric constants
- Comments (both
REMand'style) - Assembly blocks with 6502 instruction highlighting
- Type declarations and function definitions
Fold these code blocks:
SUB/END SUBFUNCTION/END FUNCTIONASM/END ASM
Basic auto-completion for:
- Bracket pairs:
(),{} - String quotes:
""
This extension provides:
- Rich Language Support: IntelliSense, code completion, and hover information via Language Server Protocol
- Syntax Highlighting: Rich syntax highlighting for XC=BASIC3 and embedded assembly
- Build System Integration: Seamless compilation and execution workflow
- Toolchain Management: Automatic XC=BASIC3 compiler and DASM assembler management
- External Tool Integration: Works with Vice emulator, Retro Debugger, and other Commodore development tools
This extension does NOT provide:
- Debugging Support: No support for VS Code's integrated debugger (stepping, breakpoints, variable inspection)
- Advanced Refactoring: Basic language server features only, no complex refactoring tools
-
Syntax definitions based on work by:
-
This extension downloads and uses:
- XC=BASIC 3: https://xc-basic.net/
- DASM Assembler: https://dasm-assembler.github.io/
This extension is released under the MIT License. See LICENSE file for details.


