This is the reference documentation for the o65 file format.
- Quick link
The o65 fileformat provides portable way for using relocatable 6502 binaries. It can hold object files or executables, and features segments for uninitialized data, initialized data and text, as well as (uninitialized) zeropage. Block loading can be used and when there is no late-binding (which is possible) no side-storage is needed.
In the file libloader.a65 is a sample loader for the o65 file format in 6502 assembler. It is taken from the OS/A65 lib6502 code. It does not use the simple file format (as described by mode.11), but computes the relocation differences for each segment separately. What it does, however, is late binding of the OSA2KERNEL and lib6502 variables, as well as looking for the main exported label to start the program.
A simpler version (without undefined references and without late binding) comes with the xa assembler and you can find it in loader.a65. It also has a sample C64 binding.
The code is not cleared from debug statements and lacks comments. Wear your hard hat.
The file format extension o65 for a 6502 relocatable file format is copyrighted by me. It may be used by systems and applications without restriction, as long as the files named with this extension obey the definitions stated in this document.
These are the changes that I propse for 1.4. The goal is to keep compatibilty of older files with newer loaders, but not necessarily vice versa.
-
add support for the MEGA65 / C64 CPU 4510, if it is not already covered by the 65ce02.
Discuss issue on github -
add support for 32 bit relocation table entries.
Discuss issue on github -
add support for 2s-complement undefined relocation entries
Discuss issue on github -
add support to note for direct stack access (like LDA $0100,X)
Discuss issue on github
Due to some requests to support other CPUs and "larger" systems, I have made an attempt to define a new, "v2" version of the o65 file format. It is far from complete, and open for discussion.
Link: fileformatng.html
The change is that the undefined reference relocation entry for high-byte relocation has changed.
The change is that the undefined reference relocation entry for high-byte relocation has changed.