Credit: https://skilldrick.github.io/easy6502
Last month, we looked at the 6502 assembly language and wrote a short program to sort numbers and run it on a web-based emulator. This time, the code will run on the Vice emulator, which is exactly like if you’re running it on a real CBM-64. To write programs for it, we have to do the following. 1. Write the 6502 source code. 2. Assemble it into a binary file. 3. Load the file into the Vice emulator and run it.
Writing 6502 code is easy enough [steady on now – ed] and you can use your favourite editor. For step two, though, we need a decent assembler and the one we’re using is xa65. You might find it easier if you edit the source files using VS Code. There are a few 6502 extensions for it, including assemblers and formatters. Enter 6502 in the extension box to see them. There’s also a VS65 debugger extension that works with Vice to let you visually debug it, but that wasn’t used here. For now, we’ll assemble the code from a terminal: $ dasm then xa65
Originally, this was written using the dasm (https://dasm-assembler.github.io) assembler. But after struggling with it for a few days, it turned out to have too many issues and the decision was made to switch over to xa65. Dasm had issues with label names and the final straw