
XC-BASIC v3, the Commodore BASIC cross-compiler is now available.
Let’s take a look to see what was new and if it is worth looking at over, say, TRSE.

Breaking Changes from V2
A while ago I wrote up a bunch of code for tutorials that would have covered XC-BASIC v2 and I sat on them knowing that v3 was in the works.
Play the adventure game in your web browser.
Big mistake holding back, as version 3 is out now and is incompatible with version 2 in some fundamental ways.
I tried to convert my code over and I ended up in a rabbit hole of pain.
So do I tell folks they will need to start over with v3 or do I forget v2 existed and re-do all my work under v3 syntax?
Right now I don’t have the energy to think about either after spending a full day trying to get any of my old code to work. I will persist, though!

You can now follow the tutorials and edit the code right in your web browser with the Online Retro IDE
– No downloads, configuration, etc necessary, and it is free!
So, what is good?
- Supports many more machines!
- User-defined types have been added, which is super cool!
XC=BASIC is a cross compiled, modern BASIC programming language for 8-bit Commodore machines, such as:
- Commodore-64
- Commodore VIC-20
- Commodore-16
- Commodore Plus/4
- Commodore-128
- Commodore PET series
- Commander X16 (beta) 1)
- MEGA65 (beta)
It compiles BASIC source code to fast machine code. Although not 100% compatible, its syntax was designed to be similar to that of QuickBASIC and CBM BASIC.
Csaba, author of XC=BASIC
User-Defined Types
User-defined types are like classes, they can even have methods.
Where in my adventure game example code I used a byte and set bits as flags, instead I could do this:
' OBJECT type
type OBJECT
fl_OBJECT_is_used as byte
fl_OBJECT_is_consumable as byte
fl_OBJECT_is_weapon as byte
fl_OBJECT_is_moveable as byte
fl_OBJECT_is_container as byte
fl_OBJECT_is_key as byte
fl_OBJECT_gives_light as byte
fl_OBJECT_is_hidden as byte
end type
What Next?
I do love basic and this is an amazing achievement. If you mainly want to target Commodore machines, and you are already familiar with basic, this is a must-try.


Which Retro game can you still play for hours?