aboutsummaryrefslogtreecommitdiff
path: root/jindroush/man/chkbas.rst
blob: b6c678f54d6b2846675848543d97d42093192839 (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
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
.. |version| replace:: 1.10

======
chkbas
======

--------------------------------------------
check and detokenize Atari BASIC SAVEd files
--------------------------------------------

.. include:: manhdr.rst

SYNOPSIS
========

chkbas [**-atari**] [**-short**] [**-verbose**] [**-noinverse**] [**-tbs** | **-bxl** | **-bxe**] **basic-file** [**output-file**]

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

**chkbas** detokenizes Atari 8-bit BASIC SAVEd files. It lists the BASIC
code in human-readable form, and gives some other useful information
about the program.

**basic-file** is an Atari BASIC, TurboBASIC, BASIC XL, or BASIC
XE program. Output will go to **output-file**, if given; otherwise,
standard output. If **basic-file** is anything other than standard
Atari BASIC, the BASIC dialect must be specified (see **OPTIONS**,
below).

It's highly recommended to avoid running **chkbas** without
redirecting or piping its output: If the program contains ATASCII
graphics or inverse characters, they will be printed as-is to the
terminal, which can confuse the terminal. For simply reading the code,
pipe to **a8cat**\(1), thus::

  $ chkbas -atari PROGRAM.BAS | a8cat

Sample run, with no options::

  $ chkbas HELLO.BAS
  chkbas v1.10 (c) 1999-2001 Jindrich Kubec <kubecj@asw.cz>
  
  chkbas v1.10 (c) 1999-2001 Jindrich Kubec <kubecj@asw.cz>
  Atari Basic/Turbo Basic/Basic XL/Basic XE decompiler.
    Latest version can be found at http://www.asw.cz/~kubecj
    Published under GPL. See GPL.TXT.
    Thanks to Russ Gilbert for his SALVAGE programs.
  
  Input file: HELLO.BAS
  
  Constants & pointers:
  Start of Name Table      (VNT)   : 000E
  End of Name Table        (VNTE)  : 0011
  Length of Name Table     (VNTL)  : 0004
  Start of Variable Table  (VVT)   : 0012
  End of Variable Table    (VVTE)  : 0021
  Length of Variable Table (VVTL)  : 0010
  Number of Variables      (NV)    : 0002
  Start of Code            (STMTAB): 0022
  Length of Code                   : 004E
  Current command          (STMCUR): 0070
  Length of current command        : 0013
  First byte after program (STARP) : 0083
  Length of file                   : 0083
  File len difference              : 00000000
  
  Variable table:
  0001 STRING   (81) 00: SPoff: 0000 Len: 5 Dim: 10  A$
  0002 SCALAR   (00) 01: 11 I
  
  Main code starts here:
  10 DIM A$(10)
  20 A$="HELLO"
  30 FOR I=1 TO 10
  40 ? A$;" WORLD!"
  50 NEXT I
  
  Immediate code starts here:
  32768 SAVE "H:HELLO.BAS"
  
  Done!

OPTIONS
=======

Input Options
-------------

**-tbs**
  Treat input as a Turbo BASIC program.

**-bxl**
  Treat input as a BASIC XL program.

**-bxe**
  Treat input as a BASIC XE program, which may or may not be EXTENDed
  with code in the extra XE banks.

Output Options
--------------

**-atari**
  Output only the program listing, with lines terminated by Atari
  EOL characters (**$9B**).

**-short**
  Output only the program listing, with lines terminated by the
  system default newline character(s), e.g. **\n** on UNIX-like OSes,
  **\r\n** on MS-DOS or Windows.

**-verbose**
  Program listing will be interspersed with per-line and per-statement
  low-level information. This option is probably most useful for debugging
  **chkbas** itself.

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

Zero for success, non-zero for failure.

.. include:: manftr.rst