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
|
========
listamsb
========
------------------------------------------------------------
List the source of a tokenized Atari Microsoft BASIC program
------------------------------------------------------------
.. include:: manhdr.rst
SYNOPSIS
========
listamsb [**-a**\] [**-v**\] [**-h**\] [**-i**\] [**-u**\] [**-t**\] [**-m**\] [**-s**\] [**input-file**\]
DESCRIPTION
===========
**listamsb** acts like the *LIST* command in Atari Microsoft BASIC. It reads a
tokenized (SAVEd) AMSB program and prints the code in human-readable
format.
By default, output is piped to **a8cat**\(1), which converts the
ATASCII output to something that's human-readable on modern terminals.
This means **a8cat** must be available somewhere in **$PATH**\.
**listamsb** supports both versions of Atari Microsoft BASIC: the
disk-based version 1 and the cartridge-based version 2. The language
is the same for both versions, so there's no need to specify it.
**input-file** must be a tokenized AMSB program. If no **input-file** is given,
input is read from stdin.
Output is to stdout. Use shell redirection to save the output to a file.
OPTIONS
=======
**-a**
Output raw ATASCII. This option must be used with a pipe or redirection, as
**listamsb** will not write ATASCII to a terminal. **a8cat** is not used,
with this option.
**-c**
Check only. No output on stdout. Diagnostics are still printed on stderr,
and the exit status is unchanged.
**-v**
Verbose output, on stderr.
**-h**
Print built-in help and exit.
**-i**\, **-u**\, **-t**\, **-m**\, **-s**
These options are passed to **a8cat**. See its man page for details. If
the **-a** or **-c** option is used, these options have no effect.
DIAGNOSTICS
===========
All error and warning messages are written to the standard error output.
Fatal errors
------------
These are errors in the program header at the start of the file. They
generally mean the input isn't actually an tokenized Atari Microsoft
BASIC file.
- not an AMSB file: first byte not $00
- not an AMSB file: too big (*N* bytes), won't fit in Atari memory
- not an AMSB file: program size too small (*N*). Atari BASIC file?
Warnings
--------
These are non-fatal: **listamsb** logs the warning to stderr, then
continues processing.
- unexpected EOF, file truncated?
A tokenized AMSB file always ends with three null bytes (*$00*\).
This file doesn't. Probably the rest of the file is missing.
- line number out of order
Probably means the file is corrupted, or isn't really an AMSB file.
- line number out range
The program contains a line number that's greater than *63999*. How
did that happen?
- line *N* has character *C* outside of a string, maybe not an AMSB file?
This happens when ATASCII codes 0 to 31 (*$1f*\) appear in the program.
AMSB can create files like this, but at runtime, it's a syntax error.
It could also mean it's not really an AMSB file.
- actual program size doesn't match program size in header
Might mean this isn't an AMSB file. If you're sure it is, part of the file
might have been overwritten with *$00* bytes.
- trailing garbage at end of file
Might mean this isn't an AMSB file. If you're sure it is, garbage
data has somehow gotten appended to the file, after the three *$00*
bytes that end the program. Maybe it was downloaded with a crappy
version of XMODEM that pads the last block.
- file has *N* unknown tokens
Either the file is corrupt, or this is a file from some *other* variant
of Microsoft BASIC (e.g. Commodore, AppleSoft, GW-BASIC, TRS-80). If
you see this warning, you'll also see *N* <unknown token *XX*>
messages in the actual listing.
LIMITATIONS
===========
Unlike **listbas**, there's no color syntax highlighting. Probably there
never will be.
It's hard to reliably detect AMSB files. Most of the time, it can at least
detect Atari BASIC files, but occasionally you'll get gibberish output instead.
EXIT STATUS
===========
0 for success, 1 if there was an error reading the input (e.g. file
not found), or 2 if the input file had errors or warnings (see
**DIAGNOSTICS**).
.. include:: manftr.rst
|