batari Basic


This is intended as a quick guide for experts or for previous bB users to get started using the latest version of bB. This guide does not cover installation in detail. If you would like more comprehensive instructions, refer to the tutorial.

Getting bB running

Extract the contents of the zip file to a new directory. The name of the directory isn't etched in stone, but for consistency with this guide and the tutorials, you may wish to use C:\Atari2600\bB. If you have an old installation of bB there, you need to clean it out first.


Before you continue, you will need to move GNU sed from its subdirectory to your bB directory, e.g. C:\Atari2600\bB. Although bB will run without moving the program, sed will improve error reporting. sed is used to limit the amount of redundant warnings and bogus errors that the assembler tends to produce. sed was not placed in the same directory as bB to avoid confusion with their conflicting licensing terms.

Batari Basic is a DOS/Windows command line program which must typically be run at the Windows command prompt. It will also run under pure DOS (i.e. without Windows running) with special considerations (see DOS compatibility in the help.html file.)

The quickest way to get started is to run batari Basic from the Windows command prompt by using the batch file (2600bas.bat.) This may be found in the "bB" folder in your installation directory.

This version of bB requires that an environment variable and path are set so that you can compile your source files no matter where they are located. So before you run bB, you need to set the "bB" environment variable and path to your bB folder. There are several ways to do this. The easiest way is to just type in the commands below. This will be active for the duration of your session, but only in the window where you define it. e.g.:

set bB=c:\Atari2600\bB

If you want this set permanently every time you start DOS or the Windows command prompt, you may add the two above lines to the autoexec.nt (Windows NT/2k/XP) or autoexec.bat (DOS/Windows 95/98/Me) file. autoexec.nt is typically located either in C:\WINNT\SYSTEM32 or C:\WINDOWS\SYSTEM32, and autoexec.bat is in the root directory. If the files don't exist, create them.

Alternatively, there is a way to change the path and environment variables in Windows without using autoexec. Since this procedure is somewhat more involved, it is not covered here. Refer to the tutorials for complete instructions on how to do this.

Once the above is done, switch to a folder containing a bB source file and type:

2600bas filename

where filename is the name of the BASIC source file you wish to compile. The project folder can be any folder you create to store your files.

To test your installation, several sample programs are included in the "Samples" folder. Switch to this folder and type:

2600bas sample.bas

If successful, a file called sample.bas.bin will be generated that you can run on an emulator. The sample program is not very interesting, but note how simple it was to write. Open sample.bas in a text editor and take a look at how it was written.


If you prefer to use a fancy Windows-based interface, you can use one of the various IDEs (Integrated development environments) available that will work with bB. Please refer to Tutorial 3 for more information about how to use Crimson Editor with bB.

Alternatively, Jacco Mintjes has written a Windows-based interface just for bB. 2600IDE is available at the batari BASIC homepage. Note that to use 2600IDE, you must copy your 2600bas.bat file as 2600baside.bat, as the file of the same name that is created by 2600ide will not work.

With either IDE, you will need to permanently set the path and environment variable in Windows.

Please note that while we will try to ensure that bB works with the above IDEs, we can't guarantee this forever since we did not program the IDEs, there is no source and neither IDE is being actively developed.

Please see the tutorials for more detailed instructions about running the compiler.

Linux and OS X

Mac OSX and statically-linked Linux binaries are also available for download, but these aren't covered in detail, so you will need to do some configuration yourself to get things working.

The binaries may be downloaded from the download page. Included with each download are four binaries (2600basic, preprocess, postprocess, and optimize) and a shell script ( that you may use in place of the batch file to compile your bB programs. Copy the binaries and shell script to your main bB folder if you plan to use one of these builds.

In either case, you will need to set bB's path and environment variable. How you do this depends on what shell you are using. The environment variable and path should be set to the location of your bB binary files, for example:

export bB=$HOME/Atari2600/bB
export PATH=$PATH:$bB

I'm sure there is a way to make the above permanent, but I don't know how to do that offhand. If you do, please let us know.

Also, Mac OSX, Linux and probably all UNIX-like operating systems will already have sed, so there is no need to download it.

Other platforms:

bB will work with some DOS/Windows emulators, namely DOSBox 0.65 or later. Some special considerations are needed here (see help.html under DOS compatibility.) Linux users might be able to use WINE to run bB, but I cannot verify that.

If none of the included binaries will work, you can get the source and compile it using a C compiler that supports makefiles. You will also need an appropriate lexical analyzer generator such as lex or GNU flex. If you have the appropriate tools, typing "make" will compile the software. It has been compiled successfully on many platforms without any issues. The source is available on the batari Basic website.

If you are building bB from source on a UNIX-like OS, you can probably still use the shell script, and so some of the section above regarding Linux and OSX may also apply. If you are building under some other platform not listed here, chances are you will need to write your own script to run bB.

Software, site and content © 2005-2007 Fred X. Quimby. All rights reserved.