The BinAof Tool
---------------

BinAof is a tool for creating an AOF object file from a binary data file. This
AOF file can then be linked with C / ObjAsm code.

The format of the BinAof comand is:

BinAOF <binary file> <object file> <area name> <symbol> { <option> }

Options: -C : Put the binary data in a CODE area
         -D : Put the binary data in a DATA area (default)
         -RW : Mark the area as READ WRITE
         -RO : Mark the area as READ ONLY (default)

<Binary file> is the name of the binary file to be placed in <object file>.

<Object file> is the name of the object output file to be produced.

<Area name> is the name of an AOF AREA in which the binary file is to be
placed.

<symbol> is the root of a pair of symbols to be exported defined the start
and limit (end + 1) of the data. These symbols can be used in C to access
the data. The symbols exported are <symbol>__base and <symbol>__limit.

Examples:

BinAof !Palette o.!Palette BinAof$$data palette -D -RO
BinAof Templates o.Templates BinAof$$data templates

*** IMPORTANT NOTES ***

The symbols define the base and limit of the data area, when referenced
ordinarily in C they will refernce the *contents* of the object at that
address. To get the actual address you must take the address of the symbols
as defined in C.

*** VERY IMPORTANT ***

If the data is placed in a READ ONLY area (as it is by default) *DO NOT*
compile code which references these symbols with the -zm flag. This will result
in the wrong address being calculated.

If you need to access READ ONLY BinAof'd data from code which must be compiled
-zm you must create a separate C source containing two functions which return
the address and compile this single source without -zm. This can then be linked
with the rest of your code compiled -zm.

For example:

extern int palette__base, palette__limit;

int data_base(void)
{
    return (int)&palette__base;
}

int data_limit(void)
{
    return (int)&palette__limit;
}
