Set up for the Commodore 64
Try the C64 in your browser, then prepare your own BASIC listings or assembly programs when you want to work locally.
Start with the machine
You can open the C64 in your browser and type into its BASIC prompt. The first BASIC lesson shows how to type a line, run it and read the answer. Lessons with Run it here also let you try their supplied program.
For assembly, Meet the Machine starts by changing the border colour. Its supplied program runs in the browser; use the local build below to assemble your own edits.
Choose what you need locally
- Typing BASIC into the C64: an emulator is enough.
- Editing a saved BASIC listing: a plain-text editor, Build198x to tokenise it, and an emulator to run the resulting program.
- Writing assembly: a plain-text editor, Asm198x to assemble it, and an emulator.
BASIC and assembly are separate routes. You can start with either.
Prepare your emulator
VICE is a local C64 emulator. Choose the download for your operating system and follow its installation instructions. Use its x64sc C64 emulator for these lessons.
Check the C64 ROM guide if your installation asks for firmware. Start the emulator: the blue BASIC screen and READY. prompt tell you the machine has booted.
Build a BASIC listing
Install Build198x
macOS
If you already use Homebrew, install Build198x with:
brew install build198x/tap/build198xWithout Homebrew, use the macOS installer or archive on the Build198x release page. Choose Apple silicon or Intel to match your Mac. Extract an archive into a folder you can find again.
The commands below use build198x by name. Homebrew makes the command available automatically. If you used an archive, add the extracted folder to your shell’s PATH, or use the full path to the executable instead. From its folder, use ./build198x.
Check that your terminal can find it:
build198x --versionIf the command is not found, check the executable’s location. A version number confirms installation; the program you run next checks the whole workflow.
Windows
Open the Build198x release page and choose the Windows x86-64 ZIP (x86_64-pc-windows-msvc). Extract it into a folder you can find again.
The commands below use build198x by name. Add the extracted folder to your user Path in Windows Environment Variables, then open a new PowerShell window. To run it from that folder without changing Path, use .\build198x.exe instead.
Check that your terminal can find it:
build198x --versionIf the command is not found, check the executable’s location. A version number confirms installation; the program you run next checks the whole workflow.
Linux
If you already use Homebrew, install Build198x with:
brew install build198x/tap/build198xWithout Homebrew, use the Linux installer or archive on the Build198x release page. Choose aarch64-unknown-linux-gnu for ARM64 or x86_64-unknown-linux-gnu for x86-64 Linux. Extract an archive into a folder you can find again.
The commands below use build198x by name. Homebrew makes the command available automatically. If you used an archive, add the extracted folder to your shell’s PATH, or use the full path to the executable instead. From its folder, use ./build198x.
Check that your terminal can find it:
build198x --versionIf the command is not found, check the executable’s location. A version number confirms installation; the program you run next checks the whole workflow.
Copy the first listing from You Type the Whole Word into a plain-text file named hello.bas. Keep the line number. Open a terminal in that file’s folder and run:
build198x basic hello.bas --machine commodore-c64 -o hello.prgBuild198x checks the listing, then turns the BASIC words into the tokens the C64 stores. The result is hello.prg, a program the emulator can load.
Open hello.prg using VICE’s Autostart disk/tape image command. You should see HELLO, followed by READY.. If it loads without starting, type RUN and press Return.
Change the message in hello.bas, build it again and open the new hello.prg. Keep the .bas file: that is the source you can edit again.
Assemble a program
Install Asm198x
macOS
If you already use Homebrew, install Asm198x with:
brew install asm198x/tap/asm198xWithout Homebrew, use the macOS installer or archive on the Asm198x release page. Choose Apple silicon or Intel to match your Mac. Extract an archive into a folder you can find again.
The commands below use asm198x by name. Homebrew makes the command available automatically. If you used an archive, add the extracted folder to your shell’s PATH, or use the full path to the executable instead. From its folder, use ./asm198x.
Check that your terminal can find it:
asm198x --versionIf the command is not found, check the executable’s location. A version number confirms installation; the program you run next checks the whole workflow.
Windows
Open the Asm198x release page and choose the Windows x86-64 ZIP (x86_64-pc-windows-msvc). Extract it into a folder you can find again.
The commands below use asm198x by name. Add the extracted folder to your user Path in Windows Environment Variables, then open a new PowerShell window. To run it from that folder without changing Path, use .\asm198x.exe instead.
Check that your terminal can find it:
asm198x --versionIf the command is not found, check the executable’s location. A version number confirms installation; the program you run next checks the whole workflow.
Linux
If you already use Homebrew, install Asm198x with:
brew install asm198x/tap/asm198xWithout Homebrew, use the Linux installer or archive on the Asm198x release page. Choose aarch64-unknown-linux-gnu for ARM64 or x86_64-unknown-linux-gnu for x86-64 Linux. Extract an archive into a folder you can find again.
The commands below use asm198x by name. Homebrew makes the command available automatically. If you used an archive, add the extracted folder to your shell’s PATH, or use the full path to the executable instead. From its folder, use ./asm198x.
Check that your terminal can find it:
asm198x --versionIf the command is not found, check the executable’s location. A version number confirms installation; the program you run next checks the whole workflow.
Copy the complete listing from Assemble and Run into border.asm. In the same folder, run:
asm198x --dialect acme --prg border.asm -o border.prgOpen border.prg with VICE’s autostart command. The border turns red. Change lda #2 to lda #5, save and rebuild; the border should turn green when you load the new program.
The acme dialect tells Asm198x which source syntax to read. You do not need to install ACME as well. If you already use it, the alternative ACME guide covers that path.
Keep your work and continue
Save the source and built program together in a project folder. Reopen the source in your editor and load the program once more before moving on. Files on your computer survive closing the emulator; an unsaved program in its memory does not.