aboutsummaryrefslogtreecommitdiff
path: root/xexcat.rst
blob: a7ce20bb8856ce71a1d48bbc85c67b754cf1780b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.. RST source for xexcat(1) man page. Convert with:
..   rst2man.py xexcat.rst > xexcat.1
.. rst2man.py comes from the SBo development/docutils package.

======
xexcat
======

-----------------------------------------------------------------
Concatenate Atari 8-bit executables (XEX) into a single XEX file.
-----------------------------------------------------------------

.. include:: manhdr.rst

SYNOPSIS
========

*xexcat* [*-hvc*] [-l *address* [-r *address*]  [-i  *address*] [-o  *outfile.xex*] [*infile.xex*] [*infile.xex ...*]

DESCRIPTION
===========

**xexcat**  reads  one or more Atari executables (XEX/BIN/COM/etc)
from the given filenames, and writes a single Atari  executable
containing  all the segments from all the input files to *outfile*.

To  read  from  standard input, *infile* may be omitted, or given as
**-**. To write to standard output, **-o** *outfile* may be  omitted,
or  given  as **-o-**.

The  output  file  is  a valid Atari executable, including the
required *$FFFF* header for the first segment. If there are multiple
segments, the second and subsequent segments will not have the
optional *$FFFF* header.

OPTIONS
=======

-h
  Print a short help message and exit.

-v
  Verbose  operation.  Each  segment's  information  is printed to
  standard error, including start/end address and length.

-c
  Check only; no output file  is  written.  Equivalent  to **-v -o /dev/null**.

-o outfile
  Write  output  xex file to outfile. Default is to write to standard output.

-l address
  Force the output file's load address to address. This  only
  affects the first segment of the output file.

-i address
  Force  the  output file's first init address (if present) to
  *address*.  This *only* affects the **first** init address segment of  the
  output  file. Further init address segments in the input will be
  left unmodified.  If *address* is 0, the first init  segment  will
  be  removed (0 means "none", not "init at address 0").  This option
  does nothing if none of the input files  contain  init  address
  segments.

-r address
  Force  the  output  file's run address to *address*. If *address*
  is not 0, all run address segments from all input files will be
  ignored,  and  a  new run address segment will be constructed
  with the given *address* and appended to the output.  If *address*
  is  0, all run addresses from all input files are ignored,
  and the output file will not contain a run address segment
  at all.  Such  a file can still be loaded from DOS, but it will
  not execute (user will be returned to the DOS menu).

NOTES
=====

It is possible to join multiple Atari  executables  together  with
the standard **cat**\(1) command. However, **xexcat** is always guaranteed to
produce a valid Atari binary load file (or an empty file, if all input
files  are invalid), which is not the case for **cat**.

When  writing  to  standard  output, **xexcat** will refuse to write
binary data to the user's terminal.

The Atari binary load format requires the *$FFFF*  header  only  for
the first  segment  in  a file. The second and subsequent segments
may also have a *$FFFF* header, but it's optional. **xexcat**'s output file
will  always  have  the *$FFFF* header for the first segment, and no
*$FFFF* header for further segments, regardless of whether the segments
in  the  input files  had  it  or  not (in fact, **xexcat** can handle
an invalid XEX file which is missing the initial $FFFF header for the
first segment).

Some Atari executables contain raw blocks of data, which are  meant
to be  read  into  memory  by  the  init routine. These blocks do not
have start/end address headers, so **xexcat** is unable  to  handle
them.  Raw data  blocks  usually occur in files created with "packer"
or "compressor" programs, or occasionally in other large programs
(Turbo BASIC  is an example). Raw data blocks are generally found just
after an init address segment. If you have an executable that loads
just fine on a real Atari  or  emulator, but fails with **xexcat**,
a raw data block is usually the reason why.

The terms "Atari executable", "binary load file", and  "XEX  file"
all refer to the same thing. Also, there is no difference between
Atari executables named with "XEX", "COM", "BIN", "EXE", etc. The
Atari and its DOS don't care about the names, only the contents.

EXIT STATUS
===========

Exit status is zero for success, non-zero for failure.

.. other sections we might want, uncomment as needed.

.. FILES
.. =====

.. ENVIRONMENT
.. ===========

.. EXIT STATUS
.. ===========

.. BUGS
.. ====

.. EXAMPLES
.. ========

.. include:: manftr.rst