aboutsummaryrefslogtreecommitdiff
path: root/protbas.rst
blob: 5ceb838c3b2ec1542469d9de913f8941875be0e2 (plain)
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
=======
protbas
=======

---------------------------------------
LIST-protect Atari 8-bit BASIC programs
---------------------------------------

.. include:: manhdr.rst

SYNOPSIS
========

protbas [**-v**] [**-nc | **-nv**] [**-s**] [**-xr** | **-xNN**] **input-file** **output-file**

DESCRIPTION
===========

**protbas** reads a tokenized Atari 8-bit BASIC program and writes a
LIST-protected copy of the program. See the **DETAILS** section of the
**unprotbas**\(1) man page, to understand how the protection works.

**input-file** must be a tokenized (SAVEd) Atari BASIC program. Use
*-* to read from standard input, but **protbas** will refuse to
read from standard input if it's a terminal.

**output-file** will be the protected tokenized BASIC program. If it
already exists, it will be overwritten. Use *-* to write to standard
output, but **protbas** will refuse to write to standard output if
it's a terminal (since tokenized BASIC is binary data and may confuse
the terminal).

The code protection works by adding a line 32767 to the program, with
a bad next-line pointer. This will fail if there's already a line
32767.

OPTIONS
=======

Options may appear in any order. The first non-option argument is used
for **input-file**; the second is **output-file**. A third non-option
argument is an error.

General Options
---------------
**--help**
  Print usage message and exit.

**--version**
  Print version number and exit.

**-v**
  Verbose operation. When displaying a number in verbose mode, it will
  be prefixed with *$* if it's in hex, or no prefix for decimal.

Protection Options
------------------
**-nc**
  Do not code-protect the program; only protect the variable names.

**-nv**
  Do not protect the variable names; only code-protect the program.

**-s**
  Shrink variable name table to minimum size, one byte per variable
  name. Programs protected this way are very similar to ones
  protected with **PROTECT.BAS**.

**-xr**, **-x** *NN*
  Character to use for variable name protection. *NN* is the
  character code in hex, e.g. **-x20** to use a space. Default is
  **9b** (the EOL character). **-xr** means random codes.

EXIT STATUS
===========

0
  **input-file** was unprotected, protection was successful.

1
  I/O error, or **input-file** isn't a valid BASIC program.

2
  **input-file** is already a protected BASIC program.

.. include:: manftr.rst