This chapter describes the simple binary output module which can be
selected with the @option{-Fbin} option.

@section Legal

    This module is written in 2002-2025 by Volker Barthelmann and
    Frank Wille and is covered by the vasm copyright without modifications.

@section Additional options for this module
 
@table @option
    @item -apple-bin
        Prepends a 4-byte header with load-address and length to the
        raw binary file, as used by the @command{AppleCommander} to write
        such files onto a DOS 3.3 disk image.
    @item -atari-com
        Writes an Atari DOS COM header preceding the output file. It has
        a standard header (@code{0xFFFF}), which is followed by any
        number of sections. Each section starts with two little-endian
        words defining the address of the first and last byte in memory.
    @item -coalesced
        Do not pad the space between separate org-blocks, but output
        all of them in a coalesced manner (sorted by address).
    @item -cbm-prg
        Writes a Commodore PRG header preceding the output file, which
        consists of two bytes in little-endian order, defining the load
        address of the program.
    @item -coco-ml
        Writes a Tandy Color Computer machine language file, which has
        a header with load address and length for each section and is
        terminated by a trailer with the execution address.
    @item -dragon-bin
        Writes a Dragon DOS header preceding the output file, where the
        file type is set to @code{$02} for binary. The load address is
        taken from the first section's start address. This will also be
        the execute-address, when not specified otherwise. Refer to
        option @option{-exec}.
    @item -exec=<symbol>
        Use the given symbol @code{<symbol>} as entry point of the program,
        for those output format headers which support it. Otherwise this
        option will be silently ignored.
        Omitting this option will usually define the execution address
        to be the same as the load address.
    @item -foenix-pgx
        Writes a simple, single-segment format for the 65C02- and 65816-based
        Foenix computers. The header defines the program's load address,
        which is also the start address.
    @item -foenix-pgz
        Write a multi-segment format for Foenix computers.
        The format is derived from binary format used by Western Design
        Center's C compiler. Every segment is stored with load address and
        size, and there is also a start address defined.
        There is a 24-bit (@code{'Z'}) and a 32-bit (@code{'z'}) format
        which will be selected according to the target CPU.
    @item -join[=<address>]
        To be able to write multiple sections as a raw binary file this
        option invokes a mini-linker, which joins all sections with
        ascending addresses, regarding their alignment. The start address
        defaults to 0 when missing. Only simple PC-relative and absolute
        relocations are supported at the moment.
    @item -oric-mc
        Writes a machine code file header for Oric-1, Oric-Atmos and
        compatible systems. It includes the file type and name, as well as
        the first and last address of the program to load. Note, that the
        name defaults to the output file name, limited to 15 characters.
        A ".tap" extension will be removed automatically.
    @item -oric-mcx
        Same as @option{-oric-mc}, but sets the auto-execute flag in
        the header.
    @item -start=<address>
        Set the start address for the default section, when no
        @code{section} or @code{org} directive was given.
@end table
 
@section General

This output module outputs the contents of all sections as simple
binary data, by default without any header or additional information.
When there are multiple sections, they must not overlap. Gaps between
sections or org-blocks are filled with zero bytes, when not using a
special header format, like Atari COM. The padding can be avoided by
option @option{-coalesced}. Undefined symbols are not allowed.

@section Known Problems

    Some known problems of this module at the moment:

@itemize @minus

@item None.

@end itemize

@section Error Messages

This module has the following error messages:

@itemize @minus
@item 3001: sections <%s>:%llx-%llx and <%s>:%llx-%llx must not overlap
@item 3007: undefined symbol <%s>
@item 3010: section <%s>: alignment padding (%lu) not a multiple of %lu at 0x%llx
@item 3013: reloc type %s, mask 0x%lx to symbol %s + 0x%lx does not fit into %u bits
@item 3021: all sections are absolute, nothing to relocate
@end itemize
