aboutsummaryrefslogtreecommitdiff
path: root/unprotbas.rst
diff options
context:
space:
mode:
Diffstat (limited to 'unprotbas.rst')
-rw-r--r--unprotbas.rst23
1 files changed, 9 insertions, 14 deletions
diff --git a/unprotbas.rst b/unprotbas.rst
index daf391f..dfd3f5a 100644
--- a/unprotbas.rst
+++ b/unprotbas.rst
@@ -16,12 +16,12 @@ unprotbas [**-v**] [**-f**] [**-n**] [**-g**] **input-file** **output-file**
DESCRIPTION
===========
-**unprotbas** modifies LIST-protected Atari 8-bit BASIC programs,
+**unprotbas** modifies a LIST-protected Atari 8-bit BASIC program,
creating a new non-protected copy. See **DETAILS**, below, to
understand how the protection and unprotection works.
-**input-file** must be a tokenized Atari BASIC program. Use *-* to
-read from standard input.
+**input-file** must be a tokenized (SAVEd) Atari BASIC program. Use
+*-* to read from standard input.
**output-file** will be the unprotected tokenized BASIC program. If it
already exists, it will be overwritten. Use *-* to write to standard
@@ -37,14 +37,15 @@ To use filenames beginning with *-*, write them as *./-file*, or they
will be treated as options.
**-v**
- Verbose operation. TODO: it's always verbose right now...
+ Verbose operation.
**-f**
Force the variable name table to be rebuilt, even if it looks OK.
+ This option cannot be combined with **-n**.
**-n**
Don't rebuild the variable table (only fix the line pointers, if
- needed).
+ needed). This option cannot be combined with **-f**.
**-g**
Remove any "garbage" data from the end of the file. By default,
@@ -124,11 +125,6 @@ Variable name table scrambling
table might be smaller.
Bad next-line pointer
- Generally, this is done with line number 32768. Yes, this line
- number is outside the range BASIC accepts... but BASIC uses it
- internally for immediate-mode commands. And when SAVE or CSAVE are
- executed, this line gets saved, too.
-
Every line of tokenized BASIC contains a line length byte, which
BASIC uses as a pointer to the next line of code. Before printing
the READY prompt, BASIC iterates over every line of code in the
@@ -145,10 +141,9 @@ Bad next-line pointer
(due to END, STOP, an error, or the Break key), BASIC will get stuck
again.
- This doesn't *have* to be done with line 32768. Any line of code
- that doesn't have to be traversed at runtime would work (in other
- words, a regular line whose line number is higher than any code that
- ever gets executed, usually the last line in the file).
+ This doesn't *have* to be done with the last line in the
+ program. The "poisoned" line could be followed by more lines of
+ code, though they could never actually execute.
Line 32100 in the example above does this job, taking advantage of
the STMCUR pointer used by BASIC, which holds the address of the