This chapter describes the TOS output module, which can be selected with option -Ftos to generate executable Atari TOS executable files, or with option-Fdri to generate DRI-format object files.

Legal
=====

This module is written in 2009-2016,2020,2021,2023 by Frank Wille and is covered by the vasm copyright without modifications.

Additional options for this module
==================================

All these options only have an effect in executable files.

-monst
     Write Devpac "MonST"-compatible symbols.

-stdsymbols
     Do not write HiSoft extended symbol names. Cut at 8 characters.

-tos-flags=<flags>
     Sets the flags field in the TOS file header. Defaults to 0. Overwrites a TOS flags definition in the assembler source.

General
=======

-Ftos
     The TOS executable file format is used on Atari 16/32-bit computers with 68000 up to 68060 CPU running any TOS, MiNT or any compatible operating system. The symbol table is in DRI format and may use HiSoft extended symbol names.

-Fdri
     The object file format defined by Digital Research for Atari M68k systems.

Restrictions
============

  - These file formats only support a single Text (code), Data and BSS section.

  - For tos all symbols must be defined, otherwise the generation of the executable fails. Unknown symbols are listed by vasm.

  - The only relocations allowed in tos are 32-bit absolute. For dri all 16- and 32-bit absolute and PC-relative relocations are supported. 16-bit base-relative appears as a 16-bit absolute symbol reference.

  - The maximum symbol length is 8 characters only. The tos format increases the maximum length to 22 by using an extension created by HiSoft, unless forbidden by -stdsymbols.

  - Symbol references in dri object files are limited to a maximum of 8192 symbols.

All these restrictions are defined by the file format itself.

Known Problems
==============

Some known problems of this module at the moment:

  - None.

Error Messages
==============

This module has the following error messages:

  - 3004: section attributes <attr> not supported

  - 3005: reloc type %d, size %d, mask 0x%lx (symbol %s + 0x%lx) not supported

  - 3006: reloc type %d not supported

  - 3007: undefined symbol <%s>

  - 3008: output module doesn't allow multiple sections of the same type

  - 3010: section <%s>: alignment padding (%lu) not a multiple of %lu at 0x%llx

  - 3011: weak symbol <%s> not supported by output format, treating as global

  - 3020: too many symbols for selected output file format