> Only after looking at the resulting hex, and comparing it with the 6502 instruction code, did I figure out that it was no longer compiling code that would work on a 6502.
How did you come to that conclusion? What are the command line arguments to ca65? What do you mean with "hex" file?