This chapter describes the TOS output module, which can be selected with option -Ftos to generate Atari TOS executable files, or with option -Fdri to generate DRI-format object files. Additionally you can generate absolute Z-file executables for the Sharp X68000, when specifying option -zfile together with -Ftos.

Legal
=====

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

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

-szbx
     Use the SozobonX extension, which allows symbol names with unlimited length in DRI objects and executables. Overrides the HiSoft extension.

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

These options are valid for the tos module only:

-monst
     Write Devpac "MonST"-compatible symbols.

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

-zfile=<load-address>
     Outputs an absolute Z-file for Sharp X68000 computers to be loaded at <load-address> in memory.

General
=======

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

-Fdri
     The object file format defined by Digital Research for Atari M68k systems. May use SozobonX extended symbol names.

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. With -szbx you may enable the SozobonX extension for unlimited length - but you need a linker which supports that format.

  - 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

  - 3009: undefined symbol <%s> at %s+%#lx, reloc type %d

  - 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

  - 3024: section <%s>: maximum size of 0x%llx bytes exceeded (0x%llx)