.. |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
