This chapter describes the MOS paper tape output module which can be selected with the -Fpap option.

Legal
=====

This module was written in 2024 by Dimitri Theulings and is covered by the vasm copyright without modifications.

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

-strict
     Enforce strict compliance with MOS paper tape format. In particular, in strict mode six NULL characters (ASCII 0x00) are appended after the carriage return (ASCII 0x0D) and line feed (ASCII 0x0A) for each record. Additionally the file is terminated with XOFF (ASCII 0x13).

-record-size=<number>
     Set the number of data bytes per record. Defaults to 24.

-start=<address>
     Set the start address for the default section, when no section or org directive was given.

General
=======

This module outputs the contents of all sections in MOS Paper Tape format, which is a simple ASCII output of hexadecimal digits. Each record starts with ';' followed by a single byte indicating number of data bytes contained in the record (by default 24). The record's starting address high (1 byte, 2 characters), starting address low (1 byte, 2 characters), and data (n bytes, 2n characters) follow. Each record is terminated by the record's check-sum (2 bytes, 4 characters), a carriage return (ASCII 0x0D), line feed (ASCII 0x0A). The final record does not contain data bytes and instead lists the number of records, followed by a checksum.

In strict mode, each record is followed by six NULL characters (ASCII 0x00) and the file is terminated with XOFF (ASCII 0x13).

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

There are currently no known problems.

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

This module may return the following error messages:

  - 3001: sections <%s>:%llx-%llx and <%s>:%llx-%llx must not overlap

  - 3002: output module doesn't support cpu %s

  - 3007: undefined symbol <%s>

  - 3012: address 0x%llx out of range for selected format