This is a tutorial project to get started with programming for the Commander X16 8-bit computer, made by The 8-bit Guy. The project is made to be modular, so that you can create a multi-file project very easily, and make use of Assembly as well as C code.
The project is a simple test of output and input of text, using C and assembly simultaneously and simply making sure your toolchain is set-up correctly.
You need to install a toolchain to compile / assemble the project, and an emulator (or a real X16 system!) to execute it. Here is how to set it up: (TODO: other systems)
- Download the latest CC65 toolchain (Official website)
- Extract it to a folder you won't touch, like in
C:\Program Files\cc65
. You should have folders in it such asasminc
,bin
, etc. Add the full path to thebin
folder to yourPath
environment variable. - Open Command Prompt, type
cc65.exe
. You should see the outputcc65.exe: No input files
. If so, you have correctly set up your toolchain. If not, make sure the Path is correctly set, and you have reopened the Command Prompt after doing so. - You will now need to install GNU make to build the project. I haven't found a good Windows binary hosting site for it, but right now, the best way is to install Mingw-w64 and you can copy
mingw32-make.exe
to CC65's bin folder and rename it tomake.exe
. Make sure it is also working. - Download the Commander X16 emulator, extract it and also add the folder to your Path variable. Make sure it works by opening
x16emu.exe
and it should present a BASIC prompt.
Open a Command Prompt window to this folder, and type make
. It should compile the project and output hello.prg
inside the build
directory. This is the binary file that you will run.
To make things easier, I've added a recipe to run the emulator from make.
You can run make run
to launch the emulator, load and launch the ROM on startup.
If you want to run it manually, launch the emulator as so:
x16emu -prg build/hello.prg -run
Omit the -run
argument to just load it into memory, and not execute.
- SlithyMatt's repositories for X16 tutorials (some of my code is based on this! Thank you!)
- The Official Commander X16 documentation check this out if you're serious about learning everything about this amazing system
- C64 Wiki page on the Commander X16, a very comprehensive description on the system