Also, please take a look at André Fachat's
O65 relocatable binary format for another approach. Although André designed O65 with his projects in mind it should be adaptable to other 65xx systems.
BigEd wrote:
I don't know what the C64 does about execution.
It is up to whatever loads the file to jump to the start address. There wasn't anything in the C-64's kernel that was an analog of UNIX's exec... system calls. However, upon completion of the load, locations
$AC and
$AD (LSB/MSB) hold the load address (also true for the C-128). So a
JMP ($AC) instruction should start execution of the program, assuming the load address actually points to executable instructions.