aboutsummaryrefslogtreecommitdiff
path: root/unprotbas.rst
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-05-23 02:06:34 -0400
committerB. Watson <urchlay@slackware.uk>2024-05-23 02:06:34 -0400
commite504bcb1a7f45062c575615c22c09c1c9d3eab70 (patch)
tree100fad376a759043bce13567892bba7130da56f9 /unprotbas.rst
parent7fc45e8ac37dde5026a8b6bc1e8190e69107f94a (diff)
downloadbw-atari8-tools-e504bcb1a7f45062c575615c22c09c1c9d3eab70.tar.gz
unprotbas: document findings about ERROR 4.
Diffstat (limited to 'unprotbas.rst')
-rw-r--r--unprotbas.rst21
1 files changed, 18 insertions, 3 deletions
diff --git a/unprotbas.rst b/unprotbas.rst
index 6ba560c..cd55dd8 100644
--- a/unprotbas.rst
+++ b/unprotbas.rst
@@ -135,6 +135,10 @@ Variable name table scrambling
generates only one- and two-character variable names, so the rebuilt
table might be smaller.
+ The program **PROTECT.BAS**, found on Disk 2 of the Holmes Archive,
+ creates protected BASIC programs that only use variable name
+ scrambling.
+
Bad next-line pointer
Every line of tokenized BASIC contains a line length byte, which
BASIC uses as a pointer to the next line of code. Before printing
@@ -164,6 +168,10 @@ Bad next-line pointer
should be (based on the tokens in the line) and changing it. No
information is lost by doing this.
+ The program **UNPROTEC**, from the *Pirate's Treasure Chest*, can
+ fix bad pointers in protected programs, though it doesn't do
+ anything about variable name scrambling.
+
One more thing **unprotbas** can do is remove extra data from the end
of the file. It's possible for BASIC files to contain extra data that
occurs after the end of the program. Some programs use this as a way
@@ -231,8 +239,15 @@ NOTES
=====
Atari BASIC has a limit of 128 variables in a program. It's actually
-possible for the variable name table (and the variable value table)
-to contain 129 variables, though the last one won't be usable in the
-program.
+possible for the variable name table to contain up to 256 variables,
+though the 129th and further ones won't be usable in the program. The
+variable value table can hold more than 256 values, though the
+variable numbers wrap around once they pass 255. The attempt to add
+variables past the 128th causes BASIC to respond with *ERROR- 4*, but
+the variable does get added to the tables. **unprotbas** will preserve
+these extra (useless) entries in the tables, though it will complain
+"Warning: variable #XXX value is corrupt" for value table entries
+256 and up. This is a pathological case, and shouldn't happen with
+programs that aren't deliberately written to test this behaviour.
.. include:: manftr.rst