aboutsummaryrefslogtreecommitdiff
path: root/listbas.rst
diff options
context:
space:
mode:
Diffstat (limited to 'listbas.rst')
-rw-r--r--listbas.rst72
1 files changed, 58 insertions, 14 deletions
diff --git a/listbas.rst b/listbas.rst
index a32f5c2..cb905c4 100644
--- a/listbas.rst
+++ b/listbas.rst
@@ -34,7 +34,7 @@ BASIC options
-------------
**-b**
- Set the BASIC dialect the program was written in. This disables
+ Set the BASIC dialect the program will be treated as. This disables
autodetection. Supported dialects are:
**-ba**
@@ -52,10 +52,7 @@ BASIC options
**-bxe**
OSS BASIC XE.
- If you see lots of "bad token XX" messages, or if the code just doesn't
- make any sense, you're using the wrong BASIC option. **whichbas**\(1)
- can usually detect the BASIC a program was written in, but if the
- results are ambiguous, **listbas** will assume Turbo BASIC XL.
+ See **BASIC DIALECTS** below for details.
**-i**
Include the immediate mode command (line 32768) in the output.
@@ -66,7 +63,8 @@ BASIC options
**-t**
Do not indent, if the program is Turbo BASIC, BASIC/A+, BASIC XL, or BASIC XE.
- If you want to indent an Atari BASIC program, use **-bt** or **-bxl**.
+ By default, indentation is enabled for everything but Atari BASIC.
+ If you want to indent an Atari BASIC program, use **-bt** or **-bxe**.
**-k**
Do not print keywords in mixed case (e.g. **Print**, **Graphics**),
@@ -132,6 +130,31 @@ Other display options
.. include:: genopts.rst
+BASIC DIALECTS
+==============
+Note that Turbo, BASIC XL, and BASIC XE are all proper supersets of
+Atari BASIC, so you can view an Atari BASIC program with any of
+**-bt**, **-bxl**, or **-bxe**. Also, BASIC XE is a superset of BASIC XL
+(provided BASIC XL's disk-based toolkit extended commands are not used),
+so you can usually use **-bxe** on a BASIC XL program.
+
+BASIC/A+ uses incompatible tokens, so its programs can't be viewed as
+any of the others. Trying to do this results in a very funny-looking
+listing, with commands like **POSITION** with no arguments (or with a
+string argument, or **POSITION #6;"string"**; it so happens A+ uses the
+same token number for **POSITION** that the other BASICs use for
+**?**). The same thing would happen if you booted BASIC/A+ on an Atari
+and tried to **LOAD** an Atari BASIC program. I can't help but think
+this is a major reason BASIC/A+ didn't sell that well (fortunately,
+OSS realized their mistake and fixed it in BASIC XL).
+
+If you see lots of "bad token XX" messages, or if the code
+just doesn't make any sense, you're using the wrong BASIC
+option. **whichbas**\(1) can usually detect the BASIC a program was
+written in, but if the results are ambiguous, **listbas** will assume
+Turbo BASIC XL. If this is wrong, use **-bxl** or **-bxe** to force
+the issue.
+
COLORS
======
@@ -211,19 +234,35 @@ other is the background color of the terminal.
NOTES
=====
-So far, **listbas** doesn't support the indentation that BASIC A+/XL/XE
-do by default. It acts like **SET 12,0** has been executed... though
-BASIC A+ doesn't actually *have* this option, and the indentation can't
-be turned off in A+ at all.
---
+Indentation
+-----------
+
+The indentation isn't all that well-tested yet, but so far it seems work
+correctly. The **-t** option is the equivalent of **\*L\ -** for Turbo,
+or **SET 12,0** for BXL/BXE. The different BASICs have different
+indentation rules; try viewing the same Atari BASIC program with
+**-bt**, **-bxl**, and **-bxe** to compare them.
+
+**listbas -t** is also (as far as I know) the only way to **LIST**
+a BASIC/A+ program without indentation, since BASIC/A+ itself doesn't
+have a way to disable it.
+
+Turbo BASIC, at least, will "max out" the indentation level at some
+point. Once there are 60 or so levels of indent, it stops adding
+more. **listbas** doesn't emulate this behaviour (shouldn't be a
+problem, it's a pathological case).
+
+Protected Programs
+------------------
**listbas** will refuse to operate on a LIST-protected program with
scrambled variable names. For code-protected programs, it will stop at
the line with the invalid offset. Use **unprotbas**\(1) to remove the
protection.
---
+Comparison to chkbas
+--------------------
**listbas** is similar to Jindroush's **chkbas**\(1). The main differences are:
@@ -234,6 +273,9 @@ protection.
- **listbas** supports OSS BASIC/A+ in addition to Turbo and BXL/BXE.
+- **listbas** indents BASIC/A+, Turbo, BXL, and BXE code, just like the
+ actual BASICs do.
+
- **listbas** doesn't show information about the variables. Use **vxrefbas**\(1)
for that.
@@ -251,7 +293,8 @@ protection.
on variable-protected programs. For code-protected programs, it lists
the program up to the "poisoned" line (normally the last line).
---
+Terminal Support
+----------------
The color and inverse/bold/underline support assumes your terminal supports
ANSI/VT220 escape codes... but it does *not* use **curses**\(3X) or
@@ -293,7 +336,8 @@ Also, **rxvt** and **aterm** don't support Unicode, but they will
otherwise work (display color and inverse) with the **-m** or **-d**
options to **listbas**.
---
+HTML Output
+-----------
I thought about adding an HTML output option, but there's no need: if you want
a colorful listing of an Atari BASIC program, install **aha**\(1) from