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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
|
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BLOB2XEX" 1 "2024-05-03" "0.2.1" "Urchlay's Atari 8-bit Tools"
.SH NAME
blob2xex \- Create Atari 8-bit executables from arbitrary data
.\" RST source for blob2xex(1) man page. Convert with:
.
.\" rst2man.py blob2xex.rst > blob2xex.1
.
.SH SYNOPSIS
.sp
blob2xex \fIoutfile\fP [\fB\-v\fP] [\fB\-r\fP \fIrunaddr\fP] [\fB\-l\fP \fIloadaddr\fP [\fB\-i\fP \fIinitaddr\fP] [\fB\-o\fP \fIoffset\fP] [\fB\-s\fP \fIsize\fP] \fIinfile\fP] ...
.SH DESCRIPTION
.sp
\fBblob2xex\fP creates an Atari 8\-bit binary load (xex) file from one or
more files of arbitrary data. Each input file will become a separate
segment in the binary load file. A run address can be added with the
\fB\-r\fP option.
.sp
Each input file \fIrequires\fP a \fB\-l\fP \fIloadaddr\fP option, to set the
load address. Optionally, init addresses can be included, per\-segment
(\fB\-i\fP). Also, using \fB\-o\fP and \fB\-s\fP, it\(aqs possible to include only
part of the input file. To read from standard input, use \fB\-\fP for the
\fIinfile\fP\&.
.sp
\fIoutfile\fP must be given as the first argument. When multiple
input files are used, the resulting .xex file will have multiple
segments. If \fIoutfile\fP already exists, it will be \fIoverwritten\fP
(or \fIdeleted\fP, in case of error). Use \fB\-\fP to write to standard
output. \fBblob2xex\fP will not write output to a terminal; \fB\-\fP must
be used with redirection or a pipe.
.sp
If \fIoutfile\fP or any \fIinfile\fP is a filename that begins with a \fB\-\fP,
prefix it with "./", otherwise it\(aqll be taken as an option. The GNU
style \fB\-\-\fP (end of options) isn\(aqt implemented because it doesn\(aqt
make sense here. How often do you really use \fB\-\fP at the start of a
filename, anyway?
.sp
Addresses, offsets, and sizes may be given in decimal or hex. Hex
addresses must be prefixed with either \fB$\fP or \fB0x\fP\&.
.SH OPTIONS
.sp
A space is required between an option and its argument; use e.g. \fB\-l 0x2000\fP,
not \fB\-l0x2000\fP\&.
.INDENT 0.0
.TP
.B \-r \fIrunaddr\fP
Optional; set the run address. Default is no run address. Since a
\&.xex file can only have one run address, there\(aqs no point in giving
multiple \fB\-r\fP options. If you do, the last one will be used. This
option should be first on the command line (right after \fIoutfile\fP),
or at least must occur before any \fIinfile\fP\&.
.TP
.B \-l \fIloadaddr\fP
Required; set the load address of the next \fIinfile\fP\&. Each \fIinfile\fP
\fBmust\fP be preceded by a \fB\-l\fP option.
.TP
.B \-i \fIinitaddr\fP
Optional; set an init address, to be executed after the next segment loads.
Default is no init address.
.TP
.B \-o \fIoffset\fP
Optional; skip this many bytes of the next input file. Default is \fB0\fP\&.
See the \fBMore Complex Example\fP below.
.TP
.B \-s \fIsize\fP
Optional; read this many bytes of the next input file. Default is the entire file,
or \fB0xffff\fP (\fB65535\fP) if the file is longer than 64KB. It\(aqs not an error
for \fIsize\fP to be larger than the file (reading will stop at EOF). Also, the
file\(aqs data will be truncated at Atari address \fB$FFFF\fP, regardless of
\fIsize\fP or the size of the file.
.UNINDENT
.INDENT 0.0
.TP
.B \-v
Verbose output.
.TP
.B \-h\fP,\fB \-\-help
Print usage message and exit.
.TP
.B \-V\fP,\fB \-\-version
Print version number and exit.
.UNINDENT
.SH DIAGNOSTICS
.sp
Error messages and warnings are printed to standard error, and are
hopefully self\-explanatory. Any message containing \fIfatal\fP causes
\fBblob2xex\fP to exit without creating the output file.
.sp
Messages containing \fIwarning\fP are non\-fatal, and the output file is
created. The only warning messages are there to let you know if your
\&.xex file\(aqs start/end addresses mean it would load into ROM (or, the
unmapped area at \fB$C000\fP on a 400/800). Normally this means the .xex
file won\(aqt load properly on the Atari, but feel free to ignore the
warnings if you know exactly what you\(aqre doing.
.SH EXAMPLES
.SS Simple Example
.sp
You\(aqve written an Atari 8\-bit program that loads at \fB$2000\fP, which
is also the run address. The assembler you used doesn\(aqt create Atari
\&.xex files, so you\(aqve got a \fBprogram.bin\fP that\(aqs just raw object
code. To turn it into a runnable .xex file, use:
.INDENT 0.0
.INDENT 3.5
blob2xex program.xex \-l \(aq$2000\(aq \-r \(aq$2000\(aq program.bin
.UNINDENT
.UNINDENT
.sp
Notice the use of quotes around the addresses? That\(aqs because the
$ character must be quoted, or the shell will try to interpret it
as a variable reference. You could also have typed \fB$2000\fP or
\fB0x2000\fP\&. Or you could have used decimal (\fB4096\fP).
.SS More Complex Example
.sp
Suppose you want to write a program that can run on an Atari 800,
but you want to use the International Character Set font from the
XL/XE machines. Also suppose that you have the XL ROM image as
\fIatarixl.rom\fP\&.
.sp
The way to use the XL ICS font on the 800 is to load it somewhere
in memory, on a 1K boundary. Suppose you\(aqve decided to load it at
\fB$8000\fP\&.
.sp
Any good reference book or other documentation on the Atari XL/XE
computers will tell you the ICS font is located at \fB$CC00\fP\&. The ROM
image starts at \fB$C000\fP (the start of XL/XE ROM), so the font is
located at offset \fB$0C00\fP within the ROM image. As always for Atari
fonts, it\(aqs 1KB, or \fB$0400\fP bytes.
.sp
So you can create a .xex file of the ROM font with:
.INDENT 0.0
.INDENT 3.5
blob2xex romfont.xex \-l 0x8000 \-o 0x0c00 \-s 0x0400 atarixl.rom
.UNINDENT
.UNINDENT
.sp
Since fonts aren\(aqt executable programs, there are no run (\fB\-r\fP) or
init (\fB\-i\fP) address options.
.sp
The resulting \fIromfont.xex\fP can be combined with the rest of your
program with \fBxexcat\fP(1).
.SH COPYRIGHT
.sp
WTFPL. See \fI\%http://www.wtfpl.net/txt/copying/\fP for details.
.SH AUTHOR
.INDENT 0.0
.IP B. 3
Watson <\fI\%urchlay@slackware.uk\fP>; Urchlay on irc.libera.chat \fI##atari\fP\&.
.UNINDENT
.SH SEE ALSO
.sp
\fBa8eol\fP(1),
\fBa8utf8\fP(1),
\fBatr2xfd\fP(1),
\fBatrsize\fP(1),
\fBaxe\fP(1),
\fBblob2c\fP(1),
\fBblob2xex\fP(1),
\fBcart2xex\fP(1),
\fBdasm2atasm\fP(1),
\fBf2toxex\fP(1),
\fBfenders\fP(1),
\fBrom2cart\fP(1),
\fBunmac65\fP(1),
\fBxexamine\fP(1),
\fBxexcat\fP(1),
\fBxexsplit\fP(1),
\fBxfd2atr\fP(1),
\fBxex\fP(5),
\fBatascii\fP(7).
.sp
Any good Atari 8\-bit book: \fIDe Re Atari\fP, \fIThe Atari BASIC Reference
Manual\fP, the \fIOS Users\(aq Guide\fP, \fIMapping the Atari\fP, etc.
.\" Generated by docutils manpage writer.
.
|