| PETCAT(1) | C64 Program Development | PETCAT(1) |
petcat - convert and display PETSCII or BASIC files
petcat [ -text | -<version> | -w<version> | -k<version> ] [ -l hexaddr ] [ -c | -nc ] [ -o outfile ] [ -skip offset ] [ -- ] [ file list ]
petcat converts input files from the most common CBM file
formats into printable ASCII form and writes to standard output. The type of
input file is determined automatically, if possible, and appropriate
conversion is performed. Since a few of the BASIC versions have keywords
defined differently, the right conversion has to be selected on the command
line. Where such confusion cannot happen, automatical recognition of input
is used. This is useful when expanding several files at once or if the
program contains code for several versions, selected according to the
hardware; eg. Simons' Basic vs. Basic 7.0.
Please note that each input file is converted individually, but the output is
produced as continuous flow. Also, all input files that are read trough a
pipe, are concatenated before they reach petcat so any machine
language section in between the BASIC programs causes all consecutive files
to be taken as one machine language program. For that reason files
containing machine language parts attached to them must be input separately,
otherwise the remaining files won't be expanded. petcat recognizes
normal PETSCII text files (SEQ), program files containing directory listing,
and BASIC programs. Both the original CBM files and files with a PC64 `P00'
header are accepted. The different BASIC versions are not automatically
distinquished, but standard C64 and C128 versions are used as default.
In order to tokenize a text file into a BASIC binary file the desired BASIC
version must be exclusively specified so that correct set of keywords will
be used. If line numbers are not found in the beginning of each program
line, the cruncher creates the missing line numbers by adding 2 to the
numeric value of previous one. Since also line numbers deviating from
strictly ascendind order are accepted, care must be taken when editing such
a program on a C64 again.
Since CBM programs usually contain unprintable characters, a way
to specify them has been created. Normally, petcat uses the same
codes as most printers, but for tokenizing programs scanned from magazines,
it can use the following convention:
Line numbers must be less than 65536. Maximum line length is 255 bytes. Leading white space is ignored. Blank lines and line numbers not followed by any text are rejected. While expanding, Machine Language section concatenated to a BASIC program is ignored. While crunching, control codes that appear outside quotes are not interpreted. The low order byte of load address must be "01".
cat(1), tr(1), sed(1), fvcbm(1), petlp(1), cbmconvert(1), iso2asc(1), ascii(7), CBM Tokens Documentation, CBM's Programmers' Reference Guide series
Jouko Valta (jopi@stekt.oulu.fi)
Frederik Ekman (d91fe@lelle.pt.hk-r.se)
Marko Mäkelä (msmakela@nic.funet.fi)
Russell Alphey (r.alphey@dce.vic.gov.au)
André Fachat (a.fachat@physik.tu-chemnitz.de)
Onno Ebbinge (ebbin200@hio.tem.NHL.NL)
Frank Kontros (jeno@kontr.uzhgorod.ua)
| March 2017 | VICE |