fachat / o65

Reference documentation for the o65 file format
2 stars 0 forks source link

o65 file format

This is the reference documentation for the o65 file format.

Quick link:: link:../main/fileformat.adoc[current version (1.3.1) ADOC]

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.

Example code


In the file link: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.

Distribution

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.

Changes


Changes in v1.3.1 are clarifications in the description of the relocation table.

Proposed Changes
----------------

Proposed version 1.4

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.

Proposed version "NG"


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: link:fileformatng.html[]

Historic versions
-----------------

version 1.3

link:../1.3/fileformat.html[version 1.3 (HTML)]

link:../1.3/fileformat.adoc[version 1.3 (ADOC)]

version 1.2


link:../1.2/fileformat.html[version 1.2]

The change is that the undefined reference relocation entry for high-byte relocation has changed. 

version 1.1

link:../1.1/fileformat.html[version 1.1]

The change is that the undefined reference relocation entry for high-byte relocation has changed.

Motivation for git

I've moved to the git repo for maintaining the o65 file format, so that changes to the format can be more easily identified (using git diff) and discussions can be had in the git issues.